零壹AI プラットフォーム API 詳細を取得

API ID を通じて単一の API エンドポイントの完全な情報を取得します——一覧インターフェースと比べて、definition(OpenAPI 3.0 Schema)、service(所属サービス詳細)、および products(関連プロダクト)フィールドが追加されます。

SDK の自動生成、LLM Agent へのツール説明の提供、ドキュメントサイトの動的レンダリングなどのシナリオに適しています。

ℹ️ 本インターフェースは 零壹AI プラットフォーム管理 API に属し、統一プレフィックスは https://01ai.platform.acedata.cloud/api/v1/ です。完全なインターフェース一覧は零壹AI プラットフォームドキュメント一覧を取得を参照してください。

インターフェース概要

項目 内容
メソッド GET
URL https://01ai.platform.acedata.cloud/api/v1/apis/{api_id}
認証 ❌ 公開

/apis/{id} と /apis/{id}/ は現在どちらも利用可能です;例では末尾のスラッシュなしの形式を統一して使用します。

認証について

本インターフェースは完全に公開されており、アカウントトークンまたはログイン状態は不要です。

パスパラメータ

パラメータ 型 必須 説明
api_id UUID ✅ API ID(UUID 形式、エイリアスは非対応)

リクエスト例

cURL

curl 'https://01ai.platform.acedata.cloud/api/v1/apis/afc7917f-d89f-4dc9-95c2-863936b02cad' \
  -H 'accept: application/json'

Python

import requests

api_id = "afc7917f-d89f-4dc9-95c2-863936b02cad"
resp = requests.get(
    f"https://01ai.platform.acedata.cloud/api/v1/apis/{api_id}",
    headers={"accept": "application/json"},
    timeout=10,
)
api = resp.json()
print(f"API: {api['title']}")
print(f"路径: {api['path']}")
print(f"所属服务: {api['service']['title']} ({api['service']['alias']})")
print(f"OpenAPI 路径数: {len(api.get('definition', {}).get('paths', {}))}")

Node.js

const apiId = 'afc7917f-d89f-4dc9-95c2-863936b02cad'
const r = await fetch(`https://01ai.platform.acedata.cloud/api/v1/apis/${apiId}`)
const api = await r.json()
console.log(api.title, api.path, api.service.title)

レスポンス例(HTTP 200)

{
  "id": "afc7917f-d89f-4dc9-95c2-863936b02cad",
  "document_id": "e31b3e50-d91d-4a4f-8d32-8dd8c9e2f512",
  "service_id": "5d732942-4d44-48be-958e-dd8474d8aa8d",
  "name": "ChatDoc Documents API",
  "title": "ChatDoc Documents API",
  "path": "/chatdoc/documents",
  "path2": null,
  "introduction": "在创建知识存储库之后,可以使用该API在知识存储库中添加、查询、修改或删除文档。",
  "cost": [
    { "conditions": { "==": [1, 1] }, "consumption": 0.057 }
  ],
  "stage": "Beta",
  "rank": 10,
  "tags": [],
  "metadata": null,
  "created_at": "2023-09-03T17:55:48.179195Z",
  "updated_at": "2026-04-26T16:16:35.579082Z",
  "service": {
    "id": "5d732942-4d44-48be-958e-dd8474d8aa8d",
    "title": "ChatDoc 问答",
    "type": "Api",
    "alias": "chatdoc"
  },
  "products": [],
  "definition": {
    "openapi": "3.0.0",
    "info": { "title": "ChatDoc Documents API", "version": "0.1" },
    "paths": {
      "/chatdoc/documents": {
        "post": { "...": "..." }
      }
    },
    "components": { "schemas": { "...": "..." } }
  }
}

レスポンスフィールドの説明

詳細インターフェースには、一覧インターフェースのフィールドに加えて以下が含まれます:

フィールド 型 説明
service object 所属サービスのコア情報:id、title、type、alias
products array 関連プロダクト一覧(通常は空で、運用側で使用)
definition object 完全な OpenAPI 3.0 仕様定義。paths、components、info などを含み、openapi-generator に直接渡してクライアントコードを生成できます

エラー処理

HTTP code 意味
400 invalid api_id が有効な UUID ではない
404 not_found API が存在しないか、すでにオフライン

実用的なヒント

  • definition フィールドは非常に大きい:単一 API の OpenAPI Schema は数百行の JSON になる場合があります。サービスインデックスのみが必要で Schema が不要な場合は、代わりに一覧インターフェースを使用してください。
  • SDK 生成の一般的な使用法:
    # 拿到 OpenAPI 文件
    curl -s 'https://01ai.platform.acedata.cloud/api/v1/apis/<api_id>' | jq '.definition' > openapi.json
    
    # 用 openapi-generator-cli 生成 Python 客户端
    openapi-generator-cli generate -i openapi.json -g python -o ./client
    
  • API 変更の追跡:updated_at フィールドは schema が最後に変更された時刻です。このフィールドを購読すると、OpenAPI の変更時に SDK を自動で再生成できます。

関連インターフェース