thelastapi
Get started free

GPT vs Claude vs Gemini API pricing per million tokens

Compare GPT, Claude, and Gemini API token pricing per million tokens across fast, balanced, reasoning, and flagship model tiers.

On this page 6 sections

API pricing for GPT, Claude, and Gemini ranges from $0.10 per million input tokens on lightweight tiers up to $20.00 per million output tokens on flagship frontier models. Entry-level models like GPT-6 Luna and Claude Haiku 5.5 start at $0.10 per million input tokens and $0.50 per million output tokens, while balanced models like Gemini 3.8 Flash cost $0.825 input and $4.125 output. Flagship models like Claude Opus 5.5 sit at the top tier at $4.00 per million input tokens and $20.00 per million output tokens.

Choosing the right model for your application requires balancing raw reasoning capabilities against token economics. This guide breaks down the pricing across all major tiers, highlights long-context thresholds, and shows how to call all three providers through a single client.

How GPT, Claude, and Gemini API pricing compares across tiers

API token pricing scales primarily by model complexity. Lightweight models handle classification, structured data extraction, and quick conversational turns for pennies. Mid-tier and reasoning models handle deep analytical tasks, and flagship models handle multi-step agent workflows.

Through thelastapi, you can access these models using standard aliases (like vibiz/fast or vibiz/smart) or by specifying a lab model ID directly (such as anthropic/claude-opus-5.5). Exactly the model you request is the model that runs. If a provider suffers an outage, the API returns a 503 model_unavailable or provider_unavailable error rather than silently routing your prompt to a different model.

Here is how token pricing compares across the primary tiers per million tokens:

Model TierLab Model NamePrimary Use CaseInput Price / 1M TokensOutput Price / 1M Tokens
vibiz/fastGPT-6 Luna (OpenAI)Chat, tool calls, JSON$0.10$0.50
vibiz/smart-miniClaude Haiku 5.5 (Anthropic)Fast coding, concise writing$0.10$0.50
vibiz/liteDeepSeek V4.1 FlashHigh-volume chat, 1M context$0.14$0.42
vibiz/balancedGemini 3.8 Flash (Google)Balanced quality, 1M context$0.825$4.125
vibiz/reasoningGPT-6.1 Terra (OpenAI)Math, logic, complex planning$1.00$5.00
vibiz/smartClaude Sonnet 5.5 (Anthropic)Hard tasks, coding, agents$2.00$10.00
vibiz/proClaude Opus 5.5 (Anthropic)Flagship chat, deep reasoning$4.00$20.00

Fast and lightweight tiers ($0.10 to $0.50)

For high-frequency tasks where response speed matters, OpenAI's GPT-6 Luna (vibiz/fast) and Anthropic's Claude Haiku 5.5 (vibiz/smart-mini) are price-matched at $0.10 per million input tokens and $0.50 per million output tokens. Both excel at parsing unstructured text, generating JSON objects, and executing straightforward tool calls. DeepSeek V4.1 Flash (vibiz/lite) provides a nearby alternative at $0.14 input and $0.42 output per million tokens, paired with a 1-million-token context window.

Balanced tiers ($0.825 to $4.125)

Google's Gemini 3.8 Flash (vibiz/balanced) sits in the mid-tier at $0.825 per million input tokens and $4.125 per million output tokens. It features a native 1-million-token context window, making it suitable for ingesting full codebases, books, or lengthy transcripts without having to chunk text into separate vectors.

Advanced reasoning and agent tiers ($1.00 to $20.00)

When your pipeline requires autonomous planning, multi-file code editing, or mathematical proofs, the larger models justify their cost:

  • GPT-6.1 Terra (vibiz/reasoning): At $1.00 per million input tokens and $5.00 per million output tokens, this reasoning model generates internal thinking steps before answering.
  • Claude Sonnet 5.5 (vibiz/smart): At $2.00 input and $10.00 output per million tokens, it is the tier for hard writing, coding and agent tasks.
  • Claude Opus 5.5 (vibiz/pro): At $4.00 input and $20.00 output per million tokens, it is the strongest chat tier, for long agent runs.

What happens to pricing with long context prompts?

While base token rates cover the vast majority of prompts, several models invoke long-context pricing rules when prompts exceed designated token counts.

Some models charge more once an incoming request passes a specific long-context threshold (pricing.long_context in the model catalogue):

  • GPT-6 models: Input token rates increase on requests exceeding 272,000 input tokens.
  • Claude Haiku 5.5: Input token rates increase on requests exceeding 100,000 input tokens.

Gemini 3.8 Flash (vibiz/balanced) natively supports a 1-million-token context window. Because every model reports its exact cost in the response, you never have to guess how tiered context thresholds impacted your bill. Every JSON response includes cost_micro_usd, which states the exact total cost of that call in micro-USD, along with the served_model identifier.

If you generate embeddings alongside your chat pipelines, OpenAI's text-embedding-3-small (vibiz/embed) costs $0.02 per million tokens (1,536 dimensions), while text-embedding-3-large (vibiz/embed-large) costs $0.13 per million tokens (3,072 dimensions).

