Skip to content

Docs

MayuAI API

One key and one endpoint for every model on MayuAI, paid in Taka from one credit balance.

  1. Get a key: sign in and open Settings → API keys. New accounts open when sign-up does.
  2. export MAYUAI_API_KEY="your key"
  3. curl https://api.mayuai.com/v1/ai/chat -H "x-api-key: $MAYUAI_API_KEY" -H "content-type: application/json" -d '{"model":"gemini-3.5-flash-lite","messages":[{"role":"user","content":"Hello"}]}'

Authentication

Send your API key in the x-api-key header, as <key id>.<secret>. Create one in Settings once you are signed in and have confirmed your email address; the secret is shown once, so keep it in an environment variable (MAYUAI_API_KEY) on your server, never in a web page or an app you ship. A signed-in session’s bearer token works for chat too. The API overview has the other endpoints.

Request and reply

POST https://api.mayuai.com/v1/ai/chat with a JSON body. There is no MayuAI SDK: any HTTP client works, and the examples below use curl, Python and JavaScript. To use an SDK, use OpenAI’s: the OpenAI SDKs are the supported path, through the OpenAI-compatible endpoint below.

The request body
FieldWhat it is
modelA model id from the table below, or auto: MayuAI picks one your plan can use for the task.
messagesThe conversation: each message has a role (system, user or assistant) and content.
temperature (optional)How varied the wording is.
max_tokens (optional)The most the model may write.
stream (optional)true to receive the answer as server-sent events as it is written.
smart_route (optional)true to use smart routing for this one request, false to keep the model you named (smart routing, below; off unless your account turns it on).
curl https://api.mayuai.com/v1/ai/chat -H "x-api-key: $MAYUAI_API_KEY" -H "content-type: application/json" -d '{"model":"gemini-3.5-flash-lite","messages":[{"role":"user","content":"Hello"}]}'

The reply

JSON
{
  "choices": [{ "message": { "role": "assistant", "content": "..." } }],
  "model": "gemini-3.5-flash-lite",
  "provider": "...",
  "usage": { "tokens": 42, "credits": 1, "remaining": 4999 }
}

model is the model that answered and was charged; usage.credits is what the request cost and usage.remaining your balance after it. With auto the reply also says which task it was sorted into: how routing works.

In your editor

The API also speaks the OpenAI chat completions format, so a coding extension that takes an OpenAI-compatible provider works with it: Kilo Code, Cline and Roo Code in VS Code, and the same extensions in editors built on VS Code, such as Antigravity. In Continue it is the openai provider with apiBase set to the base URL. Choose that provider and fill in:

An extension’s settings
SettingValue
API providerOpenAI Compatible
Base URLhttps://api.mayuai.com/v1
API keyyour MayuAI API key
Modela model id from the table below, or auto

The extension sends the key as Authorization: Bearer, which MayuAI reads as your API key; it calls POST /v1/chat/completions and lists models from GET /v1/models, the models your plan can call. Credits, plans and rate limits are the same as for any request.

cURL
curl https://api.mayuai.com/v1/chat/completions -H "Authorization: Bearer $MAYUAI_API_KEY" -H "content-type: application/json" -d '{"model":"gemini-3.5-flash-lite","messages":[{"role":"user","content":"Hello"}]}'
  • Native tool calling (tools, tool_calls) is not supported: use an extension that describes its tools in the prompt, as Kilo Code, Cline and Roo Code do.
  • An extension cannot send smart_route, so it gets the model it names unless smart routing is turned on for the account on Usage.
  • An agent in an editor sends many requests in a row: see your plan’s AI requests a minute.

Step-by-step: the setup guides for the OpenAI SDKs, Cursor, Continue, Cline, Roo Code, Kilo Code and OpenCode.

Models and rates

Use a model’s id as model. A rate is credits per 1,000 tokens, one for what you send and one for what the model writes; the table is the catalog as it stands now, and the Model Hub shows what each model is good at.

