惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

K
Kaspersky official blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
V
Visual Studio Blog
F
Full Disclosure
B
Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
L
Lohrmann on Cybersecurity
月光博客
月光博客
I
Intezer
博客园 - 三生石上(FineUI控件)
Hacker News - Newest:
Hacker News - Newest: "LLM"
D
Darknet – Hacking Tools, Hacker News & Cyber Security
博客园_首页
P
Proofpoint News Feed
C
Check Point Blog
N
News | PayPal Newsroom
H
Heimdal Security Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
G
GRAHAM CLULEY
WordPress大学
WordPress大学
C
CERT Recently Published Vulnerability Notes
Y
Y Combinator Blog
Recorded Future
Recorded Future
Application and Cybersecurity Blog
Application and Cybersecurity Blog
T
Tailwind CSS Blog
W
WeLiveSecurity
L
LINUX DO - 热门话题
Microsoft Azure Blog
Microsoft Azure Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Schneier on Security
Schneier on Security
爱范儿
爱范儿
Martin Fowler
Martin Fowler
U
Unit 42
T
Troy Hunt's Blog
S
Securelist
V
V2EX
V2EX - 技术
V2EX - 技术
MongoDB | Blog
MongoDB | Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
博客园 - 聂微东
人人都是产品经理
人人都是产品经理
M
MIT News - Artificial intelligence
T
Tor Project blog
Cisco Talos Blog
Cisco Talos Blog
罗磊的独立博客
小众软件
小众软件
阮一峰的网络日志
阮一峰的网络日志
Vercel News
Vercel News

OpenRouter Blog

