Menu

Free AI APIs in 2026: limits, setup examples, and token budgets

Free AI APIs in 2026: limits, setup examples, and token budgets

Updated • BestFreeAI
LLM API OpenRouter Groq Gemini Together AI free AI tools AI development

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.

We checked official sources on October 23, 2026. We checked OpenRouter's public model catalog and the example syntax, but did not run authenticated inference, performance, or uptime tests. The requests below are instructions for you to execute after checking your account.

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 A Free Tier project does not require a paid upgrade. Linking billing changes the tier and payment conditions 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 First organization credit purchase at least $15, later purchases at least $5 Paid service. Disable auto-recharge unless you intentionally budget for it

The table follows Groq billing, Gemini billing and pricing, OpenRouter limits, and Together credits. Together's current guide distinguishes first and subsequent purchases. An older $5 minimum does not establish a free trial.

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 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.

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. Listing a model does not establish its free allowance.

set -o pipefail
curl --fail-with-body --silent --show-error --max-time 30 \
    'https://api.groq.com/openai/v1/models' \
    -H "Authorization: Bearer ${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.

jq -n --arg model "${GROQ_MODEL:?Set GROQ_MODEL}" \
    '{model:$model,messages:[{role:"user",content:"Reply with OK."}],max_completion_tokens:64}' |
    curl --fail-with-body --silent --show-error --max-time 30 \
    'https://api.groq.com/openai/v1/chat/completions' \
    -H "Authorization: Bearer ${GROQ_API_KEY:?Set GROQ_API_KEY}" \
    -H 'Content-Type: application/json' --data-binary @-

OpenRouter

The public models endpoint includes IDs, prices, and supported parameters. This filter finds :free variants with zero text input and output prices. Review the full pricing object and feature costs before using one.

curl --fail-with-body --silent --show-error --max-time 30 \
    'https://openrouter.ai/api/v1/models' |
    jq -r '.data[] | select(.id | endswith(":free")) |
    select((.pricing.prompt | tonumber) == 0 and
    (.pricing.completion | tonumber) == 0) | .id'

Set OPENROUTER_MODEL to one reviewed :free ID. This example uses the chat API, without paid plugins or a list of fallback models.

jq -n --arg model "${OPENROUTER_MODEL:?Set OPENROUTER_MODEL}" \
    '{model:$model,messages:[{role:"user",content:"Reply with OK."}],max_tokens:64}' |
    curl --fail-with-body --silent --show-error --max-time 30 \
    'https://openrouter.ai/api/v1/chat/completions' \
    -H "Authorization: Bearer ${OPENROUTER_API_KEY:?Set OPENROUTER_API_KEY}" \
    -H 'Content-Type: application/json' --data-binary @-

The OpenRouter pricing FAQ currently advertises 20 requests per minute and 50 per day for free models, rising to 1,000 per day after at least $10 in credit purchases. This is a purchase condition for the higher allowance. A negative balance can also block free calls. Check your account rather than automatically buying credits.

Before a longer run, inspect authenticated GET https://openrouter.ai/api/v1/key. Check free_model_daily_requests where applicable, remaining credits, and any effective budget. More keys do not bypass account limits.

Gemini Developer API

Use the models API to find resource names supporting generateContent. Follow nextPageToken if present. Cross-check the exact model and feature against the free-tier pricing table and your project's active limits.

model_page_args=()
if [ -n "${GEMINI_PAGE_TOKEN:-}" ]; then
    model_page_args=(--data-urlencode "pageToken=$GEMINI_PAGE_TOKEN")
fi
curl --get --fail-with-body --silent --show-error --max-time 30 \
    'https://generativelanguage.googleapis.com/v1beta/models' \
    --data-urlencode 'pageSize=1000' "${model_page_args[@]}" \
    -H "x-goog-api-key: ${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 --fail-with-body --silent --show-error --max-time 30 \
    "https://generativelanguage.googleapis.com/v1beta/${GEMINI_MODEL:?Set GEMINI_MODEL}:generateContent" \
    -H "x-goog-api-key: ${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. A returned model name or HTTP 200 alone does not prove a usable result.

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. Reduce calls, 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.

Handle quota failures without creating a bill

Inspect the response body and quota dashboard before changing a limit. HTTP codes alone do not identify the enforcing layer.

Response What to check Action
429 Minute limit, daily allowance, provider capacity, or a paid spend-rate limit Retry a temporary limit after the indicated delay. Stop until reset for an exhausted daily quota
402 Balance, key cap, or provider-specific billing metadata Stop for depleted credit. OpenRouter's openrouter_in_flight_budget is a documented temporary exception when Retry-After is present
403 Permissions, regional eligibility, policy, or an organization budget Fix the named restriction. Repeated requests do not repair authorization or budget blocks
404 Base URL, API version, exact model ID, and supported method Refresh discovery and correct the request. Do not silently substitute a paid model
400 or 401 Request parameters or key validity Correct the request or credential configuration before retrying

Follow the provider's Groq error reference, Gemini troubleshooting, and OpenRouter error metadata.

For temporary failures, set a total deadline and at most two retries as an application policy. Respect Retry-After when supplied. Without it, use exponential backoff with jitter. If the requested wait exceeds your deadline, stop or queue the job instead of retrying early. Check SDK defaults so SDK retries and your own loop do not multiply attempts.

Keep a fallback allowlist of reviewed free model IDs and compatible features. If none has capacity, return a clear temporary failure or queue the task. Never replace :free with its paid sibling, activate auto-recharge, or upgrade an account automatically.

Record provider, model ID, status, token usage, retry count, and a provider request ID when returned. Redact authorization headers and omit sensitive prompts and responses. Before production, separately test required structured output, tool calls, cancellation, and failure behavior. This guide's documentation checks do not establish those results.

Related Posts

Free OpenRouter models for Kilo Code: selection and tool checks

Free OpenRouter models for Kilo Code: selection and tool checks

Find free Kilo Code models with a reproducible OpenRouter catalog check, verify tool calls, and distinguish quota, model ID, routing, and billing failures.

Read more : Free OpenRouter models for Kilo Code: selection and tool checks
Is Cursor free for students in 2026? Current access and promotion checks

Is Cursor free for students in 2026? Current access and promotion checks

Cursor currently offers general free access and event-based student promotions. The official student page no longer promises every student a free year of Pro.

Read more : Is Cursor free for students in 2026? Current access and promotion checks
n8n vs Dify: choose by workflow ownership and AI application needs

n8n vs Dify: choose by workflow ownership and AI application needs

Compare n8n and Dify by integration work, knowledge retrieval, deployment, licensing, and a repeatable evaluation.

Read more : n8n vs Dify: choose by workflow ownership and AI application needs