1. Docs
  2. API reference
  3. Gemini

Gemini

POSThttps://api.airoutly.com/v1beta/models/{model}:generateContent

Google's native API for Gemini models, for the Google Gen AI SDKs and Gemini CLI. Paths and request bodies are the same as Google's; only the host changes.

Authentication

Send the key as x-goog-api-key: <key> (what the Google SDKs do), as ?key=<key>, or as Authorization: Bearer <key>.

Request body

ParameterDescription
{model}pathrequiredA Gemini model ID from the models page, such as gemini-2.5-flash.
contentsarrayrequiredThe conversation: each item has a role and parts (text, inline images, audio or video).
systemInstructionobjectSystem prompt.
generationConfigobjecttemperature, maxOutputTokens and other generation settings. Field names use lowerCamelCase.

Example request

curl "https://api.airoutly.com/v1beta/models/gemini-2.5-flash:generateContent" \
  -H "x-goog-api-key: $AIROUTLY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"contents": [{"parts": [{"text": "Hello"}]}]}'

With the Google Gen AI SDK, set the base URL to https://api.airoutly.com; the SDK adds /v1beta/models/... itself.

Streaming

Call :streamGenerateContent?alt=sse instead of :generateContent.

curl
curl "https://api.airoutly.com/v1beta/models/gemini-2.5-flash:streamGenerateContent?alt=sse" \
  -H "x-goog-api-key: $AIROUTLY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"contents": [{"parts": [{"text": "Tell me a story"}]}]}'