Running a Coding Agent on a Free API Tier: What Breaks

Quick answer: A free API tier that works fine for single completions can fail every request inside an agent harness, because harnesses declare a large max_tokens and call in loops. On Groq's free tier the 8,000 TPM budget is charged against the max_tokens you declare, not what the model returns, so the maxTokens: 8192 that ships in most harness configs is over budget before your prompt is counted. The three providers we measured meter three different things, so the same config is safe on one and fatal on another.
Measured 2026-09-01 against the live APIs from a US runner, plus each provider's own rate-limit documentation. Every number below is reproducible with one curl; the sweep script and raw output are in our benchmark repo.

Free AI APIs are usually tested the way they are advertised: one prompt, one completion, look at the tokens per second. An agent harness does something different. It sends many small calls in a loop, each carrying tool schemas, each declaring a generous output ceiling it will almost never use. Limits that never bind on a single call bind immediately on the second pattern.

Here is what actually broke when we pointed harnesses at free tiers, with the numbers.

1. The budget can be charged on what you declare, not what you use

This is the one that fails 100% of requests rather than some of them, which makes it the hardest to diagnose — nothing intermittent, nothing to correlate.

Groq's free tier publishes 8,000 tokens per minute. That budget is charged against the max_tokens in your request, before generation:

# 20-token prompt, generous ceiling -> rejected before a token exists
max_tokens: 8192  ->  413  "Limit 8000, Requested 8271"

# 4,078-token prompt, small ceiling -> fine
max_tokens: 16    ->  200 OK

The larger prompt succeeds and the tiny one fails. The variable is the ceiling you asked for. Every harness default we checked declares 8192, so on this tier every single call is rejected.

2. The rejection can arrive labelled as something else

OpenClaw surfaces that 413 as "Context overflow". That sends you looking for an oversized system prompt, and the obvious remedy — trimming context — changes nothing, because the prompt was never the problem. We lost an afternoon to this before reading the raw response body.

If a harness reports a context error on a request you know is small, read the upstream status code before you touch your prompt.

3. It is a shared rolling window, not a per-model constant

The first spot check made one model look exempt. It was not — it had simply landed in a minute with headroom left. The same request 413s a minute later:

"Rate limit reached ... Limit 8000, Used 4373, Requested 6278"

Never conclude a model is exempt from a single passing probe. One agent run can starve the next one, and two harnesses on the same key starve each other.

4. Half the advertised model list cannot take a chat request

We swept all 14 models Groq's /models endpoint advertises on the free tier:

ResultCountWhich
Answered a minimal chat request9 / 14gpt-oss-120b, gpt-oss-20b, gpt-oss-safeguard-20b, qwen3.6-27b, qwen3.8-27b, compound-mini, allam-2-7b, 2 guard models
Failed outright5 / 14whisper-large-v3 and -turbo, orpheus-v1-english, orpheus-arabic-saudi (400); groq/compound (429)
Answered, then 413 at max_tokens: 81924 of the 9gpt-oss-120b (8271), qwen3.8-27b (8212), qwen3.6-27b (8210), gpt-oss-safeguard-20b (8271)

The list mixes speech-to-text, text-to-speech and guard models in with chat models and carries no modality field. A harness that enumerates /models and picks one automatically will eventually pick a Whisper model and hand you a 400.

Two of the nine also cap the ceiling far below the tier limit: the guard models reject anything above max_tokens: 512, and allam-2-7b above 4096.

5. A routed model reports errors under a different name

groq/compound is a router in front of gpt-oss-120b. Its 429 names openai/gpt-oss-120b rather than itself — the only place that routing is visible from the outside.

If your harness branches on the model name in an error to decide what to retry or fall back to, that branch will not match.

6. In a loop, first-token latency matters more than throughput

Throughput decides how fast one long answer streams. An agent turn is short, so what accumulates is the wait before the first token, multiplied by the number of turns.

The same model served by two providers, same prompt, same runner:

Serving nemotron-3-super-120bTime to first tokenGeneration× 20 turns, waiting only
OpenRouter (free)2.7 s45.7 tok/s54 s
NVIDIA (own API)7.6 s36.7 tok/s2 min 32 s

Identical weights, and a 20-turn task spends an extra minute and a half doing nothing. No tokens-per-second table shows this.

Groq's first-token times on the free tier, for comparison: qwen3.6-27b 0.37 s, gpt-oss-20b 0.67 s, gpt-oss-120b 0.68 s, qwen3.8-27b 0.85 s, compound-mini 1.25 s.

The same config is safe on one provider and fatal on another

This is the part worth internalising, because it means there is no portable "free tier" harness config:

ProviderWhat the minute budget countsFree limitIs maxTokens: 8192 safe?
GroqThe max_tokens you declare8,000 TPMNo — every request 413s
Alibaba Model StudioActual input + output tokens5,000,000 TPM (qwen3.5-plus, qwen-turbo)Yes, with room to spare
OpenRouterNothing per minute — it meters requests20 RPM; 50 RPD, or 1,000 RPD after $10 lifetime spendYes; free models allow 32,768 completion tokens and up

Alibaba's documentation states its TPM "includes input and output tokens" — actual usage. OpenRouter does not impose a per-minute token budget at all. Groq's accounting is the outlier, and its limit is also the lowest by a wide margin: Alibaba's is 625× larger.

Values that work

For Groq's free tier inside a harness, declare a ceiling the tier can actually accept and let the harness trim rather than take a 413:

{ "id": "openai/gpt-oss-120b", "contextWindow": 6000, "maxTokens": 1500 }

The numbers look small deliberately. With tool schemas in the prompt, a larger declared ceiling is what pushes the request over the budget.

A one-minute check before you wire anything up

Send the same trivial prompt twice, once with a small max_tokens and once with the ceiling your harness declares. If the small one returns 200 and the large one returns 413, the budget is charged on the declared value, and you need to lower the ceiling rather than shorten your prompt.

curl -s -o /dev/null -w "%{http_code}\n" https://api.groq.com/openai/v1/chat/completions \
  -H "Authorization: Bearer $GROQ_API_KEY" -H "Content-Type: application/json" \
  -d '{"model":"openai/gpt-oss-120b","max_tokens":8192,"messages":[{"role":"user","content":"hi"}]}'

Two seconds, and it answers a question no pricing page does. For the wider picture of which free tiers still exist at all, see our free AI API speed test and the Groq free tier writeup.