google/gemini-3.1-pro-preview
Gemini 3.1 Pro Preview is Google’s frontier reasoning model, delivering enhanced software engineering performance, improved agentic reliability, and more efficient token usage across complex workflows. Building on the mu...
Input⌘ / Ctrl + Enter
Try a prompt
OutputReady
Your response will appear here
Choose an example or write a prompt, then click Run.
API details and access
Model Details
ProviderGoogle
TypeLlm
Model IDgoogle/gemini-3.1-pro-preview
Capabilities
InputTextImage
OutputText
Context1,000,000
Max Output65,536
VisionSupported
Function CallingSupported
Access details
Chat CompletionsBase URLhttps://api.sandbase.ai
API Endpoint/v1/chat/completions
{
"model": "google/gemini-3.1-pro-preview",
"messages": [
{
"role": "user",
"content": "Hello"
}
],
"max_tokens": 512
}Pricing
Input$2.00 / 1M tokens
Output$12.00 / 1M tokens
Cache read$0.20 / 1M tokens
Production endpoint
Send your first request
OpenAI-compatible endpoint with unified authentication and usage tracking.
POST
https://api.sandbase.ai/v1/chat/completionsModel ID
google/gemini-3.1-pro-preview01
Input Schema
10 parameters · 1 required · 9 optional
| Parameter | Type | Required | Description |
|---|---|---|---|
messages | object[] | Required | — |
seed | integer | Optional | — |
stop | string[] | Optional | — |
tools | array | Optional | — |
top_p | number | Optional | Min: 0 · Max: 1 |
stream | boolean | Optional | Default: false |
max_tokens | integer | Optional | Max: 65536 |
temperature | number | Optional | Min: 0 · Max: 2 · Default: 1 |
tool_choice | string | Optional | — |
response_format | object | Optional | — |
02
Output Schema
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier for the completion |
object | string | Object type, e.g. "chat.completion" |
model | string | Model used for the completion |
choices | array | List of completion choices |
choices[].message.content | string | Generated text content |
choices[].finish_reason | string | Reason the generation stopped |
usage.prompt_tokens | integer | Number of tokens in the prompt |
usage.completion_tokens | integer | Number of tokens in the completion |
usage.total_tokens | integer | Total tokens used |
03
Code Examples
Ready-to-run snippets
curl https://api.sandbase.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "google/gemini-3.1-pro-preview",
"messages": [{"role": "user", "content": "Hello"}],
"temperature": 0.7,
"max_tokens": 2048,
"stream": true
}'