Examples, by id
IdModelPlans
crouton-alphaCrouton AlphaAll plans
gemini-3.6-flashGemini 3.6 FlashPro and above
claude-fable-5-1Claude Fable 5.1Developer and above
gpt-6-astraGPT-6 AstraPro and above
Every model and its rate, in credits per 1,000 tokens
ModelIdInputOutputPlans
Claude Fable 5.1claude-fable-5-118.1990.91Developer and above
Claude Fable 5.2claude-fable-5-214.5572.73Developer and above
Claude Haiku 5.5claude-haiku-5-50.190.91Starter and above
Claude Opus 5.5claude-opus-5-57.2836.37Pro and above
Claude Sonnet 5.5claude-sonnet-5-53.6418.19Pro and above
Crouton Alphacrouton-alpha0.000.00All plans
DeepSeek V4.1 Flashdeepseek-flash0.281.10Starter and above · rate changes with the time of day (off-peak shown)
DeepSeek V4 Pro-0813deepseek-v4-pro1.213.61Starter and above · rate changes with the time of day (off-peak shown)
Fugu Ultra v2fugu-ultra-v29.1054.55Pro and above
Gemini 3.1 Pro Previewgemini-3.1-pro-preview7.2832.73Pro and above
Gemini 3.5 Flash Litegemini-3.5-flash-lite0.554.55All plans
Gemini 3.5 Flashgemini-3.5-flash2.7316.37Starter and above
Gemini 3.6 Flashgemini-3.6-flash2.7313.64Pro and above
Gemini 3.7 Flashgemini-3.7-flash2.7313.64Starter and above
Gemini 3.8 Flashgemini-3.8-flash2.7313.64Starter and above
Gemini 4 Argongemini-4-argon7.2836.37Pro and above
Gemini 4 Carbongemini-4-carbon7.2836.37Developer and above
Gemini 4 Hydrogengemini-4-hydrogen2.7313.64Starter and above
Gemini 4 Neongemini-4-neon5.4627.28Pro and above
GLM-5.2glm-5.21.1310.55Starter and above
GLM-5.3 FlashXglm-5.3-flashx0.682.28Starter and above
GLM-5.3glm-5.32.558.01Starter and above
GPT-5.6 Solgpt-5.6-sol14.5554.55Pro and above
GPT-6 Astragpt-6-astra18.1990.91Pro and above
GPT-6 Lunagpt-6-luna0.190.91Starter and above
GPT-6.1 Solgpt-6.1-sol3.6418.19Pro and above
GPT-6.1 Terragpt-6.1-terra1.829.10Starter and above
GPT-6.2 Astragpt-6.2-astra14.5572.73Pro and above
GPT-6.2 Solgpt-6.2-sol3.6418.19Pro and above
GPT-OSS 120Bgpt-oss-120b0.050.17All plans
Grok 4.5grok-4.53.6410.91Starter and above
Grok 4.6grok-4.63.6410.91Starter and above
Grok 4.7grok-4.73.6410.91Pro and above
Kimi K2.6kimi-k2.61.737.28Pro and above
Kimi K2.7 Codekimi-k2.7-code1.106.37Pro and above
Kimi K3.1 Prokimi-k3.1-pro3.6418.19Pro and above
Kimi K3kimi-k35.4629.10Pro and above
Llama 4 Maverickllama-4-maverick0.641.82Starter and above
Llama 4 Scoutllama-4-scout0.190.55All plans
MiMo V2.6 Flashmimo-v2.6-flash0.260.51All plans
MiMo V2.6 Promimo-v2.6-pro0.801.59Starter and above
MiniMax M3minimax-m30.552.19Starter and above
Mistral Large 4mistral-large-41.283.82Starter and above
Mistral Small 4mistral-small-40.281.10Starter and above
Muse Ember 1.0muse-ember-1.00.190.91Starter and above
Muse Spark 1.3 Contributormuse-spark-1.3-contributor0.190.37All plans
Muse Spark 1.3muse-spark-1.32.287.73Starter and above
Muse Wondermuse-wonder7.2836.37Pro and above
Nemotron 3.5 Super VLnemotron-3.5-super-vl0.280.86Starter and above
Qwen 3.7 Flashqwen-3.7-flash0.060.24All plans
Qwen 3.7 Maxqwen-3.7-max4.5513.64Pro and above
Qwen 3.8 Flashqwen-3.8-flash0.280.86Starter and above
Qwen 3.8 Maxqwen-3.8-max3.6410.91Pro and above
Qwen 4 Maxqwen-4-max2.738.19Pro and above

A model with no rate on file says “not set”. A rate of 0.00 is a real figure: the provider charges nothing for that model.

Smart routing

Off unless you turn it on (since 2026-11-20): the model you name is the one that answers. When it is on and a request is simple (a greeting or a short question: no code, analysis or writing task, no image), MayuAI serves it with the cheapest model your plan can use instead of the one you named, and says so. Only a model that has been confirmed by a real call is ever chosen, never a dearer one than you named, never one outside your plan. Anything else is served by the model you named.

