Gemini 4 API: Neon Pricing, Setup and Code (2026)
Unicorn API Team · · 10 min read
The Gemini 4 API you can call today is Gemini 4 Neon, Google’s 1M-context reasoning model, and you can reach it with one key through an OpenAI-compatible chat completions endpoint. This post covers which Gemini 4 models exist, how the two Neon model IDs differ, what a request actually costs, and working code you can paste into a terminal, a Python script or a Node app.
If you landed here searching for a Gemini 4 release date, Gemini 4 Pro or Gemini 4 Flash, the first section clears up the naming. If you just want to send a request, skip to the code.
What is the Gemini 4 API?
Gemini 4 is Google’s latest generation of large language models (LLMs: neural networks trained on huge amounts of text that read a prompt and generate a reply). Unlike earlier generations, Google has shipped Gemini 4 variants under codenames rather than the familiar “Pro” and “Flash” labels. Three names come up most often:
- Gemini 4 Argon: rolled out from October 2026, first to Pro and Ultra subscribers and paid API users.
- Gemini 4 Carbon: positioned by Google as a reasoning model for complex software engineering, science and long-running agent workflows.
- Gemini 4 Neon: a 1M-context reasoning model for complex coding, analysis and science, with four thinking levels. This is the one on Unicorn API.
So when people say “the Gemini 4 API”, they usually mean programmatic access to one of these variants: you send messages over HTTP and get text back, instead of typing into the Gemini app.
Gemini 4 is not Genie 4
A lot of search results for the Gemini 4 API are actually about Genie 4, a Google DeepMind world model that generates interactive 720p environments with native audio and real-time controls. Genie 4 is served through Google’s Gemini API platform, which is why the names collide. It is a different kind of model entirely: it builds explorable worlds, while Gemini 4 reads text, images, audio or video and returns text. If you want a chatbot, coding assistant or document analyst, you want Gemini 4.
What about Gemini 4 Pro and Gemini 4 Flash?
At the time of writing there is no model called Gemini 4 Pro or Gemini 4 Flash in the Unicorn API catalog. If you were looking for the strongest Gemini 4 model to call by API right now, that is Gemini 4 Neon. New variants appear in the full model catalog as they are added.
Which Gemini 4 models can you call on Unicorn API?
Unicorn API lists Gemini 4 Neon twice, with a release date of 20 November 2026. Both entries are the same underlying model with the same prices. The difference is the route the request takes.
| gemini-4-neon | gemini-4-neon-openai | |
|---|---|---|
| Model page | Gemini 4 Neon | Gemini 4 Neon OpenAI |
| Described as | Native Gemini 4 Neon API | OpenAI-compatible route with streaming, tools and Google Search grounding |
| Context window | 1M tokens | 1M tokens |
| Endpoint on Unicorn API | POST /v1/chat/completions | POST /v1/chat/completions |
| Input / output (credits per 1M tokens) | 240 / 1,200 | 240 / 1,200 |
| Cached input (credits per 1M) | 12 | 12 |
Both accept the same request fields: model, messages, tools, tool_choice, stream, max_tokens, temperature, top_p, stop, response_format and reasoning_effort.
A practical rule: start with gemini-4-neon. Switch to gemini-4-neon-openai when you need Google Search grounding (the model checking live search results before answering), or when you hit a behaviour difference in tool calling and want the OpenAI-shaped route end to end. Because the prices match, switching costs nothing but a string change.

