Gemini

Generate content (Gemini-compatible)

Generates content using the Gemini GenerateContent request shape. The model details must advertise Gemini requests and the model must be available. ProtoJSON lowerCamelCase and original proto snake_case field names are preserved. Unknown fields are accepted on a best-effort basis; model-specific support is not guaranteed.

Authentication: Use ?key= query parameter, x-goog-api-key header, or Authorization: Bearer header.

post/v1beta/models/{model}:generateContent

Request

  • Base URL: https://api.tokenlab.sh
  • URL: https://api.tokenlab.sh/v1beta/models/{model}:generateContent
  • Auth: HTTP bearer

Path parameters

modelstring required

Model name (e.g., gemini-2.5-pro)

Query parameters

keystring

API key (alternative to header auth)

Headers

X-TokenLab-Delivery-Policy'auto' | 'verified' | 'official'

Per-request Delivery policy. Overrides the API key and Workspace defaults. Auto tries TokenLab Verified first and may switch once to Official only before output, request acceptance, or persistent resource creation.

Request body

cachedContentstring

Gemini cached content resource name for compatible models.

system_instructionobject

Original proto field-name spelling of systemInstruction.

generation_configobject

Original proto field-name spelling of generationConfig.

safety_settingsobject[]

Original proto field-name spelling of safetySettings.

tool_configobject

Original proto field-name spelling of toolConfig.

cached_contentstring

Original proto field-name spelling of cachedContent.

Response

Successful response

Changes

No recorded changes to this operation across all 1 revision of this API.