API Reference
MR Multi Model AI Coder provides a REST API for sending messages, listing models, checking quotas, and counting tokens — through a unified interface that works with multiple AI providers.
Base URL: https://api.mr-coder.io (or your self-hosted instance)
/v1/messagesMessages
Send a message and receive an AI response. Supports streaming, system prompts, and tool use.
/v1/modelsModels
List all available models with their IDs, context windows, and pricing tiers.
/v1/key-statusKey Status
Check your API key validity, rate limits, token window usage, and monthly budget.
/v1/messages/count_tokensCount Tokens
Calculate the token count for a given messages payload before sending a request.
Base URL
https://api.mr-coder.ioAll API endpoints are relative to this base URL. For local development or self-hosting, replace the domain with your own instance URL.
Authentication
Authenticate requests using your API key via the x-api-key header:
curl https://api.mr-coder.io/v1/models \
-H "x-api-key: sk-mr-auth-xxxxxxxxxxxxxxxxxxxxxxxxxxxx"For full authentication details including key types, session auth, and multi-key strategies, see the Authentication guide.
Request Format
All request bodies must be JSON with Content-Type: application/json header.
Error Responses
Errors follow the Anthropic format with a type and message:
{
"type": "error",
"error": {
"type": "authentication_error",
"message": "Invalid API key. Please check that your API key is correct and try again."
}
}| HTTP Status | Error Type |
|---|---|
| 400 | invalid_request_error |
| 401 | authentication_error |
| 403 | permission_error |
| 429 | rate_limit_error |
| 500 | api_error |
Rate Limits
Rate limits are enforced per API key and vary by plan. Check your current limits with the Key Status endpoint.
| Limit Type | Description |
|---|---|
| RPM (Requests Per Minute) | Maximum requests per minute for your key tier. |
| Token Window | Rolling window of token usage (e.g. 1M tokens per 5 hours). |
| Monthly Budget | Optional monthly token cap. Resets on the 1st of each month. |
Provider Prefix Format
Model IDs can be bare (e.g., claude-sonnet-4-6) or prefixed with the provider (e.g., anthropic:claude-sonnet-4-6). Bare names default to anthropic:.
# Both of these are equivalent:
"model": "claude-sonnet-4-6"
"model": "anthropic:claude-sonnet-4-6"