Choosing the Optimal Image Input Detail Level in LLMs — OpenRouter Blog DeepSeek V4 Is Earning Agentic Token Share — OpenRouter Blog The Open Weight Models that Matter: June 2026 — OpenRouter Blog The OpenRouter MCP Server — OpenRouter Blog Introducing the Unified Image API — OpenRouter Blog The AI Governance Checklist That Maps to Your Stack — OpenRouter Blog Enforce AI Data Residency at the Routing Layer — OpenRouter Blog OpenRouter vs Portkey: Routing Network vs Control Plane — OpenRouter Blog OpenRouter vs LiteLLM: Managed vs Self-Hosted Gateway — OpenRouter Blog Connect OpenClaw to OpenRouter: One Key, Failover, Free Models — OpenRouter Blog Connect SillyTavern to OpenRouter: Setup, Models, Fixes — OpenRouter Blog A Robot is Sprinting Towards You: Do You Want it Running on Claude or Grok? Kilo Code + OpenRouter: Setup, Routing, and Free Models — OpenRouter Blog Codex CLI with OpenRouter: config.toml Setup and Models — OpenRouter Blog Claude Code with OpenRouter: Setup, Models, and Costs — OpenRouter Blog How to Use OpenRouter With Any Coding Agent or AI Tool — OpenRouter Blog Subagent: Let Your Model Delegate the Busywork — OpenRouter Blog How to Enforce Agentic AI Governance at the API Layer — OpenRouter Blog Keep Your Agent Running When Models Disappear — OpenRouter Blog Hermes Agent + OpenRouter: Setup, Model Choice & Routing Config — OpenRouter Blog Lowest-Cost LLM Inference: The Complete OpenRouter Guide — OpenRouter Blog How OpenRouter Model Routing Works: Providers, Fallbacks & Auto Router — OpenRouter Blog OpenRouter Failover: Provider Failover vs Model Fallbacks Explained — OpenRouter Blog Surpassing Frontier Performance with Fusion — OpenRouter Blog Dinner is Served — OpenRouter Blog LLM Gateway: What It Is and How to Choose One — OpenRouter Blog Advisor: Give Any Model a Lifeline to a Smarter One — OpenRouter Blog Gemini 2.5 Flash API - Pricing, Quickstart & Provider Comparison — OpenRouter Blog EU AI Act & Colorado ADMT Compliance: Human Oversight for AI Agents — OpenRouter Blog May Release Spotlight — OpenRouter Blog Guardrails: Protect your Agents, Data, and Costs — OpenRouter Blog OpenRouter Raises $113M Series B — OpenRouter Blog Human-in-the-Loop Tools for the Agent SDK — OpenRouter Blog Consistent Web Search and Fetch Across Every Model — OpenRouter Blog GPT-5.5 Price Increase: What It Actually Costs — OpenRouter Blog New Audio APIs for Speech and Transcription — OpenRouter Blog Response Caching: Zero Cost for Identical Requests — OpenRouter Blog April Release Spotlight — OpenRouter Blog Create OpenRouter Accounts via CLI with Stripe Projects — OpenRouter Blog Opus 4.7 Agent SDK: Building Multi-turn Agent Workflows on OpenRouter — OpenRouter Blog Build Your Own Harness with the Agent SDK — OpenRouter Blog Introducing Workspaces — OpenRouter Blog Announcing Video Generation — OpenRouter Blog Auto Exacto: Adaptive Quality Routing, On by Default — OpenRouter Blog February Release Spotlight — OpenRouter Blog OpenRouter Outages on February 17 and 19, 2026 — OpenRouter Blog January Release Spotlight — OpenRouter Blog Distillable Models and Synthetic Data Pipelines with NeMo Data Designer — OpenRouter Blog December Release Spotlight — OpenRouter Blog Response Healing: Reduce JSON Defects by 80%+ — OpenRouter Blog The 2025 State of AI Report — OpenRouter Blog Is Implicit Caching Prompt Retention? — OpenRouter Blog Provider Variance: Introducing Exacto — OpenRouter Blog 1 million free BYOK requests per month — OpenRouter Blog The First-Ever Image Model Is Up on OpenRouter — OpenRouter Blog GPT-5 is now live — OpenRouter Blog Audio Inputs and PDF URLs for Apps — OpenRouter Blog Presets: How To Seamlessly Transfer Model Configurations Across Apps — OpenRouter Blog New Privacy-Focused Provider Drop: Venice — OpenRouter Blog Use OpenRouter Models in Cursor: Try it with Moonshot AI Updates to Our Free Tier: Sustaining Accessible AI for Everyone — OpenRouter Blog New Stealth Model: "Cypher Alpha" — OpenRouter Blog Introducing Presets: Manage LLM Configs from Your Dashboard! — OpenRouter Blog Dev & BYOK Updates: Uptime API + Smarter Key Management — OpenRouter Blog Simplifying Our Platform Fee — OpenRouter Blog GIF Prompts, Omni Search, Tool Caching, and BYOK Flags — OpenRouter Blog New Features: Reasoning Streams, Crypto Invoices, End-User IDs & More — OpenRouter Blog Passkeys, DevEx Upgrades, and a New Guide for TypeScript Agents — OpenRouter Blog New Provider Drop: Cerebras Is Here — OpenRouter Blog Better Insights, Faster Metrics, and New Developer Power Tools — OpenRouter Blog Privacy Clarity, New Providers, OAuth Upgrade, and Gemini Gets Parallel Tools — OpenRouter Blog Universal PDF Support — OpenRouter Blog Smarter Charts, Inline SVGs, and Live Usage Accounting — OpenRouter Blog Quasar Alpha and Optimus Alpha Reveal — OpenRouter Blog "Stealth" model: Optimus Alpha — OpenRouter Blog “Stealth” model: Quasar Alpha — OpenRouter Blog Never Pay for Empty AI Responses Again — OpenRouter Blog Deep Research & Many New Models — OpenRouter Blog Introducing Nitro and Floor Price Shortcuts — OpenRouter Blog Introducing Cloudflare as a new provider — OpenRouter Blog Reasoning Tokens for Thinking Models — OpenRouter Blog Introducing Web Search via the API — OpenRouter Blog Standardized finish reasons — OpenRouter Blog Happy New Year! Introducing a new Auto Router — OpenRouter Blog Holiday launches: Web Search & Price Cuts — OpenRouter Blog Bring Your Own API Keys — OpenRouter Blog Crypto Payments API — OpenRouter Blog Structured Outputs & Free Gemini Flash 2.0 — OpenRouter Blog Price Drops and Llama 3.3 70b — OpenRouter Blog Author Pages & Amazon Nova — OpenRouter Blog
Free LLM API in 2026: 13 Options Ranked and Compared — OpenRouter Blog
OpenRouter · 2026-06-16 · via OpenRouter Blog

