Gemini 3.1 Pro Preview vs GPT-6.1 Terra: API price and setup

This page compares the exact API IDs `gemini-3.1-pro-preview` and `gpt-6.1-terra`, not names inferred from the URL. The native clients are Gemini for Gemini 3.1 Pro Preview (Google) and Codex for GPT-6.1 Terra (OpenAI). Both share a Code By AI key and balance. Prices come from the live catalog.

Short answer

For 1M input plus 1M output tokens, GPT-6.1 Terra is the lower-priced row: Gemini 3.1 Pro Preview costs $0.20 for input plus $1.20 for output on Code By AI, versus GPT-6.1 Terra at $0.10 plus $0.50. Official list rates are $2.00 input / $12.00 output and $1.00 input / $5.00 output per 1M tokens.

Token and monthly figures are arithmetic from the current catalog, not a forecast or a measured benchmark. The monthly example excludes cache writes, tools and actual usage differences.

Token prices on the same basis

All values are USD per 1M tokens. Code By AI prices already include the published multiplier. Vendor list prices are shown only when verified. The 5-minute and 1-hour cache writes apply only to Claude and use each platform’s own input rate.

ModelMetricCode By AIOfficial listOpenRouter
Gemini 3.1 Pro Previewgemini-3.1-pro-previewInput$0.20$2.00$2.00
Cache read$0.02$0.20$0.20
Cache write (5 min)Not applicableNot applicableNot applicable
Cache write (1 hour)Not applicableNot applicableNot applicable
Output$1.20$12.00$12.00
GPT-6.1 Terragpt-6.1-terraInput$0.10$1.00$1.00
Cache read$0.005$0.05$0.05
Cache write (5 min)Not applicableNot applicableNot applicable
Cache write (1 hour)Not applicableNot applicableNot applicable
Output$0.50$5.00$5.00

OpenRouter standard endpoint (verified): google/gemini-3.1-pro-preview · google-ai-studio · google/gemini-3.1-pro-preview-20260219 ·

OpenRouter standard endpoint (verified): openai/gpt-6.1-terra · openai · openai/gpt-6.1-terra-20261026 ·

OpenRouter cells show a number only when the exact provider model ID and rate basis were checked against this catalog row. Cells marked Not verified have no such evidence. Credit-purchase fees and other OpenRouter plans are separate and are never added to the per-token prices here. OpenRouter pricing and FAQ · FAQ

OpenRouter: OpenAI provider, 1,050,000-token context. Verified base rates apply below 272,000 input tokens per request and matched the catalog vendor fields; they are recorded here. Above that threshold OpenRouter lists higher rates. Batch, Priority and regional endpoints are excluded. OpenRouter: Google AI Studio, 1,048,576-token context. Verified base rates apply below 200,000 input tokens per request for Gemini 3.1 Pro Preview and matched the catalog vendor fields; they are recorded here. Larger requests have different rates. Batch, Priority and regional endpoints are excluded. /pricing

Monthly arithmetic example

At 20M input and 2M output tokens per month, priced at catalog rates:

ModelOfficial list / monthCode By AI / month
Gemini 3.1 Pro Previewgemini-3.1-pro-preview$64.00$6.40
GPT-6.1 Terragpt-6.1-terra$30.00$3.00

Which choice fits which work?

Rows restate catalog arithmetic and official guidance. They are not Code By AI benchmarks or measured speed and quality results.

Kind of workStarting pointBasis
Work that runs in GeminiGemini 3.1 Pro PreviewThis is the native client for Google models on this gateway.
Work that runs in CodexGPT-6.1 TerraThis is the native client for OpenAI models on this gateway.
Input-heavy requests: long prompts, large context, repeated instructionsGPT-6.1 TerraInput rate: Gemini 3.1 Pro Preview $0.20 vs GPT-6.1 Terra $0.10 per 1M tokens.
Output-heavy requests: long code or document generationGPT-6.1 TerraOutput rate: Gemini 3.1 Pro Preview $1.20 vs GPT-6.1 Terra $0.50 per 1M tokens.
Cache-read-heavy requests: repeated prefixes and reused contextGPT-6.1 TerraCache read rate: Gemini 3.1 Pro Preview $0.02 vs GPT-6.1 Terra $0.005 per 1M tokens.

How the integration differs

These are wire-level settings readers must configure, not capability claims.

Model IDsgemini-3.1-pro-preview / gpt-6.1-terra
Gemini setupGemini CLI setup guide · model: gemini-3.1-pro-preview · https://www.codebyai.net/api/agent
Codex setupCodex setup guide · model: gpt-6.1-terra · https://www.codebyai.net/api/agent
ProtocolGemini: Gemini generateContent · Codex: OpenAI Responses — tool calling with GPT-6.1 Terra requires Responses.
Key and balanceBoth use the same Code By AI key and prepaid balance. Configure each native client separately.
What changesThe client settings and protocol change; the base URL, key and balance stay the same.
BillingBoth debit the same prepaid wallet at the per-1M-token rates above. Code By AI does not charge the official list price.

FAQ

Which model is cheaper on Code By AI?
For 1M input plus 1M output tokens, GPT-6.1 Terra is the lower-priced row: Gemini 3.1 Pro Preview costs $0.20 for input plus $1.20 for output on Code By AI, versus GPT-6.1 Terra at $0.10 plus $0.50. Official list rates are $2.00 input / $12.00 output and $1.00 input / $5.00 output per 1M tokens.
Are these the exact API model IDs?
Yes. Use `gemini-3.1-pro-preview` and `gpt-6.1-terra` exactly. The page does not derive IDs by splitting the slug.
Do both models use the same client setup?
They share the Code By AI key and prepaid balance, but not the client protocol: Gemini 3.1 Pro Preview uses Gemini, and GPT-6.1 Terra uses Codex. Configure each client separately.
How are the OpenRouter prices obtained?
The OpenRouter cells show recorded base rates that matched the catalog vendor fields when checked. The dates are listed with the sources below the table. OpenRouter cells show a number only when the exact provider model ID and rate basis were checked against this catalog row. Cells marked Not verified have no such evidence. Credit-purchase fees and other OpenRouter plans are separate and are never added to the per-token prices here.
Does this page measure quality or speed?
No. The scenarios describe client protocols and token mix, not measured quality, speed or SLA results.

Next step

Create a Code By AI account, top up the prepaid wallet and create an API key. Then call the model with the ID and endpoint above.

Code By AI is a third-party prepaid API gateway. It is not an official vendor product.