How to call the Gemini 4 API: your first request
You need three things: an API key, the base URL https://api.unicornapi.net, and a model ID. Create a key on the API keys page and export it:
export UNICORN_API_KEY="your-key-here"
curl
This is the smallest useful Gemini 4 API call. It is a plain chat completion, the same shape you would send to any OpenAI-compatible service.
curl https://api.unicornapi.net/v1/chat/completions \
-H "Authorization: Bearer $UNICORN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-4-neon",
"messages": [
{"role": "system", "content": "You are a senior Python reviewer. Be concise."},
{"role": "user", "content": "What is wrong with: def add(items=[]): items.append(1); return items"}
],
"max_tokens": 400
}'
The reply comes back in the standard chat completions format. The text is in choices[0].message.content, and the usage object reports the token counts your credits are debited from.
Python
Since the endpoint is OpenAI-compatible, the official openai package works if you point it at Unicorn API. This is the quickest route for most Gemini 4 API Python projects.
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["UNICORN_API_KEY"],
base_url="https://api.unicornapi.net/v1",
)
response = client.chat.completions.create(
model="gemini-4-neon",
messages=[
{"role": "system", "content": "You are a careful data analyst."},
{"role": "user", "content": "Explain the difference between median and mean income in two sentences."},
],
max_tokens=300,
)
print(response.choices[0].message.content)
print("Tokens used:", response.usage.prompt_tokens, "in,", response.usage.completion_tokens, "out")
If you prefer no SDK, the same call with requests is just a POST with a JSON body:
import os
import requests
r = requests.post(
"https://api.unicornapi.net/v1/chat/completions",
headers={"Authorization": f"Bearer {os.environ['UNICORN_API_KEY']}"},
json={
"model": "gemini-4-neon",
"messages": [{"role": "user", "content": "Write one sentence about unicorns."}],
"max_tokens": 200,
},
timeout=120,
)
r.raise_for_status()
print(r.json()["choices"][0]["message"]["content"])
JavaScript with streaming
Streaming sends the reply token by token so your UI can show text as it arrives, which matters for a reasoning model that may take a while on hard prompts. Here it is with the openai npm package in Node:
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.UNICORN_API_KEY,
baseURL: "https://api.unicornapi.net/v1",
});
const stream = await client.chat.completions.create({
model: "gemini-4-neon-openai",
messages: [
{ role: "user", content: "Outline a migration plan from REST to GraphQL for a 20-endpoint API." },
],
max_tokens: 1500,
stream: true,
});
for await (const chunk of stream) {
process.stdout.write(chunk.choices[0]?.delta?.content ?? "");
}
Want to compare answers before writing code? The browser playground runs the same models with the same key. And if you work in Cursor, Claude Code or another coding agent, the agents setup connects them to Unicorn API over MCP.
Gemini 4 API pricing in credits and dollars
Gemini 4 Neon is billed per token (a token is a chunk of text, roughly three quarters of an English word on average). Unicorn API charges in credits, and the exact cost is debited from the usage the model reports for each request.
| Token type | Credits per 1M tokens | On a monthly plan ($0.01/credit) | With top-ups ($0.015/credit) |
|---|---|---|---|
| Input | 240 | $2.40 | $3.60 |
| Output | 1,200 | $12.00 | $18.00 |
| Cached input | 12 | $0.12 | $0.18 |
Monthly plans give credits at $0.01 each: Starter $25, Creator $50, Studio $100 and Pro $200 per month. Top-ups cost $0.015 per credit and never expire, which suits spiky or occasional usage. Full details are on the pricing page.
Worked example: a code review request
Say you paste a 20,000-token chunk of a codebase into Gemini 4 Neon and ask for a review, and it replies with 2,000 tokens.
- Input: 20,000 ÷ 1,000,000 × 240 = 4.8 credits
- Output: 2,000 ÷ 1,000,000 × 1,200 = 2.4 credits
- Total: 7.2 credits, about $0.072 on a monthly plan or $0.108 with top-ups
Run that review 100 times a day for a month (30 days) and you are at 21,600 credits, or $216 at plan rates. If the same 20,000 tokens of code are sent again and hit the cache, that input drops from 4.8 credits to 0.24 credits per request, a 20x cut on that part of the bill.
Know the price before you run it
Two habits keep the Gemini 4 API predictable. First, always set max_tokens: output tokens cost five times as much as input, so an uncapped reply is where surprise costs come from. Second, Unicorn API can tell you the exact price of a request before you send it via POST /v1/models/price; the request shape is in the API documentation. That is handy for building a cost preview into your own app.

