API Documentation
Integrate China's most powerful AI models into your applications with just a few lines of code.
Need Help?
Contact support for technical assistance.
Quick Start
NexusAPI is fully compatible with the OpenAI API format. Simply change the base URL to start using China's AI models.
1. Install the SDK
pip install openai2. Configure your client
from openai import OpenAI
client = OpenAI(
api_key="your_nexus_api_key",
base_url="https://www.xouliwei.com/v1"
)3. Make your first request
response = client.chat.completions.create(
model="gpt-4",
messages=[{"role": "user", "content": "Hello!"}]
)
print(response.choices[0].message.content)Authentication
All API requests require authentication using an API key. Include your API key in the Authorization header.
Authorization: Bearer your_nexus_api_keyNote: Keep your API key secure. Do not share it in public repositories or client-side code.
Chat Completions
The Chat Completions API follows the OpenAI format. Here are examples in different languages:
Python
from openai import OpenAI
client = OpenAI(
api_key="your_nexus_api_key",
base_url="https://www.xouliwei.com/v1"
)
# Chat completion
response = client.chat.completions.create(
model="gpt-4",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello!"}
]
)
print(response.choices[0].message.content)JavaScript/Node.js
import OpenAI from 'openai';
const client = new OpenAI({
apiKey: 'your_nexus_api_key',
baseURL: 'https://www.xouliwei.com/v1'
});
// Chat completion
const response = await client.chat.completions.create({
model: 'gpt-4',
messages: [
{ role: 'system', content: 'You are a helpful assistant.' },
{ role: 'user', content: 'Hello!' }
]
});
console.log(response.choices[0].message.content);cURL
curl https://www.xouliwei.com/v1/chat/completions \
-H "Authorization: Bearer your_nexus_api_key" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4",
"messages": [
{"role": "user", "content": "Hello!"}
]
}'Supported Models
All models are accessible using OpenAI-compatible model names. No code changes required.
| Model ID | Provider | Context | Input / 1M | Output / 1M |
|---|---|---|---|---|
| gpt-4 | DeepSeek | 32K | $$2.00 | $$8.00 |
| gpt-4-turbo | DeepSeek | 128K | $$1.00 | $$4.00 |
| gpt-4o | Kimi | 128K | $$1.50 | $$6.00 |
| gpt-3.5-turbo | MiniMax | 32K | $$0.15 | $$0.60 |
| claude-3-opus | Zhipu | 128K | $$1.50 | $$6.00 |
| claude-3-sonnet | Zhipu | 32K | $$0.80 | $$3.20 |
Pricing
Pay only for what you use. No monthly fees or hidden charges.
Starter
$9.99/mo
1M tokens included
Pro
$29.99/mo
10M tokens included
Enterprise
$99.99/mo
100M tokens included