Fhddos exposes Gemini’s generation capabilities through two request styles: the OpenAI-compatible /v1/chat/completions endpoint (recommended for portability) and Gemini’s native generateContent protocol. Both styles authenticate with your Fhddos Bearer token and return the same underlying model output.
Set Up Your Environment
export BASE_URL = "https://aiapi.fhddos.com"
export TOKEN = "your-fhddos-token"
Basic Text Conversation
curl -X POST " $BASE_URL /v1/chat/completions" \
-H "Authorization: Bearer $TOKEN " \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-2.5-flash",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello, how are you?"}
]
}'
curl -X POST " $BASE_URL /v1beta/models/gemini-2.5-flash:generateContent" \
-H "Authorization: Bearer $TOKEN " \
-H "Content-Type: application/json" \
-d '{
"contents": [{
"parts": [{"text": "Hello, how are you?"}]
}]
}'
Streaming
Add "stream": true to receive tokens as server-sent events:
OpenAI-Compatible
Gemini Native API
curl -N " $BASE_URL /v1/chat/completions" \
-H "Authorization: Bearer $TOKEN " \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-2.5-flash",
"messages": [{"role": "user", "content": "Write me a short poem about the ocean."}],
"stream": true
}'
curl -N " $BASE_URL /v1beta/models/gemini-2.5-flash:streamGenerateContent?alt=sse" \
-H "Authorization: Bearer $TOKEN " \
-H "Content-Type: application/json" \
-d '{
"contents": [{"parts": [{"text": "Write me a short poem about the ocean."}]}]
}'
Gemini models understand images alongside text. Pass image data as a URL or inline base64 in the content array:
curl -X POST " $BASE_URL /v1/chat/completions" \
-H "Authorization: Bearer $TOKEN " \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-2.5-flash",
"messages": [{
"role": "user",
"content": [
{"type": "text", "text": "Describe what you see in this image."},
{"type": "image_url", "image_url": {"url": "https://example.com/photo.jpg"}}
]
}]
}'
curl -X POST " $BASE_URL /v1/chat/completions" \
-H "Authorization: Bearer $TOKEN " \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-2.5-flash",
"messages": [{
"role": "user",
"content": [
{"type": "text", "text": "Describe what you see in this image."},
{"type": "image_url", "image_url": {"url": "data:image/png;base64,<BASE64_DATA>"}}
]
}]
}'
Thinking Mode (Reasoning)
Gemini 2.5 series models support extended reasoning before producing a final answer. Use reasoning_effort to control the depth of thought:
curl -X POST " $BASE_URL /v1/chat/completions" \
-H "Authorization: Bearer $TOKEN " \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-2.5-flash",
"messages": [{"role": "user", "content": "Step by step, what is 23 × 47?"}],
"reasoning_effort": "medium"
}'
reasoning_effort accepts "low", "medium", or "high". To include the thinking trace in the response, add include_thoughts:
curl -X POST " $BASE_URL /v1/chat/completions" \
-H "Authorization: Bearer $TOKEN " \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-2.5-flash",
"messages": [{"role": "user", "content": "Explain quantum entanglement."}],
"reasoning_effort": "high",
"extra_body": {
"google": {
"thinking_config": {"include_thoughts": true}
}
}
}'
The model’s thinking trace appears in the reasoning_content field of the response. Gemini 2.5 series uses thinkingBudget natively. Fhddos maps reasoning_effort to the correct parameter automatically.
Pass a tools array to let the model invoke functions you define:
curl -X POST " $BASE_URL /v1/chat/completions" \
-H "Authorization: Bearer $TOKEN " \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-2.5-flash",
"messages": [{"role": "user", "content": "What is the weather in London today?"}],
"tools": [{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get the current weather for a city",
"parameters": {
"type": "object",
"properties": {
"city": {"type": "string", "description": "City name"}
},
"required": ["city"]
}
}
}]
}'
JSON Mode
Force the model to return valid JSON by setting response_format:
curl -X POST " $BASE_URL /v1/chat/completions" \
-H "Authorization: Bearer $TOKEN " \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-2.5-flash",
"messages": [{"role": "user", "content": "Generate a user profile JSON with name, age, and email fields."}],
"response_format": {"type": "json_object"}
}'
Generation Parameters
Parameter Description Default temperatureRandomness from 0–2 1.0max_tokensMaximum output tokens Model default top_pNucleus sampling probability 0.95stopStop sequences —
For Gemini 2.5 models with reasoning enabled, keep temperature at 1.0. Setting it too low can degrade reasoning performance.
SDK Examples
Python (OpenAI SDK)
Python (Google SDK)
from openai import OpenAI
client = OpenAI(
api_key = "your-fhddos-token" ,
base_url = "https://aiapi.fhddos.com/v1"
)
response = client.chat.completions.create(
model = "gemini-2.5-flash" ,
messages = [{ "role" : "user" , "content" : "Hello!" }]
)
print (response.choices[ 0 ].message.content)