Mica
Product
DesktopProducts overviewAI hardware engineerAI PCB designerAsk MicaDownload
Developers Coming soonEnterprise Coming soon
Resources
DocsTutorialsUse casesCompareGlossaryFAQSecurityTransparencyUpdates
Pricing
Talk to usJoin the waitlist
Product
DesktopProducts overviewAI hardware engineerAI PCB designerAsk MicaDownload
Resources
DocsTutorialsUse casesCompareGlossaryFAQSecurityTransparencyUpdates
Developers Coming soonEnterprise Coming soon
PricingNewsTalk to us
Join the waitlist
Mica

Windows alpha. Designs stay on your computer.

Product

  • Desktop
  • Products
  • Download
  • Pricing
  • Updates

Capabilities

  • AI hardware engineer
  • AI PCB designer
  • Ask Mica
  • MCP
  • Integrations

Use cases

  • What you can build
  • Wearables
  • Connected sensors
  • Motor control
  • All use cases

Resources

  • Docs
  • Tutorials
  • Compare
  • Glossary
  • FAQ

Company

  • Security
  • Transparency
  • Careers
  • Events
  • Contact
  • Explore
  • Developers Coming soon
  • Enterprise Coming soon

Programs

  • Startups
  • Students
  • Nonprofits

Legal

  • Terms of Service
  • Privacy Policy
  • Cookie Policy
  • EULA
  • Usage Policy
  • Responsible Disclosure
  • Policies
© 2026 Mica. Mica by MuscoLabsDrafts of legal terms are pending lawyer review.
Home/Docs/The planned model gateway, in plain words
Docs · reference

The planned model gateway, in plain words

The model gateway (the server program that would pass your request to the AI model) is planned and is not live. Nobody can buy a plan or get a license key today, so nothing on this page can be called yet. The AI models would come with the plan, so there is no model key to bring. This page records how the code in mica/billing/license_server.py, mica/billing/inference.py and mica/billing/limits.py behaves, so it can be checked. Plans, limits and prices may change before launch.

How you sign in

Every request that asks the model for an answer proves who you are with your Mica sign-in token or your license key, a long code that proves you have a subscription. Put the key in a line called a Bearer header:
Authorization: Bearer orc_...
The key would come from MICA_LICENSE_KEY or from ~/.mica/license.json. The server stores only a SHA-256 hash, a scrambled fingerprint of the key, never the key itself. The plan is that you would see the raw key exactly once, at checkout.

Addresses you can call

The chat address follows the OpenAI style, a request shape that many tools already know how to send. The gateway checks your plan and your usage limits. A token is a small piece of text the model reads or writes, and each answer counts its tokens times the model's multiplier. The gateway then passes the request to the model provider behind it. Add model to the request body to choose a model. Leave it out and the server default applies.
curl -s https:///v1/inference/chat/completions \
  -H "Authorization: Bearer orc_..." \
  -H "Content-Type: application/json" \
  -d '{"messages": [{"role": "user", "content": "Summarize this DRC report"}],
       "max_tokens": 500, "temperature": 0.2}'
A successful request (200) returns:
{
  "choices": [{"message": {"role": "assistant", "content": "..."}}],
  "model": "claude-...",
  "usage": {"prompt_tokens": 1234, "completion_tokens": 210,
            "multiplier": 1.0, "weighted": 1444.0},
  "limits": {"tier": "PRO", "hosted": true, "session_hours": 5.0,
             "session": {"used": ..., "limit": ..., "percent": 23.4, "resets_at": "..."},
             "weekly":  {"used": ..., "limit": ..., "percent": 6.1,  "resets_at": "..."}}
}
Every answer includes a limits block: how much of your session window and your weekly window you have used (percent) and when each resets (resets_at, UTC), so the client (the program that calls the gateway) can show it without asking again. usage.weighted is what this answer cost: its tokens times the model's multiplier. GET /v1/inference/models lists the models your plan may use, each with its multiplier, plus the same block.
Ask for your license status and current usage. The answer looks like this:
{
  "active": true,
  "tier": "PRO",
  "email": "operator@example.invalid",
  "status": "active",
  "current_period_end": 1791484800,
  "usage": {
    "prompt_tokens": 82000,
    "completion_tokens": 31000,
    "overage_tokens": 0,
    "period": "2026-11"
  },
  "limits": { ... }
}
usage is a raw monthly count kept for reporting; it does not limit you. limits does. An unknown key returns {"active": false, "status": "unknown_key"}.
A simple health check returns {"ok": true}.
✓ Health and readiness For the operator there are also GET /healthz, which always answers {"status": "ok"}; GET /readyz, which answers 200 only when the database is reachable and a model provider is configured; and GET /metrics, numbers for Prometheus (a tool that collects numbers about a running service), behind a token when one is set.

