Skip to main content

Quick Start

AI Station is a unified model gateway built on NewAPI. The API is OpenAI-compatible, and additionally supports Anthropic, Gemini, Midjourney, and a range of video/audio plugin tasks.

Endpoint​

ItemValue
Base URLhttps://test.kailin.com.cn
AuthAuthorization: Bearer sk-xxxx (request header)
ProtocolHTTPS — REST, SSE streaming, and WebSocket (Realtime)

Get an API Key​

  1. Sign in to the Console.
  2. Create a new token on the Tokens / API Keys page. Tokens look like sk-xxxxxxxx.
  3. Keep your token safe. Never commit it to a repository or expose it in client-side code.

Your First Request​

Every endpoint is authenticated with the Authorization: Bearer <your token> header. Chat completion example:

curl https://test.kailin.com.cn/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-your-token" \
-d '{
"model": "deepseek-v4-1-flash-261017",
"messages": [
{ "role": "user", "content": "Hello, introduce yourself" }
]
}'
RequestREQUEST
POSThttps://test.kailin.com.cn/v1/chat/completions
ResponseRESPONSE
Fill in the request and hit Send — the response shows up here

Official SDKs​

The API is OpenAI-compatible, so the official SDKs work out of the box — just point base_url at this site:

from openai import OpenAI

client = OpenAI(
api_key="sk-your-token",
base_url="https://test.kailin.com.cn/v1",
)

resp = client.chat.completions.create(
model="deepseek-v4-1-flash-261017",
messages=[{"role": "user", "content": "Hello"}],
)
print(resp.choices[0].message.content)
import OpenAI from 'openai';

const client = new OpenAI({
apiKey: 'sk-your-token',
baseURL: 'https://test.kailin.com.cn/v1',
});

const resp = await client.chat.completions.create({
model: 'deepseek-v4-1-flash-261017',
messages: [{ role: 'user', content: 'Hello' }],
});
console.log(resp.choices[0].message.content);

The Anthropic SDK works too (point base_url at this site). See Anthropic Messages.

Streaming​

Most text endpoints accept "stream": true and respond with SSE (Server-Sent Events) — text/event-stream, each event prefixed with data: , terminated by data: [DONE]:

data: {"id":"chatcmpl-xxx","choices":[{"delta":{"content":"Hi"},"index":0}]}

data: {"id":"chatcmpl-xxx","choices":[{"delta":{"content":" there"},"index":0}]}

data: [DONE]

Set stream=True (Python) or stream: true (Node.js) in the SDK and it handles the parsing for you.

Error Format​

Errors are returned as JSON. type is usually new_api_error (gateway-level) or an upstream error such as invalid_request_error:

{
"error": {
"message": "Invalid token (request id: 2026xxxx)",
"type": "new_api_error",
"code": ""
}
}
HTTP StatusMeaningCommon Causes
401Auth failedToken invalid, deleted, or Authorization header missing
403ForbiddenToken lacks model access, group mismatch, or IP restriction
404Not foundWrong model name or task ID
429Rate limitedRPM/TPM limit hit — retry later
5xxServer errorUpstream channel issue — retry or switch models
note

The request id in an error message is the key to troubleshooting. Include it when reporting issues.

List Available Models​

Call List Models to see which models your token can access:

curl https://test.kailin.com.cn/v1/models \
-H "Authorization: Bearer sk-your-token"

API Overview​

CategoryEndpointDescription
ModelsGET /v1/modelsList available models
TextPOST /v1/chat/completionsChat completion (multimodal / tools / reasoning)
TextPOST /v1/completionsLegacy text completion
TextPOST /v1/responsesResponses API
TextPOST /v1/messagesAnthropic format
EmbeddingsPOST /v1/embeddingsText embeddings
ImagesPOST /v1/images/generationsImage generation
AudioPOST /v1/audio/transcriptions etc.Transcription / translation / TTS
RealtimeWS /v1/realtimeRealtime voice conversation
RankingPOST /v1/rerankText reranking
SafetyPOST /v1/moderationsContent moderation
VideoPOST /v1/video/generationsVideo generation task
Images/mj/*Midjourney proxy
TasksPOST /v1/tasksGeneric plugin tasks (Suno/Kling etc.)