Skip to main content

Gemini Native Format

This page only documents Gemini Native behavior that was revalidated against Crazyrouter production on 2026-03-22. Current primary example model:
  • gemini-3-pro-preview
Dedicated multimodal pages based on successful request patterns:

Endpoints

POST /v1beta/models/{model}:generateContent
POST /v1beta/models/{model}:streamGenerateContent

Authentication

Pass the API key through the URL parameter:
?key=YOUR_API_KEY

Basic text generation

cURL
curl "https://crazyrouter.com/v1beta/models/gemini-3-pro-preview:generateContent?key=YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [
      {
        "role": "user",
        "parts": [
          {
            "text": "Explain machine learning in one sentence."
          }
        ]
      }
    ],
    "generationConfig": {
      "maxOutputTokens": 128
    }
  }'
Verified response shape:
{
  "candidates": [
    {
      "content": {
        "parts": [
          {
            "text": "...",
            "thoughtSignature": "..."
          }
        ]
      }
    }
  ]
}

Streaming generation

This recheck confirmed that streamGenerateContent returns incremental SSE output.
cURL
curl "https://crazyrouter.com/v1beta/models/gemini-3-pro-preview:streamGenerateContent?key=YOUR_API_KEY&alt=sse" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [
      {
        "role": "user",
        "parts": [
          {
            "text": "Write one short sentence about AI."
          }
        ]
      }
    ]
  }'
Observed SSE chunk shape:
data: {"candidates":[{"content":{"parts":[{"text":"...","thoughtSignature":"..."}]}}]}

Structured outputs

This production recheck confirmed that responseMimeType + responseSchema works:
cURL
curl "https://crazyrouter.com/v1beta/models/gemini-3-pro-preview:generateContent?key=YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [
      {
        "role": "user",
        "parts": [
          {
            "text": "Return a JSON object with keys city and country for Tokyo."
          }
        ]
      }
    ],
    "generationConfig": {
      "responseMimeType": "application/json",
      "responseSchema": {
        "type": "object",
        "properties": {
          "city": {"type": "string"},
          "country": {"type": "string"}
        },
        "required": ["city", "country"]
      }
    }
  }'
Verified production output:
{"city":"Tokyo","country":"Japan"}

This production recheck confirmed that the googleSearch tool works:
cURL
curl "https://crazyrouter.com/v1beta/models/gemini-3-pro-preview:generateContent?key=YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [
      {
        "role": "user",
        "parts": [
          {
            "text": "Use Google Search to find one recent headline from a major technology news site."
          }
        ]
      }
    ],
    "tools": [
      {
        "googleSearch": {}
      }
    ]
  }'
Verified fields include:
  • groundingMetadata.webSearchQueries
  • groundingMetadata.groundingChunks
  • groundingMetadata.groundingSupports

Thinking

This production recheck confirmed that thinkingConfig works:
cURL
curl "https://crazyrouter.com/v1beta/models/gemini-3-pro-preview:generateContent?key=YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [
      {
        "role": "user",
        "parts": [
          {
            "text": "Which is larger, 9.11 or 9.9? Explain briefly."
          }
        ]
      }
    ],
    "generationConfig": {
      "thinkingConfig": {
        "thinkingBudget": 256
      },
      "maxOutputTokens": 512
    }
  }'
Verified marker:
{
  "usageMetadata": {
    "thoughtsTokenCount": 120
  }
}

Common generationConfig fields

FieldTypeDescription
maxOutputTokensintegerMaximum output tokens
temperaturenumberSampling temperature
responseMimeTypestringMIME type for structured outputs
responseSchemaobjectStructured output constraint
thinkingConfigobjectThinking mode configuration
Gemini Native uses the contents[].parts[] structure rather than OpenAI-style messages. If you want an OpenAI-style route instead, use Gemini OpenAI-Compatible Format.