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/v1Authentication
Use a bearer token for OpenAI-compatible endpoints:
http
Authorization: Bearer sk_your_key_hereSome 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
| Endpoint | Method | Format |
|---|---|---|
/v1/models | GET | OpenAI-style model list. |
/v1/chat/completions | POST | OpenAI Chat Completions. |
/v1/responses | POST | OpenAI Responses-style request and stream shape. |
/v1/embeddings | POST | OpenAI Embeddings. |
/v1/images/generations | POST | OpenAI Images-style response. |
/v1/video/generations | POST | OpenAI-ish video generation response. |
/v1/messages | POST | Anthropic Messages-compatible route. |
/compatible/v1beta/models/{model}:generateContent | POST | Gemini-compatible route. |
/embed/image:{model} | GET | Raw 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.