Skip to main content
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

Streaming

Add "stream": true to receive tokens as server-sent events:
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
  }'

Multimodal Input (Vision)

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"}}
      ]
    }]
  }'

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.

Tool Calling

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

ParameterDescriptionDefault
temperatureRandomness from 0–21.0
max_tokensMaximum output tokensModel default
top_pNucleus sampling probability0.95
stopStop sequences
For Gemini 2.5 models with reasoning enabled, keep temperature at 1.0. Setting it too low can degrade reasoning performance.

SDK Examples

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)