Models → Pricing → Docs → Blog → Changelog → Contact → Status →
Get started freeLog in

API keys and per-key limits

One account, up to 20 active keys, each with its own scopes, limits and pause switch.

⏱ 5 min read

Create a key

Keys are made at Dashboard → API keys. A key looks like fm_ followed by 48 hexadecimal characters.

  • Free accounts must finish the one-time Telegram verification before they can create a key (see Free plan).
  • An account can have at most 20 active keys. Revoke a key you no longer use to make room.
  • When you create a key you can give it a name, scopes and the limits below. All of them except scopes can be changed later.

Send the key

Any one of these headers works on every endpoint:

HeaderTypical client
Authorization: Bearer fm_…OpenAI SDKs and most tools
x-api-key: fm_…Anthropic SDKs, Claude Code
anthropic-api-key: fm_…Some Anthropic-style clients
x-goog-api-key: fm_…Gemini-style clients

A ?key= or ?api_key= query parameter is also read when no header is sent. Prefer a header: URLs end up in logs and browser history.

curl https://freemodel.in/v1/models \
  -H "Authorization: Bearer $FREEMODEL_API_KEY"

Keep the key in an environment variable or a secrets manager, never in code you commit.

Scopes

ScopeAllows
inference/v1/chat/completions, /v1/responses, /v1/messages (and count_tokens), the Gemini endpoints, and the image endpoints
models:readGET /v1/models and GET /v1/models/{id}
embeddingsPOST /v1/embeddings — reserved — endpoint not available yet (501)

New keys get all three by default. A request outside the key's scopes returns 403 insufficient_scope. Many coding tools call /v1/models first, so keep models:read on unless you have a reason not to.

Per-key limits

Each limit is optional; empty means no limit on the key. The account's own limits (plan tokens, plan requests per minute) always apply on top.

LimitWhat it countsWhen reached
Token limitPlan tokens charged to this key (after multipliers)402 key_token_limit_reached
Spend limit (USD)The key's spend, worked out from each model's list price per token, as shown on the key card402 key_spend_limit_reached
Expiry dateDate and time in UTC; must be in the future401 key_expired
Requests per minuteRequests from this key in a sliding 60-second window; cannot be set above the plan's limit429 rate_limit_exceeded

The create form has three presets: Open (no limits), Budget (a $5 spend limit) and Trial (1,000,000 tokens, expires in 7 days). You can change any value before saving.

Uses for limits: a separate key per app or teammate, a trial key for a contractor, or a hard ceiling on a script that might loop.

When a key's token limit is close, the output length of a request is lowered so the request stays within it (never below 256 output tokens).

Pause, rotate and revoke

ActionWhat happens
PauseThe key answers 403 key_paused until you resume it. Nothing else changes. Good for a key you think has leaked while you check.
Rotate secretThe key gets a new fm_… secret. The old secret stops working at once. Name, scopes, limits and usage counters stay.
RevokeThe key is switched off for good and answers 401 invalid_api_key. It no longer counts toward the 20-key maximum.

After rotating, update every place that uses the key. Usage made with a key you gave away, or after it leaked, is not refundable — pause or rotate quickly.

Usage per key

Each key card shows its requests, tokens, spend, last use and expiry. The usage log and its CSV export list the key name for every request; see Usage and billing.

Key errors at a glance

StatusCodeCause
401invalid_api_keyMissing, wrong, rotated-away or revoked key
401key_expiredExpiry date passed
402key_token_limit_reachedKey token limit reached
402key_spend_limit_reachedKey spend limit reached
403key_pausedKey paused
403insufficient_scopeEndpoint not in the key's scopes
429rate_limit_exceededKey requests per minute
Was this page helpful?
Still stuck?
Open a support ticket from your dashboard or message our support bot on Telegram.
Telegram supportGet help