SDKs and protocols

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 general-purpose Flash model
Gemini 3.5gemini-3.5-flash / gemini-3.5-flash-liteBalanced speed and cost / lightweight
Gemini 3.1 Progemini-3.1-pro-preview / gemini-3.1-pro-preview-customtoolsAdvanced reasoning / custom tools
Gemini 3.1gemini-3.1-flash-lite / gemini-3.1-flash-lite-previewLightweight and low-cost
Gemini 3gemini-3-flash-previewGemini 3 Flash preview
Gemini 2.5gemini-2.5-pro / gemini-2.5-flash / gemini-2.5-flash-liteStable models

Google's benchmark price for gemini-3.1-pro-preview is $2 per million input tokens and $12 per million output tokens. HopBase pricing depends on the key's plan group; see the model catalog after signing in.

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 API)

gemini-omni-flash-preview accepts text, images, and video, and can output video directly. Text-to-video only needs model and input. For video editing, provide a remote uri or base64 data with a mime_type. Use POST https://api.hop-base.com/v1/interactions for complete video output; do not parse the response as Chat Completions text.

curl https://api.hop-base.com/v1/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 colorful ball slowly rolling on a white background"
  }'

Successful response (video in steps[].content[])

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

Omni limits input video to 10 seconds. Output video is 3-10 seconds, 720p, and 24 FPS. Decode steps[].content[].data and save the base64 MP4.

Use a Gemini plan key and only request model IDs returned by GET /v1/models for that key.

On this page