JSON
"routing": {
  "smartRoute": true,
  "requestedModel": "...",
  "model": "...",
  "savedCredits": 3,
  "note": "routed to ..., saved 3 credits vs ..."
}
  • The reply carries routing, and your usage log records the model you named and what was saved.
  • To use it for one request, send "smart_route": true; to keep the model you named, send "smart_route": false.
  • To turn it on for every request, use the switch on Usage. A request’s own smart_route wins.
  • model: "auto" is separate: MayuAI sorts the task and ranks the models your plan can use that can do it; Routing explains how.

How credits are counted

Every request is paid for in credits from one balance: 1 credit = ৳0.15. A request costs

input tokens ÷ 1,000 × input rate + output tokens ÷ 1,000 × output rate

rounded up to a whole credit, never less than 1. For example, Gemini 3.5 Flash with 1,200 tokens in and 400 out: 1.2 × 2.73 + 0.4 × 16.37 comes to 10 credits.

  • An estimate is set aside before a request runs; you are charged what it used and the rest comes back. A request that fails costs nothing.
  • A monthly plan’s credits are spent first and expire when its 30 days end. Credits from a pack never expire, and a pack never changes your plan.
  • Free credits given to a Free-plan account end 7 days after sign-up; only what is left of them ends, never credits you bought.
  • The Claude models cost fewer credits when plan credits pay: one coding exchange (10,000 tokens in, 2,000 out) on Claude Fable 5.1 is 223 plan credits or 364 pack credits.

Credit packs

One-time packs; the credits never expire
PackPriceCredits
Mini৳99660 credits
Small৳6995,500 credits
Medium৳9998,000 credits
Large৳2,49920,000 credits
Extra Large৳4,99940,000 credits

Buy one from Wallet once you are signed in. Prices and credits are in Pricing.

Plans

Monthly plans: 30 days, renewed by buying again
PlanPrice a monthCreditsModels
Free৳0507
Starter৳7495,00030
Pro৳1,99913,50051
Developer৳2,99925,00054
Agency৳7,49950,00054
EnterpriseContact salesAgreed with you54

A model outside your plan answers 403 not_in_your_plan. See Pricing for what each plan includes.

Rate limits

Requests, by plan
PlanAI requests a minuteAll requests an hour
Free5200
Starter15800
Pro302,000
Developer15015,000
Agency17517,500
EnterpriseAgreed with youAgreed with you
Headers on a reply
HeaderWhat it says
X-RateLimit-Limit-AIAI requests a minute your plan allows.
X-RateLimit-Remaining-AIAI requests left in this minute.
X-RateLimit-LimitAll requests a minute your plan allows.
X-RateLimit-RemainingAll requests left in this minute.
Retry-AfterOn a 429: seconds to wait before trying again.

Errors

StatusCodeWhat it means
401Authentication requiredNo key, or a key that is not valid: send it in the x-api-key header as <key id>.<secret>.
402insufficient_creditsYour balance is empty. Buy a pack or renew a plan; nothing ran.
403not_in_your_planThe model is not in your plan. The reply names your plan, the plan that has it and the pricing page.
429ai_rate_limitToo many requests for your plan this minute. Wait Retry-After seconds. (user_rate_limit says the same of all requests.)
502, 503provider_unavailable, provider_internal_error (502); provider_not_configured, provider_auth_failed (503)The model's provider failed or is not set up. Nothing was charged.

Still stuck? Read the FAQ or contact us. The example model on this page is gemini-3.5-flash-lite, which every plan may call.

Common questions

What do the docs cover?

A three-line quickstart, authentication, the chat request and reply, every model with its rate, smart routing, how credits are counted, the packs and plans, the rate limits and the errors.

Are the API pages checked against the service?

Yes. The endpoints and request fields on the API pages are checked by a test against the service's own route definitions, so a page cannot name a call that does not exist.

What if the docs do not answer my question?

Read the FAQ, or contact us by email, phone or WhatsApp.

Where to go next

  • FAQ

    Short answers about credits, models and payments.

    Open
  • Models

    The catalog and its credit rates.

    Open
  • API

    The other endpoints: models and usage.

    Open
  • Plans and credits

    Plans

    What each plan includes and which models it reaches.

    Open

Not open to the public yet

A quickstart, then the endpoint, every model with its rate, credits, plans, limits and errors.

Existing accounts can sign in. To ask about access, contact us.