# Gemini 4 Neon

Use `gemini-4-neon` with the native Gemini format. The [model page](https://seedrouter.ai/models/gemini-4-neon#playground) includes the Playground and current prices. Gemini 4 Neon sits between [Gemini 4 Hydrogen](https://seedrouter.ai/docs/gemini-4-hydrogen) and [Gemini 4 Carbon](https://seedrouter.ai/docs/gemini-4-carbon) and uses the same native `generateContent` request format; Google's migration guide says moving between Gemini 4 models requires no request schema changes.

## Model ID

| Model ID        | Context window                                         | Default effort |
| --------------- | ------------------------------------------------------ | -------------- |
| `gemini-4-neon` | 1,048,576 tokens, shared by input, thinking and output | `high`         |

Use `gemini-4-neon` for the Default tier, or select an explicit `gemini-4-neon:GROUP_NAME` tier returned by model discovery. Check your available tiers before sending requests.

## Quick example

```bash
curl https://api.seedrouter.ai/v1beta/models/gemini-4-neon:generateContent \
  -H "Authorization: Bearer $SEEDROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"contents":[{"role":"user","parts":[{"text":"Audit this payment retry queue for race conditions and propose lock acquisition steps."}]}],"generationConfig":{"thinkingConfig":{"thinkingLevel":"high"},"maxOutputTokens":65536}}'
```

```python
import json
import os
from urllib.request import Request, urlopen

body = {
    "contents": [{"role": "user", "parts": [{"text": "Audit this payment retry queue for race conditions and propose lock acquisition steps."}]}],
    "generationConfig": {"thinkingConfig": {"thinkingLevel": "high"}, "maxOutputTokens": 65536},
}
request = Request(
    "https://api.seedrouter.ai/v1beta/models/gemini-4-neon:generateContent",
    data=json.dumps(body).encode(),
    headers={"Authorization": f"Bearer {os.environ['SEEDROUTER_API_KEY']}", "Content-Type": "application/json"},
    method="POST",
)
with urlopen(request, timeout=1200) as response:
    print(json.load(response))
```

```javascript
const response = await fetch(
  "https://api.seedrouter.ai/v1beta/models/gemini-4-neon:generateContent",
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${process.env.SEEDROUTER_API_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      contents: [{ role: "user", parts: [{ text: "Audit this payment retry queue for race conditions and propose lock acquisition steps." }] }],
      generationConfig: { thinkingConfig: { thinkingLevel: "high" }, maxOutputTokens: 65536 },
    }),
  },
);
if (!response.ok) throw new Error(await response.text());
console.log(await response.json());
```

```go
package main

import (
    "bytes"
    "fmt"
    "io"
    "net/http"
    "os"
    "time"
)

func main() {
    body := []byte(`{"contents":[{"role":"user","parts":[{"text":"Audit this payment retry queue for race conditions and propose lock acquisition steps."}]}],"generationConfig":{"thinkingConfig":{"thinkingLevel":"high"},"maxOutputTokens":65536}}`)
    req, err := http.NewRequest("POST", "https://api.seedrouter.ai/v1beta/models/gemini-4-neon:generateContent", bytes.NewReader(body))
    if err != nil { panic(err) }
    req.Header.Set("Authorization", "Bearer " + os.Getenv("SEEDROUTER_API_KEY"))
    req.Header.Set("Content-Type", "application/json")
    client := &http.Client{Timeout: 20 * time.Minute}
    resp, err := client.Do(req)
    if err != nil { panic(err) }
    defer resp.Body.Close()
    out, err := io.ReadAll(resp.Body)
    if err != nil { panic(err) }
    fmt.Println(string(out))
}
```

The model belongs in the URL. `contents` is required. An answer includes native `candidates`, `finishReason` and `usageMetadata`; retain complete content parts, including `thoughtSignature`, for conversation history. Hard prompts can run for several minutes. Google recommends a 20-minute client timeout. Use streaming to receive output as it becomes available.

## Endpoints

| Operation          | Endpoint                                                          |
| ------------------ | ----------------------------------------------------------------- |
| JSON response      | `POST /v1beta/models/gemini-4-neon:generateContent`               |
| Server-sent events | `POST /v1beta/models/gemini-4-neon:streamGenerateContent?alt=sse` |

The [OpenAPI specification](https://seedrouter.ai/docs/gemini-4-neon.openapi.json) includes every nested request and response schema. Optional fields use API defaults when omitted. The public native API preserves the submitted body for Gemini validation. The Playground also checks documented constraints before submission and enforces its safety settings.

## Request parameters

The URL fixes the model to `gemini-4-neon`. The request contract contains 11 top-level fields. Fields are optional unless marked required; omission differs from JSON `null`. Nullable arbitrary JSON is preserved where the official schema permits it.

| Field               | Type      | Required | Default and constraints                                                                                                     |
| ------------------- | --------- | -------- | --------------------------------------------------------------------------------------------------------------------------- |
| `contents`          | object\[] | Yes      | Nonempty conversation; each content has nonempty `parts`                                                                    |
| `systemInstruction` | object    | No       | Text-only parts; no automatic user identity is inserted                                                                     |
| `generationConfig`  | object    | No       | Generation parameters in the next table                                                                                     |
| `tools`             | object\[] | No       | Function declarations and built-in tool configurations                                                                      |
| `toolConfig`        | object    | No       | Function selection and retrieval configuration                                                                              |
| `safetySettings`    | object\[] | No       | One setting per category; no duplicate categories                                                                           |
| `serviceTier`       | string    | No       | `unspecified`, `standard`, `flex`, `priority`; ordinary processing is standard                                              |
| `continuationToken` | string    | No       | Token returned with `finishReason: CONTINUATION` or `MAX_TOKENS`; resend the same request with it to continue a long answer |
| `labels`            | object    | No       | String values; lowercase keys/values, maximum 63 Unicode codepoints each                                                    |
| `model`             | string    | No       | Optional resource name; the URL determines the actual model                                                                 |
| `store`             | boolean   | No       | Generic request storage preference; model-specific effect unverified                                                        |

Explicit context caching (`cachedContent` and `cachedContents` resources) is not supported on Gemini 4 Neon. Implicit caching is on by default for prompts of at least 4,096 tokens.

### Generation parameters

| Field in `generationConfig`  | Type      | Default and constraints                                                                                                                                                                                                                                                                           |
| ---------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `maxOutputTokens`            | integer   | Default 65,536, including thinking. Up to 1,048,576 minus input with continuation. Each streaming or non-streaming response supports up to 65,536 tokens; use continuation for longer output                                                                                                      |
| `thinkingConfig`             | object    | `thinkingLevel`: `low`, `medium`, `high`, `xhigh` (default `high`); uppercase spellings accepted. `includeThoughts`: boolean, default false. Use `thinkingLevel`; the deprecated `thinkingBudget` maps to a level when supplied alone with a warning, and cannot be combined with `thinkingLevel` |
| `stopSequences`              | string\[] | Maximum five sequences                                                                                                                                                                                                                                                                            |
| `responseMimeType`           | string    | Default `text/plain`; legacy JSON schema output requires `application/json`                                                                                                                                                                                                                       |
| `responseSchema`             | object    | Official schema dialect; mutually exclusive with `responseJsonSchema`                                                                                                                                                                                                                             |
| `responseJsonSchema`         | JSON      | JSON Schema; mutually exclusive with `responseSchema`                                                                                                                                                                                                                                             |
| `responseFormat`             | object    | Text format configuration; `text.mimeType` and optional `text.schema`. Schema requires JSON MIME type                                                                                                                                                                                             |
| `responseModalities`         | string\[] | Text only: `TEXT`; empty means text                                                                                                                                                                                                                                                               |
| `mediaResolution`            | enum      | `MEDIA_RESOLUTION_UNSPECIFIED`, `LOW`, `MEDIUM`, `HIGH` with the `MEDIA_RESOLUTION_` prefix                                                                                                                                                                                                       |
| `seed`                       | integer   | Signed 32-bit value; model-specific deterministic behavior unverified                                                                                                                                                                                                                             |
| `presencePenalty`            | number    | Generic field; model-specific effect/range unverified                                                                                                                                                                                                                                             |
| `frequencyPenalty`           | number    | Generic field; model-specific effect/range unverified                                                                                                                                                                                                                                             |
| `responseLogprobs`           | boolean   | Generic field; model-specific availability unverified                                                                                                                                                                                                                                             |
| `logprobs`                   | integer   | 0–20; requires `responseLogprobs: true`; model support unverified                                                                                                                                                                                                                                 |
| `enableEnhancedCivicAnswers` | boolean   | Generic field; model support unverified                                                                                                                                                                                                                                                           |
| `enableAffectiveDialog`      | boolean   | Generic field; model support unverified                                                                                                                                                                                                                                                           |
| `audioTranscriptionConfig`   | object    | Generic field; model-specific options unverified                                                                                                                                                                                                                                                  |
| `translationConfig`          | object    | Generic field; model-specific options unverified                                                                                                                                                                                                                                                  |

The [OpenAPI document](https://seedrouter.ai/docs/gemini-4-neon.openapi.json) lists nested types, enums, required properties and documented bounds for every message, including `audioMetadata`, `documentMetadata`, `spreadsheetMetadata` and `videoMetadata.contentLayers` from the v1beta discovery specification. The schemas describe official parameters; they are not a SeedRouter request allowlist. Caller-supplied fields and values are preserved. A field accepted by the schema is not proof of support for every account. `minimal` thinking is not a listed level. Google says `temperature`, `topP`, `topK` and `candidateCount` are deprecated and should be removed; in-range custom sampling values are ignored and out-of-range values return 400. If submitted in native JSON, they still pass through unchanged for the Gemini API to handle.

## Long decode

One Gemini 4 Neon response returns up to 65,536 tokens when streaming and up to 65,536 tokens without streaming. To go further, set `maxOutputTokens` above 65,536 and continue the answer yourself:

1. Send the request. If the response ends with `finishReason: "CONTINUATION"`, read `candidates[0].continuationToken`.
2. Send the **same** request again with that value in the top-level `continuationToken` field. Do not append the partial output to `contents`; the token carries the model's state, including its thinking.
3. Repeat until `finishReason` is `STOP` or `MAX_TOKENS`. If a call hits `MAX_TOKENS` and returns a `continuationToken`, you can resume only by increasing `maxOutputTokens`; repeating the same cap returns `400 INVALID_ARGUMENT`.

```json
{
  "contents": [{"role": "user", "parts": [{"text": "Generate a complete multi-module migration specification and verification checklist for this payment service."}]}],
  "generationConfig": {"thinkingConfig": {"thinkingLevel": "high"}, "maxOutputTokens": 262144},
  "continuationToken": "TOKEN_FROM_THE_PREVIOUS_RESPONSE"
}
```

A hop spent entirely on thinking can return empty text with `CONTINUATION`; that is normal progress. Each hop sends your prompt plus everything generated so far back to the model, so input tokens are counted again in every later hop (with repeated prefixes eligible for implicit caching). SeedRouter bills each hop as its own request. The Interactions API's server-side `background` mode is not part of this endpoint.

## Structured output

```json
{
  "contents": [{"parts": [{"text": "Return a JSON object with ok set to true."}]}],
  "generationConfig": {
    "thinkingConfig": {"thinkingLevel": "low"},
    "maxOutputTokens": 65536,
    "responseMimeType": "application/json",
    "responseJsonSchema": {
      "type": "object",
      "properties": {"ok": {"type": "boolean"}},
      "required": ["ok"]
    }
  }
}
```

The legacy `responseSchema` and `responseJsonSchema` fields cannot be used together. Both require `responseMimeType: "application/json"`. The newer `responseFormat.text` schema must likewise specify JSON. Use REST enum spellings (`APPLICATION_JSON` and `TEXT_PLAIN`) in that message. Requests pass through unchanged; media MIME types and arbitrary function JSON are not rewritten.

## Functions and built-in tools

Use `tools[].functionDeclarations` with a name and either `parameters` or `parametersJsonSchema`, not both. Function selection lives in `toolConfig.functionCallingConfig`; `allowedFunctionNames` requires `ANY` or `VALIDATED` and declared names. Do not ask the model via system instructions to emit raw-text JSON tool calls without declared tools, which can return `MALFORMED_FUNCTION_CALL`.

Your application executes returned functions and supplies their results in the next conversation turn. Preserve each original `thoughtSignature`, function call and function response. Do not copy a thought signature across parallel `functionCall` parts, and do not round numeric identifiers when serializing opaque function arguments.

Google lists Search, Maps, code execution, URL context, File Search and Computer Use for Gemini 4 Neon. File Search resources require access under the credentials serving the request. Native MCP configuration appears in the generic schema, but its availability for this model is not established. Check the official restrictions for each tool before combining it with media. With grounding, Google counts internal tool instructions and function declarations as input tokens. The Playground does not execute your custom functions.

## Multimodal input and safety

A `contents[].parts[]` item contains exactly one payload: text, inline media, a file reference, a function call/response, or an execution part. It may also carry a signature or media metadata (`videoMetadata`, `audioMetadata`, `documentMetadata`, `spreadsheetMetadata`, `mediaResolution`, `mediaProcessing`). Input supports text, images, audio, video and PDFs; output is text only. The model has no image or audio generation and no Live API.

For inline bytes, use `inlineData.mimeType` and base64 `data`. For file references, use `fileData.mimeType` and `fileUri`. A syntactically valid URL is not proof the model can retrieve it. Video metadata can specify `startOffset`, `endOffset`, a positive `fps` no greater than 24, and `contentLayers`. Agentic video understanding is selected per part with `mediaProcessing: "AGENTIC"` next to the video's `fileData` or `inlineData`; static processing is the default.

Safety settings use the official native format and pass through the API unchanged. In the Playground, all four categories must be set to `BLOCK_MEDIUM_AND_ABOVE` or stricter; lower thresholds are available through the API only.

## JSON responses and streaming

`generateContent` returns native JSON. `streamGenerateContent?alt=sse` emits native JSON in SSE `data:` events. Important fields include `candidates[].content.parts`, `finishReason`, `continuationToken`, `safetyRatings`, `groundingMetadata`, `promptFeedback`, `modelVersion`, `responseId` and `usageMetadata`.

Retain complete native content in conversation history. Thinking summaries are not the same as thought signatures. A disconnect does not prove generation failed or completed; inspect the partial result and account record before sending another request. Stream usage is cumulative, so use the latest counters instead of summing every chunk.

## Usage and pricing

`promptTokenCount` includes cached input. `cachedContentTokenCount` is charged at the cached-input rate, rather than charged again as uncached input. Billable output includes `candidatesTokenCount` plus `thoughtsTokenCount`. Gemini 4 Neon defaults to `high` thinking. Set the level explicitly when comparing its usage with another model.

There is no context-length price step for this model. Current SeedRouter prices use Standard token rates; Flex discounts and Priority surcharges have not been configured for this integration. Support for those processing tiers still requires verification. Google Search grounding can add per-query charges beyond token usage; check tool pricing before enabling it. Failed requests are not charged. See the [live pricing table](https://seedrouter.ai/models/gemini-4-neon#pricing).

## Account groups

The Default tier uses the bare `gemini-4-neon` model ID. Additional tiers use `gemini-4-neon:GROUP_NAME` in the URL. The Playground selects an available tier; the API also accepts an explicit header:

```http
X-SeedRouter-Group: GROUP_NAME
```

The chosen group determines the price and available capacity; an explicit selection does not silently switch to another group. Omit the header or use `auto` to keep the API key's default behavior.

Check your API key's available groups without generating a response:

```bash
curl "https://api.seedrouter.ai/api/seedrouter/llm/groups?model=gemini-4-neon" \
  -H "Authorization: Bearer YOUR_SEEDROUTER_KEY"
```

## Verification status

Official documentation and REST discovery revision `20261119` were checked on November 20, 2026. On that date, read-only model discovery (`GET /v1/models`), group discovery (`GET /api/seedrouter/llm/groups?model=gemini-4-neon`) and public pricing (`GET /v1/pricing`) confirmed both the Default `gemini-4-neon` tier and the explicit `gemini-4-neon:googlellm-vertext` tier. Three single-attempt paid smoke calls through `api.seedrouter.ai` also completed with HTTP 200: JSON generation with `low` thinking on Default (54 prompt, 28 output, 39 thinking tokens), SSE streaming with `xhigh` thinking on Default (50 prompt, 13 output, 207 thinking tokens), and a declared `functionCall` with `low` thinking on `gemini-4-neon:googlellm-vertext` (95 prompt, 22 output, 49 thinking tokens, returning `thoughtSignature`). Native body pass-through and response-field allowlisting require deploying the updated backend build. Media understanding, grounding, Computer Use, continuation/long decode, other generic fields and processing tiers remain unverified, and these checks do not establish comparative quality or latency.

## References

* [Google model specification](https://aistudio.google.com/docs/models/gemini-4-neon)
* [What's new in Gemini 4 Neon](https://aistudio.google.com/docs/whats-new-gemini-4-neon)
* [Long decode with generateContent](https://aistudio.google.com/docs/long-decode?generate-content=true)
* [Thinking](https://aistudio.google.com/docs/thinking)
* [Pricing](https://aistudio.google.com/docs/pricing#gemini-4-neon)
* [GenerateContent REST reference](https://ai.google.dev/api/generate-content)
