Google offers 42 models through Lava’s AI Gateway, supporting Chat Completions, Chat Completions (Gemini Native), Chat Completions (Gemini Streaming). Authentication uses Authorization: Bearer or x-goog-api-key. See the Google API docs for provider-specific parameters.
Supports both managed API keys (from Lava) and BYOK mode.
Quick Start
const response = await fetch('https://api.lavapayments.com/v1/forward?u=https%3A%2F%2Fgenerativelanguage.googleapis.com%2Fv1beta%2Fopenai%2Fchat%2Fcompletions', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${forwardToken}`,
},
body: JSON.stringify({
model: 'gemini-3.1-pro-preview',
messages: [{ role: "user", content: "Hello!" }],
}),
});
Chat Completions
Target URL: https://generativelanguage.googleapis.com/v1beta/openai/chat/completions
| |
|---|
| Auth Header | Authorization: Bearer |
| Content Type | application/json |
| Streaming | Yes (set stream: true in request body) |
| Model | Input / 1M tokens | Output / 1M tokens |
|---|
| gemini-3.1-pro-preview | $2.00 | $12.00 |
| models/gemini-3.1-pro-preview | $2.00 | $12.00 |
| gemini-3-pro-preview | $2.00 | $12.00 |
| models/gemini-3-pro-preview | $2.00 | $12.00 |
| gemini-2.5-pro | $1.25 | $10.00 |
| models/gemini-2.5-pro | $1.25 | $10.00 |
| gemini-3-flash-preview | $0.50 | $3.00 |
| models/gemini-3-flash-preview | $0.50 | $3.00 |
| gemini-2.5-flash | $0.30 | $2.50 |
| models/gemini-2.5-flash | $0.30 | $2.50 |
| gemini-2.5-flash-lite | $0.10 | $0.40 |
| models/gemini-2.5-flash-lite | $0.10 | $0.40 |
| gemini-2.0-flash | $0.10 | $0.40 |
| models/gemini-2.0-flash | $0.10 | $0.40 |
Chat Completions (Gemini Native)
Target URL: https://generativelanguage.googleapis.com/v1beta/models/{model}:generateContent
| |
|---|
| Auth Header | x-goog-api-key |
| Content Type | application/json |
| Streaming | No |
| Model | Input / 1M tokens | Output / 1M tokens |
|---|
| gemini-3.1-pro-preview | $2.00 | $12.00 |
| models/gemini-3.1-pro-preview | $2.00 | $12.00 |
| gemini-3-pro-preview | $2.00 | $12.00 |
| models/gemini-3-pro-preview | $2.00 | $12.00 |
| gemini-2.5-pro | $1.25 | $10.00 |
| models/gemini-2.5-pro | $1.25 | $10.00 |
| gemini-3-flash-preview | $0.50 | $3.00 |
| models/gemini-3-flash-preview | $0.50 | $3.00 |
| gemini-2.5-flash | $0.30 | $2.50 |
| models/gemini-2.5-flash | $0.30 | $2.50 |
| gemini-2.5-flash-lite | $0.10 | $0.40 |
| models/gemini-2.5-flash-lite | $0.10 | $0.40 |
| gemini-2.0-flash | $0.10 | $0.40 |
| models/gemini-2.0-flash | $0.10 | $0.40 |
Chat Completions (Gemini Streaming)
Target URL: https://generativelanguage.googleapis.com/v1beta/models/{model}:streamGenerateContent
| |
|---|
| Auth Header | x-goog-api-key |
| Content Type | application/json |
| Streaming | Always |
| Model | Input / 1M tokens | Output / 1M tokens |
|---|
| gemini-3.1-pro-preview | $2.00 | $12.00 |
| models/gemini-3.1-pro-preview | $2.00 | $12.00 |
| gemini-3-pro-preview | $2.00 | $12.00 |
| models/gemini-3-pro-preview | $2.00 | $12.00 |
| gemini-2.5-pro | $1.25 | $10.00 |
| models/gemini-2.5-pro | $1.25 | $10.00 |
| gemini-3-flash-preview | $0.50 | $3.00 |
| models/gemini-3-flash-preview | $0.50 | $3.00 |
| gemini-2.5-flash | $0.30 | $2.50 |
| models/gemini-2.5-flash | $0.30 | $2.50 |
| gemini-2.5-flash-lite | $0.10 | $0.40 |
| models/gemini-2.5-flash-lite | $0.10 | $0.40 |
| gemini-2.0-flash | $0.10 | $0.40 |
| models/gemini-2.0-flash | $0.10 | $0.40 |
Next Steps