Gemini 4 Carbon API
Google's Gemini reasoning model for complex coding, maths and science.
On this page
Gemini 4 Carbon API pricing
75% less than Google’s API for 1,000 input and 500 output tokens, before caching.
| Token type | RouterHub | GoogleOfficial API |
|---|---|---|
| Input | $0.50 | $2.00 |
| Output | $2.50 | $10.00 |
| Cached input | $0.025 | $0.10 |
Google pricing source · Checked 2026-11-18 · Rates through 2026-11-30
Compatible with the tools you already use
One key, one base URL. OpenAI and Anthropic compatible.
Gemini 4 Carbon uses Chat Completions. See the tools that support this model.
Start for free
Plus up to $5 bonus credit on your first top-up.
Context window and API compatibility
Gemini 4 Carbon uses the OpenAI-compatible Chat Completions API over POST /v1/chat/completions and has a context window of 1,048,576 tokens. Use model ID gemini-4-carbon in requests.
- Exact model ID
gemini-4-carbon- Provider
- Variant
- Standard
- Supported API
- OpenAI-compatible Chat Completions API (
/v1/chat/completions) - Availability
- Preview
- Context window
- 1,048,576 tokens
- Maximum input
- Not published
- Maximum output
- 65,536 tokens
- Input types
- text and images
- Coding tools
- OpenCode, VS Code + Continue, VS Code + Cline, Hermes Agent
Make your first API request
Set ROUTERHUB_API_KEY locally, then send a request with the exact model ID below.
curl --connect-timeout 30 --max-time 600 https://routerhub.si/v1/chat/completions \
-H "Authorization: Bearer $ROUTERHUB_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gemini-4-carbon","messages":[{"role":"user","content":"Write a short noir scene set in a lighthouse."}],"max_tokens":256}'Python: install openai with pip. This example requests 256 output tokens and disables automatic retries. Check Usage before resending a paid request.
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["ROUTERHUB_API_KEY"],
base_url="https://routerhub.si/v1",
timeout=600.0,
max_retries=0,
)
response = client.chat.completions.create(
model="gemini-4-carbon",
messages=[{"role": "user", "content": "Write a short noir scene set in a lighthouse."}],
max_tokens=256,
)
print(response.choices[0].message.content)Common questions
What is Gemini 4 Carbon?
Gemini 4 Carbon is a Google language model served through RouterHub using the OpenAI-compatible Chat Completions API. Its exact API model ID is gemini-4-carbon.
How much does Gemini 4 Carbon cost?
RouterHub charges $0.50 input, $0.025 cached input and $2.50 output per million tokens (prices as of 2026-11-22). A typical chat message of about 1,000 input and 500 output tokens costs about 0.18¢. Usage is billed against your prepaid balance.
What is the Gemini 4 Carbon context window?
Context window: 1,048,576 tokens. Maximum input: Not published. Maximum output: 65,536 tokens.
Which API does Gemini 4 Carbon support?
Use the OpenAI-compatible Chat Completions API at https://routerhub.si/v1/chat/completions with the exact model ID gemini-4-carbon and your RouterHub API key (Authorization: Bearer header).
Which coding tools work with Gemini 4 Carbon?
OpenCode, VS Code + Continue, VS Code + Cline, Hermes Agent. These tools support this model’s Chat Completions endpoint with the configurations in their setup guides.
Can I try Gemini 4 Carbon for free?
Gemini 4 Carbon needs a free RouterHub account with prepaid credits. New accounts get $5 free on their first top-up of $20 or more.