What the error codes mean

CodeerrorWhat it means
400invalid request: ...The request body is malformed or incomplete.
400model_not_availableThe model is not offered: it has no multiplier set, or it is not on the gateway's list.
401missing_license_keyThe request has no Authorization: Bearer header.
401invalid_license_keyThe license key is not recognized.
402subscription_requiredThe subscription is not active, for example because it was canceled or revoked. Renew it to get the included model access back.
403not_in_planYour plan has no hosted models on this server.
403model_not_in_planYou are on Free and the model is above the Free multiplier ceiling. Pick a cheaper model or move to Pro.
429limit_reachedYour session window or your weekly window is full. The answer names the window (session or weekly) and when it resets (resets_at).
500upstream error: ...The model provider behind the gateway failed. Retrying will not help.
502upstream error: ...The model provider behind the gateway failed for now. It is safe to retry.
503inference_not_configuredThe server has no model provider configured. This is a setup problem for the operator (the person who runs the server), not for you.
503limits_misconfiguredThe server cannot read its limit settings. This is a setup problem for the operator, not for you.
The client follows mica/models/hosted.py. Treat 401, 402, 403 and a 429 limit_reached as permanent: retrying will not help before the window resets. Treat 5xx as temporary and retry.

Planned usage limits

There is no monthly token quota. A plan's allowance is spent in two rolling windows, the way Claude and ChatGPT plans work: a 5-hour session window and a weekly window. A window starts with your first request, not on a calendar date. Each answer counts its tokens (the small pieces of text the model reads and writes) times the model's multiplier, which the app shows next to each model. The rules live in mica/billing/limits.py:
PlanModelsAllowance
FreeThe cheaper models onlyA small allowance
ProEvery model the gateway servesA much larger allowance
  • A model's multiplier says how fast it uses your windows: a 4× model four times as fast as a 1× model, a 0.25× model a quarter as fast.
  • Hard stop: once a window is full, new requests get 429 limit_reached, which names the window and when it resets. The request that crosses the line is still answered. Nothing is charged automatically.
  • The session window closes 5 hours after it opened and the weekly window 7 days after. A subscription marked past_due keeps working during its grace window.
  • The allowances and multipliers come from the model makers' published prices and can change.
✓ Verify: per-second and per-minute rate limiting The billing code has no limiter for requests per second or per minute. The session and weekly windows are the only limits it enforces. Do not publish a requests-per-minute figure until one exists.

Running the license server (for the operator, not live)

The gateway is a single Python process (one running program) that uses only the Python standard library, so it needs no extra packages. The setup is described in STRIPE_SETUP.md:
export MICA_STRIPE_SECRET_KEY=sk_live_...
export MICA_STRIPE_WEBHOOK_SECRET=whsec_...
export MICA_STRIPE_PRICE_PRO=price_...
export MICA_UPSTREAM_API_KEY=...   # model provider key, held by the operator
export MICA_UPSTREAM_MODEL=...
# models, multipliers and limits: deploy/gateway-limits.env
python -m mica.billing.license_server
← Back to docs home

Start with a description.

Mica is in early development. Join the list and we will tell you when it is ready to try.

By joining, you agree to our Privacy Policy. We will only email you about Mica’s launch, and you can ask to be removed at any time.

We will email you when there is something to try. No spam.