01 · Quick start
Get your key and make a request
M82 Router uses prepaid credit in Nepali rupees. Your M82 key works across every model in this catalog. You don't need an account or key with any model provider.
- 01Sign inUse your approved account to open the M82 dashboard.
- 02Check your creditCheck your wallet balance before sending requests.
- 03Create an API keyCopy it when it's shown. Use a separate key for each app, and revoke keys you no longer need. Local test keys can't authenticate to production.
Keep the key in your server environment or secret manager. Don't put it in browser code, a public repository or a shared screenshot. The examples below read it from your environment.
https://api.m82router.com/v1# Bash or zsh: input is hidden while you paste the key.
printf 'M82 API key: '
IFS= read -r -s M82_API_KEY
printf '\n'
export M82_API_KEY
export M82_BASE_URL='https://api.m82router.com/v1'curl -sS "$M82_BASE_URL/models" \
-H "Authorization: Bearer $M82_API_KEY"02 · Client setup
Connect a client
Choose a live chat model. The examples and output limits update with your selection.
- Frontier model: requires Rs. 500 in verified top-ups before fees.
reasoning_effortacceptsminimal,low,medium,high. Reasoning tokens bill as output.- Not supported:
temperature,top_p,logprobs,top_logprobs,tool_choicevalues that force a tool call ("auto" works). Requests that include them are rejected before any charge.
curl -sS "$M82_BASE_URL/chat/completions" \
-H "Authorization: Bearer $M82_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"model":"anthropic/claude-fable-5.1","messages":[{"role":"user","content":"Say hello in Nepali."}],"max_tokens":128}'Normal responses include m82.request_id and the exact m82.cost_npr. Find the same request on your Usage page. The SDK examples turn off automatic retries, so a request that may already be billed isn't repeated after an uncertain failure.
Classify with Jev 1.13 — decisions
Use the same M82 key and API base URL with POST /v1/decisions. Send text or structured state and typed questions: noul for a yes probability, choice for a category, or score for ordered levels. Results include usage and the exact NPR charge. Decisions do not stream.
curl "https://api.m82router.com/v1/decisions" \
-H "Authorization: Bearer $M82_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"model":"typesafe/jev-1.13.0","state":"My invoice payment failed. Please help today.","questions":{"urgent":{"type":"noul","instructions":"Does this convey urgency?"},"department":{"type":"choice","instructions":"Which team should handle this?","criteria":{"billing":"Invoices and payments","technical":"Software problems"}}}}'typesafe/jev-1.13.0 · 32,000 context tokens · input Rs. 7.1485659 per million tokens · output Rs. 0 per million tokens.
03 · Streaming
Receive tokens as they arrive
Streaming uses Server-Sent Events. Keep reading through the final usage chunk and data: [DONE]. An interrupted stream may need settlement review, so check Usage before sending the request again.
curl -N -sS "$M82_BASE_URL/chat/completions" \
-H "Authorization: Bearer $M82_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"model":"anthropic/claude-fable-5.1","messages":[{"role":"user","content":"Say hello in Nepali."}],"max_tokens":128,"stream":true,"stream_options":{"include_usage":true}}'04 · Live catalog
Models and current rupee prices
Rates are per million tokens. Your request keeps the price that was active when its credit was authorized, even if prices change while it runs. Cached tokens use the reported cache rate; reasoning tokens count as output.
| Model | Protocol | Input / 1M | Cached / 1M | Output / 1M | Minimum |
|---|---|---|---|---|---|
Claude Fable 5.1anthropic/claude-fable-5.1 | Chat | Rs. 1,702.0395 | Rs. 42.5509875 | Rs. 8,510.1975 | Rs. 0 |
Claude Haiku 5.5anthropic/claude-haiku-5.5 | Chat | Rs. 17.020395 | Rs. 1.7020395 | Rs. 85.101975 | Rs. 0 |
Claude Opus 5.5anthropic/claude-opus-5.5 | Chat | Rs. 680.8158 | Rs. 34.04079 | Rs. 3,404.079 | Rs. 0 |
Claude Sonnet 5.5anthropic/claude-sonnet-5.5 | Chat | Rs. 340.4079 | Rs. 17.020395 | Rs. 1,702.0395 | Rs. 0 |
North Mini Code (free)cohere/north-mini-code:free | Chat | Rs. 0 | Rs. 0 | Rs. 0 | Rs. 0 |
DeepSeek V4.1 Flashdeepseek/deepseek-flash | Chat | Rs. 48.6297 | Rs. 0.972594 | Rs. 194.5188 | Rs. 0 |
DeepSeek V4 Prodeepseek/deepseek-v4-pro | Chat | Rs. 213.97068 | Rs. 7.132356 | Rs. 641.91204 | Rs. 0 |
Nemotron 3 Super (free)nvidia/nemotron-3-super:free | Chat | Rs. 0 | Rs. 0 | Rs. 0 | Rs. 0 |
Nemotron 3 Ultra (free)nvidia/nemotron-3-ultra:free | Chat | Rs. 0 | Rs. 0 | Rs. 0 | Rs. 0 |
GPT-3.5 Turboopenai/gpt-3.5-turbo | Chat | Rs. 85.101975 | Rs. 85.101975 | Rs. 255.305925 | Rs. 0 |
GPT-4 Turboopenai/gpt-4-turbo | Chat | Rs. 1,702.0395 | Rs. 1,702.0395 | Rs. 5,106.1185 | Rs. 0 |
GPT-4.1openai/gpt-4.1 | Chat | Rs. 340.4079 | Rs. 85.101975 | Rs. 1,361.6316 | Rs. 0 |
GPT-4.1 Miniopenai/gpt-4.1-mini | Chat | Rs. 68.08158 | Rs. 17.020395 | Rs. 272.32632 | Rs. 0 |
GPT-4.1 Nanoopenai/gpt-4.1-nano | Chat | Rs. 17.020395 | Rs. 4.25509875 | Rs. 68.08158 | Rs. 0 |
GPT-4oopenai/gpt-4o | Chat | Rs. 425.509875 | Rs. 212.7549375 | Rs. 1,702.0395 | Rs. 0 |
GPT-4o-miniopenai/gpt-4o-mini | Chat | Rs. 25.5305925 | Rs. 12.76529625 | Rs. 102.12237 | Rs. 0 |
GPT-5openai/gpt-5 | Chat | Rs. 212.7549375 | Rs. 21.27549375 | Rs. 1,702.0395 | Rs. 0 |
GPT-5 Miniopenai/gpt-5-mini | Chat | Rs. 42.5509875 | Rs. 4.25509875 | Rs. 340.4079 | Rs. 0 |
GPT-5 Nanoopenai/gpt-5-nano | Chat | Rs. 8.5101975 | Rs. 0.85101975 | Rs. 68.08158 | Rs. 0 |
GPT-5.1openai/gpt-5.1 | Chat | Rs. 212.7549375 | Rs. 21.27549375 | Rs. 1,702.0395 | Rs. 0 |
GPT-5.1-Codexopenai/gpt-5.1-codex | Chat | Rs. 212.7549375 | Rs. 22.1265135 | Rs. 1,702.0395 | Rs. 0 |
GPT-5.1-Codex-Maxopenai/gpt-5.1-codex-max | Chat | Rs. 212.7549375 | Rs. 21.27549375 | Rs. 1,702.0395 | Rs. 0 |
GPT-5.1-Codex-Miniopenai/gpt-5.1-codex-mini | Chat | Rs. 42.5509875 | Rs. 5.1061185 | Rs. 340.4079 | Rs. 0 |
GPT-5.2openai/gpt-5.2 | Chat | Rs. 297.8569125 | Rs. 29.78569125 | Rs. 2,382.8553 | Rs. 0 |
GPT-5.2-Codexopenai/gpt-5.2-codex | Chat | Rs. 297.8569125 | Rs. 29.78569125 | Rs. 2,382.8553 | Rs. 0 |
GPT-5.3-Codexopenai/gpt-5.3-codex | Chat | Rs. 297.8569125 | Rs. 29.78569125 | Rs. 2,382.8553 | Rs. 0 |
GPT-5.4openai/gpt-5.4 | Chat | Rs. 425.509875 | Rs. 42.5509875 | Rs. 2,553.05925 | Rs. 0 |
GPT-5.4 Miniopenai/gpt-5.4-mini | Chat | Rs. 127.6529625 | Rs. 12.76529625 | Rs. 765.917775 | Rs. 0 |
GPT-5.4 Nanoopenai/gpt-5.4-nano | Chat | Rs. 34.04079 | Rs. 3.404079 | Rs. 212.7549375 | Rs. 0 |
GPT-5.5openai/gpt-5.5 | Chat | Rs. 851.01975 | Rs. 85.101975 | Rs. 5,106.1185 | Rs. 0 |
GPT-5.6 Lunaopenai/gpt-5.6-luna | Chat | Rs. 34.04079 | Rs. 3.404079 | Rs. 204.24474 | Rs. 0 |
GPT-5.6 Solopenai/gpt-5.6-sol | Chat | Rs. 680.8158 | Rs. 68.08158 | Rs. 3,404.079 | Rs. 0 |
GPT-5.6 Terraopenai/gpt-5.6-terra | Chat | Rs. 340.4079 | Rs. 34.04079 | Rs. 2,042.4474 | Rs. 0 |
GPT-6 Astraopenai/gpt-6-astra | Chat | Rs. 1,702.0395 | Rs. 170.20395 | Rs. 8,510.1975 | Rs. 0 |
GPT-6 Lunaopenai/gpt-6-luna | Chat | Rs. 17.020395 | Rs. 1.7020395 | Rs. 85.101975 | Rs. 0 |
GPT-6 Solopenai/gpt-6-sol | Chat | Rs. 340.4079 | Rs. 34.04079 | Rs. 1,702.0395 | Rs. 0 |
GPT-6.1 Solopenai/gpt-6.1-sol | Chat | Rs. 340.4079 | Rs. 17.020395 | Rs. 1,702.0395 | Rs. 0 |
gpt-oss-120bopenai/gpt-oss-120b | Chat | Rs. 6.29754615 | Rs. 6.29754615 | Rs. 28.9346715 | Rs. 0 |
gpt-oss-20bopenai/gpt-oss-20b | Chat | Rs. 5.1061185 | Rs. 5.1061185 | Rs. 25.5305925 | Rs. 0 |
gpt-oss-safeguard-20bopenai/gpt-oss-safeguard-20b | Chat | Rs. 12.76529625 | Rs. 6.382648125 | Rs. 51.061185 | Rs. 0 |
o1openai/o1 | Chat | Rs. 2,553.05925 | Rs. 1,276.529625 | Rs. 10,212.237 | Rs. 0 |
o3openai/o3 | Chat | Rs. 340.4079 | Rs. 85.101975 | Rs. 1,361.6316 | Rs. 0 |
o3 Miniopenai/o3-mini | Chat | Rs. 187.224345 | Rs. 93.6121725 | Rs. 748.89738 | Rs. 0 |
o4 Miniopenai/o4-mini | Chat | Rs. 187.224345 | Rs. 46.80608625 | Rs. 748.89738 | Rs. 0 |
Qwen3 Coder 30B A3B Instructqwen/qwen3-coder-30b-a3b-instruct | Chat | Rs. 11.9142765 | Rs. 11.9142765 | Rs. 47.657106 | Rs. 0 |
Qwen3 Coder Nextqwen/qwen3-coder-next | Chat | Rs. 20.424474 | Rs. 11.9142765 | Rs. 136.16316 | Rs. 0 |
Jev 1.13 — decisionstypesafe/jev-1.13.0 | Decisions | Rs. 7.1485659 | Rs. 7.1485659 | Rs. 0 | Rs. 0 |
GLM 4.7 Flashz-ai/glm-4.7-flash | Chat | Rs. 10.297338975 | Rs. 10.297338975 | Rs. 68.08158 | Rs. 0 |
Selected model's pricing peg: Rs. 162.099 per USD. The peg is configurable; future price changes never rewrite past charges.
Frontier models need verified top-ups, counted before fees and across payments, of at least the amount shown for each model before their first request: Claude Fable 5.1 Rs. 500, Claude Opus 5.5 Rs. 500, Claude Sonnet 5.5 Rs. 500, DeepSeek V4 Pro Rs. 500, GPT-4 Turbo Rs. 500, GPT-4.1 Rs. 500, GPT-4o Rs. 500, GPT-5 Rs. 500, GPT-5.1 Rs. 500, GPT-5.1-Codex Rs. 500, GPT-5.1-Codex-Max Rs. 500, GPT-5.2 Rs. 500, GPT-5.2-Codex Rs. 500, GPT-5.3-Codex Rs. 500, GPT-5.4 Rs. 500, GPT-5.5 Rs. 500, GPT-5.6 Sol Rs. 500, GPT-5.6 Terra Rs. 500, GPT-6 Astra Rs. 500, GPT-6 Sol Rs. 500, GPT-6.1 Sol Rs. 500, o1 Rs. 500, o3 Rs. 500, o3 Mini Rs. 500, o4 Mini Rs. 500. Spending credit afterwards does not remove access.
Decision models use POST /v1/decisions with state and typed questions. They can't be used as chat or OpenCode models.
05 · Usage limits
Plan for both key and account limits
Every inference request must fit both scopes, so creating more keys doesn't get around your account limit. Key and account overrides may differ from the deployed defaults shown here.
| Scope | Requests / minute | Estimated tokens / minute | Concurrent requests |
|---|---|---|---|
| API key | 120 | 40,00,000 | 8 |
| Account | 300 | 80,00,000 | 20 |
- Requests and estimated tokens use fixed windows of 60 seconds that start with the first request in each scope.
- Chat token limits count an input estimate plus your maximum output allowance before inference. Unused allowance isn't returned to the rate-limit window, so lower
max_tokenswhen you need a short response. - Streaming holds a concurrency slot until the request finishes or closes. Spend restrictions and available wallet credit are enforced separately.
429includesRetry-Afterin seconds. Keep queues bounded and avoid immediate retry loops.- Requests fail temporarily with
503when shared limit enforcement is unavailable.
Free models
Models marked Free cost nothing. They are run by third-party providers that may keep prompts to improve their models, so don't send secrets or private code you can't share. Free capacity is shared, so it has its own limits on top of the ones above:
- Each workspace can make 100 free-model requests a day (reset at 00:00 UTC) and 5 a minute:
429 free_quota_exceededor429 free_rate_limited. - When free capacity is busy you get
429 free_capacity_busywithRetry-After. Try again later, or choose a paid model. - Free models are never chosen for you; tools use them only when you pick one.
Request bodies are limited to 2 MiB. Each model's output-token limit is shown when you select it above.
06 · Troubleshooting
Keep the request ID
Every API response carries an X-Request-ID header. Include that ID when you report a problem, and never share your key or a private prompt. Contact support.
| HTTP | Meaning | Next step |
|---|---|---|
| 400 | Invalid request | Check the model protocol, JSON fields, and output-token limit. unsupported_parameter and context_length_exceeded name a model rule; requests rejected for either are not charged. |
| 401 | Invalid API key | Use your M82 machine key. A dashboard login token is not an API key. |
| 402 | Insufficient credit or funding | Add credit to your wallet, or lower max_tokens when the error names a limit that fits. Each request holds an estimate of its cost before it runs; unused credit is released after settlement. frontier_topup_required means the model needs more verified top-ups, counted before fees. |
| 403 | Access restricted | Check the key's allowed models, spend limits, and account status. model_refusal means the model declined the request before writing anything; no charge is made, so rephrase it or choose another model. |
| 404 | Model unavailable | Refresh the catalog and use an enabled public model ID. |
| 429 | Rate limited | Respect Retry-After, reduce parallel requests, and use bounded backoff with jitter. |
| 502 / 503 | Service unavailable | Keep the request ID. Check your Usage page before retrying an interrupted request. |
| 500 | Processing failed | Keep the request ID and check Usage before retrying. Settlement may require review. |