Skip to main content

Getting started

Creating an API key needs no card. Sign up, create a workspace (see quickstart step 2 — signup does not make one for you, and keys live inside it), then mint a key from Workspace home in the dashboard. It exists, authenticates, and appears in your key list immediately. Spending is what needs funding. Every request is checked against your balance before it reaches a model, and a new account’s balance is zero, so until you add funds your requests come back 402 Payment Required (the exact body is below). Having no card, and having no balance, are both fine at key-creation time — so you can distribute the key, commit the integration and run your deploy pipeline before any payment detail exists. (Key creation is still refused in a few other cases: your role in the workspace, a workspace you are not an active member of, a workspace that has been suspended or archived, the per-workspace limit on how many keys may be live at once, and an account frozen over a payment dispute. Organization-level ownership is not a substitute for workspace membership — if you administer the organization but are not a member of the workspace, you cannot mint a key in it.) There are two ways to get a balance. Add a card and top up — see Adding a card — or carry credit — from the FlexAI Startup Program, a negotiated offer, or the verified first top-up match, which doubles your first top-up up to $100 on US-dollar accounts once you have verified your identity. See the credits FAQ for the terms and how to claim it. New accounts do not come with an automatic credit grant; see the credits FAQ for where credits come from. Credit is not a separate pocket that is spent first. It lands in the same workspace balance as the money you top up, and every request draws on that one number — so what credit buys you is a balance that lasts longer, not a period before billing starts. Your card is charged when funds are added, either because you topped up or because an auto-recharge rule fired, and never per request. That is the shape for a workspace funded by top-ups, which is the default and what the rest of this page describes. A workspace Flex has separately approved to keep serving once its balance is exhausted is invoiced for that usage afterwards instead — still a charge per invoice, never per request. The first top-up match runs in that order too, and the name is the clearest way to see it: you top up and are charged for it, and the matching credit lands on the balance afterwards.
Funds are workspace-level — one wallet per workspace, topped up once, and every key in that workspace draws on the whole balance. There is no per-key allowance. Three things can still bound what a key spends, all set by someone else: a per-member spend cap set by a workspace admin, a monthly ceiling on the organization, and a cap we apply directly in rare cases. Rate limits work the other way round: the ceiling is set on the same account that funds the workspace, but each key is counted against it separately, and it runs out independently of money.

How we bill

Dollar-denominated, per-request. We don’t sell token bundles, we don’t subscribe you — we meter what you use: Per-model pricing is in the catalog. Spend appears in the dashboard within a few minutes of each request.
Streaming a chat completion and stopping early still bills for the tokens that were generated before you closed the connection — the model did the work. Set max_tokens to cap worst-case spend.

Per-request cost in the response

Chat completion responses carry what the request cost you, in the usage block: These are FlexAI’s charge to you, not an upstream provider’s cost to us. The upstream_inference_* names follow OpenRouter’s usage-accounting fields, so tools that already read them work unchanged. Where they appear:
  • Non-streaming: on the response’s usage.
  • Streaming: on the usage of the final chunk. Send stream_options: { "include_usage": true } to get that chunk.
Values are USD numbers rounded to 8 decimal places. The fields are absent, not 0, when the response cannot state the charge yet. That happens when the gateway has no per-token price for the model, or when a stream’s final chunk reports zero tokens and the count is corrected after the stream ends. The request is still billed. To read the recorded charge for one request, call GET /v1/flex/usage/request/{request_id} with the x-litellm-call-id response header. GET /v1/pricing is the published price list, and it is served per region like the rest of the API: read it from https://api.flex.ai/v1/pricing, or https://eu.api.flex.ai/v1/pricing for an EU workspace, matching the workspace whose charges you are checking. These charges are computed from it.

Rate limits

Set on the account that funds your workspace, enforced on each key, per minute. Keys are not pooled — a second key does not draw down the first key’s window. The ceiling follows your tier: A workspace whose account has no card on file starts on the free tier, and its keys are limited at that rate. Adding a card moves that account’s keys to the paid tier — it is having the card, not having spent anything, that makes the difference, and it is the only tier change you can make yourself. It is not instantaneous: the promotion is applied by a reconciler shortly after the card is added, so allow a minute before judging the limit from the headers. Keys an admin has given an explicit per-member rate limit keep that limit, and so do disabled keys and suspended members. Beyond the paid tier, limits are set by hand: email support@flex.ai and tell us the rate you need. We raise the ceiling, but that alone moves no existing key — an admin then sets each member’s limit within the new headroom, and that is what the keys pick up. See Concurrency for both layers. Every response from the API carries rate-limit headers: When you exceed the limit you get 429 Too Many Requests with a Retry-After header (seconds to wait). Don’t retry in a tight loop — back off until the header’s deadline.

When credit runs out

Our API returns 402 Payment Required:
Chat and completions answer a little differently — that path checks the request’s worst-case cost against your balance before generating, so the code is insufficient_balance and the useful numbers arrive under error.provider_specific_fields. Errors has both shapes in full; render the fields rather than matching on the sentence. Once you add credit, subsequent requests succeed immediately — no key regeneration needed.

Adding a card

From the billing page:
  1. Click Add payment method.
  2. Enter card details (processed by Stripe; we never see the number).
  3. Top up by any amount between $5 and $500 — or €5 to €500 if your account bills in euros, which is a native range rather than a converted one.
The amount you enter is the credit you receive. Any sales tax or VAT is added on top of it, so a €100 top-up credits €100 of balance and charges your card €100 plus the VAT for your country. The exact total is shown before you confirm. Your balance is credited once the payment settles, which is usually seconds but is not instant — the dashboard shows the top-up as pending until then. You can also set an auto-recharge rule on the same page: pick a balance threshold and a top-up amount, and we charge the card on file when the balance falls below it, which makes a long-running job much less likely to stop at 402. With no rule set, nothing is charged automatically. It is not a guarantee, and it is worth knowing why. The rule is evaluated when something moves your balance rather than on a timer, so an account that is already below the threshold and has just come off a short cooldown waits for its next balance-moving event instead of being swept up. Attempts are bounded too: by default no more than three in any rolling 24 hours, with a short cooldown between them — or, if you set a monthly spending cap on the rule, by that cap instead. And the card still has to clear. If your balance reaches zero with a rule in place, one of those is why. The emails differ depending on which you are on. With no auto-recharge rule, we warn you once your balance drops under a fifth of what it was straight after the credit that started the current run — usually a top-up, but a promotional bonus or an adjustment we apply counts too — so a run starting at $50 warns below $10. We write again when the balance reaches zero. With auto-recharge on, we send only the second one, because a balance that reaches zero with a rule in place means a recharge did not go through — usually a declined card or a cap being hit. Accounts in the EU region are charged and invoiced in euros rather than dollars; see Regions.