DEVELOPER DOCUMENTATION

Build with SinoRouter

Use one OpenAI-compatible gateway for supported text, image, and video models.

QUICKSTART

Make your first request

You need three values: an API key, the Gateway URL, and an exact model ID.

  1. 1
    Create an API key

    Generate a key in the SinoRouter console and store it securely.

  2. 2
    Choose a model

    Copy an enabled model ID from Model Square or the models endpoint.

  3. 3
    Set the API base

    Use https://api.sinorouter.ai/v1 with OpenAI SDKs.

  4. 4
    Send a test request

    Start with Chat Completions, then monitor usage in the console.

CONNECTION

Base URL

Use the value that matches how your client handles the API version path.

โŒ‚
Gateway URLFor clients that append /v1
https://api.sinorouter.ai/
Do not duplicate /v1. Use the Gateway URL for clients that append /v1 themselves. For SDKs that accept base_url or baseURL, append /v1 once.
AUTHENTICATION

Create and protect your API key

  1. Open Console โ†’ API Keys.
  2. Create a key and select the permitted provider or group shown in your account.
  3. 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_KEY
MODELS

List 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"
TEXT API

Chat Completions

Use the OpenAI-compatible endpoint for supported text, reasoning, coding, and agent workloads.

POST/v1/chat/completions
curl 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}
}
Streaming: with stream: true, read text/event-stream data chunks until data: [DONE]. Tool calls and reasoning fields are model-dependent.
VIDEO API

Create and retrieve a video

Video generation is asynchronous. Create a task, poll its status, then download the completed content.

1CreatePOST /v1/videos
โ†’
2Check statusGET /v1/videos/{task_id}
โ†’
3DownloadGET /v1/videos/{task_id}/content

Create 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"
}
Task lifecycle: poll until 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.
INTEGRATIONS

Configure popular AI apps

Choose an OpenAI-compatible or New API provider, enter your key, and use an exact model ID.

ProviderOpenAI-compatible / New API
API keyYour SinoRouter API key
ModelExact ID from Model Square
CS
Cherry StudioBuilt-in New API provider
+
  1. Open Settings โ†’ Model Services โ†’ New API.
  2. Enter your SinoRouter API key.
  3. Set API Address to https://api.sinorouter.ai/. Cherry Studio appends the version path automatically.
  4. Fetch or add a model ID, run Test, then enable the provider.
OW
Open WebUIOpenAI connection
+
  1. Go to Settings โ†’ Admin โ†’ Connections.
  2. Add an external OpenAI API connection.
  3. Set URL to https://api.sinorouter.ai/v1 and enter your key.
  4. Leave the model filter empty for discovery, or add allowed model IDs manually.
CB
ChatboxOpenAI API compatible provider
+
  1. Open Settings โ†’ Model Provider โ†’ Add.
  2. Select OpenAI API compatible.
  3. Use API Host https://api.sinorouter.ai/; keep the default path /v1/chat/completions.
  4. Enter your key, add a model ID, save, and run Check.
DF
DifyCustom OpenAI-compatible model
+
  1. Open Settings โ†’ Model Provider and select an OpenAI-compatible provider.
  2. Add a custom chat model with the exact SinoRouter model ID.
  3. Enter your key and endpoint https://api.sinorouter.ai/v1.
  4. Validate credentials before using the model. Field labels vary by Dify version and plugin.
n8n
n8nHTTP Request node, reliable across versions
+
  1. Add an HTTP Request node with method POST.
  2. Use https://api.sinorouter.ai/v1/chat/completions.
  3. Add Bearer authorization and Content-Type: application/json.
  4. Send a JSON body with model and messages. Keep the key in n8n credentials.
LC
LangChainChatOpenAI 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)
Tool calling, vision, structured output, and other advanced features depend on both the selected model and the client. Test required features before production rollout.
TROUBLESHOOTING

Common errors

401
Invalid or missing API key

Check the Bearer header, key status, and copied whitespace.

403
Model or group not permitted

Confirm the key can use the selected provider or model group.

404
Incorrect endpoint

For text use /v1/chat/completions; for video use /v1/videos.

429
Rate or credit limit reached

Review wallet balance, account limits, request frequency, and concurrency.

5xx
Temporary gateway or upstream issue

Retry with exponential backoff. Contact support if the issue persists.

SUPPORT

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.

Email Support