Use Chinese AI models with the OpenAI SDK.
Many Chinese model providers and gateways expose OpenAI-compatible endpoints. In practice, most integrations come down to three settings: API key, base URL and model name.
Black Eagle AI endpoint: https://api.blackeaglecambodia.com/v1
1. Start with a raw API check
Before wiring a provider into an agent framework, test a single chat completion request. This separates provider access issues from framework adapter issues.
curl https://api.blackeaglecambodia.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-your-token" \
-d '{
"model": "deepseek-v4-flash",
"messages": [{"role": "user", "content": "Say hello in one sentence."}]
}'
2. Configure the OpenAI SDK
If your app already uses the OpenAI SDK, switching to a compatible Chinese model endpoint usually means changing the base URL and model name.
Python
from openai import OpenAI
client = OpenAI(
api_key="sk-your-black-eagle-token",
base_url="https://api.blackeaglecambodia.com/v1"
)
response = client.chat.completions.create(
model="deepseek-v4-flash",
messages=[{"role": "user", "content": "Create a release checklist."}]
)
print(response.choices[0].message.content)
Node.js
import OpenAI from "openai";
const client = new OpenAI({
apiKey: "sk-your-black-eagle-token",
baseURL: "https://api.blackeaglecambodia.com/v1"
});
const response = await client.chat.completions.create({
model: "deepseek-v4-flash",
messages: [{ role: "user", content: "Create a release checklist." }]
});
console.log(response.choices[0].message.content);
3. Keep model names explicit
Some frameworks normalize model names internally. When debugging, verify the exact model id being sent to the endpoint.
DeepSeek naming update: use deepseek-v4-flash for a low-risk first test and deepseek-v4-pro for stronger reasoning or coding checks. DeepSeek's legacy aliases deepseek-chat and deepseek-reasoner are scheduled for retirement on July 24, 2026.
| Use case | Example model | Notes |
|---|---|---|
| Low-cost chat | deepseek-v4-flash |
Good first test for OpenAI-compatible chat completions. |
| Reasoning and coding | deepseek-v4-pro |
Use smaller prompts first, then scale context length after your framework works. |
| Chinese model comparison | Qwen, Kimi, GLM families | Availability and model ids can differ by provider or gateway. |
4. Debug in this order
- Confirm the raw endpoint returns a response.
- Confirm the model id is supported by the endpoint.
- Confirm the framework is not rewriting model names or base URLs.
- Only then test streaming, tools, structured output or long context.
5. When a gateway helps
A direct provider account is best when you already have billing, documentation and model routing under control. A gateway is useful when your team wants one English-friendly setup, prepaid credits, and a consistent OpenAI-compatible surface for testing Chinese model families. For current availability, check the Black Eagle AI model catalog. For stack-specific examples, use the integration recipes. If you need a model that is not live yet, use the request access template.
Try Black Eagle AI
Start with prepaid credits, create an API token, and test Chinese model access from your existing OpenAI-compatible client.
Create account