- Docs
- API reference
- Gemini
Gemini
POST
https://api.airoutly.com/v1beta/models/{model}:generateContentGoogle'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
| Parameter | Description |
|---|---|
{model}pathrequired | A Gemini model ID from the models page, such as gemini-2.5-flash. |
contentsarrayrequired | The conversation: each item has a role and parts (text, inline images, audio or video). |
systemInstructionobject | System prompt. |
generationConfigobject | temperature, 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"}]}]}'import os
from google import genai
from google.genai import types
client = genai.Client(
api_key=os.environ["AIROUTLY_API_KEY"],
http_options=types.HttpOptions(base_url="https://api.airoutly.com"),
)
resp = client.models.generate_content(model="gemini-2.5-flash", contents="Hello")
print(resp.text)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"}]}]}'