Use google/gemini-4-neon to call Gemini 4 Neon through Vercel AI Gateway. Set providerOptions.gateway.order to try specific providers first while keeping others eligible, and use providerOptions.gateway.only to restrict requests to the listed providers. Model API reference
Suitable tasks. Connect to Gemini 4 Neon through AI Gateway and control routing and failover across Google Vertex AI and Google.
Unsuitable tasks. Set up a direct connection to the Google Gemini API or estimate production latency from short-term gateway metrics.
Applicable model version. Gemini 4 Neon, with gateway model ID google/gemini-4-neon.
Applicable clients, agents, or APIs. Vercel AI SDK, OpenAI-compatible Chat Completions and Responses APIs, and the Anthropic-compatible Messages API.
Recommended reasoning level and parameters. Use the provider defaults for the initial connectivity check. If you need to set the reasoning level explicitly, the model page's AI SDK v7 example shows how with reasoning: 'high'. Model API reference
Install ai and dotenv, then set AI_GATEWAY_API_KEY to your Vercel gateway key. This code combines the generateText and provider allowlist examples from the official model page. Model API reference
import 'dotenv/config';
import { generateText } from 'ai';
const result = await generateText({
model: 'google/gemini-4-neon',
prompt: 'Explain what a cache miss is in one sentence.',
providerOptions: {
gateway: { only: ['vertex', 'google'] },
},
});
console.log(result.text);The model page also includes a streamText example. When connecting through a compatible SDK, use the same model ID and key, and set the SDK's base URL for your API. Model API reference
| API | SDK base URL |
|---|---|
| OpenAI Chat Completions and Responses | https://ai-gateway.vercel.sh/v1 |
| Anthropic Messages | https://ai-gateway.vercel.sh |
Create a gateway key in Vercel, send a short text request, and confirm that you receive text in response.
To set provider priority, use order: ['vertex', 'google'] to try Vertex AI first, followed by Google. If your application can use only specific providers, use only, for example only: ['vertex']. The request fails if no provider on the allowlist is available. Vercel provider routing documentation
To set the reasoning level in AI SDK v7, use the top-level reasoning option. The Google provider documentation also says that providerOptions.google.thinkingConfig.thinkingLevel accepts xhigh on Neon. Provider-native reasoning settings take precedence over the top-level reasoning option. Support depends on the provider that handles the request. AI SDK Google provider documentation · Gateway reasoning configuration
The model page identifies Google Vertex AI as vertex and Google as google. Both providers can handle requests for the same model ID. Provider list
Field under providerOptions.gateway | Description on the model page |
|---|---|
only | Restricts eligible providers. Failover stays within the list. |
order | Tries providers in the specified order first. Unlisted providers remain eligible. |
sort | Use cost, ttft, or tps to sort candidates by price, time to first token, or throughput. |
zeroDataRetention | Set to true to route only to providers with a zero data retention policy for this model. |
The model ID, key, and gateway base URLs above apply to Vercel AI Gateway. For direct access to the Google Gemini API, use Google's credentials and endpoint with the model ID gemini-4-neon.
order and only control which providers the gateway considers. Vercel AI Gateway still receives and forwards the request when you specify a provider. Pass each provider's native parameters in its own namespace.
On 2026-11-19, we used the international edition of Tabbit to check the API tab, provider table, and routing parameters on Vercel's model page. We also checked the official documentation linked from that page and adapted the example from the documentation. We sent no model requests.
Gemini 4 Neon