Reasoning effort, tools and the 1M context window
reasoning_effort
Gemini 4 Neon is a reasoning model: it can “think” through a problem internally before writing the answer. The reasoning_effort field picks how much thinking it does, across four levels, with xhigh as the highest. The model page lists every accepted value. More thinking generally helps on multi-step maths, debugging and planning, and it also means more tokens and more waiting. A sensible pattern is a lower level for routine requests and xhigh only for the hard ones:
curl https://api.unicornapi.net/v1/chat/completions \
-H "Authorization: Bearer $UNICORN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-4-neon",
"reasoning_effort": "xhigh",
"messages": [
{"role": "user", "content": "This recursive function overflows the stack for n above 10000. Rewrite it iteratively and prove the output is unchanged."}
],
"max_tokens": 3000
}'
Tools and structured output
Tool calling (also called function calling) lets the model ask your code to run a function, such as a database lookup, and then use the result. You describe functions in tools and control whether the model must call one with tool_choice. For machine-readable replies, response_format asks for JSON, which saves you from parsing prose. Both fields work on either Neon variant, with the same request shapes you would use for any OpenAI-compatible model.
The 1M-token context window
The context window is the total amount of text the model can consider in one request, input and output together. One million tokens is enough for a mid-sized codebase, a long contract bundle or hours of transcripts. Two cautions apply. Big context is billed: a full 1M-token prompt is 240 credits of input on its own, so retrieve the relevant parts when you can. And a huge prompt is not a substitute for a clear question; put your instructions at the end of long documents so they are not buried.
Gemini 4 Neon vs GPT 6.2, Claude Opus 5.5 and DeepSeek
One reason to use the Gemini 4 API through Unicorn API is that switching models is a one-word change. Every model below takes the same chat completions request, so you can test Gemini 4 Neon against the alternatives on your own prompts instead of trusting someone else’s benchmarks.
| Model | Maker | Input (credits / 1M) | Output (credits / 1M) | Cached input (credits / 1M) |
|---|---|---|---|---|
| Gemini 4 Neon | 240 | 1,200 | 12 | |
| GPT 6.2 Astra | OpenAI | 480 | 2,400 | 24 |
| Claude Opus 5.5 | Anthropic | 320 | 1,600 | 32 |
| GPT 6.2 Sol | OpenAI | 120 | 600 | 6 |
| DeepSeek V4.1 Flash | DeepSeek | 24 | 95 | 0.5 |
Reading the table:
- Against the other flagship models, Gemini 4 Neon is the cheapest per token: half the price of GPT 6.2 Astra and three quarters the price of Claude Opus 5.5.
- GPT 6.2 Sol costs half as much as Neon, and DeepSeek V4.1 Flash costs about a tenth on input. For classification, extraction and short summaries, a cheaper model is often good enough.
- Price per token is not price per task. A model that needs fewer retries or shorter answers can win even at a higher rate. Measure cost per finished task on your own workload.
A common setup is routing: send easy requests to DeepSeek V4.1 Flash or GPT 6.2 Sol, and escalate to Gemini 4 Neon when the task needs long context or deep reasoning. With one key and one bill, that is an if statement, not a second vendor account. For the OpenAI side of that comparison, see our post on GPT-6 Astra, Sol and API access.
Common mistakes with the Gemini 4 API
- Confusing Gemini 4 with Genie 4. If a tutorial talks about worlds, frames and real-time controls, it is about Genie 4. You will not get a chatbot out of it.
- Hunting for a “gemini-4-pro” model ID. Gemini 4 uses codenames. On Unicorn API the IDs are
gemini-4-neonandgemini-4-neon-openai. A wrong ID fails the request. - Leaving max_tokens unset. Output is the expensive half of the bill. Cap it to what your feature can actually display.
- Running every request at xhigh. Maximum reasoning is slower and uses more tokens. Reserve it for problems where you have seen it change the answer.
- Re-sending the same long prompt without structure. Keep fixed material such as system prompts and reference documents at the start and identical between calls so it has the best chance of being served from cache at 12 credits per million instead of 240.
- Using the base URL without /v1 in an SDK. Raw HTTP calls go to
https://api.unicornapi.net/v1/chat/completions. OpenAI SDKs append/chat/completionsthemselves, so theirbaseURLshould end in/v1. - Putting user text straight into the system prompt. Prompt injection (text that tries to override your instructions) is a real risk once the model reads emails, web pages or uploads. Keep untrusted content in the user message, label it clearly, and never let the model’s output trigger sensitive tools without a check in your code.
- Picking a model on reputation alone. Run the same 20 to 50 real prompts across Gemini 4 Neon and one or two cheaper models before committing. It takes an afternoon and often halves the bill.
Getting started checklist
To go from zero to a working Gemini 4 API integration:
- Create a key on the keys page and export it as
UNICORN_API_KEY. - Send the curl request above with
modelset togemini-4-neonand confirm you get a reply. - Move the call into your language of choice with the OpenAI SDK and
base_urlset tohttps://api.unicornapi.net/v1. - Set
max_tokens, choose areasoning_effortlevel and log theusageobject for every call. - Switch to
gemini-4-neon-openaiif you need Google Search grounding. - Compare costs against GPT 6.2 Sol or DeepSeek V4.1 Flash for your simpler tasks.
The Gemini 4 API is mostly ordinary chat completions with a very large context window and a dial for how hard the model thinks. Treat it that way, keep an eye on output tokens, and you will have Gemini 4 Neon running in production with the same code you already use for every other model.
Frequently asked questions
When did Gemini 4 come out?
Google started rolling out Gemini 4 Argon in October 2026, first to Pro and Ultra subscribers and paid API users. Gemini 4 Neon followed in November, and it is listed on Unicorn API with a release date of 20 November 2026. If you want to call a Gemini 4 model through Unicorn API today, Neon is the one available, in a native variant and an OpenAI-compatible variant.
How much does the Gemini 4 API cost?
On Unicorn API, Gemini 4 Neon costs 240 credits per million input tokens, 1,200 credits per million output tokens and 12 credits per million cached input tokens. On a monthly plan a credit is $0.01, so that is $2.40 and $12 per million tokens. Top-up credits cost $0.015 each and never expire. You are charged from the token usage the model reports for each request.
How do I use the Gemini 4 API in Python?
Because Unicorn API exposes Gemini 4 Neon through an OpenAI-compatible chat completions endpoint, you can use the official openai Python package. Set base_url to https://api.unicornapi.net/v1, pass your Unicorn API key, and call client.chat.completions.create with model set to gemini-4-neon. Plain HTTP with the requests library works too, since the body is ordinary JSON.
What is the difference between gemini-4-neon and gemini-4-neon-openai?
Both are Gemini 4 Neon with the same 1M-token context and the same prices, and both are called through POST /v1/chat/completions on Unicorn API. gemini-4-neon is listed as the native Gemini 4 Neon API. gemini-4-neon-openai runs the model through an OpenAI-compatible route and its listing calls out streaming, tools and Google Search grounding. Pick the OpenAI variant if you need grounding.
Is Gemini 4 Pro or Gemini 4 Flash available by API?
Google has named Gemini 4 variants with codenames such as Argon, Carbon and Neon rather than the older Pro and Flash labels. At the time of writing, the Unicorn API catalog has no model called Gemini 4 Pro or Gemini 4 Flash. The Gemini 4 model you can call is Gemini 4 Neon. Check the model catalog for new additions.
Is Genie 4 the same as Gemini 4?
No. Genie 4 is a Google DeepMind world model that generates interactive 720p environments you can move through, with native audio. Gemini 4 is Google's family of language and reasoning models that take text, images, audio or video and return text. They share an API platform at Google, which is why search results mix them up, but they solve very different problems.