API overview
Learn the MiloRouter API endpoints, authentication, and smallest working request.
Before you begin
- Confirm a model ID and its group
- Create an API key for that group
- Confirm that the account has available credit
- Never expose the complete key in chats, screenshots, or public code
API endpoints
| Use | Endpoint |
|---|---|
| Default | https://milorouter.com |
| Asia-Pacific accelerated | https://apac.milorouter.com |
| OpenAI SDK / OpenCode | https://milorouter.com/v1 |
| Chat Completions | https://milorouter.com/v1/chat/completions |
| Codex Responses | Root URL + wire_api = responses |
Authentication
http
Authorization: Bearer YOUR_MILOROUTER_API_KEY
Content-Type: application/json- Keep one space between Bearer and the key
- Remove leading or trailing spaces
- Confirm that the key is enabled and has not expired
- Confirm that spending, rate, or IP limits have not been reached
Minimal request
Replace the API key and model ID with your own values, then send a short request.
bash
curl https://milorouter.com/v1/chat/completions \
-H "Authorization: Bearer $MILOROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "your-model-id",
"messages": [{"role": "user", "content": "Hello"}]
}'