Gemini Native

Gemini native generate

Changed on

Direct passthrough to Google's Gemini API. The model_path parameter is <model>:<action>, for example google/gemini-2.5-flash:generateContent or google/gemini-2.5-flash:streamGenerateContent.

Supported actions:

ActionWhat it does
:generateContentOne-shot response (JSON)
:streamGenerateContentSSE stream of partial chunks

What you can do on this surface (request shape stays Gemini's native JSON; pick the right model for each):

  • Chat / reasoning — any gemini-* chat model, paired with generationConfig.thinkingConfig for budget control.
  • Multimodal input — inline_data parts for image / audio / video / file content alongside text parts.
  • Function calling — tools: [{functionDeclarations: [...]}].
  • Built-in server tools — tools: [{googleSearch: {}}], tools: [{codeExecution: {}}], tools: [{urlContext: {}}].
  • Text-to-speech — *-tts preview models with generationConfig.responseModalities: ["AUDIO"] and speechConfig.voiceConfig.
  • Image generation — gemini-*-image* models; the response carries the image as an inlineData part.

Authentication accepts the standard Authorization: Bearer sk-orca-… header, plus the Gemini-style x-goog-api-key header and ?key= query string for google-genai SDK compatibility — see Get an API key.

post/v1beta/models/{model_path}

Request

  • Base URL
    https://api.orcarouter.ai
  • URL
    https://api.orcarouter.ai/v1beta/models/{model_path}
  • Auth
    HTTP bearer

Path parameters

model_pathstring required

Headers

X-OrcaRouter-Include-Coststring
Example:true

Opt in to per-request cost reporting. When true (or 1, case-insensitive), the billed cost of the call is added to the response's usage object — usage.cost_usd on the OpenAI and Anthropic formats, usageMetadata.costUsd on the Gemini format. On streams it rides the frame carrying final usage (send stream_options: {"include_usage": true} on the OpenAI format). Absent or any other value means off. See Per-request cost.

Request body

object required

Gemini-native request body (Google's GenerateContentRequest shape). See the examples for common payloads.

Response

Successful response. For :generateContent the body is JSON (GenerateContentResponse). For :streamGenerateContent the body is SSE (text/event-stream); each event is a partial GenerateContentResponse.

object required

Gemini-native GenerateContentResponse.

Changes