API 文档

🚀 快速开始

WukongAI 提供 OpenAI 兼容的 API 接口,您只需修改 baseURL 即可无缝切换。

Base URL

https://api.apiwukong.com/v1

Python 示例

import OpenAI from 'openai';

const client = new OpenAI({
  apiKey: 'wk_your_api_key',
  baseURL: 'https://api.apiwukong.com/v1',
});

const response = await client.chat.completions.create({
  model: 'auto',  // 智能路由
  messages: [{ role: 'user', content: 'Hello!' }],
});

print(response.choices[0].message.content)

cURL 示例

curl https://api.apiwukong.com/v1/chat/completions \
  -H "Authorization: Bearer wk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "auto",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

准备好开始了吗?

免费注册 →