You’re working on a side project or early-stage app and don’t want to pay for LLM calls yet. You search “free llm api” and get flooded with dozens of services claiming to be free. Some deliver real value. Others give tiny trial credits that disappear in an afternoon. A few use your prompts to train their next model without disclosing it upfront.

OpenRouter routes traffic across 70+ LLM providers and processes 100 trillion tokens per month. Because it sits in front of those providers, it routes to the same models they serve, including the fastest and longest-context ones, which is worth keeping in mind as you compare them below.

Tl;dr

  • 13 platforms offer usable free LLM API access in 2026, including several permanent free tiers for text inference. Limits and trade-offs differ significantly.
  • OpenRouter is a strong starting point, with 20+ free models, a single API key, and no credit card.
  • For raw speed, Groq’s LPU hardware runs Llama 3.3 70B at around 320 tokens per second (Artificial Analysis). For long context, Google AI Studio and several open models reach 1M tokens. OpenRouter routes to both, so you can reach them through one key or go direct.
  • Every free tier has hidden costs. Rate limits, data training opt-ins, reduced context windows, and quality drops all come with the territory.
  • Test 2 or 3 options early and implement failover. It saves more headaches than any single endpoint ever could.

What “Free LLM API” Actually Means in 2026

Free LLM access falls into 3 distinct categories. The word “free” gets used loosely, which creates confusion.

Permanent free tiers give you indefinite access without a credit card or expiry. You manage rate limits, nothing else.

Trial credits are temporary marketing offers ($1 to $30) that expire after a few weeks or require a card on file. They suit one-off tests, not ongoing work.

Local inference means downloading open-weight models and running them on your own machine using tools like Ollama or vLLM. No per-token charges after setup, but you’re responsible for hardware, electricity, and maintenance.

Permanent free tiers (OpenRouter, Google AI Studio, Groq, Mistral, Cerebras) are where you should start. Trial credits suit one-off evaluation. Local inference suits maximum privacy and unlimited volume if you have the hardware.

Free LLM API Providers Compared (2026)

This comparison covers 13 platforms across permanent free tiers and trial-credit offerings, verified against the cheahjs/free-llm-api-resources repository (March 2026 update) and provider documentation as of April 2026.

In the tables below, RPM is requests per minute, RPD is the daily ceiling, and TPM is the throughput limit measured in model tokens per minute.

ProviderFree ModelsRPMRPD / Monthly LimitContext WindowOpenAI CompatibleCredit CardData Training
OpenRouter20+ (multi-provider)2050/day (1,000/day with $10 top-up)Up to 1MYesNoNo
Google AI Studio8 Gemini/Gemma variants5–1520–1,500/dayUp to 1MPartialNoYes (outside EU/UK/EEA)
GroqLlama 3.3 70B, Mixtral, others301,000/day128KYesNoNo
MistralCodestral, Mistral Small/LargeVariable~1B tokens/month32K–256KYesNoYes (Experiment tier)
CerebrasLlama 3.3 70B, others30~1M tokens/dayUp to 1MYesNoNo
Cloudflare Workers AI20+ modelsHigh~10K neurons/day2K–8KPartialNoNo
GitHub ModelsGPT-4o, Claude 3.5 Sonnet, Llama, Phi15150–1,000/day8K–128KYesNoNo
CohereCommand R+10–20~100/day128KPartialNoNo (non-commercial only)
Hugging Face100K+ OSS modelsVariableCommunity / rate limitedModel dependentPartialNoNo
NVIDIA NIMNemotron, Llama variantsHigh~1,000/day128KPartialNoNo
ChutesVarious OSS modelsVariableCommunity tierModel dependentYesNoNo
SambaNovaLlama 3.1 405BVariable$5 trial credit128KYesYesNo
Vercel AI GatewayMulti-provider (BYOK)VariableProvider dependentVariesYesNoDepends on backend

OpenRouter leads on model variety and ease of use, and because it routes to the providers below, you can reach Groq’s speed or a 1M-context model through the same key. Going direct to Groq, Cerebras, or Google AI Studio gives you that provider’s full native free-tier quota and SDK features. No single setup wins on every axis, which is why pairing a router with one or two direct integrations tends to be the resilient choice.

Permanent Free Tiers Breakdown

