Gemini 3.1 Pro Preview API
Google's Pro tier for multimodal reasoning over ~1M-token context.
API access
- Endpoint
- POST /v1/chat/completions
- Base URL
- https://api.apiko.app/v1
Speaks OpenAI Chat Completions; one APIKO key reaches every listed model.
Input price
34% off$2.00
$1.32
/ 1M tokens
Output price
34% off$12.00
$7.94
/ 1M tokens
Context
1M
Context window
Max output
32K
Per response on APIKO · official 64K
Start testing Gemini 3.1 Pro Preview
Ask a question — the answer streams in, followed by token usage, latency and an estimated cost.
Gemini 3.1 Pro Preview API quickstart
Call Gemini 3.1 Pro Preview in the OpenAI Chat Completions format. Copy-ready cURL, Python and Node.js samples below.
Code sample
Endpoint:/v1/chat/completions
curl https://api.apiko.app/v1/chat/completions \
-H "Authorization: Bearer $APIKO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-3.1-pro-preview",
"messages": [{"role": "user", "content": "Hello"}]
}'Tip: set APIKO_API_KEY to a key created on the API keys page.
Works with the official SDKs — swap in the base URL, API key and model ID.
Full Gemini 3.1 Pro Preview API docsManage API keysOne APIKO key works across every listed model.
Gemini 3.1 Pro Preview API pricing
Billed on the input, output and cached tokens reported in usage; every price is per 1M tokens.
- Input tokens34% off
- $2.00$1.32/ 1M tokens
The prompt and context you send to the model
- Output tokens34% off
- $12.00$7.94/ 1M tokens
What the model generates, reasoning tokens included
- Cached input
- $0.3969/ 1M tokens
Gemini 3.1 Pro Preview specs
Specs follow APIKO's public request contract first; anything it does not publish is taken from the model vendor's official docs, and shows as not disclosed only when neither publishes it.
- Streaming
- Supported
- Tool calling
- Supported
- Structured JSON
- Supported
- Reasoning mode
- Supported
- Input modality
- text · image · video · audio · pdf
- Output modality
- text
- Reasoning levels
- low · medium · high
- Max output
- 32K per response (16K on the free trial); official 64K
About Gemini 3.1 Pro Preview
Google's Pro tier for multimodal reasoning over ~1M-token context.
APIKO serves this model at /v1/chat/completions. Try prompts and parameters in the playground on this page first, then connect your server with the same APIKO API key.
- Provider
- Endpoint
- /v1/chat/completions
- Context window
- 1M
- Model ID
- gemini-3.1-pro-preview
How to use Gemini 3.1 Pro Preview
The playground and the API share one model ID — three steps take you from trying a prompt to production calls.
Step 1
Try it online
Test the system prompt, output length and sampling settings in the playground.
Step 2
Manage API keys
Sign in to see your keys or create one; one key works across every listed model.
Step 3
Connect your server
Send requests to /v1/chat/completions and record cost from the usage field.
Compare Gemini 3.1 Pro Preview with other Google models
Live APIKO prices per 1M tokens. Every model here works with the same API key — switch by changing the model ID.
| Model | Context window | Input | Output |
|---|---|---|---|
| Gemini 3.1 Pro PreviewThis pagegemini-3.1-pro-preview | 1M | $1.32 | $7.94 |
| Gemini 3.5 Flash Litegemini-3.5-flash-lite | 1M | — | — |
| Gemini 3.6 Flashgemini-3.6-flash | 1M | $0.993 | $4.95 |
| Gemini 3.7 Flashgemini-3.7-flash | 1M | — | — |
| Gemini 3.8 Flashgemini-3.8-flash | 1M | $0.337 | $1.69 |
| Gemini 4 Argongemini-4-argon | 1M | $1.50 | $7.50 |
| Gemini 4 Carbongemini-4-carbon | 1M | $1.35 | $6.75 |
| Gemini 4 Neongemini-4-neon | 1M | $2.23 | $11.15 |
| gemini-omni-1.2-flashgemini-omni-1.2-flash | — | — | — |
Comparing models and price tiers?
See live prices for every modelGemini 3.1 Pro Preview FAQ
How is Gemini 3.1 Pro Preview billed?
By input and output tokens at the per-1M rates above; cached input uses its published rate when available. See the failed-request question below for the refund rule.
Is it OpenAI-compatible?
Yes. Point the OpenAI SDK at the gateway base URL, replace the model id, and keep the rest of your request unchanged.
How do I get an API key?
Sign up, then create an API key in your console. One API key can call every model on the gateway.
Is there a free trial for the Gemini 3.1 Pro Preview API?
Yes. Sign in with Google using a Gmail address and $0.20 of trial credit is added to your balance, no card needed, once per person. It works on gemini-3.1-pro-preview and every other model. Output is capped at 16k tokens per request during the trial.
Can I stream responses?
Yes. Set stream: true; for Chat Completions, also send stream_options.include_usage = true to receive usage in the final event.
What if a request fails?
You are not billed for failed or errored calls. Retry, and if it keeps failing, contact us via the live chat at the bottom right of the page.