Compatible API guide

Gemini-Compatible API Using GenerateContent

Services already using the Google Gemini contents, parts, and generationConfig structure can connect to currently available Gemini models through the Infistar GenerateContent-compatible endpoint. The model ID is part of the request path and must match a live callable ID.

Use POST /v1beta/models/{model}:generateContent for standard generation and POST /v1beta/models/{model}:streamGenerateContent?alt=sse for streaming. Infistar authenticates these requests with Authorization: Bearer YOUR_API_KEY.

Gemini-compatible endpoints and fields

POST /v1beta/models/{model}:generateContent

Standard GenerateContent request

POST /v1beta/models/{model}:streamGenerateContent?alt=sse

Streaming generation over SSE

contents[].parts[]

Text or multimodal parts supported by the model

generationConfig

Temperature, topP, and maximum output settings

systemInstruction

System instruction when supported by the model

Migrate a Gemini request

  1. Change the request host to the mainland or international Infistar site while keeping the /v1beta/models/{model} path shape.
  2. Send the Infistar API key as a Bearer token. Do not expose it in URLs, logs, or browser code.
  3. Copy an original Gemini model ID from Models and Pricing or the model list, then replace {model} in the path.
  4. Test text, multimodal, and streaming requests independently. Only inputs and parameters declared by the selected model are available.

Minimal GenerateContent request

MODEL_ID is a path placeholder. Replace it with a model visible to your API key that supports the Gemini endpoint.

curl "https://infistar.ai/v1beta/models/MODEL_ID:generateContent" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [{
      "role": "user",
      "parts": [{"text": "Hello"}]
    }]
  }'

Path and capability boundaries

  • The Gemini model ID is part of the URL. Do not send a display label, translated name, or the literal braces.
  • Image, audio, video, tool, and safety-setting support depends on the selected model and cannot be inferred from the format alone.
  • The streaming endpoint uses alt=sse. Clients should also handle disconnects, terminal events, and application timeouts.