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.
| 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"
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
Get started
Four steps to your first request
- 01
Create a free account
Sign up with Google, GitHub or email and set a password. No card is required.
- 02
Generate an API key
Create a key in one click from the dashboard. It lets your CLI authenticate with Code By AI.
- 03
Top up your balance
Add credit before your first request; usage is charged per token from your balance.
- 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.
No card required to sign up · API usage requires a top-up