Make your first request
You need three values: an API key, the Gateway URL, and an exact model ID.
- 1Create an API key
Generate a key in the SinoRouter console and store it securely.
- 2Choose a model
Copy an enabled model ID from Model Square or the models endpoint.
- 3Set the API base
Use
https://api.sinorouter.ai/v1with OpenAI SDKs. - 4Send a test request
Start with Chat Completions, then monitor usage in the console.
Base URL
Use the value that matches how your client handles the API version path.
/v1https://api.sinorouter.ai//v1. Use the Gateway URL for clients that append /v1 themselves. For SDKs that accept base_url or baseURL, append /v1 once.Create and protect your API key
- Open Console โ API Keys.
- Create a key and select the permitted provider or group shown in your account.
- Copy the key once and keep it in a server-side secret manager.
Never expose an API key in browser code, public repositories, screenshots, or support messages.
Authorization: Bearer YOUR_API_KEYList models available to your account
Availability can change by account and service status. Query the API instead of hardcoding the public catalogue.
curl https://api.sinorouter.ai/v1/models \
-H "Authorization: Bearer $SINOROUTER_API_KEY"Chat Completions
Use the OpenAI-compatible endpoint for supported text, reasoning, coding, and agent workloads.
/v1/chat/completionscurl https://api.sinorouter.ai/v1/chat/completions \
-H "Authorization: Bearer $SINOROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "kimi-k3",
"messages": [
{"role": "user", "content": "Summarize this support ticket."}
]
}'Request fields
modelRequired. Exact ID returned by /v1/models.messagesRequired. Conversation messages with system, user, assistant, or tool roles.streamOptional. Set to true for SSE chunks when the model supports streaming.temperatureOptional. Number from 0 to 2; support depends on the model.top_pOptional. Nucleus sampling value from 0 to 1.max_tokens / max_completion_tokensOptional output-token limits. Use the field accepted by your client.tools / tool_choiceOptional function tools. Availability depends on the selected model.response_format / reasoning_effortOptional structured-output and reasoning controls; verify model support first.Response
{
"id": "chatcmpl_...",
"object": "chat.completion",
"created": 1710000000,
"model": "your-model-id",
"choices": [{
"index": 0,
"message": {"role": "assistant", "content": "..."},
"finish_reason": "stop"
}],
"usage": {"prompt_tokens": 12, "completion_tokens": 24, "total_tokens": 36}
}stream: true, read text/event-stream data chunks until data: [DONE]. Tool calls and reasoning fields are model-dependent.Create and retrieve a video
Video generation is asynchronous. Create a task, poll its status, then download the completed content.
POST /v1/videosGET /v1/videos/{task_id}GET /v1/videos/{task_id}/contentCreate a task
Send multipart/form-data. Supported duration, dimensions, image input, and quality options depend on the selected model.
curl -X POST https://api.sinorouter.ai/v1/videos \
-H "Authorization: Bearer $SINOROUTER_API_KEY" \
-F "model=seedance-2.5-pro" \
-F "prompt=A premium product shot with a slow camera orbit" \
-F "duration=5" \
-F "width=1280" \
-F "height=720"Check status and download
curl https://api.sinorouter.ai/v1/videos/VIDEO_TASK_ID \
-H "Authorization: Bearer $SINOROUTER_API_KEY"
curl https://api.sinorouter.ai/v1/videos/VIDEO_TASK_ID/content \
-H "Authorization: Bearer $SINOROUTER_API_KEY" \
--output result.mp4{
"id": "VIDEO_TASK_ID",
"object": "video",
"model": "your-video-model-id",
"status": "queued",
"progress": 0,
"created_at": 1710000000,
"seconds": "5"
}status is completed or failed, then download /content. The task identifier is the returned id. This page documents the Sora-compatible /v1/videos route; it does not claim support for NewAPI's separate /v1/video/generations route.Configure popular AI apps
Choose an OpenAI-compatible or New API provider, enter your key, and use an exact model ID.
CSCherry StudioBuilt-in New API provider+
- Open Settings โ Model Services โ New API.
- Enter your SinoRouter API key.
- Set API Address to
https://api.sinorouter.ai/. Cherry Studio appends the version path automatically. - Fetch or add a model ID, run Test, then enable the provider.
OWOpen WebUIOpenAI connection+
- Go to Settings โ Admin โ Connections.
- Add an external OpenAI API connection.
- Set URL to
https://api.sinorouter.ai/v1and enter your key. - Leave the model filter empty for discovery, or add allowed model IDs manually.
CBChatboxOpenAI API compatible provider+
- Open Settings โ Model Provider โ Add.
- Select OpenAI API compatible.
- Use API Host
https://api.sinorouter.ai/; keep the default path/v1/chat/completions. - Enter your key, add a model ID, save, and run Check.
DFDifyCustom OpenAI-compatible model+
- Open Settings โ Model Provider and select an OpenAI-compatible provider.
- Add a custom chat model with the exact SinoRouter model ID.
- Enter your key and endpoint
https://api.sinorouter.ai/v1. - Validate credentials before using the model. Field labels vary by Dify version and plugin.
n8nn8nHTTP Request node, reliable across versions+
- Add an HTTP Request node with method POST.
- Use
https://api.sinorouter.ai/v1/chat/completions. - Add Bearer authorization and
Content-Type: application/json. - Send a JSON body with
modelandmessages. Keep the key in n8n credentials.
LCLangChainChatOpenAI with a custom base URL+
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(
model="kimi-k3",
api_key="YOUR_API_KEY",
base_url="https://api.sinorouter.ai/v1",
)
print(llm.invoke("Summarize this ticket.").content)Common errors
Check the Bearer header, key status, and copied whitespace.
Confirm the key can use the selected provider or model group.
For text use /v1/chat/completions; for video use /v1/videos.
Review wallet balance, account limits, request frequency, and concurrency.
Retry with exponential backoff. Contact support if the issue persists.
Need help with an integration?
Send the client name, endpoint, model ID, HTTP status, request time, and a redacted response. Never send your full API key.