Integration

Connect an OpenAI-compatible API

Understand gateway URLs, version paths, model IDs, and server-side API keys before connecting your application.

Collect three values

You need a SinoRouter API key, the gateway URL https://api.sinorouter.ai/, and an exact model ID enabled for your account. A marketing name is not necessarily an API model ID. Use the account model list or GET /v1/models to check availability.

Create and store credentials on the server, in an environment variable or secret manager. Do not place an API key in a browser bundle, mobile application source, public repository, or screenshot. If a key is exposed, revoke it and replace it.

Include the version path exactly once

The gateway root is https://api.sinorouter.ai/. A complete chat-completions request uses https://api.sinorouter.ai/v1/chat/completions. Different applications build that final URL differently.

Some clients ask for the root and add /v1 themselves. The OpenAI Python and JavaScript SDKs expect an API prefix in base_url or baseURL, so their configuration uses the root with /v1 appended. This is a path under the same gateway, not another service. Check the final request URL if you see 404 errors.

Make one minimal text request first

Send an Authorization: Bearer header and a JSON body containing the enabled model ID and a short messages array. Start without streaming or tools. Confirm that the response contains the expected message and inspect its usage fields.

Next, enable each feature your application needs one at a time. Streaming responses need an SSE reader; they are not a single JSON object. Tool calling, image inputs, structured output, and reasoning fields are model-dependent. A client that supports them does not guarantee the chosen model supports them.

Move from a test into an application

Add request timeouts, bounded retries, error handling, and usage monitoring before opening the feature to users. A 401 usually requires checking credentials; a 429 may indicate account limits, concurrency limits, or upstream limits. Do not repeatedly retry invalid credentials.

Video and image generation may need separate endpoints, task polling, and different parameters. Follow the relevant documentation and confirm account access rather than reusing a text request unchanged. If an integration fails, share the time, model ID, request ID, and a redacted error message with support. Never send your API key.

  • Keep credentials on the server.
  • Check the final endpoint path.
  • Test features independently.
  • Redact sensitive content before sending diagnostics.

Reference and next checks

Use the applicable provider or application documentation alongside your account-specific route information. These guides explain configuration and evaluation; they do not certify live support for every feature.