取得 AI 聚合平台 API 詳情
透過 API ID 取得單一 API 端點的完整資訊——比列表介面多出 definition(OpenAPI 3.0 Schema)、service(所屬服務詳情)和 products(關聯產品)欄位。
適用於自動產生 SDK、給 LLM Agent 餵工具描述、文件網站動態渲染等情境。
ℹ️ 本介面屬於 AI 聚合平台管理 API,統一前綴
https://yxai-tech.platform.acedata.cloud/api/v1/。完整介面索引請見取得 AI 聚合平台文件列表。
¶ 介面概覽
| 項 | 內容 |
|---|---|
| 方法 | GET |
| URL | https://yxai-tech.platform.acedata.cloud/api/v1/apis/{api_id} |
| 驗證 | ❌ 公開 |
/apis/{id} 與 /apis/{id}/ 目前都可用;範例統一使用無尾斜線形式。
¶ 驗證說明
本介面完全公開,無需帳戶權杖或登入狀態。
¶ 路徑參數
| 參數 | 類型 | 必填 | 說明 |
|---|---|---|---|
api_id |
UUID | ✅ | API ID(UUID 格式,不支援別名) |
¶ 請求範例
¶ cURL
curl 'https://yxai-tech.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://yxai-tech.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://yxai-tech.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://yxai-tech.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。
¶ 相關介面
- 取得 AI 聚合平台 API 列表
- 取得 AI 聚合平台 API 呼叫統計
- 取得 AI 聚合平台服務詳情
- 取得 AI 聚合平台文件詳情 — 使用
document_id跳轉到帶有渲染的開發者文件

