Developer Docs
Use the following examples to quickly integrate with the API. All endpoints are compatible with OpenAI SDK.
API Base URL
Base URL for all requests:
/v1
Authentication
Add your API key in the request header. Keys can be created on the "API Keys" page.
Authorization: Bearer YOUR_API_KEY
Code Examples
curlcurl /v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "deepseek-v3",
"messages": [{"role": "user", "content": "Hello!"}]
}'from openai import OpenAI
client = OpenAI(
api_key="YOUR_API_KEY",
base_url="/v1"
)
response = client.chat.completions.create(
model="deepseek-v3",
messages=[{"role": "user", "content": "Hello!"}]
)
print(response.choices[0].message.content)import OpenAI from 'openai';
const client = new OpenAI({
apiKey: 'YOUR_API_KEY',
baseURL: '/v1',
});
const response = await client.chat.completions.create({
model: 'deepseek-v3',
messages: [{ role: 'user', content: 'Hello!' }],
});
console.log(response.choices[0].message.content);# 设置环境变量 export ANTHROPIC_BASE_URL=YOUR_API_BASE_URL export ANTHROPIC_API_KEY=YOUR_API_KEY # 启动 Claude Code claude
