Our API is fully compatible with OpenAI's API format. Simply change the base URL and use your API key.
https://zaijiank.cloud/v1
Include your API key in the Authorization header:
Authorization: Bearer sk-your-api-key-here
/v1/chat/completions
Send a chat completion request
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | Model to use (gpt-4, gpt-4o, gpt-3.5-turbo, claude-3-5-sonnet) |
| messages | array | Yes | Array of message objects |
| temperature | float | No | Response creativity (0-2, default 0.7) |
| max_tokens | integer | No | Max response length |
| stream | boolean | No | Enable streaming responses |
curl https://zaijiank.cloud/v1/chat/completions \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello!"}
]
}'
{
"id": "chatcmpl-123",
"object": "chat.completion",
"created": 1677652288,
"model": "gpt-4",
"choices": [{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! How can I help you today?"
},
"finish_reason": "stop"
}]
}
| Model | Description | Price (per 1M tokens) |
|---|---|---|
| gpt-4 | Most capable model | $30 in / $60 out |
| gpt-4o | Latest GPT-4 model | $5 in / $15 out |
| gpt-3.5-turbo | Fast & cost-effective | $0.5 in / $1.5 out |
| claude-3-5-sonnet | Anthropic Claude 3.5 | $3 in / $15 out |
| Code | Description |
|---|---|
| invalid_api_key | Invalid or missing API key |
| insufficient_balance | Account has insufficient balance |
| rate_limit_exceeded | Too many requests |
| model_not_found | Model does not exist |
from openai import OpenAI
client = OpenAI(
api_key="sk-your-api-key",
base_url="https://zaijiank.cloud/v1"
)
response = client.chat.completions.create(
model="gpt-4",
messages=[{"role": "user", "content": "Hello!"}]
)
import OpenAI from 'openai';
const client = new OpenAI({
apiKey: 'sk-your-api-key',
baseURL: 'https://zaijiank.cloud/v1'
});
const response = await client.chat.completions.create({
model: 'gpt-4',
messages: [{ role: 'user', content: 'Hello!' }]
});