Skip to content

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

ModelDescription
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

MethodPathDescription
GETList Gemini models
POSTNon-streaming content generation
POSTStreaming 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

NameTypeRequiredDescription
stringYesRequest authentication. Use a Bearer Token, for example: . You may instead use or the query parameter
stringNoGoogle API Key style auth, for example: ; mutually exclusive with
stringYesRequest 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

NameTypeRequiredDescription
arrayYesConversation contents. In multi-turn chats, alternates between and
objectNoSystem-level instruction (system prompt); both and are accepted
objectNoGeneration config controlling model output behavior
arrayNoSafety settings
arrayNoGemini tool declarations
objectNoTool-calling config
stringNoCached Content ID for reusing a context cache
objectNoCustom key-value labels for request tracing and billing attribution

contents item

NameTypeRequiredDescription
stringNoContent role: or
arrayYesContent 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.

NameTypeRequiredDescription
stringNoVideo start offset as a Duration string, e.g. ,
stringNoVideo end offset, e.g.
numberNoFrame sampling rate; default ; valid range < fps ≤

generationConfig

NameTypeRequiredDescription
numberNoOutput randomness, range , default
numberNoNucleus sampling probability cutoff
integerNoSample only from the K highest-probability tokens
integerNoNumber of candidate results to return; default
integerNoMaximum output token count
arrayNoStop generation when any of these strings is hit; up to 5
stringNoOutput format: (default) / /
objectNoStructured output schema (OpenAPI 3.0 subset); use with
objectNoStandard JSON Schema constraints; mutually exclusive with
arrayNoOutput modalities, e.g. ; image generation can use
integerNoFixed random seed for more reproducible results
numberNoReduce repeated topics and encourage new content
numberNoReduce repeated words or sentences
booleanNoWhether to return token probability information
integerNoNumber of token probabilities to return, range
booleanNoWhether to enable enhanced answers for elections, government, and similar civic topics
objectNoSpeech output config (TTS); may include , , etc.
booleanNoWhether to return audio timestamps; for audio understanding only
objectNoThinking model reasoning config
stringNoMedia resolution: / /
objectNoImage generation config; common fields include (e.g. , ) and ( / / )

thinkingConfig

NameTypeRequiredDescription
booleanNoWhether to return a thinking summary in the response
integerNoThinking token budget (Gemini 2.5 series); dynamic thinking, off
stringNoThinking intensity: / (Gemini 3 series; mutually exclusive with )

safetySettings item

NameTypeRequiredDescription
stringYesHarm category; see Common safety settings below
stringYesBlocking threshold; see Common safety settings below
stringNoEvaluation method: (by severity) or (by probability)

tools

Supported tool types:

TypeDescription
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 :

ValueDescription
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

NameTypeDescription
arrayCandidate results
objectIncludes (usually ) and
stringFinish reason, e.g.
arraySafety ratings
objectToken usage; includes , ,

Common safety settings

category

ValueDescription
Harassment
Hate speech
Sexually explicit content
Dangerous content

threshold

ValueDescription
Do not block
Block high risk only
Block medium risk and above
Block low risk and above