OpenRouter (variety). A single API key and one OpenAI-compatible endpoint for benchmarking 20+ free models from different families. Use it when you want to test multiple providers without managing separate accounts.

Google AI Studio (context). A strong option for long-form data. The free tier supports up to 1 million tokens of context on Gemini Flash, and Gemini models handle multimodal input (text, images, audio). Partially OpenAI-compatible for standard chat tasks, but Google’s native SDK is recommended for advanced features like file-based RAG.

Groq (speed). Specialized LPU hardware runs Llama 3.3 70B at around 320 tokens per second (Artificial Analysis). The API is fully OpenAI-compatible, which makes it a good pick for voice agents, real-time chat, and other latency-sensitive UX.

Mistral (volume). Roughly 1 billion tokens per month on the Experiment tier is among the most generous permanent free quotas here, but you must opt into data training to use it.

Cerebras (throughput). Roughly 1M tokens per day on Llama 3.3 70B and other models. Strong for batch processing where you need volume without speed compromises.

GitHub Models (frontier access). Free access to GPT-4o, Claude 3.5 Sonnet, Llama, and Phi via an Azure-based OpenAI-compatible endpoint. Tied to a GitHub account. Includes a browser-based playground for testing prompts before integrating.

Cloudflare Workers AI (edge). 20+ models with generous request budgets, ideal for edge-deployed inference. Smaller context windows than most alternatives.

Cohere (RAG). Command R+ on the Trial API key, capped at roughly 100 requests per day with no card required. Strictly non-commercial use.

Note: free tiers may use your prompts and responses to improve their products. Google’s policy is the most explicit about this outside the EU/UK/EEA.

Providers with Trial Credits

Trial-credit providers offer between $1 and $30 of evaluation budget before requiring payment, with DeepSeek the outlier offering 10 million tokens instead. These are time-limited or spend-limited offers. Useful for one-off evaluation, not viable for ongoing free use.

  • Fireworks ($1 credit). Enough for a few thousand requests on smaller models. Good for benchmarking Fireworks-hosted Llama and Mixtral variants. No card required at signup.
  • Baseten ($30 credit). The most generous trial in this list. Sufficient to prototype a small app end-to-end. Card required after credit exhaustion.
  • Nebius ($1 credit). Limited but enough to test their hosted lineup of open-weight models.
  • SambaNova ($5 credit). Access to Llama 3.1 405B, one of the largest open-weight models available through any free tier. Credit card required at signup.
  • DeepSeek (10M tokens). A generous token-based trial. DeepSeek R1 excels at multi-step reasoning, mathematical problem solving, and logical deduction, making this useful for evaluating reasoning-heavy workloads.
  • AI21 ($10 credit). Trial access to the Jamba family. Useful if you specifically need AI21’s hybrid SSM-Transformer architecture.

Trial credits are best treated as evaluation budget. Build your real prototype on a permanent free tier and use trial credits to compare specific models you might pay for later.

Rate Limits Side by Side

20 requests per minute means one request every 3 seconds. 1,000 requests per day means roughly 40 per hour. These are real constraints on what you can build.

ProviderRequests Per MinuteRequests Per DayTokens Per MinuteBest For
Groq301,000HighReal-time apps, voice agents
Cerebras30~1M tokens/day equivalentHighBatch processing, throughput
Mistral (Experiment)Variable~1B tokens/monthVariableCoding workloads, high volume
OpenRouter2050 (1,000 with $10 top-up)VariableExperimentation, routing across models
GitHub Models15150–1,000VariableFrontier model access
Google AI Studio5–1520–1,500VariableLong-context analysis
Cohere10–20~100LowRAG prototyping (non-commercial)
NVIDIA NIMHigh~1,000VariableNVIDIA-hosted inference
Cloudflare Workers AIHigh~10K neurons/dayVariableEdge deployment
Hugging FaceVariableCommunity-rate-limitedVariableOSS model exploration

All figures verified against cheahjs/free-llm-api-resources (March 2026 update) and provider documentation as of April 2026. Rate limits on free tiers change frequently; verify current numbers before committing.

Groq and Cerebras offer high throughput on their free tiers. Google AI Studio offers up to 1M tokens of context at lower request volume. OpenRouter gives you one key across these providers with failover. Choose based on whether your bottleneck is per-provider quota, speed, or context, and remember you can mix direct and routed access.

