Developer documentation

Build with M82.

One M82 key. Current models and rupee prices. Connect the client you already use.

Catalog checked 05:05 Nepal timeRefreshes every minute while this page is open.

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.

Invitation-only beta. Public registration is disabled; only approved users and accounts have access.
  1. 01Sign inUse your approved account to open the M82 dashboard.
  2. 02Check your creditCheck your wallet balance before sending requests.
  3. 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.

API base URLhttps://api.m82router.com/v1
Environment · Bash / zsh
# 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'
Discover enabled models
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.

Chat model

anthropic/claude-fable-5.1 · 10,00,000 context tokens · 4,096 maximum output tokens

  • Frontier model: requires Rs. 500 in verified top-ups before fees.
  • reasoning_effort accepts minimal, low, medium, high. Reasoning tokens bill as output.
  • Not supported: temperature, top_p, logprobs, top_logprobs, tool_choice values that force a tool call ("auto" works). Requests that include them are rejected before any charge.
Chat completion
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.

Typed classification · curl
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.

Streaming chat · curl
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.

Current public models and active customer prices in Nepali rupees per million tokens
ModelProtocolInput / 1MCached / 1MOutput / 1MMinimum
Claude Fable 5.1anthropic/claude-fable-5.1ChatRs. 1,702.0395Rs. 42.5509875Rs. 8,510.1975Rs. 0
Claude Haiku 5.5anthropic/claude-haiku-5.5ChatRs. 17.020395Rs. 1.7020395Rs. 85.101975Rs. 0
Claude Opus 5.5anthropic/claude-opus-5.5ChatRs. 680.8158Rs. 34.04079Rs. 3,404.079Rs. 0
Claude Sonnet 5.5anthropic/claude-sonnet-5.5ChatRs. 340.4079Rs. 17.020395Rs. 1,702.0395Rs. 0
North Mini Code (free)cohere/north-mini-code:freeChatRs. 0Rs. 0Rs. 0Rs. 0
DeepSeek V4.1 Flashdeepseek/deepseek-flashChatRs. 48.6297Rs. 0.972594Rs. 194.5188Rs. 0
DeepSeek V4 Prodeepseek/deepseek-v4-proChatRs. 213.97068Rs. 7.132356Rs. 641.91204Rs. 0
Nemotron 3 Super (free)nvidia/nemotron-3-super:freeChatRs. 0Rs. 0Rs. 0Rs. 0
Nemotron 3 Ultra (free)nvidia/nemotron-3-ultra:freeChatRs. 0Rs. 0Rs. 0Rs. 0
GPT-3.5 Turboopenai/gpt-3.5-turboChatRs. 85.101975Rs. 85.101975Rs. 255.305925Rs. 0
GPT-4 Turboopenai/gpt-4-turboChatRs. 1,702.0395Rs. 1,702.0395Rs. 5,106.1185Rs. 0
GPT-4.1openai/gpt-4.1ChatRs. 340.4079Rs. 85.101975Rs. 1,361.6316Rs. 0
GPT-4.1 Miniopenai/gpt-4.1-miniChatRs. 68.08158Rs. 17.020395Rs. 272.32632Rs. 0
GPT-4.1 Nanoopenai/gpt-4.1-nanoChatRs. 17.020395Rs. 4.25509875Rs. 68.08158Rs. 0
GPT-4oopenai/gpt-4oChatRs. 425.509875Rs. 212.7549375Rs. 1,702.0395Rs. 0
GPT-4o-miniopenai/gpt-4o-miniChatRs. 25.5305925Rs. 12.76529625Rs. 102.12237Rs. 0
GPT-5openai/gpt-5ChatRs. 212.7549375Rs. 21.27549375Rs. 1,702.0395Rs. 0
GPT-5 Miniopenai/gpt-5-miniChatRs. 42.5509875Rs. 4.25509875Rs. 340.4079Rs. 0
GPT-5 Nanoopenai/gpt-5-nanoChatRs. 8.5101975Rs. 0.85101975Rs. 68.08158Rs. 0
GPT-5.1openai/gpt-5.1ChatRs. 212.7549375Rs. 21.27549375Rs. 1,702.0395Rs. 0
GPT-5.1-Codexopenai/gpt-5.1-codexChatRs. 212.7549375Rs. 22.1265135Rs. 1,702.0395Rs. 0
GPT-5.1-Codex-Maxopenai/gpt-5.1-codex-maxChatRs. 212.7549375Rs. 21.27549375Rs. 1,702.0395Rs. 0
GPT-5.1-Codex-Miniopenai/gpt-5.1-codex-miniChatRs. 42.5509875Rs. 5.1061185Rs. 340.4079Rs. 0
GPT-5.2openai/gpt-5.2ChatRs. 297.8569125Rs. 29.78569125Rs. 2,382.8553Rs. 0
GPT-5.2-Codexopenai/gpt-5.2-codexChatRs. 297.8569125Rs. 29.78569125Rs. 2,382.8553Rs. 0
GPT-5.3-Codexopenai/gpt-5.3-codexChatRs. 297.8569125Rs. 29.78569125Rs. 2,382.8553Rs. 0
GPT-5.4openai/gpt-5.4ChatRs. 425.509875Rs. 42.5509875Rs. 2,553.05925Rs. 0
GPT-5.4 Miniopenai/gpt-5.4-miniChatRs. 127.6529625Rs. 12.76529625Rs. 765.917775Rs. 0
GPT-5.4 Nanoopenai/gpt-5.4-nanoChatRs. 34.04079Rs. 3.404079Rs. 212.7549375Rs. 0
GPT-5.5openai/gpt-5.5ChatRs. 851.01975Rs. 85.101975Rs. 5,106.1185Rs. 0
GPT-5.6 Lunaopenai/gpt-5.6-lunaChatRs. 34.04079Rs. 3.404079Rs. 204.24474Rs. 0
GPT-5.6 Solopenai/gpt-5.6-solChatRs. 680.8158Rs. 68.08158Rs. 3,404.079Rs. 0
GPT-5.6 Terraopenai/gpt-5.6-terraChatRs. 340.4079Rs. 34.04079Rs. 2,042.4474Rs. 0
GPT-6 Astraopenai/gpt-6-astraChatRs. 1,702.0395Rs. 170.20395Rs. 8,510.1975Rs. 0
GPT-6 Lunaopenai/gpt-6-lunaChatRs. 17.020395Rs. 1.7020395Rs. 85.101975Rs. 0
GPT-6 Solopenai/gpt-6-solChatRs. 340.4079Rs. 34.04079Rs. 1,702.0395Rs. 0
GPT-6.1 Solopenai/gpt-6.1-solChatRs. 340.4079Rs. 17.020395Rs. 1,702.0395Rs. 0
gpt-oss-120bopenai/gpt-oss-120bChatRs. 6.29754615Rs. 6.29754615Rs. 28.9346715Rs. 0
gpt-oss-20bopenai/gpt-oss-20bChatRs. 5.1061185Rs. 5.1061185Rs. 25.5305925Rs. 0
gpt-oss-safeguard-20bopenai/gpt-oss-safeguard-20bChatRs. 12.76529625Rs. 6.382648125Rs. 51.061185Rs. 0
o1openai/o1ChatRs. 2,553.05925Rs. 1,276.529625Rs. 10,212.237Rs. 0
o3openai/o3ChatRs. 340.4079Rs. 85.101975Rs. 1,361.6316Rs. 0
o3 Miniopenai/o3-miniChatRs. 187.224345Rs. 93.6121725Rs. 748.89738Rs. 0
o4 Miniopenai/o4-miniChatRs. 187.224345Rs. 46.80608625Rs. 748.89738Rs. 0
Qwen3 Coder 30B A3B Instructqwen/qwen3-coder-30b-a3b-instructChatRs. 11.9142765Rs. 11.9142765Rs. 47.657106Rs. 0
Qwen3 Coder Nextqwen/qwen3-coder-nextChatRs. 20.424474Rs. 11.9142765Rs. 136.16316Rs. 0
Jev 1.13 — decisionstypesafe/jev-1.13.0DecisionsRs. 7.1485659Rs. 7.1485659Rs. 0Rs. 0
GLM 4.7 Flashz-ai/glm-4.7-flashChatRs. 10.297338975Rs. 10.297338975Rs. 68.08158Rs. 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.

Deployed default rate limits
ScopeRequests / minuteEstimated tokens / minuteConcurrent requests
API key12040,00,0008
Account30080,00,00020
  • 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_tokens when 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.
  • 429 includes Retry-After in seconds. Keep queues bounded and avoid immediate retry loops.
  • Requests fail temporarily with 503 when 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_exceeded or 429 free_rate_limited.
  • When free capacity is busy you get 429 free_capacity_busy with Retry-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.

HTTPMeaningNext step
400Invalid requestCheck 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.
401Invalid API keyUse your M82 machine key. A dashboard login token is not an API key.
402Insufficient credit or fundingAdd 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.
403Access restrictedCheck 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.
404Model unavailableRefresh the catalog and use an enabled public model ID.
429Rate limitedRespect Retry-After, reduce parallel requests, and use bounded backoff with jitter.
502 / 503Service unavailableKeep the request ID. Check your Usage page before retrying an interrupted request.
500Processing failedKeep the request ID and check Usage before retrying. Settlement may require review.