Gemini 4 Carbon API pricing and access

Run Gemini 4 Carbon (model ID gemini-4-carbon) through Code By AI for $0.40 per 1M input tokens and $2.00 per 1M output tokens, with no monthly subscription.

What Gemini 4 Carbon is for

Use this model through Gemini CLI to explain code, investigate error messages and summarize project changes. Review its suggestions against your project.

Your price

$0.40

per 1M tokens, USD

Gemini model service may be unstable due to recent upstream risk controls. Please choose carefully.

gemini-4-carbonTop up & try
Your price
Input$0.40
Cache read$0.02
Output$2.00

What gemini-4-carbon costs in a typical month

On Code By AI, 20M input tokens and 2M output tokens cost $12.00.

How to use gemini-4-carbon

Export GOOGLE_GEMINI_BASE_URL=https://www.codebyai.net/api/agent and GEMINI_API_KEY=sk-proj-xxxx, then launch the CLI, and use the model ID gemini-4-carbon. The Gemini guide walks through the full configuration.

export GOOGLE_GEMINI_BASE_URL="https://www.codebyai.net/api/agent"
export GEMINI_API_KEY="sk-proj-xxxx"
Read the Gemini setup guideCompare plans and monthly costs

No key yet? Create one

Claude Code, Codex and Gemini CLI compatibility

A client can call gemini-4-carbon only when it speaks the endpoint that serves this model. The table shows what works and the minimum configuration.

  • Claude CodeNot applicable

    Not applicable: the Anthropic Messages endpoint serves Claude models only.

    Open the Claude Code guide
  • CodexNot applicable

    This model is not available in Codex. Gemini models use the Gemini endpoint.

    Open the Codex guide
  • Gemini CLIAvailable

    Set GOOGLE_GEMINI_BASE_URL="https://www.codebyai.net/api/agent" and GEMINI_API_KEY, select gemini-api-key in ~/.gemini/settings.json, then use model gemini-4-carbon.

    Open the Gemini CLI guide

Compare other Gemini models

Your price /1M

Similar price on other channels

Gemini 4 Carbon FAQ

Gemini 4 Carbon costs $0.40 per 1M input tokens, $0.02 per 1M cache read tokens and $2.00 per 1M output tokens on Code By AI.

No. Requests to Gemini without a model parameter use the default model instead; set the model parameter to gemini-4-carbon to select this one.

Export GOOGLE_GEMINI_BASE_URL=https://www.codebyai.net/api/agent and GEMINI_API_KEY in your shell, pass the model ID gemini-4-carbon, then launch the CLI. The Gemini guide covers the full configuration.

Yes with Gemini CLI. Claude Code and Codex do not work: they serve the Claude and GPT/Codex families, while Gemini models use the generateContent endpoint.

Cache reads cost $0.02 per 1M tokens. The catalog defines no separate cache-write rate for this channel.

Get started

Four steps to your first request

  1. 01

    Create a free account

    Sign up with Google, GitHub or email and set a password. No card is required.

  2. 02

    Generate an API key

    Create a key in one click from the dashboard. It lets your CLI authenticate with Code By AI.

  3. 03

    Top up your balance

    Add credit before your first request; usage is charged per token from your balance.

  4. 04

    Point your CLI at Code By AI

    Export one base-URL variable, or add a model provider block to config.toml. The setup guides list the exact lines for each agent.

Use it nowTop up to send a requestWhat a working month costs

No card required to sign up · API usage requires a top-up