Theme
Gemini native format
Call , , and model listing with Google Gemini native paths and request bodies.
http
POST /v1beta/models/{model}:{action}The Gemini native format keeps Google Gemini API paths and request bodies. It fits integrations that already use a Gemini SDK, a contents / parts structure, or safety settings.
The default example model is .
Available models
| Model | Description |
|---|---|
| Latest Gemini 3.6 Flash | |
| Gemini 3.1 Pro preview | |
| Gemini 3.1 Flash Lite preview | |
| Gemini 3 Flash preview | |
| Gemini 2.5 Pro | |
| Gemini 2.5 Flash | |
| Gemini 2.5 Flash Lite |
Paths
| Method | Path | Description |
|---|---|---|
GET | List Gemini models | |
POST | Non-streaming content generation | |
POST | Streaming content generation |
Replace with a concrete model ID (see Available models above), and replace with or .
The debugger on this page defaults to non-streaming .
Headers
| Name | Type | Required | Description |
|---|---|---|---|
| string | Yes | Request authentication. Use a Bearer Token, for example: . You may instead use or the query parameter | |
| string | No | Google API Key style auth, for example: ; mutually exclusive with | |
| string | Yes | Request content type; must be |
The query parameter can also authenticate, for example: /v1beta/models/gemini-3.6-flash:generateContent?key=YOUR_API_KEY.
Request body
| Name | Type | Required | Description |
|---|---|---|---|
| array | Yes | Conversation contents. In multi-turn chats, alternates between and | |
| object | No | System-level instruction (system prompt); both and are accepted | |
| object | No | Generation config controlling model output behavior | |
| array | No | Safety settings | |
| array | No | Gemini tool declarations | |
| object | No | Tool-calling config | |
| string | No | Cached Content ID for reusing a context cache | |
| object | No | Custom key-value labels for request tracing and billing attribution |
contents item
| Name | Type | Required | Description |
|---|---|---|---|
| string | No | Content role: or | |
| array | Yes | Content parts. Supports , ( + Base64 ), ( + ), , , and more |
parts.videoMetadata
Video input metadata. Use only with video or in the same to control the time range and frame sampling rate the model reads. When there are multiple videos, each can set its own metadata.
| Name | Type | Required | Description |
|---|---|---|---|
| string | No | Video start offset as a Duration string, e.g. , | |
| string | No | Video end offset, e.g. | |
| number | No | Frame sampling rate; default ; valid range < fps ≤ |
generationConfig
| Name | Type | Required | Description |
|---|---|---|---|
| number | No | Output randomness, range –, default | |
| number | No | Nucleus sampling probability cutoff | |
| integer | No | Sample only from the K highest-probability tokens | |
| integer | No | Number of candidate results to return; default | |
| integer | No | Maximum output token count | |
| array | No | Stop generation when any of these strings is hit; up to 5 | |
| string | No | Output format: (default) / / | |
| object | No | Structured output schema (OpenAPI 3.0 subset); use with | |
| object | No | Standard JSON Schema constraints; mutually exclusive with | |
| array | No | Output modalities, e.g. ; image generation can use | |
| integer | No | Fixed random seed for more reproducible results | |
| number | No | Reduce repeated topics and encourage new content | |
| number | No | Reduce repeated words or sentences | |
| boolean | No | Whether to return token probability information | |
| integer | No | Number of token probabilities to return, range – | |
| boolean | No | Whether to enable enhanced answers for elections, government, and similar civic topics | |
| object | No | Speech output config (TTS); may include , , etc. | |
| boolean | No | Whether to return audio timestamps; for audio understanding only | |
| object | No | Thinking model reasoning config | |
| string | No | Media resolution: / / | |
| object | No | Image generation config; common fields include (e.g. , ) and ( / / ) |
thinkingConfig
| Name | Type | Required | Description |
|---|---|---|---|
| boolean | No | Whether to return a thinking summary in the response | |
| integer | No | Thinking token budget (Gemini 2.5 series); dynamic thinking, off | |
| string | No | Thinking intensity: / (Gemini 3 series; mutually exclusive with ) |
safetySettings item
| Name | Type | Required | Description |
|---|---|---|---|
| string | Yes | Harm category; see Common safety settings below | |
| string | Yes | Blocking threshold; see Common safety settings below | |
| string | No | Evaluation method: (by severity) or (by probability) |
tools
Supported tool types:
| Type | Description |
|---|---|
| Function Calling declarations | |
| Google Search capability | |
| Code execution capability | |
| URL content parsing capability | |
| Retrieval-augmented generation (RAG); deprecated, older models only | |
| Google retrieval-augmented search; for new models prefer |
toolConfig
Commonly used to configure :
| Value | Description |
|---|---|
| Model decides whether to call tools | |
| Force a tool call | |
| Disallow tool calls |
Optional : restrict which functions may be called.
Request example
Text generation
bash
curl -X POST https://octopusx.ai/v1beta/models/gemini-3.6-flash:generateContent \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [
{
"role": "user",
"parts": [
{ "text": "Introduce the Gemini native API in three sentences." }
]
}
],
"generationConfig": {
"temperature": 0.7,
"maxOutputTokens": 300
}
}'You can also use :
bash
curl -X POST https://octopusx.ai/v1beta/models/gemini-3.6-flash:generateContent \
-H "x-goog-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [
{
"role": "user",
"parts": [
{ "text": "Introduce the Gemini native API in three sentences." }
]
}
]
}'Multimodal input
bash
curl -X POST https://octopusx.ai/v1beta/models/gemini-3.6-flash:generateContent \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [
{
"role": "user",
"parts": [
{
"inlineData": {
"mimeType": "image/png",
"data": "<BASE64_IMAGE>"
}
},
{
"text": "Describe the main content of this image."
}
]
}
]
}'Video input (videoMetadata)
bash
curl -X POST https://octopusx.ai/v1beta/models/gemini-3.6-flash:generateContent \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [
{
"role": "user",
"parts": [
{
"fileData": {
"mimeType": "video/mp4",
"fileUri": "https://example.com/demo.mp4"
},
"videoMetadata": {
"startOffset": "3s",
"endOffset": "10s",
"fps": 1.0
}
},
{
"text": "Summarize the key actions in this clip."
}
]
}
]
}'Streaming generation
bash
curl -X POST https://octopusx.ai/v1beta/models/gemini-3.6-flash:streamGenerateContent \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [
{
"role": "user",
"parts": [
{ "text": "Introduce the Gemini native API in three sentences." }
]
}
]
}'Response example
200 - Non-streaming
json
{
"candidates": [
{
"content": {
"role": "model",
"parts": [
{
"text": "The Gemini native API expresses input with contents and parts. It supports text, images, files, and function calling. Through the unified gateway you can keep using the same API Key and billing system."
}
]
},
"finishReason": "STOP",
"safetyRatings": [
{
"category": "HARM_CATEGORY_HARASSMENT",
"probability": "NEGLIGIBLE"
}
]
}
],
"usageMetadata": {
"promptTokenCount": 18,
"candidatesTokenCount": 58,
"totalTokenCount": 76
}
}Response fields
| Name | Type | Description |
|---|---|---|
| array | Candidate results | |
| object | Includes (usually ) and | |
| string | Finish reason, e.g. | |
| array | Safety ratings | |
| object | Token usage; includes , , |
Common safety settings
category
| Value | Description |
|---|---|
| Harassment | |
| Hate speech | |
| Sexually explicit content | |
| Dangerous content |
threshold
| Value | Description |
|---|---|
| Do not block | |
| Block high risk only | |
| Block medium risk and above | |
| Block low risk and above |