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)

Base URL

Bash
https://api.mr-coder.io

All 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:

Bash
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:

JSON
{
  "type": "error",
  "error": {
    "type": "authentication_error",
    "message": "Invalid API key. Please check that your API key is correct and try again."
  }
}
HTTP StatusError Type
400invalid_request_error
401authentication_error
403permission_error
429rate_limit_error
500api_error

Rate Limits

Rate limits are enforced per API key and vary by plan. Check your current limits with the Key Status endpoint.

Limit TypeDescription
RPM (Requests Per Minute)Maximum requests per minute for your key tier.
Token WindowRolling window of token usage (e.g. 1M tokens per 5 hours).
Monthly BudgetOptional 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:.

JSON
# Both of these are equivalent:
"model": "claude-sonnet-4-6"
"model": "anthropic:claude-sonnet-4-6"