統一接口
一個接口,接入任何中轉站
TKX 詞元中轉層是一個 OpenAI 相容的統一閘道。其他中轉站/平台用一把 key、一個基址就能接進來——零改程式碼,塞進任意 OpenAI SDK 即可。文本與影片(Seedance)走同一個端點。
OpenAI-compatibleBearer key一個基址
接入基址
https://tkx.org/gw
把它設成你的 OpenAI base_url,用你的 TKX key 作 Bearer。任意 OpenAI SDK/工具零改動即可用。
端點
GET/gw/v1/models
你的 key 可呼叫的模型清單。
POST/gw/v1/chat/completions
OpenAI 相容的對話補全(支援串流)。
POST/gw/v1/video/generations
提交 Seedance 影片任務——返回 task_id 與狀態。
{model, prompt, duration, resolution} → returns {task_id, status}.GET/gw/v1/videos/{task_id}
輪詢任務——狀態為 queued / in_progress / completed;完成後結果裡帶影片位址。
status ∈ queued / in_progress / completed; on completed the video URL is in the result.30 秒接入
# OpenAI SDK — just change base_url + key
from openai import OpenAI
client = OpenAI(base_url="https://tkx.org/gw/v1", api_key="<your-tkx-key>")
# Video (Seedance)
curl https://tkx.org/gw/v1/video/generations \
-H "Authorization: Bearer <your-tkx-key>" \
-H "Content-Type: application/json" \
-d '{"model":"doubao-seedance-2-0-260128","prompt":"a puppy on a sunny beach","duration":5,"resolution":"480p"}'
# → {"task_id":"...","status":"queued"} then poll GET /gw/v1/videos/{task_id}
取得 key:合作方接入走 BD——聯絡Get a key: partner onboarding is via BD — contact
hi@tkx.org. 定價與計費按合作方單獨商定。