Skip to content

API overview

The primary rout.my API is OpenAI-compatible. Most SDKs only need a custom base URL and a rout.my API key.

text
https://api.rout.my/v1

Authentication

Use a bearer token for OpenAI-compatible endpoints:

http
Authorization: Bearer sk_your_key_here

Some compatibility routes also accept x-api-key or ?key=... because specific clients expect those styles. Bearer auth is the default for new integrations.

Endpoint families

EndpointMethodFormat
/v1/modelsGETOpenAI-style model list.
/v1/chat/completionsPOSTOpenAI Chat Completions.
/v1/responsesPOSTOpenAI Responses-style request and stream shape.
/v1/embeddingsPOSTOpenAI Embeddings.
/v1/images/generationsPOSTOpenAI Images-style response.
/v1/video/generationsPOSTOpenAI-ish video generation response.
/v1/messagesPOSTAnthropic Messages-compatible route.
/compatible/v1beta/models/{model}:generateContentPOSTGemini-compatible route.
/embed/image:{model}GETRaw image bytes for embedding in pages or chats.

Minimal request

bash
curl https://api.rout.my/v1/chat/completions \
  -H "Authorization: Bearer $ROUTMY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "provider/model-id",
    "messages": [
      { "role": "user", "content": "Hello." }
    ]
  }'

CORS

The public API endpoints send permissive CORS headers for browser clients. Keep API keys out of public frontend code unless you intentionally want users to bring their own key.

Response shape

Successful responses are normalized to the endpoint family you called. Errors use a consistent JSON object:

json
{
  "error": {
    "message": "Model is required",
    "type": "invalid_request_error",
    "code": "Bad Request"
  }
}

See Errors for status codes and retry behavior.

API documentation for rout.my.