API Key Limits: Rate, Concurrency, Context and Spend
Four api key limits shape what your code can do: how many requests you send per minute, how many run at once, how much text fits in one call, and how much credit is behind the key. This page gives the exact numbers for our API and shows how to stay under them.
Last updated

Summary
- Full key: 8 concurrent requests and 300 per minute. Trial key: 2 and 60.
- Context is 100,000 tokens, prompt and completion together.
- Streams hold a concurrency slot until they end, so long generations hit that limit first.
- Spend is bounded by prepaid credit, and X-Balance-USD shows what is left.
The limits at a glance
| Limit | Full key | Trial key |
|---|---|---|
| Requests per minute | 300 | 60 |
| Concurrent requests | 8 | 2 |
| Context window | 100,000 tokens | 100,000 tokens |
| Request body | 8 MB | 8 MB |
| Spend | Prepaid credit | $0.50 trial credit |
A trial key comes from the free $0.50 claim on the API key page. A full key is what you have once you have topped up. The rest of this page explains each row and what to do when you reach it.
Requests per minute
300 requests per minute works out to an average of five per second. The trial's 60 per minute is one per second. Go over and the API answers with HTTP 429 and the error code rate_limited.
The limit counts requests, not tokens, so a tiny request and a huge one cost the same slot. That makes batching small prompts into fewer, larger calls a real option when you are near the ceiling. Two short classification items can often share one request if you ask for a JSON array back.
Spreading calls evenly helps more than any retry logic. A loop that fires 60 requests in the first second of a minute and then waits is more likely to be refused than one that sends one per second.
Concurrency: the limit most people hit first
Concurrency counts requests in flight. The full key allows 8, the trial key 2. A streamed request keeps its slot until the last event arrives, not until the first token appears. Over the limit you get 429 with the error code concurrency.
The arithmetic shows why this limit binds before the per-minute one. Throughput is slots divided by request duration:
- 8 slots, 20-second generations: 8 / 20 = 0.4 requests per second, or 24 per minute. Far below 300.
- 8 slots, 2-second generations: 8 / 2 = 4 per second, or 240 per minute. Close to the rate limit.
- 2 trial slots, 20-second generations: 2 / 20 = 0.1 per second, or 6 per minute.
So long outputs are limited by concurrency, short ones by rate. If you run many jobs, cap them on the client side instead of letting the server refuse them:
import asyncio
from openai import AsyncOpenAI
client = AsyncOpenAI(base_url="https://api.kimikeyapi.com/v1", api_key="YOUR_KEY")
slots = asyncio.Semaphore(8) # use 2 for a trial key
async def ask(prompt):
async with slots:
r = await client.chat.completions.create(
model="uncensored",
messages=[{"role": "user", "content": prompt}],
)
return r.choices[0].message.content
async def main():
prompts = [f"Write one sentence about topic {i}." for i in range(40)]
results = await asyncio.gather(*(ask(p) for p in prompts))
print(len(results))
asyncio.run(main())
If a browser tab or a forgotten script is also using the key, those requests share the same slots. A stuck stream that never closes is a common cause of unexplained concurrency errors.
Context: 100,000 tokens, prompt plus completion
The window is 100,000 tokens and it covers both directions. A prompt of 95,000 tokens leaves room for a 5,000-token answer. The completion can use whatever is left, and max_tokens is optional, so you only set it when you want a hard ceiling on output length or cost.
As a rough rule, a token is about three quarters of an English word, so the window holds on the order of 75,000 words. Code, other languages and unusual formatting use more tokens per word. Treat any estimate as approximate and read the real count from the usage field of a response.
Two related limits sit next to it. The request body may be at most 8 MB, which matters if you embed large text blobs. And a long window is not free: a prompt that fills it costs 100,000 x $0.15 / 1M = $0.015 in input alone, every time you send it. Chats that resend a growing history pay that price repeatedly, so trim or summarise old turns.
To see where you stand before sending anything, count your prompt roughly with characters divided by three, then compare it with the budget you want. Many chat apps stay under 10,000 tokens per call by summarising older turns. That leaves the rest of the window free for long answers and keeps each request cheap and quick.
Spend: the cap is your balance
There is no monthly plan and no invoice. You hold prepaid credit, and each request deducts its cost at $0.15 per 1M input tokens and $0.50 per 1M output tokens. Failed or refused requests are not charged, and credit never expires.
Read the balance two ways: the X-Balance-USD header on every response, or the OpenAI-style endpoint GET /v1/dashboard/billing/credit_grants (also available as GET /v1/balance).
curl -i https://api.kimikeyapi.com/v1/chat/completions -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json" -d '{"model":"uncensored","max_tokens":5,"messages":[{"role":"user","content":"Hi"}]}' | grep -iE "x-balance-usd|x-ratelimit"
That prints the balance plus X-RateLimit-Limit-Requests and X-RateLimit-Limit-Concurrency, so a script can confirm which key type it is running with. To bound a runaway job, set max_tokens and keep a counter of tokens used from the usage field. Top-ups run from $20 to $500; see the pricing page for bonus tiers.
Sizing a batch job against the limits
You can estimate how long a job takes before you run it. The relation is simple: requests in flight equal the arrival rate times the time each request takes. Turned around, your maximum throughput is the number of slots divided by the average duration, capped by the per-minute limit.
Take a batch of 10,000 requests where each generation takes about 6 seconds:
- Full key: 8 / 6 = 1.33 requests per second, which is 4,800 per hour and under the 300 per minute ceiling (18,000 per hour). The batch finishes in 10,000 / 4,800 = 2.08 hours.
- Trial key: 2 / 6 = 0.33 requests per second, or 1,200 per hour. The same batch would take 8.3 hours, and it would also cost real money, so a trial is the wrong tool for it.
Two levers shorten the job. Lower the average duration by asking for shorter outputs and setting max_tokens, or put more work into each request. Adding workers beyond 8 does nothing; extra requests are refused with the concurrency error and waste time on retries. Measure your real duration on a sample of 50 requests first, since it depends on how long your outputs are.
Handling a 429 properly
Two kinds of 429 look similar and need different responses.
rate_limitedorconcurrency: your own traffic is the cause. Slow down or lower parallelism.- Temporary overload: the API returns 429 with a
Retry-After: 5header. Wait the stated time and retry.
import time
from openai import OpenAI, RateLimitError
client = OpenAI(base_url="https://api.kimikeyapi.com/v1", api_key="YOUR_KEY", max_retries=0)
def call(messages, tries=5):
for attempt in range(tries):
try:
return client.chat.completions.create(model="uncensored", messages=messages)
except RateLimitError as e:
wait = e.response.headers.get("retry-after")
time.sleep(float(wait) if wait else 2 ** attempt)
raise RuntimeError("still rate limited")
Respect the header when it is there and fall back to exponential backoff when it is not. Do not retry in a tight loop; that only keeps you over the limit. More examples are in the API documentation.
Managing keys and checking your tier
Limits are tied to the key type. If a script behaves differently on two machines, check which key each one uses. On the API key page you can regenerate the key at any time; the old key stops working immediately. Accounts that have topped up can hold up to 5 keys, give each a label and revoke any of them, so a leaked key is a one-click fix without contacting support.
If you are comparing providers by their key limits, the questions to ask are the same ones listed above: requests per minute, concurrency, context size, body size and how spend is capped. Our comparison with a Claude API key covers the cost side of that decision.
More guides
Frequently asked questions
What are the rate limits on a trial key?
A trial key allows 2 concurrent requests and 60 requests per minute. A full key allows 8 and 300.
Does the 100,000-token limit include the answer?
Yes. Prompt and completion share the window, so a long prompt leaves less room for the reply.
Why do I get 429 when I am under 300 requests per minute?
You may be over the concurrency limit. Streams hold their slot until they end, so a few long generations can fill all 8 slots.
How do I stop a key from spending too much?
Spend is bounded by your prepaid credit. Set max_tokens, track the usage field, and watch the X-Balance-USD header.
Can I replace a leaked key?
Yes. Regenerate it on the API key page and the old one stops working at once. You can also revoke individual keys if you hold several.
Get your API key
Sign up, copy the key, update your base URL. Simple as that.