Generate Content
Call Google Gemini models through the Gemini native protocol. OfoxAI is compatible with the Google GenAI SDK.
Endpoint
POST https://api.ofox.ai/gemini/v1beta/models/{model}:generateContent
POST https://api.ofox.ai/gemini/v1beta/models/{model}:streamGenerateContentAuthentication
The Gemini protocol uses the x-goog-api-key header:
x-goog-api-key: <your OFOXAI_API_KEY>Request Examples
cURL
Terminal
curl "https://api.ofox.ai/gemini/v1beta/models/google/gemini-3-flash-preview:generateContent" \
-H "x-goog-api-key: $OFOX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [
{
"parts": [{"text": "Write a simple web server in Python"}]
}
]
}'Streaming
Python
gemini_stream.py
response = client.models.generate_content_stream(
model="google/gemini-3-flash-preview",
contents="Write an article about AI"
)
for chunk in response:
print(chunk.text, end="", flush=True)Multimodal Input
Gemini natively supports multimodal input, including images, audio, and video:
import base64
# Image analysis
with open("photo.jpg", "rb") as f:
image_data = base64.b64encode(f.read()).decode()
response = client.models.generate_content(
model="google/gemini-3-flash-preview",
contents=[
{"text": "Describe the contents of this image"},
{"inline_data": {"mime_type": "image/jpeg", "data": image_data}}
]
)Supported Models
| Model | Description |
|---|---|
google/gemini-3.1-pro-preview | Gemini 3.1 Pro — Most capable reasoning |
google/gemini-3-pro-preview | Gemini 3 Pro — Balanced performance |
google/gemini-3-flash-preview | Gemini 3 Flash — Fast and cost-effective |
OfoxAI’s Gemini protocol supports the major features of the Google GenAI SDK, including Function Calling, Code Execution, Grounding, and more.