API overview
The primary rout.my API is OpenAI-compatible. Most SDKs only need a custom base URL and a rout.my API key.
https://api.rout.my/v1Authentication
Use a bearer token for OpenAI-compatible endpoints:
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. |
/v1/messages/count_tokens | POST | Anthropic Messages token-counting 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
curl https://api.rout.my/v1/chat/completions \
-H "Authorization: Bearer $ROUTMY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-5.4",
"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:
{
"error": {
"message": "Model is required",
"type": "invalid_request_error",
"code": "Bad Request"
}
}See Errors for status codes and retry behavior.
Video compatibility
/v1/video/generations accepts a unified video request shape for text-to-video, image-to-video, reference-to-video, motion-control, and video editing. Use common fields such as duration, resolution, aspect_ratio, audio, quality, negative_prompt, input_image, input_video, last_frame_image, and reference_urls; rout.my maps them to provider-specific Vercel AI Gateway options when the selected model supports them.
See Video for the full field list and examples.