BeLive Token Hub
API ReferenceChat

Gemini (Google-Compatible)

/v1beta/models/{model}:generateContent — Google-native endpoints, usable with the Google GenAI SDK.

BeLive Studio provides Google-native Gemini endpoints, usable with the official Google GenAI SDK or by pointing Gemini CLI at BeLive Studio.

Endpoints

POST https://api.tokenhub.belivestudios.com/v1beta/models/{model}:generateContent
POST https://api.tokenhub.belivestudios.com/v1beta/models/{model}:streamGenerateContent

Request Example

curl "https://api.tokenhub.belivestudios.com/v1beta/models/gemini-3.7-flash:generateContent" \
  -H "x-goog-api-key: sk-your-belive-studios-key" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [{
      "parts": [{"text": "Hello"}]
    }]
  }'

Common request parameters

ParameterTypeRequiredDescription
contentsarrayyesConversation content; each item contains role and parts, while simple requests may omit role
systemInstructionobjectnoSystem instruction represented as a Content object containing parts
generationConfigobjectnoContainer for generation settings
generationConfig.maxOutputTokensintegernoMaximum candidate-output tokens; thinking models also consume reasoning budget from it
generationConfig.temperaturenumbernoSampling temperature; valid range and default depend on the model
generationConfig.topPnumbernoNucleus-sampling parameter
generationConfig.topKintegernoLimits candidate tokens considered for sampling
generationConfig.stopSequencesarraynoCustom stop sequences
generationConfig.candidateCountintegernoNumber of candidates to return; multiple candidates are unsupported by some models
generationConfig.responseMimeTypestringnoOutput MIME type, such as application/json
generationConfig.responseSchemaobjectnoJSON Schema for structured output; requires a compatible MIME type and model
generationConfig.thinkingConfigobjectnoThinking settings, which may include thinkingLevel, thinkingBudget, or includeThoughts
toolsarraynoTools available to the model, such as function declarations
toolConfigobjectnoTool-calling behavior configuration
safetySettingsarraynoRequest-level safety settings; available categories and thresholds depend on the service and model

Parameter compatibility

Generation, thinking, structured output, tool calling, and safety parameters vary by Gemini model version. Sending unsupported fields may return an error.

Output tokens and thinking

The Gemini-native interface uses generationConfig.maxOutputTokens to set the output limit; it does not use the OpenAI-compatible max_tokens field. For models that support thinking, reasoning also consumes the output budget. If the limit is too small, the API may return HTTP 200 with no displayable text and candidates[0].finishReason set to "MAX_TOKENS".

{
  "contents": [{"parts": [{"text": "Introduce BeLive Studio in one sentence"}]}],
  "generationConfig": {"maxOutputTokens": 1024}
}

Do not judge success from the HTTP status alone. Check candidates[].content.parts and candidates[].finishReason. If there is no text and the finish reason is "MAX_TOKENS", increase maxOutputTokens and retry, then inspect usageMetadata.thoughtsTokenCount to determine whether reasoning consumed most of the budget. There is no single minimum that applies to every Gemini model.

The following low-budget response was tested on the platform:

{
  "candidates": [{"finishReason": "MAX_TOKENS"}],
  "usageMetadata": {
    "promptTokenCount": 7,
    "totalTokenCount": 13,
    "thoughtsTokenCount": 6
  }
}

Models that support thinking configuration use generationConfig.thinkingConfig. The control for disabling thinking differs by model. Follow the compatibility table below rather than inferring support from the model ID.

Disabling thinking

The following results were verified through the BeLive Studio Google-native endpoint on September 10, 2026. Every test request used maxOutputTokens: 2000:

Model IDCan thinking be disabled?ParameterNotes
gemini-3.5-flashYesthinkingBudget: 0thoughtsTokenCount was 0 in all three consecutive tests
gemini-3.6-flashYesthinkingBudget: 0thoughtsTokenCount was 0 in all three consecutive tests
gemini-3.1-pro-previewYesthinkingBudget: 0thoughtsTokenCount was 0 in all three consecutive tests
gemini-3.7-flashNot guaranteedNo reliable off switchthinkingBudget: 0 may still produce thinking tokens; thinkingLevel: "LOW" only reduces the level and does not disable thinking

For the first three models, use the following request and replace {model} in the URL with the model ID:

curl "https://api.tokenhub.belivestudios.com/v1beta/models/{model}:generateContent" \
  -H "x-goog-api-key: sk-your-belive-studios-key" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [{
      "parts": [{"text": "Analyze this problem and provide the answer"}]
    }],
    "generationConfig": {
      "maxOutputTokens": 2000,
      "thinkingConfig": {
        "thinkingBudget": 0
      }
    }
  }'

Check usageMetadata.thoughtsTokenCount in the response. If it is 0 or omitted, that request did not consume thinking tokens.

gemini-3.7-flash caveat

Across 13 platform tests with thinkingBudget: 0, three requests reached zero while ten still produced thinking tokens. This parameter therefore cannot be treated as a reliable off switch for this model. thinkingLevel: "MINIMAL" returns HTTP 400 because MINIMAL is unsupported, while thinkingLevel: "LOW" is accepted but still produces thinking tokens.

To request returnable reasoning content, set includeThoughts: true. When the model produces returnable reasoning, the response contains parts marked with thought: true. Applications should keep these separate from the final answer:

{
  "contents": [{"parts": [{"text": "Analyze 2+2 and give the answer"}]}],
  "generationConfig": {
    "maxOutputTokens": 512,
    "thinkingConfig": {
      "thinkingLevel": "LOW",
      "includeThoughts": true
    }
  }
}

includeThoughts only controls whether returnable reasoning content is included. It does not disable thinking or guarantee lower thinking-token usage. Available thinking fields and values depend on the model version; sending thinking configuration to an unsupported model returns an error.

Response fields

FieldDescription
candidates[].content.parts[].textText returned by the model
candidates[].content.parts[].thoughtWhen true, the part contains reasoning and should not be displayed as the final answer
candidates[].finishReasonWhy generation ended, such as STOP, MAX_TOKENS, or a safety-related reason
usageMetadata.promptTokenCountInput-token count
usageMetadata.candidatesTokenCountFinal candidate token count; it may be absent when no text is produced
usageMetadata.thoughtsTokenCountReasoning-token count; it may be absent when the model does not reason
usageMetadata.totalTokenCountTotal input, reasoning, and candidate tokens
modelVersion / responseIdActual model version and response identifier

Streaming

streamGenerateContent returns text/event-stream, with each event prefixed by data::

curl -N "https://api.tokenhub.belivestudios.com/v1beta/models/gemini-3.7-flash:streamGenerateContent" \
  -H "x-goog-api-key: sk-your-belive-studios-key" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [{"parts": [{"text": "Write a two-line poem"}]}]
  }'

Parse the JSON following each data: prefix. Intermediate events may omit finishReason; the final event provides the finish reason and usage information.

Python SDK

from google import genai

client = genai.Client(
    api_key="sk-your-belive-studios-key",
    http_options={"base_url": "https://api.tokenhub.belivestudios.com"},
)

resp = client.models.generate_content(
    model="gemini-3.7-flash",
    contents="Hello",
)
print(resp.text)

The SDK appends /v1beta/models/... automatically, so set base_url to the host only and do not add /v1beta.

Client Integration

Gemini CLI connects via the GOOGLE_GEMINI_BASE_URL and GEMINI_API_KEY environment variables — see the Gemini CLI guide.

On this page