统一接口

一个接口,接入任何中转站

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. 定价与计费按合作方单独商定。