Gemini 4 Neon API
A fast reasoning model for complex coding, knowledge work, and multimodal understanding.
- Model:
gemini-4-neon - Provider: Google
- Type: chat
POST /v1/chat/completions
Chat Completions
Basic text request
Required parameters: model, messages
Available parameters: model, messages, max_tokens, stream, stream_options
Request parameters
| Parameter | Type | Required | Description |
|---|
model | string | Yes | Use `gemini-4-neon`. Options: gemini-4-neon |
messages | array | Yes | Ordered conversation turns. Each turn contains `role` and `content`. |
max_tokens | integer | No | Output budget for reasoning and visible text. The example sets a per-call budget. |
stream | boolean | No | Defaults to `false` for JSON. Set `true` for SSE. |
stream_options | object | No | Streaming options. |
`MAX_TOKENS` can return only reasoning usage or partial text. After a client timeout, check the original request before sending another one.
Check JSON and fields for HTTP 400, the API key for 401, the account balance for 402, and request frequency for 429. A 5xx status indicates a service error. Streams can also contain error events, so check both the HTTP status and the final event.
Reasoning and visible text share the output budget. Omitted counters are unreported. An explicit zero means the counter is zero.
### Streaming request example
```bash
curl -N -X POST 'https://api.router.ai/v1/chat/completions' \
-H "Authorization: Bearer $API_KEY" \
-H 'Content-Type: application/json' \
--data-raw '{"model":"gemini-4-neon","max_tokens":256,"stream":true,"messages":[{"role":"user","content":"Suggest a name for a fictional paper sailboat."}],"stream_options":{"include_usage":true}}'
```
Neon requests can take longer. An SSE response with HTTP 200 can carry only a finish event or usage, so check that visible text arrived.
Verified 2026-11-26. [Google model reference](https://aistudio.google.com/docs/models/gemini-4-neon)
Request example
curl -X POST 'https://api.router.ai/v1/chat/completions' \
-H "Authorization: Bearer $API_KEY" \
-H 'Content-Type: application/json' \
--data-raw '{"model":"gemini-4-neon","max_tokens":256,"stream":false,"messages":[{"role":"user","content":"Suggest a name for a fictional paper sailboat."}]}'
Endpoint reference: Create a chat completion (OpenAI-compatible)
POST /v1/responses
Responses
Basic text request
Required parameters: model, input
Available parameters: model, input, max_output_tokens, stream
Request parameters
| Parameter | Type | Required | Description |
|---|
model | string | Yes | Use `gemini-4-neon`. Options: gemini-4-neon |
input | string | Yes | Input text. This example uses a plain string. |
max_output_tokens | integer | No | Output budget for reasoning and visible text. The example sets a per-call budget. |
stream | boolean | No | Defaults to `false` for JSON. Set `true` for SSE. |
`MAX_TOKENS` can return only reasoning usage or partial text. After a client timeout, check the original request before sending another one.
Check JSON and fields for HTTP 400, the API key for 401, the account balance for 402, and request frequency for 429. A 5xx status indicates a service error. Streams can also contain error events, so check both the HTTP status and the final event.
Reasoning and visible text share the output budget. Omitted counters are unreported. An explicit zero means the counter is zero.
### Streaming request example
```bash
curl -N -X POST 'https://api.router.ai/v1/responses' \
-H "Authorization: Bearer $API_KEY" \
-H 'Content-Type: application/json' \
--data-raw '{"model":"gemini-4-neon","max_output_tokens":256,"stream":true,"input":"Suggest a name for a fictional paper sailboat."}'
```
Neon requests can take longer. An SSE response with HTTP 200 can carry only a finish event or usage, so check that visible text arrived.
Verified 2026-11-26. [Google model reference](https://aistudio.google.com/docs/models/gemini-4-neon)
Request example
curl -X POST 'https://api.router.ai/v1/responses' \
-H "Authorization: Bearer $API_KEY" \
-H 'Content-Type: application/json' \
--data-raw '{"model":"gemini-4-neon","max_output_tokens":256,"stream":false,"input":"Suggest a name for a fictional paper sailboat."}'
POST /v1/messages
Messages
Basic text request
Required parameters: model, messages, max_tokens
Available parameters: model, messages, max_tokens, stream, system
Request parameters
| Parameter | Type | Required | Description |
|---|
model | string | Yes | Use `gemini-4-neon`. Options: gemini-4-neon |
messages | array | Yes | Ordered conversation turns. Each turn contains `role` and `content`. |
max_tokens | integer | Yes | Output budget for reasoning and visible text. The example sets a per-call budget. |
stream | boolean | No | Defaults to `false` for JSON. Set `true` for SSE. |
system | string | No | Optional top-level system instruction. |
`MAX_TOKENS` can return only reasoning usage or partial text. After a client timeout, check the original request before sending another one.
Check JSON and fields for HTTP 400, the API key for 401, the account balance for 402, and request frequency for 429. A 5xx status indicates a service error. Streams can also contain error events, so check both the HTTP status and the final event.
Reasoning and visible text share the output budget. Omitted counters are unreported. An explicit zero means the counter is zero.
### Streaming request example
```bash
curl -N -X POST 'https://api.router.ai/v1/messages' \
-H "Authorization: Bearer $API_KEY" \
-H 'Content-Type: application/json' \
-H 'anthropic-version: 2023-06-01' \
--data-raw '{"model":"gemini-4-neon","max_tokens":256,"stream":true,"messages":[{"role":"user","content":"Suggest a name for a fictional paper sailboat."}]}'
```
Neon requests can take longer. An SSE response with HTTP 200 can carry only a finish event or usage, so check that visible text arrived.
Verified 2026-11-26. [Google model reference](https://aistudio.google.com/docs/models/gemini-4-neon)
Request example
curl -X POST 'https://api.router.ai/v1/messages' \
-H "Authorization: Bearer $API_KEY" \
-H 'Content-Type: application/json' \
-H 'anthropic-version: 2023-06-01' \
--data-raw '{"model":"gemini-4-neon","max_tokens":256,"stream":false,"messages":[{"role":"user","content":"Suggest a name for a fictional paper sailboat."}]}'
Endpoint reference: Create a message (Claude native)
POST /v1beta/models/gemini-4-neon:generateContent
Gemini native generation · v1beta
Basic text request
Required parameters: contents
Available parameters: contents, generationConfig, systemInstruction
Request parameters
| Parameter | Type | Required | Description |
|---|
contents | array | Yes | Ordered turns. Text requests use `contents[].parts[].text`. |
generationConfig | object | No | Generation settings. `maxOutputTokens` controls the combined text and reasoning budget. |
systemInstruction | object | No | Optional system instruction using `parts[].text`. |
`MAX_TOKENS` can return only reasoning usage or partial text. After a client timeout, check the original request before sending another one.
When a native function call includes `thoughtSignature`, return the original model parts and the matching `functionResponse` in order, with the signature intact. Cross-account signature portability is unverified.
Check JSON and fields for HTTP 400, the API key for 401, the account balance for 402, and request frequency for 429. A 5xx status indicates a service error. Streams can also contain error events, so check both the HTTP status and the final event.
Reasoning and visible text share the output budget. Omitted counters are unreported. An explicit zero means the counter is zero.
Neon requests can take longer. An SSE response with HTTP 200 can carry only a finish event or usage, so check that visible text arrived.
Verified 2026-11-26. [Google model reference](https://aistudio.google.com/docs/models/gemini-4-neon)
Request example
curl -X POST 'https://api.router.ai/v1beta/models/gemini-4-neon:generateContent' \
-H "x-goog-api-key: $API_KEY" \
-H 'Content-Type: application/json' \
--data-raw '{"contents":[{"role":"user","parts":[{"text":"Suggest a name for a fictional paper sailboat."}]}],"generationConfig":{"maxOutputTokens":192,"thinkingConfig":{"thinkingLevel":"LOW"}}}'
POST /v1beta/models/gemini-4-neon:streamGenerateContent
Gemini native streaming · v1beta
Basic text request
Required parameters: contents
Available parameters: contents, generationConfig, systemInstruction
Request parameters
| Parameter | Type | Required | Description |
|---|
contents | array | Yes | Ordered turns. Text requests use `contents[].parts[].text`. |
generationConfig | object | No | Generation settings. `maxOutputTokens` controls the combined text and reasoning budget. |
systemInstruction | object | No | Optional system instruction using `parts[].text`. |
`MAX_TOKENS` can return only reasoning usage or partial text. After a client timeout, check the original request before sending another one.
When a native function call includes `thoughtSignature`, return the original model parts and the matching `functionResponse` in order, with the signature intact. Cross-account signature portability is unverified.
Check JSON and fields for HTTP 400, the API key for 401, the account balance for 402, and request frequency for 429. A 5xx status indicates a service error. Streams can also contain error events, so check both the HTTP status and the final event.
Reasoning and visible text share the output budget. Omitted counters are unreported. An explicit zero means the counter is zero.
### SSE event format
```text
data: {"candidates":[{"index":0,"content":{"role":"model","parts":[{"text":"Paper Finch"}]},"finishReason":"STOP"}],"usageMetadata":{"promptTokenCount":24,"candidatesTokenCount":7,"thoughtsTokenCount":9,"totalTokenCount":40},"modelVersion":"gemini-4-neon","responseId":"example_gemini_response_001"}
```
Neon requests can take longer. An SSE response with HTTP 200 can carry only a finish event or usage, so check that visible text arrived.
Verified 2026-11-26. [Google model reference](https://aistudio.google.com/docs/models/gemini-4-neon)
Request example
curl -N -X POST 'https://api.router.ai/v1beta/models/gemini-4-neon:streamGenerateContent?alt=sse' \
-H "x-goog-api-key: $API_KEY" \
-H 'Content-Type: application/json' \
--data-raw '{"contents":[{"role":"user","parts":[{"text":"Suggest a name for a fictional paper sailboat."}]}],"generationConfig":{"maxOutputTokens":192,"thinkingConfig":{"thinkingLevel":"LOW"}}}'
POST /v1/models/gemini-4-neon:generateContent
Gemini native generation · v1
Basic text request
Required parameters: contents
Available parameters: contents, generationConfig, systemInstruction
Request parameters
| Parameter | Type | Required | Description |
|---|
contents | array | Yes | Ordered turns. Text requests use `contents[].parts[].text`. |
generationConfig | object | No | Generation settings. `maxOutputTokens` controls the combined text and reasoning budget. |
systemInstruction | object | No | Optional system instruction using `parts[].text`. |
`MAX_TOKENS` can return only reasoning usage or partial text. After a client timeout, check the original request before sending another one.
When a native function call includes `thoughtSignature`, return the original model parts and the matching `functionResponse` in order, with the signature intact. Cross-account signature portability is unverified.
Check JSON and fields for HTTP 400, the API key for 401, the account balance for 402, and request frequency for 429. A 5xx status indicates a service error. Streams can also contain error events, so check both the HTTP status and the final event.
Reasoning and visible text share the output budget. Omitted counters are unreported. An explicit zero means the counter is zero.
Neon requests can take longer. An SSE response with HTTP 200 can carry only a finish event or usage, so check that visible text arrived.
Verified 2026-11-26. [Google model reference](https://aistudio.google.com/docs/models/gemini-4-neon)
Request example
curl -X POST 'https://api.router.ai/v1/models/gemini-4-neon:generateContent' \
-H "x-goog-api-key: $API_KEY" \
-H 'Content-Type: application/json' \
--data-raw '{"contents":[{"role":"user","parts":[{"text":"Suggest a name for a fictional paper sailboat."}]}],"generationConfig":{"maxOutputTokens":192,"thinkingConfig":{"thinkingLevel":"LOW"}}}'
POST /v1/models/gemini-4-neon:streamGenerateContent
Gemini native streaming · v1
Basic text request
Required parameters: contents
Available parameters: contents, generationConfig, systemInstruction
Request parameters
| Parameter | Type | Required | Description |
|---|
contents | array | Yes | Ordered turns. Text requests use `contents[].parts[].text`. |
generationConfig | object | No | Generation settings. `maxOutputTokens` controls the combined text and reasoning budget. |
systemInstruction | object | No | Optional system instruction using `parts[].text`. |
`MAX_TOKENS` can return only reasoning usage or partial text. After a client timeout, check the original request before sending another one.
When a native function call includes `thoughtSignature`, return the original model parts and the matching `functionResponse` in order, with the signature intact. Cross-account signature portability is unverified.
Check JSON and fields for HTTP 400, the API key for 401, the account balance for 402, and request frequency for 429. A 5xx status indicates a service error. Streams can also contain error events, so check both the HTTP status and the final event.
Reasoning and visible text share the output budget. Omitted counters are unreported. An explicit zero means the counter is zero.
### SSE event format
```text
data: {"candidates":[{"index":0,"content":{"role":"model","parts":[{"text":"Paper Finch"}]},"finishReason":"STOP"}],"usageMetadata":{"promptTokenCount":24,"candidatesTokenCount":7,"thoughtsTokenCount":9,"totalTokenCount":40},"modelVersion":"gemini-4-neon","responseId":"example_gemini_response_001"}
```
Neon requests can take longer. An SSE response with HTTP 200 can carry only a finish event or usage, so check that visible text arrived.
Verified 2026-11-26. [Google model reference](https://aistudio.google.com/docs/models/gemini-4-neon)
Request example
curl -N -X POST 'https://api.router.ai/v1/models/gemini-4-neon:streamGenerateContent?alt=sse' \
-H "x-goog-api-key: $API_KEY" \
-H 'Content-Type: application/json' \
--data-raw '{"contents":[{"role":"user","parts":[{"text":"Suggest a name for a fictional paper sailboat."}]}],"generationConfig":{"maxOutputTokens":192,"thinkingConfig":{"thinkingLevel":"LOW"}}}'