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}:streamGenerateContentRequest 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
| Parameter | Type | Required | Description |
|---|---|---|---|
contents | array | yes | Conversation content; each item contains role and parts, while simple requests may omit role |
systemInstruction | object | no | System instruction represented as a Content object containing parts |
generationConfig | object | no | Container for generation settings |
generationConfig.maxOutputTokens | integer | no | Maximum candidate-output tokens; thinking models also consume reasoning budget from it |
generationConfig.temperature | number | no | Sampling temperature; valid range and default depend on the model |
generationConfig.topP | number | no | Nucleus-sampling parameter |
generationConfig.topK | integer | no | Limits candidate tokens considered for sampling |
generationConfig.stopSequences | array | no | Custom stop sequences |
generationConfig.candidateCount | integer | no | Number of candidates to return; multiple candidates are unsupported by some models |
generationConfig.responseMimeType | string | no | Output MIME type, such as application/json |
generationConfig.responseSchema | object | no | JSON Schema for structured output; requires a compatible MIME type and model |
generationConfig.thinkingConfig | object | no | Thinking settings, which may include thinkingLevel, thinkingBudget, or includeThoughts |
tools | array | no | Tools available to the model, such as function declarations |
toolConfig | object | no | Tool-calling behavior configuration |
safetySettings | array | no | Request-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 ID | Can thinking be disabled? | Parameter | Notes |
|---|---|---|---|
gemini-3.5-flash | Yes | thinkingBudget: 0 | thoughtsTokenCount was 0 in all three consecutive tests |
gemini-3.6-flash | Yes | thinkingBudget: 0 | thoughtsTokenCount was 0 in all three consecutive tests |
gemini-3.1-pro-preview | Yes | thinkingBudget: 0 | thoughtsTokenCount was 0 in all three consecutive tests |
gemini-3.7-flash | Not guaranteed | No reliable off switch | thinkingBudget: 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
| Field | Description |
|---|---|
candidates[].content.parts[].text | Text returned by the model |
candidates[].content.parts[].thought | When true, the part contains reasoning and should not be displayed as the final answer |
candidates[].finishReason | Why generation ended, such as STOP, MAX_TOKENS, or a safety-related reason |
usageMetadata.promptTokenCount | Input-token count |
usageMetadata.candidatesTokenCount | Final candidate token count; it may be absent when no text is produced |
usageMetadata.thoughtsTokenCount | Reasoning-token count; it may be absent when the model does not reason |
usageMetadata.totalTokenCount | Total input, reasoning, and candidate tokens |
modelVersion / responseId | Actual 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.