YYDS API
一个入口,两件事:把网关接上(两个值就完事),以及每个 SKILL 或软件怎么用、要什么权限。
任何能改 Base URL 的 OpenAI 兼容客户端都能接,不用装东西。协议在网关侧转换——OpenAI、Anthropic、Gemini 三种请求形状原生支持,不是套壳。
换掉令牌和模型名,直接发:
curl "https://ai.yydsflight.com/v1/chat/completions" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "model": "<model-name>", "stream": true, "messages": [{"role": "user", "content": "你好"}] }'from openai import OpenAI
client = OpenAI(base_url="https://ai.yydsflight.com/v1", api_key="$TOKEN")
stream = client.chat.completions.create( model="<model-name>", messages=[{"role": "user", "content": "你好"}], stream=True,)for chunk in stream: print(chunk.choices[0].delta.content or "", end="")import OpenAI from 'openai'
const client = new OpenAI({ baseURL: 'https://ai.yydsflight.com/v1', apiKey: process.env.TOKEN })const stream = await client.chat.completions.create({ model: '<model-name>', messages: [{ role: 'user', content: '你好' }], stream: true,})
for await (const chunk of stream) { process.stdout.write(chunk.choices[0]?.delta?.content ?? '')}期望逐块收到数据,最后是 [DONE]。整段一次性出现,说明前置代理开了缓冲。
