Free AI APIs in 2026: limits, setup examples, and token budgets
Choose a free AI API by account limits
For a prototype, start with Groq for an OpenAI-compatible text API, Gemini Developer API for a supported text or multimodal model, or OpenRouter to compare explicitly free model variants. None provides unlimited free inference. The useful choice depends on your request volume, token volume, and data requirements.
On November 6, 2026, we ran the OpenRouter text probe below and verified a $0 charge. Groq, Gemini, and Together AI entries come from official documentation. Check your project and exact model before running any example.
| Provider | What is free? | Billing requirement | Development and production boundary |
|---|---|---|---|
| Groq | Free Plan access within model and organization limits | Stay on Free. Upgrading to Developer requires a payment method and enables usage billing | Useful for integration evaluation. Confirm capacity and production requirements before relying on it |
| Gemini Developer API | Free input and output for selected models and features | Confirm the project is on Free Tier. Linking billing and completing paid setup enables paid usage | Check regional eligibility, model quotas, and data terms. Some features have no free tier |
| OpenRouter | Explicitly free model variants within the applicable account limits | No credit purchase for basic free access. Purchase history can increase the daily ceiling | Suitable for model evaluation. A zero-priced catalog entry does not guarantee capacity |
| Together AI | No current free trial | Prepaid balance above $0. First organization credit purchase at least $15, later purchases at least $5 | Optional auto-recharge buys credits when the balance crosses its threshold |
The table follows Groq billing, Gemini billing and pricing, OpenRouter limits, and Together credits.
Separate free quotas from credits and chat subscriptions
A recurring API allowance resets under the provider's rules. A promotional credit is a finite balance with eligibility and expiry conditions. A consumer chat subscription covers the advertised chat product. Do not count it as an API budget unless its terms explicitly include API calls.
Older tutorials may describe Google's $300 Cloud credit as free Gemini API access. The current Gemini billing guide excludes new Welcome credits for accounts opened after March 2, 2026. The Cloud Free Program documentation also excludes Gemini API in AI Studio. Use those specific rules rather than the general $300 marketing offer. An eligible historical credit, while valid, still was not a recurring free tier.
Gemini's pricing page marks free-tier content as potentially used to improve Google products, subject to its terms. Resolve that condition before sending confidential material. A free allowance also does not establish an uptime commitment.
Discover model IDs before sending a request
Use Bash or Zsh with curl 7.76 or later and jq. Supply keys through local environment variables or your server's secret manager. Keep them out of public browser code, screenshots, shell tracing, and logs. The examples do not print keys. Set pipefail so a failed command in a pipeline produces a failure status.
OpenRouter — run a verified $0 text call
- Open the free model collection. Pick an exact catalog ID ending in
:free. Check the model's text input, output, and any per-request price in the catalog and check the listed provider endpoint. SetOPENROUTER_MODELto that ID. - Use a workspace with default plugins and BYOK disabled for this test. The request uses plain text, a 64-token output cap, zero endpoint price caps, and a single model with provider fallback disabled. Priced add-ons and upstream BYOK charges follow their own billing rules. Check provider routing and pricing before enabling them.
- Before calling, check the free quota of the account that owns your key. The published caps are 20 requests per minute and 50 per UTC day for standard free access, or 1,000 per day at the published $10 lifetime credit purchase threshold. The guide describes a rounding allowance. Use the counter below for your actual tier. A negative balance can block free calls. Paid models and enabled auto top-up can spend money. See OpenRouter limits and the current key API.
curl -q --fail-with-body --silent --show-error --max-time 30 \
'https://openrouter.ai/api/v1/key' \
-H @<(printf 'Authorization: Bearer %s\n' "${OPENROUTER_API_KEY:?Set OPENROUTER_API_KEY}") |
jq -e '.data | objects | {free_model_daily_requests, key_spend_remaining: .limit_remaining}'
free_model_daily_requests shows the daily used, limit, and remaining counts where applicable. The account's daily quota resets at 00:00 UTC. The separate key_spend_remaining is a key spending cap, with null indicating no key cap. Check your balance on the Credits page.
The script validates the model suffix before posting. It saves headers and JSON locally for diagnosis and makes a single attempt.
(
umask 077
: "${OPENROUTER_API_KEY:?Set OPENROUTER_API_KEY}"
case "${OPENROUTER_MODEL:?Set OPENROUTER_MODEL}" in
*:free) ;;
*) printf '%s\n' 'Choose an exact :free model ID.' >&2; exit 1 ;;
esac
probe_dir=$(mktemp -d) || exit 1
printf 'Probe files: %s\n' "$probe_dir"
request=$(jq -cn --arg model "$OPENROUTER_MODEL" '{
model:$model, messages:[{role:"user",content:"Reply with OK."}],
max_tokens:64, stream:false,
provider:{allow_fallbacks:false,max_price:{prompt:0,completion:0,request:0}}
}') || exit 1
curl -q --proto '=https' --retry 0 --silent --show-error --max-time 30 \
--fail-with-body 'https://openrouter.ai/api/v1/chat/completions' \
-H @<(printf 'Authorization: Bearer %s\n' "$OPENROUTER_API_KEY") \
-H 'Content-Type: application/json' --data-binary "$request" \
--dump-header "$probe_dir/headers.txt" --output "$probe_dir/body.json" \
--write-out 'HTTP %{http_code}\n'
)
Set probe_dir to the path printed after Probe files: and inspect the response.
jq '{id, model, provider, error, text: .choices[0].message.content,
finish_reason: .choices[0].finish_reason, usage}' "$probe_dir/body.json"
Our November 6 test of liquid/lfm-2.5-2.6b:free on Liquid returned HTTP 200, OK, and finish reason stop. It used 14 prompt tokens and 56 completion tokens. The response reported numeric usage.cost: 0. The same request's generation record, fetched by response ID, independently reported data.total_cost: 0.
For your own run, check the returned model and provider, visible text, finish reason, and any embedded error, even with HTTP 200. An absent usage.cost leaves the charge unverified. Check the generation record if you need to confirm the charge. See usage accounting. This test covered one text request.
Groq
List the IDs available to your key, then compare a text model against the Free Plan table and your account's Limits page. The models guide documents discovery. As an example, the public Free Plan table lists qwen/qwen3.8-27b at 30 requests per minute, 1,000 per day, 8,000 tokens per minute, and 200,000 per day. Check your organization limits and project limits before using these figures. A project can impose a lower limit. Adding a payment method and upgrading to Developer enables usage billing.
set -o pipefail
curl -q --fail-with-body --silent --show-error --max-time 30 \
'https://api.groq.com/openai/v1/models' \
-H @<(printf 'Authorization: Bearer %s\n' "${GROQ_API_KEY:?Set GROQ_API_KEY}") |
jq -r '.data[].id'
Set GROQ_MODEL to the chosen ID. This small request uses the documented chat endpoint. Groq's OpenAI compatibility guide also identifies unsupported parameters.
request=$(jq -cn --arg model "${GROQ_MODEL:?Set GROQ_MODEL}" \
'{model:$model,messages:[{role:"user",content:"Reply with OK."}],max_completion_tokens:64}') &&
curl -q --fail-with-body --silent --show-error --max-time 30 \
'https://api.groq.com/openai/v1/chat/completions' \
-H @<(printf 'Authorization: Bearer %s\n' "${GROQ_API_KEY:?Set GROQ_API_KEY}") \
-H 'Content-Type: application/json' --data-binary "$request"
Gemini Developer API
Use the models API to find resource names supporting generateContent. Follow nextPageToken if present. Confirm that the key belongs to a Free Tier project in AI Studio Projects, then check its active limits. For example, the Gemini 3.5 Flash-Lite pricing row lists free standard text input and output for eligible projects. Model and feature eligibility vary. Paid setup may require prepaid credits with optional auto-reload, or use postpay depending on the account. Review the billing guide before linking billing or enabling reloads.
model_page_args=()
if [ -n "${GEMINI_PAGE_TOKEN:-}" ]; then
model_page_args=(--data-urlencode "pageToken=$GEMINI_PAGE_TOKEN")
fi
curl -q --get --fail-with-body --silent --show-error --max-time 30 \
'https://generativelanguage.googleapis.com/v1beta/models' \
--data-urlencode 'pageSize=1000' "${model_page_args[@]}" \
-H @<(printf 'x-goog-api-key: %s\n' "${GEMINI_API_KEY:?Set GEMINI_API_KEY}") |
jq '{models:[.models[] |
select((.supportedGenerationMethods // []) | index("generateContent")) | .name],
nextPageToken}'
The output preserves nextPageToken. For the first page, leave GEMINI_PAGE_TOKEN unset. If a token is returned, set GEMINI_PAGE_TOKEN to that value and rerun this block once for the next page. --data-urlencode encodes the pageToken parameter. Stop when no token remains, and unset the variable before starting a new listing.
Set GEMINI_MODEL to the full returned name, including models/. This uses API-key authentication and the native generateContent endpoint.
curl -q --fail-with-body --silent --show-error --max-time 30 \
"https://generativelanguage.googleapis.com/v1beta/${GEMINI_MODEL:?Set GEMINI_MODEL}:generateContent" \
-H @<(printf 'x-goog-api-key: %s\n' "${GEMINI_API_KEY:?Set GEMINI_API_KEY}") \
-H 'Content-Type: application/json' \
--data-binary '{"contents":[{"parts":[{"text":"Reply with OK."}]}],"generationConfig":{"maxOutputTokens":64}}'
The 64-token cap limits these examples. Reasoning models may consume their output budget before returning visible text. Inspect finish reasons and usage before changing the cap. With Gemini, inspect candidates[0].content.parts, finishReason, and usageMetadata. For Groq, inspect choices[0].message.content, finish_reason, and usage.
Calculate whether the free allowance fits
Use your expected workload, not a provider's largest advertised context window. This worksheet is a hypothetical text application, not measured traffic or a provider quota.
| Assumption or calculation | Result |
|---|---|
| 60 daily users × 5 actions × 2 model calls | 600 requests per day |
| 800 input tokens and 200 output tokens per call | 480,000 input and 120,000 output tokens per day |
| Reserve 20% for retries and repeated actions | 720 requests, 576,000 input, and 144,000 output tokens per day |
| Peak 30 calls per minute before the reserve | 24,000 input and 6,000 output tokens per minute |
| Assume 4 seconds per call at that steady rate | About 2 requests in flight on average |
Count the complete prompt, retrieved passages, tool schemas, and conversation history. Each step of an agent loop is another request. Use the provider's token counter where available, then replace estimates with returned usage.
Compare every applicable ceiling. Groq limits can cover requests and tokens per minute and day, at organization level. Its headers distinguish daily request counts from per-minute token counts. Gemini commonly counts input TPM, RPM, and RPD per project, with additional model-specific limits. Its daily request reset uses Pacific time. OpenRouter free access can be constrained by request counts even for short prompts.
This worksheet exceeds OpenRouter's advertised basic 50 daily requests and 20 requests per minute. A higher daily allowance still does not solve the minute limit. For the Groq example, the estimated 30,000 combined tokens per minute exceed 8,000 TPM, and 600,000 per day exceed 200,000 TPD, before the reserve. Reduce calls, shorten prompts, queue work, or choose another verified allowance.
Concurrency is a separate operational control. An average of two in-flight requests does not permit thirty simultaneous calls. Queue bursts, reserve headroom, and stop when any counter is exhausted. Shared projects and organizations must include other applications' usage.
For a paid contingency calculation, use monthly cost = input tokens / 1,000,000 × input price + output tokens / 1,000,000 × output price. Add separately priced tools, media, and hosting. Calculating that cost is not permission to enable billing.
Diagnose HTTP 429 without switching to paid inference
Capture the status, headers, and error body for one attempt. For the OpenRouter probe, use the saved files. For other curl examples, save headers with --dump-header and the response with --output. Keep these files local.
awk 'tolower($0) ~ /^(http\/|retry-after:|x-ratelimit-|x-request-id:|request-id:)/' \
"$probe_dir/headers.txt"
jq '.error' "$probe_dir/body.json"
| What you find | How to identify the limit | What to do |
|---|---|---|
| Minute request or token limit | Check the active model limits and current traffic from all apps sharing the account or project. Groq's x-ratelimit-*-requests headers refer to requests per day and x-ratelimit-*-tokens to tokens per minute. Gemini can report RESOURCE_EXHAUSTED with quota details |
Slow the queue and trim prompts if the token limit is binding. Honor Retry-After when present |
| Daily allowance exhausted | Compare the OpenRouter key's daily counter or Gemini's project usage against the applicable daily cap. Check Groq's daily request headers and dashboard | Pause until the provider's reset. OpenRouter resets at midnight UTC and Gemini's daily request quota resets at midnight Pacific time |
| Upstream model capacity | OpenRouter platform rate limits return X-RateLimit-* headers, including a reset hint. An upstream error may include error.metadata.provider_code. A remaining daily balance alone cannot distinguish upstream capacity from a minute limit |
Use a bounded retry for a transient failure. If needed, explicitly select another reviewed :free ID and run the same price checks |
| Paid spend rate, cap, or depleted credits | Gemini paid projects can return 429 for a 10-minute spend rate or a spend cap. Gemini Prepay can return 402 after credits run out. Groq reports a spend block as HTTP 400 with blocked_api_access |
Wait for a documented spend-rate reset when applicable. Stop on depleted credit or a hard cap and review billing before spending more |
References for the response fields and limits include Groq rate limits and spend limits, Gemini rate limits and billing, and OpenRouter error metadata.
For a temporary failure, allow at most two retries within a total deadline as an application policy. Retry-After can be a delay in seconds or an HTTP date. Without a server hint, use exponential backoff with jitter. If the wait exceeds your deadline, queue or return a temporary failure. Include SDK retries in the same attempt budget. For an unexplained 429, inspect the quota dashboard before increasing the retry count.
For 402, check credits and billing details. OpenRouter's openrouter_in_flight_budget with Retry-After is a documented temporary exception. For 403, resolve the named permission, policy, or budget restriction. For 404, recheck the base URL, API version, model ID, and method. For other 400 or 401 responses, fix parameters or credentials first.
Keep a list of reviewed free model IDs for fallback. If they lack capacity, queue the work or return a clear failure. Leave paid model selection, tier changes, and auto-recharge behind an explicit billing decision.
Log provider, model ID, status, token usage, retry count, and request ID when available. Redact keys and omit sensitive prompts and responses. Test the structured output, tools, and failure behavior your application needs before depending on the integration.