Gemini chat

Call Gemini models through the OpenAI compatible protocol and Interactions API.

Gemini chat models use the OpenAI Chat Completions compatible protocol: POST https://api.hop-base.com/v1/chat/completions with Authorization: Bearer sk-your-key. Existing OpenAI SDKs and third-party clients only need a Gemini model ID.

Available models

FamilyModel IDUse case
Gemini Omnigemini-omni-flash-previewText, image, and video input; video output
Gemini 3.6gemini-3.6-flashLatest Flash model; currently under observation
Gemini 3.5gemini-3.5-flash / gemini-3.5-flash-liteRecommended default / low cost
Gemini 3.1 Progemini-3.1-pro-preview / gemini-3.1-pro-preview-customtoolsAdvanced reasoning preview / tool-use preview
Gemini 3.1gemini-3.1-flash-lite / gemini-3.1-flash-lite-previewLightweight / lightweight preview
Gemini 3gemini-3-flash-previewGemini 3 Flash preview
Gemini 2.5gemini-2.5-pro / gemini-2.5-flash / gemini-2.5-flash-liteStable models

Use gemini-3.5-flash by default. Gemini 2.5 stable models are the mature fallback. gemini-3.6-flash is newly available and remains under observation. Treat every model ID containing preview as a preview without a stability guarantee.

Rates vary by plan group. The signed-in model catalog for the current key is authoritative.

curl example

curl https://api.hop-base.com/v1/chat/completions \
  -H "Authorization: Bearer sk-your-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemini-3.5-flash",
    "messages": [{"role": "user", "content": "Hello"}]
  }'

Streaming with SSE (add "stream": true)

curl https://api.hop-base.com/v1/chat/completions \
  -H "Authorization: Bearer sk-your-key" \
  -H "Content-Type: application/json" \
  -d '{"model": "gemini-3.1-pro-preview", "stream": true,
    "messages": [{"role": "user", "content": "Hello"}]}'

Gemini-native payload passthrough

Existing Gemini SDK request bodies can keep their native contents field. The same endpoint detects the format and forwards it as a native Gemini request.

curl https://api.hop-base.com/v1/chat/completions \
  -H "Authorization: Bearer sk-your-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemini-3.5-flash",
    "contents": [{"role": "user", "parts": [{"text": "Hello"}]}]
  }'

Gemini Omni video generation (native Interactions)

gemini-omni-flash-preview accepts text, images, and video, and can output video directly. Text-to-video only needs model and input. Use POST https://api.hop-base.com/v1beta/interactions for the complete native video response. The Chat Completions endpoint remains available for text chat but should not be used to receive the complete video payload. POST /v1/interactions remains as a compatibility alias.

curl https://api.hop-base.com/v1beta/interactions \
  -H "Authorization: Bearer sk-your-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemini-omni-flash-preview",
    "input": "Generate a 3-second video of a red ball slowly rolling on a white background"
  }'

The video is in steps[].content[], with data holding a base64-encoded MP4. usage.output_tokens_by_modality breaks the output tokens down by modality for your information — those numbers are already inside total_output_tokens, which is what billing uses. See Gemini Omni video for the full contract and pricing.

{
  "status": "completed",
  "model": "gemini-omni-flash-preview",
  "steps": [{
    "type": "model_output",
    "content": [{
      "type": "video",
      "mime_type": "video/mp4",
      "data": "<base64-mp4>"
    }]
  }],
  "usage": {
    "total_input_tokens": 20,
    "total_output_tokens": 17819,
    "output_tokens_by_modality": [{"modality": "video", "tokens": 17376}]
  }
}

Input video is limited to 10 seconds. Output is 3-10 seconds at 720p and 24 FPS. State the desired duration in input. The model context is 1,048,576 tokens; preview capabilities and availability can change.

Available Gemini models vary by plan group. Call GET /v1/models with the current key and only use complete IDs returned by that response.

On this page