Why free-tier limits bite
A free tier has to protect the provider from abuse, so it comes with tight caps on requests per minute, requests per day, or tokens. The exact numbers for Gemini live in Google's documentation and may change, so look them up there rather than copying a figure from a forum thread. The pattern is the same everywhere: a prototype fits inside the cap, then a loop, a second user or a batch job pushes past it and you get errors.
The painful part is that the cap is not yours to control. You cannot buy your way past it by wanting to. You wait for the window to reset, or you move to a paid plan on the same provider, or you change provider. This article covers the third path for text workloads: an independent API with published limits and prepaid credit, where reaching a limit means slowing down briefly, not hitting a wall for the day.
The limits on this API
| Full key | Trial key | |
|---|---|---|
| Concurrent requests | 8 | 2 |
| Requests per minute | 300 | 60 |
| Max body | 8 MB | 8 MB |
| Context window | 100,000 tokens | 100,000 tokens |
Responses include the headers X-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests and X-RateLimit-Limit-Concurrency. The first helps when you contact support, the second shows your remaining credit on every call, and the last two tell your client what ceiling it is working under.
There is no daily cap in the limits above. The ceilings are per minute and per moment, and credit never expires, so a quiet day does not waste anything.
Two kinds of 429
When you go over a limit, the API returns HTTP 429. The error code tells you which limit.
rate_limited: too many requests in the minute. Wait for the window to move, or spread requests more evenly.concurrency: too many requests at once. Finish some before starting others.
There is also a third case. On temporary overload the API returns 429 with a Retry-After: 5 header. Treat that one as an instruction: wait five seconds and try again. Do not hammer the endpoint, since immediate retries only keep the queue full.
A subtle point on streaming: a streamed request occupies its concurrency slot until the stream ends. If a user opens a chat and walks away from a stream you never close, that slot stays taken. Cancel abandoned streams on the client side, and always read a stream to completion or close the connection.
Retry code that behaves
The Python below caps concurrency with a semaphore, so you never trigger concurrency errors in the first place, and retries on 429 using Retry-After when present, otherwise exponential backoff. Set MAX_PARALLEL to 8 for a full key or 2 for the trial.
import asyncio
import random
from openai import AsyncOpenAI, RateLimitError
client = AsyncOpenAI(base_url="https://api.uncensoredgemini.cc/v1", api_key="YOUR_KEY", max_retries=0)
MAX_PARALLEL = 8
sem = asyncio.Semaphore(MAX_PARALLEL)
async def ask(prompt: str) -> str:
delay = 1.0
for attempt in range(6):
async with sem:
try:
r = await client.chat.completions.create(
model="uncensored",
messages=[{"role": "user", "content": prompt}],
)
return r.choices[0].message.content
except RateLimitError as e:
retry_after = e.response.headers.get("Retry-After")
wait = float(retry_after) if retry_after else delay
await asyncio.sleep(wait + random.random())
delay = min(delay * 2, 30)
raise RuntimeError("still rate limited after 6 attempts")
async def main():
prompts = [f"Write a one-line tagline, variant {i}." for i in range(40)]
results = await asyncio.gather(*(ask(p) for p in prompts))
print(len(results), "done")
asyncio.run(main())
The sleep happens outside the semaphore on purpose. A waiting request should not hold a slot while it waits. Setting max_retries=0 on the client keeps retry logic in one place, so you can see what happens.
The same idea in Node
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.uncensoredgemini.cc/v1", apiKey: process.env.API_KEY, maxRetries: 0 });
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
async function ask(prompt) {
let delay = 1000;
for (let i = 0; i < 6; i++) {
try {
const r = await client.chat.completions.create({
model: "uncensored",
messages: [{ role: "user", content: prompt }],
});
return r.choices[0].message.content;
} catch (e) {
if (e.status === 429) {
const ra = Number(e.headers?.["retry-after"]);
await sleep((ra ? ra * 1000 : delay) + Math.random() * 500);
delay = Math.min(delay * 2, 30000);
continue;
}
throw e;
}
}
throw new Error("still rate limited");
}How much throughput you really get
The 300 requests per minute ceiling is rarely the one you hit first. Concurrency usually is. Suppose a typical reply takes 10 seconds to generate (an assumption for the sake of the math; your prompts will differ). With 8 requests in flight, you finish 8 every 10 seconds, which is 48 per minute. To reach 300 per minute at that speed you would need about 50 in flight, which the limit does not allow. With replies that take 2 seconds, 8 slots give you 240 per minute, close to the cap.
So for batch work, shorter outputs raise your effective throughput more than any retry tweak does. Set max_tokens when you only need a short answer, and use stop sequences to end a reply early. For the trial key the same logic applies with 2 slots: at 10 seconds per reply, that is 12 per minute, well under the 60 cap.
Habits that keep you under the limits
Retry code is a safety net. The better fix is to send fewer wasted requests in the first place.
- Queue on your side. Put jobs in a queue and let a fixed number of workers pull from it. The worker count is your concurrency, and you choose it below the limit.
- Do not retry on a 4xx you caused. A malformed body or an oversized request will fail every time. Only retry 429 and network errors.
- Add jitter. If ten workers all wait exactly five seconds, they all return at once and collide again. A random extra half second spreads them out.
- Cache repeated prompts. If your app sends the same classification prompt many times, store the answer. With a fixed
seedand low temperature, repeats are cheap to detect and skip. - Watch the balance header.
X-Balance-USDarrives with every response. Alert when it drops below a threshold, so a drained balance does not look like a mysterious outage. - Trim history. Long prompts take longer to process, and slow replies hold concurrency slots longer. Summarise old turns instead of resending them.
For a chat product with many users, count how many people can be mid-reply at the same moment. With 8 slots and replies that take about 10 seconds, you can serve 48 replies a minute before queueing begins. Past that, show a short typing indicator while the queue drains, rather than failing the request.
What prepaid changes
On a prepaid account you decide how much capacity you fund. Pricing is $0.15 per 1M input tokens and $0.50 per 1M output tokens, with no subscription. A batch of 10,000 requests at 1,000 input and 300 output tokens each uses 10M input tokens ($1.50) and 3M output tokens ($1.50), so $3.00 in total. That batch, at 48 requests per minute from the earlier example, takes about 208 minutes, and the time is set by your concurrency, not by a daily quota.
New users can claim $0.50 of trial credit on the API key page, valid 7 days, one per person. Top-ups run from $20 to $500 in whole amounts, with +5% from $50, +10% from $100 and +15% from $200, and are paid in crypto (USDT on TRC20 or USDC on Base). See pricing and the docs.
One honest limit: this service is text only and runs a single open-weight model. If you rely on Gemini features beyond text, keep using Gemini for those calls and send the text traffic here.