Free tiers aren’t free. The cost shifts from your wallet to your privacy, performance, or reliability. 4 trade-offs matter most.

Data training opt-ins are the biggest privacy concern. Google uses your prompts to improve its models unless you’re in the EU, UK, or EEA. Mistral’s Experiment tier requires you to opt into training to access the 1B token/month quota. If you’re working with proprietary code, customer data, or anything confidential, these policies create compliance risk that costs more to remediate later than a paid tier costs today.

Reduced context windows catch developers off guard. Some providers serve a smaller context window on their free endpoint than the same model offers on a paid plan, so long conversations truncate, RAG systems lose context, and document analysis can fail partway through. Check the context length on the specific free endpoint you’re using rather than the model’s headline number.

Lower quantization is more subtle. To control costs, some platforms serve quantized model weights (for example 8-bit or 4-bit) on free tiers instead of the full-precision version. Lower precision can reduce output quality on complex tasks, so check the quantization level if accuracy matters. OpenRouter lists the quantization for each endpoint.

No service level agreement means zero guarantees. Free tiers can tighten rate limits without warning, increase latency during peak hours, or experience complete outages with no compensation. Acceptable for personal projects, risky for anything customer-facing.

IP blocking and anti-abuse measures are also common. Many platforms aggressively block VPNs, shared hosting IPs, or data center ranges to prevent abuse. If you develop from certain environments, you might find yourself locked out until you upgrade or switch services.

For sensitive work, the safer defaults are services with clear no-training policies (OpenRouter, Groq, Cerebras) or running models locally with Ollama.

Which Free LLM API Should You Use?

There’s no universal best free LLM API. The right choice depends on your main constraint right now.

Long document analysis or research. Google AI Studio’s 1M token context window on Gemini Flash handles entire books, large codebases, or long PDFs without aggressive chunking, and Gemini also takes multimodal input (images and audio). Free 1M-context models are available through OpenRouter too (for example Qwen3 Coder), so you can route to one instead of integrating Google directly.

Speed-critical apps (voice, real-time chat). Groq’s specialized LPU hardware runs Llama 3.3 70B at around 320 tokens per second (Artificial Analysis). You can call Groq directly or route to it through OpenRouter.

Coding assistants and developer tools. Mistral Codestral on the Experiment tier provides a 1B token/month budget optimized for code generation and refactoring.

Complex reasoning tasks. DeepSeek R1 through the DeepSeek trial credit is purpose-built for multi-step reasoning, mathematical problem solving, and logical deduction.

High-volume batch processing. Cerebras gives you roughly 1M tokens per day, enough for bulk data cleaning, summarization, and offline workloads that would trigger rate-limit blocks elsewhere.

Maximum model variety from one API key. OpenRouter gives you 20+ free models across multiple providers through a single OpenAI-compatible endpoint, with auto-failover when individual providers throttle.

Production-grade with failover. OpenRouter with a $10 top-up bumps your limit to 1,000 requests per day on free models and gives you automatic failover across underlying providers when any single one degrades.

Privacy-first or EU compliance. Scaleway offers European hosting with GDPR-aligned data handling. Or run models locally with Ollama.

A few caveats are worth being honest about. Going direct to a provider gives you that provider’s full native free-tier quota and any provider-specific SDK features, like Google AI Studio’s file-based RAG or Mistral’s larger monthly token allowance. OpenRouter routes to those same providers, so it matches their speed and context, but its own free tier has separate request caps and a unified endpoint that doesn’t expose every native feature. If your need is narrow and well-defined, going direct can mean fewer limits; if you want variety, failover, and one integration, the router wins.

Quickstart: Your First Free LLM API Call in 60 Seconds

Most services in this guide use an OpenAI-compatible API, which means the same code works across all of them with a base URL and API key swap. Here’s the pattern using OpenRouter as the primary example.

Using the OpenRouter SDK (recommended):

from openrouter import OpenRouter

client = OpenRouter()

response = client.chat.send(
    model="meta-llama/llama-3.3-70b-instruct:free",
    messages=[{"role": "user", "content": "Explain rate limiting in one sentence."}],
)

print(response.choices[0].message.content)
import { OpenRouter } from '@openrouter/sdk';

