Gemini 3.1 Pro Preview

Review Gemini 3.1 Pro Preview model IDs, endpoint, request parameters, and response examples for HopsAPI.

Gemini 3.1 Pro Preview is a chat model in the HopsAPI catalog. This page documents only gateway-verified protocols, endpoints, and model IDs; context length, vision, tools, reasoning, and JSON capabilities depend on the current upstream and live response.

Model information

ItemValue
ProtocolGoogle generateContent
EndpointPOST /v1/models/{model}:generateContent
AvailabilityUse the current API key's GET /v1/models response
PricingUse the console pricing page and account coefficient

Model IDs

Model IDNotes
gemini-3.1-pro-previewUse this ID when returned by the current API key's model list

Do not assume that the model is enabled for your account from this page alone. Before calling it, query GET /v1/models and use the returned model ID, endpoint, and optional responses_endpoint exactly.

Core request parameters

ParameterRequiredDescription
modelYesUse an ID above that is returned by the model list
contentsYesGoogle contents / parts content
generationConfig.maxOutputTokensNoLimits model output length
generationConfig.temperatureNoSampling parameter; accepted range depends on the current upstream
:streamGenerateContentNoFor streaming, replace the URL method suffix with :streamGenerateContent

Request example

curl "https://hopsapi.com/v1/models/gemini-3.1-pro-preview:generateContent" \
  -H "Authorization: Bearer sk-YOUR_KEY" \
  -H "content-type: application/json" \
  -d '{"contents":[{"role":"user","parts":[{"text":"Introduce this model in one sentence."}]}],
       "generationConfig":{"maxOutputTokens":1500}}'

This example uses Authorization: Bearer. The same platform key also works as x-goog-api-key or ?key= on /v1/models/{model}:generateContent. Google's /v1beta path is not this endpoint. Use a model ID from GET /v1/models. See Gemini format.

Response example

This example shows the protocol shape only. Text, token counts, and additional fields such as id and model come from the live response.

{
  "candidates": [
    {
      "content": {
        "role": "model",
        "parts": [{ "text": "This chat model is called through Google generateContent." }]
      },
      "finishReason": "STOP"
    }
  ],
  "usageMetadata": { "promptTokenCount": 8, "candidatesTokenCount": 20, "totalTokenCount": 28 }
}

The gateway passes through native protocol responses and streaming events. See Gemini format.

On this page

On this page