Providers
Gemini Provider
Google Gemini models with Echo billing integration
Gemini Provider
The Gemini provider gives you access to Google's Gemini models through the Vercel AI SDK with automatic Echo billing integration.
Supported Models
All Gemini models are supported via the GeminiModel
type:
Model | Input Cost | Output Cost |
---|---|---|
gemini-2.0-flash | $0.15 / 1M tokens | $0.60 / 1M tokens |
gemini-2.0-flash-001 | $0.15 / 1M tokens | $0.60 / 1M tokens |
gemini-2.0-flash-exp | $0.15 / 1M tokens | $0.60 / 1M tokens |
gemini-2.0-flash-exp-image-generation | $0.15 / 1M tokens | $0.60 / 1M tokens |
gemini-2.0-flash-lite | $0.07 / 1M tokens | $0.30 / 1M tokens |
gemini-2.0-flash-lite-001 | $0.07 / 1M tokens | $0.30 / 1M tokens |
gemini-2.0-flash-lite-preview | $0.07 / 1M tokens | $0.30 / 1M tokens |
gemini-2.0-flash-lite-preview-02-05 | $0.07 / 1M tokens | $0.30 / 1M tokens |
gemini-2.0-flash-preview-image-generation | $0.15 / 1M tokens | $0.60 / 1M tokens |
gemini-2.0-flash-thinking-exp | $0.15 / 1M tokens | $0.60 / 1M tokens |
gemini-2.0-flash-thinking-exp-01-21 | $0.15 / 1M tokens | $0.60 / 1M tokens |
gemini-2.0-flash-thinking-exp-1219 | $0.15 / 1M tokens | $0.60 / 1M tokens |
gemini-2.5-flash | $0.30 / 1M tokens | $2.50 / 1M tokens |
gemini-2.5-flash-image-preview | $0.30 / 1M tokens | $2.50 / 1M tokens |
gemini-2.5-flash-lite | $0.10 / 1M tokens | $0.40 / 1M tokens |
gemini-2.5-flash-lite-preview-06-17 | $0.10 / 1M tokens | $0.40 / 1M tokens |
gemini-2.5-flash-preview-05-20 | $0.30 / 1M tokens | $2.50 / 1M tokens |
gemini-2.5-flash-preview-tts | $0.30 / 1M tokens | $2.50 / 1M tokens |
gemini-2.5-pro | $2.50 / 1M tokens | $10.00 / 1M tokens |
gemini-2.5-pro-preview-03-25 | $2.50 / 1M tokens | $10.00 / 1M tokens |
gemini-2.5-pro-preview-05-06 | $2.50 / 1M tokens | $10.00 / 1M tokens |
gemini-2.5-pro-preview-06-05 | $2.50 / 1M tokens | $10.00 / 1M tokens |
gemini-2.5-pro-preview-tts | $2.50 / 1M tokens | $10.00 / 1M tokens |
⚠️ Gemini Limitations
Important: Gemini is currently only supported via the /chat/completions
endpoint. This means:
- Direct Gemini API streaming may not work as expected
- For the most reliable streaming experience, ensure your implementation uses the chat completions interface
- To enable this, you should use the OpenAI Provider, which will hit Gemini's supported chat/completions endpoint.
- For more information, see Google's documentation here.
- Streaming will be supported through the Vercel interface for Gemini as soon as possible.
const result = streamText({
model: openai.chat('gemini-2.0-flash'),
messages: convertToModelMessages(messages),
});
return result.toUIMessageStreamResponse();
To instantiate openai.chat
in this example, see the following guides:
For React applications, see React SDK LLM Integration
For server-side usage, see Next.js SDK LLM Integration