const openRouter = new OpenRouter();

const response = await openRouter.chat.send({
  model: 'meta-llama/llama-3.3-70b-instruct:free',
  messages: [{ role: 'user', content: 'Explain rate limiting in one sentence.' }],
  stream: false,
});

console.log(response.choices[0].message.content);

Or via the OpenAI SDK with a base URL swap (works across all OpenAI-compatible providers):

curl https://openrouter.ai/api/v1/chat/completions \
  -H "Authorization: Bearer $OPENROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "meta-llama/llama-3.3-70b-instruct:free",
    "messages": [{"role": "user", "content": "Explain rate limiting in one sentence."}]
  }'

With OpenRouter, you don’t swap base URLs to reach a different provider. The endpoint and API key stay the same, and you change the model string to route somewhere else. To run the same prompt on a 1M-context model or a different model family, swap the slug:

# Llama 3.3 70B
model="meta-llama/llama-3.3-70b-instruct:free"

# Qwen3 Coder, 1M token context
model="qwen/qwen3-coder:free"

# OpenAI gpt-oss 120B
model="openai/gpt-oss-120b:free"

Some providers don’t fully follow the OpenAI API schema when you call them directly. Google’s Gemini models, for example, offer up to 1M tokens of context but need Google’s native SDK for a direct integration. OpenRouter normalizes those differences behind the one endpoint, so the same code reaches them by slug.

What Happens When Free Runs Out

You hit the daily limit at 2pm. Your app stops responding. The transition path depends on which service you started with.

OpenRouter. Add a $10 minimum top-up. This raises your daily cap to 1,000 requests on free models. OpenRouter charges the provider’s per-token rate plus a 5.5% platform fee with no additional provider markup, so paid usage stays close to direct-provider pricing while keeping the failover and single-key benefits.

Google AI Studio. Switch to pay-as-you-go Gemini pricing; the Flash tier is inexpensive, and Google’s pricing page lists current per-token rates.

Groq. Move to Groq’s paid pay-as-you-go pricing, which raises rate limits on the same OpenAI-compatible endpoint. Check the current per-token rates before you switch.

Mistral. The Experiment tier (free with data training opt-in) transitions to the Production tier (paid, no data training) at standard per-token rates.

The most resilient setups combine several tactics rather than relying on a single endpoint:

  1. Standardize with failover. Use the base URL swap pattern across a primary and secondary OpenAI-compatible provider (e.g., OpenRouter primary, Groq secondary). Your core code stays clean, and your app switches endpoints automatically when a rate limit hits.
  2. Route for specialized power. When a task needs a very long context window, send that request to Google AI Studio using their native SDK. This taps the 1M token context window without forcing your entire stack against a non-standard schema.
  3. Micro-fund for stability. Add a $10 credit balance to OpenRouter or a similar gateway for consistent, throttle-free performance during peak hours.
  4. Offload to local inference. As your workload grows, shift background batch processing or non-real-time tasks to local models using Ollama.

Here’s a practical failover example:

import os
from openai import OpenAI


def call_llm(prompt: str, max_tokens: int = 500):
    providers = [
        {
            "name": "OpenRouter",
            "base_url": "https://openrouter.ai/api/v1",
            "key": os.environ.get("OPENROUTER_API_KEY"),
            "model": "meta-llama/llama-3.3-70b-instruct:free",
        },
        {
            "name": "Groq",
            "base_url": "https://api.groq.com/openai/v1",
            "key": os.environ.get("GROQ_API_KEY"),
            "model": "llama-3.3-70b-versatile",
        },
    ]

    for provider in providers:
        if not provider["key"]:
            continue
        try:
            client = OpenAI(api_key=provider["key"], base_url=provider["base_url"])
            response = client.chat.completions.create(
                model=provider["model"],
                messages=[{"role": "user", "content": prompt}],
                max_tokens=max_tokens,
            )
            print(f"Success via {provider['name']}")
            return response
        except Exception as e:
            print(f"{provider['name']} failed: {e}")
            continue

    raise Exception("All providers failed")

One honest comparison to close on. If you’re spending more than $50 a month, run the numbers against direct provider APIs at your actual volume. Aggregators add convenience and failover, and direct providers sometimes win on raw cost at high volume.