How to query all three providers with a single API key

Instead of signing up for separate billing accounts and managing distinct keys for OpenAI, Anthropic, and Google, you can use the unified AI gateway on thelastapi. It exposes an OpenAI-compatible endpoint at /v1/ai.

To learn more about how routing works behind the scenes, read One API key for GPT, Claude and Gemini: how a unified AI API works and OpenAI-compatible API for Claude and Gemini: change one base URL.

You can initialize a project and inject your environment variables with the CLI:

Terminal
vibiz init "Pricing Demo" --resources ai
vibiz dev

The vibiz dev command writes .env.development.local, populating VIBIZ_AI_BASE_URL and VIBIZ_AI_API_KEY (alongside aliases OPENAI_BASE_URL and OPENAI_API_KEY).

Using the official Node.js OpenAI SDK, you can call GPT, Claude, and Gemini simply by changing the model parameter:

TypeScript
import OpenAI from 'openai';

const openai = new OpenAI({
  baseURL: process.env.VIBIZ_AI_BASE_URL,
  apiKey: process.env.VIBIZ_AI_API_KEY,
});

const models = ['vibiz/fast', 'vibiz/balanced', 'vibiz/smart'];

for (const model of models) {
  const response = await openai.chat.completions.create({
    model,
    messages: [{ role: 'user', content: 'Explain amortized analysis in one sentence.' }],
  });

  console.log(`${model}:`, response.choices[0]?.message.content);
}

For more implementation patterns, see Call Claude and Gemini from the OpenAI Node.js SDK.

You can also execute raw HTTP requests against the gateway using curl:

Terminal
curl https://thelastapi.dev/v1/ai/chat/completions \
  -H "Authorization: Bearer $VIBIZ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"vibiz/smart","messages":[{"role":"user","content":"Hi"}]}'

How to run Gemini models on your own Google account

If you already have existing Google Cloud credits or prefer Google to bill you directly for Gemini, you can link your own key.

Add your key via the CLI:

Terminal
GEMINI_API_KEY=your_key_here vibiz ai keys set google
vibiz ai keys test google

Or make an HTTP call:

Terminal
curl -X PUT https://thelastapi.dev/v1/ai-keys/google \
  -H "Authorization: Bearer $OWNER_KEY" \
  -H "Content-Type: application/json" \
  -d '{"type":"gemini_api_key","api_key":"your_key_here"}'

When configured, any Google model—including vibiz/balanced, vibiz/image (Nano Banana 2), and direct IDs like google/gemini-3.8-flash-tts—runs against your Google account at zero cost on thelastapi. The response marks "paid_by": "your_key" and returns would_cost_micro_usd. GPT and Claude models continue running on thelastapi as usual.

If your Google key fails or expires, the API does not fall back to thelastapi's billing. The call fails immediately with provider_failed and details.reason: "customer_key_rejected", preventing unexpected charges.

Tracking token spend and setting daily limits

Accounts on thelastapi are prepaid. Token usage is charged against your account credit balance at list price plus a 10% AI margin. New accounts automatically receive $2.00 in trial credits.

To ensure agents or runaway loops do not drain your balance, every account and project operates under built-in safety limits:

  • Daily spend ceiling: Set to $5.00 per account per UTC day by default across all AI calls and actions. Account owners can raise this up to $1,000 in the console or via PATCH /v1/billing {"daily_spend_limit_usd": 50}.
  • Project budget: Defaults to $1.00 per project per UTC day. You can change it with PATCH /v1/projects/:id/ai {"daily_budget_usd": 10}.
  • Rate limits: An account key receives 300 requests and 400,000 tokens per minute. A project key receives 120 requests and 200,000 tokens per minute (configurable up to 600 requests and 2,000,000 tokens).

You can monitor spend directly from your terminal:

Terminal
vibiz usage --by model
vibiz usage --period 7d --by tool

If you reach 80% or 100% of your daily limit, an alert email goes out to the account owner with a direct link to adjust the cap. Learn more in the AI, Usage and limits, and Billing and credits documentation.

To start testing prompts across GPT, Claude, and Gemini without configuring multiple accounts, check the AI documentation or create your account at thelastapi.dev/start.

Frequently asked questions

Can I use the OpenAI client library to call Claude and Gemini?

Yes. Because the `/v1/ai` gateway is OpenAI-compatible, you point your existing OpenAI SDK client to `VIBIZ_AI_BASE_URL` with your API key, then pass model aliases like `vibiz/smart` or lab IDs like `anthropic/claude-opus-5.5`.

Does thelastapi charge a markup over standard lab token prices?

Yes, AI calls are recorded at the underlying lab's list price plus a 10% AI fee, which is deducted in real time from your prepaid account credits.

What happens if a model hits an outage during a request?

The API returns an error response with status code 503 (`model_unavailable` or `provider_unavailable`) along with a retry hint, rather than quietly swapping your request to a different model.

Can I bring my own API key to bypass token charges?

You can connect your own Gemini API key for Google models, which routes all Gemini chat, voice, and Nano Banana image requests directly to your Google account at $0 on thelastapi.