Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 15 additions & 13 deletions content/docs/ai-gateway/gemini.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ summary: >-
streamGenerateContent APIs through Neon AI Gateway. Use the google-genai SDK
with a custom base URL.
enableTableOfContents: true
updatedOn: '2026-11-18T00:17:54.883Z'
updatedOn: '2026-11-20T16:51:06.128Z'
---

The Gemini endpoint exposes the [Google Gemini API](https://ai.google.dev/api/generate-content) through Neon AI Gateway. Use it when you're already working with the `google-genai` SDK and want to keep your existing code. For most use cases, the [chat completions](/docs/ai-gateway/chat-completions) endpoint is simpler to set up and works with Gemini models via the OpenAI SDK.
Expand Down Expand Up @@ -34,18 +34,20 @@ NEON_AI_GATEWAY_BASE_URL=https://br-winter-pond-aptw82ef-api.ai.c-2.us-east-2.aw

This endpoint accepts Google models only:

| Model ID | Notes |
| ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `gemini-4-carbon` | Supports `temperature` and `thinkingConfig.thinkingLevel` on this endpoint, but not on [chat completions](/docs/ai-gateway/chat-completions#switching-models). |
| `gemini-4-argon` | Supports `temperature` and `thinkingConfig.thinkingLevel` on this endpoint, but not on [chat completions](/docs/ai-gateway/chat-completions#switching-models). |
| `gemini-3-8-flash` | |
| `gemini-3-7-flash` | |
| `gemini-3-6-flash` | |
| `gemini-3-5-flash` | |
| `gemini-3-5-flash-lite` | |
| `gemini-3-1-pro` | |
| `gemini-3-1-flash-lite` | |
| `gemini-3-flash` | |
| Model ID | Notes |
| ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `gemini-4-carbon` | Supports `temperature` and `thinkingConfig.thinkingLevel` on this endpoint, but not on [chat completions](/docs/ai-gateway/chat-completions#switching-models). |
| `gemini-4-argon` | Supports `temperature` and `thinkingConfig.thinkingLevel` on this endpoint, but not on [chat completions](/docs/ai-gateway/chat-completions#switching-models). |
| `gemini-3-pro-image` | Generates images. On [chat completions](/docs/ai-gateway/chat-completions), the image comes back as an `image_url` content block. |
| `gemini-3-1-flash-image` | Generates images. On [chat completions](/docs/ai-gateway/chat-completions), the image comes back as an `image_url` content block. |
| `gemini-3-8-flash` | |
| `gemini-3-7-flash` | |
| `gemini-3-6-flash` | |
| `gemini-3-5-flash` | |
| `gemini-3-5-flash-lite` | |
| `gemini-3-1-pro` | |
| `gemini-3-1-flash-lite` | |
| `gemini-3-flash` | |

Sending a non-Google model ID returns `400 model "<model-id>" is not available on the gemini_generate_content endpoint`, naming whichever model you sent. Use the [chat completions endpoint](/docs/ai-gateway/chat-completions) if you want to call Gemini models alongside other providers from the same code.

Expand Down
9 changes: 8 additions & 1 deletion content/docs/ai-gateway/models.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ summary: >-
models, which endpoint to use, shorter and longer request paths, the
/v1/models API, rate limits, pricing, and provider terms.
enableTableOfContents: true
updatedOn: '2026-11-18T00:17:54.883Z'
updatedOn: '2026-11-20T16:51:06.128Z'
---

This page covers how to call models through Neon AI Gateway and the rules that apply. For the full list of models you can call, see the [model catalog](https://neon.com/ai-gateway#models).
Expand Down Expand Up @@ -86,6 +86,7 @@ All paths below are appended to your branch's bare AI Gateway host (`NEON_AI_GAT
On `/v1/chat/completions`, `message.content` is a plain string for most models. For the models below, the gateway returns an array of typed content blocks instead. This is a known gateway issue that we're fixing.

- `gemini-3-7-flash`, `gemini-3-8-flash`, `gemini-4-argon`, and `gemini-4-carbon` return an array on every non-streaming response, even for a trivial prompt. Their streamed `delta.content` values are strings, with `null` on the final chunk.
- `gemini-3-pro-image` and `gemini-3-1-flash-image` return an array on every non-streaming response, and some streamed `delta.content` values are arrays too. When the model generates an image, the array includes an `image_url` block with the image as a base64 `data:image/png` URL.
- `claude-opus-5-5`, `claude-haiku-5-5`, `claude-fable-5-1`, and `claude-fable-5-2` return an array whenever the model reasons and a string when it doesn't. They decide on their own when to reason, so even a trivial prompt can return an array. When they reason while streaming, some `delta.content` values are arrays too. A low `max_tokens` value can cut a response off before the `text` block appears, leaving only a `reasoning` block.

The arrays have these shapes:
Expand All @@ -96,6 +97,12 @@ The arrays have these shapes:
{ type: 'text', text: '...', thoughtSignature: '...' },
];

// Gemini image models, when they generate an image
[
{ type: 'reasoning', summary: [...] },
{ type: 'image_url', image_url: { url: 'data:image/png;base64,...' } },
];

// Claude models, once they reason
[
{ type: 'reasoning', summary: [...] },
Expand Down
5 changes: 3 additions & 2 deletions content/docs/ai-gateway/openai-responses.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ summary: >-
AI Gateway. Required for codex model variants, which do not work with the
chat completions endpoint.
enableTableOfContents: true
updatedOn: '2026-11-10T18:56:17.167Z'
updatedOn: '2026-11-20T16:51:06.128Z'
---

The OpenAI Responses endpoint exposes the [OpenAI Responses API](https://platform.openai.com/docs/api-reference/responses) through Neon AI Gateway. Use it with the OpenAI SDK's `responses.create()` method by changing only the `baseURL`.
Expand Down Expand Up @@ -37,6 +37,7 @@ This endpoint accepts OpenAI models only:
| Model ID | Notes |
| --------------- | ---------------------- |
| `gpt-6-astra` | |
| `gpt-6-1-terra` | |
| `gpt-6-1-sol` | |
| `gpt-6-sol` | |
| `gpt-6-luna` | |
Expand Down Expand Up @@ -173,7 +174,7 @@ const result = streamText({
return result.toUIMessageStreamResponse();
```

AI SDK `generateImage()` is not supported by AI Gateway; image generation is available only through this Responses tool.
AI SDK `generateImage()` is not supported by AI Gateway. For OpenAI image models, use this Responses tool. The Google image models, `gemini-3-pro-image` and `gemini-3-1-flash-image`, generate images on [chat completions](/docs/ai-gateway/chat-completions) and the [Gemini endpoint](/docs/ai-gateway/gemini) instead.

## Error handling

Expand Down
141 changes: 135 additions & 6 deletions src/app/models.json/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -2139,6 +2139,62 @@
}
}
},
"gpt-6-1-terra": {
"id": "gpt-6-1-terra",
"name": "GPT-6.1 Terra",
"lab": "openai",
"provider": "databricks",
"family": "gpt-terra",
"released": true,
"attachment": true,
"reasoning": true,
"reasoning_options": [
{
"type": "effort",
"values": ["none", "low", "medium", "high", "xhigh"]
}
],
"tool_call": true,
"temperature": false,
"structured_output": true,
"open_weights": false,
"knowledge": "2026-06-01",
"release_date": "2026-10-27",
"last_updated": "2026-10-27",
"modalities": {
"input": ["text", "image", "pdf"],
"output": ["text"]
},
"limit": {
"context": 1050000,
"input": 922000,
"output": 128000
},
"cost": {
"input": 1,
"output": 5,
"cache_read": 0.05,
"cache_write": 1.25,
"tiers": [
{
"input": 2,
"output": 7.5,
"cache_read": 0.1,
"cache_write": 2.5,
"tier": {
"type": "context",
"size": 272000
}
}
],
"context_over_200k": {
"input": 2,
"output": 7.5,
"cache_read": 0.1,
"cache_write": 2.5
}
}
},
"gpt-6-luna": {
"id": "gpt-6-luna",
"name": "GPT-6 Luna",
Expand Down Expand Up @@ -2414,9 +2470,9 @@
"output": 65536
},
"cost": {
"input": 0,
"output": 0,
"cache_read": 0
"input": 2,
"output": 10,
"cache_read": 0.2
}
},
"claude-fable-5-2": {
Expand Down Expand Up @@ -2486,9 +2542,82 @@
"output": 65536
},
"cost": {
"input": 0,
"output": 0,
"cache_read": 0
"input": 4,
"output": 20,
"cache_read": 0.2
}
},
"gemini-3-pro-image": {
"id": "gemini-3-pro-image",
"name": "Gemini 3 Pro Image",
"lab": "google",
"provider": "databricks",
"family": "gemini-pro",
"released": true,
"attachment": true,
"reasoning": true,
"reasoning_options": [
{
"type": "toggle"
},
{
"type": "effort",
"values": ["low", "medium", "high", "xhigh", "max"]
}
],
"tool_call": true,
"temperature": true,
"structured_output": true,
"open_weights": false,
"knowledge": "2025-01",
"release_date": "2025-11-20",
"last_updated": "2025-11-20",
"modalities": {
"input": ["text", "image", "pdf"],
"output": ["text", "image"]
},
"limit": {
"context": 65536,
"output": 32768
},
"cost": {
"input": 2,
"output": 12
}
},
"gemini-3-1-flash-image": {
"id": "gemini-3-1-flash-image",
"name": "Gemini 3.1 Flash Image",
"lab": "google",
"provider": "databricks",
"family": "gemini-flash",
"released": true,
"attachment": true,
"reasoning": true,
"reasoning_options": [
{
"type": "effort",
"values": ["low", "medium", "high", "max"]
}
],
"tool_call": true,
"temperature": true,
"structured_output": true,
"open_weights": false,
"knowledge": "2025-01",
"release_date": "2026-02-26",
"last_updated": "2026-02-26",
"modalities": {
"input": ["text", "image", "pdf"],
"output": ["text", "image"]
},
"limit": {
"context": 131072,
"output": 32768
},
"cost": {
"input": 0.5,
"output": 3
}
}
}
Expand Down
43 changes: 43 additions & 0 deletions src/app/models/capabilities.json
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,49 @@
"responses": false,
"webSearch": false,
"imageGeneration": false
},
{
"id": "gpt-6-1-terra",
"owner": "openai",
"entitled": true,
"chat": "conforms",
"deviations": [],
"nativeDialect": "openai-responses",
"responses": true,
"webSearch": true,
"imageGeneration": true
},
{
"id": "gemini-3-pro-image",
"owner": "google",
"entitled": true,
"chat": "array-content",
"deviations": [
"`id` is null; the spec requires a string",
"`content` is an array[2] of {reasoning, text} with keys {summary, text, thoughtSignature, type}; the spec requires a string",
"`usage.total_tokens` is 964, but prompt + completion is 225",
"`usage.reasoning_tokens` is top-level; the spec nests it under `completion_tokens_details`"
],
"nativeDialect": "gemini",
"responses": false,
"webSearch": false,
"imageGeneration": false
},
{
"id": "gemini-3-1-flash-image",
"owner": "google",
"entitled": true,
"chat": "array-content",
"deviations": [
"`id` is null; the spec requires a string",
"`content` is an array[1] of {text} with keys {text, thoughtSignature, type}; the spec requires a string",
"`usage.total_tokens` is 788, but prompt + completion is 242",
"`usage.reasoning_tokens` is top-level; the spec nests it under `completion_tokens_details`"
],
"nativeDialect": "gemini",
"responses": false,
"webSearch": false,
"imageGeneration": false
}
]
}
Loading