Use the OpenAI-compatible Chat Completions endpoint with gemini-4-neon, gemini-4-hydrogen, gemini-4-carbon, gemini-4-argon, gemini-3.8-flash, gemini-3.7-flash, or gemini-3.5-flash-lite.
The response uses the OpenAI-compatible choices and usage fields.
{ "id": "google-response-id", "object": "chat.completion", "model": "gemini-3.5-flash-lite", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Idempotency means repeating the same operation produces the same intended effect. It prevents retries from creating duplicate changes." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 32, "completion_tokens": 28, "total_tokens": 60 }}
Streaming request
Set stream to true. GENGEN returns text/event-stream, emits partial Chat Completions chunks, includes final usage, and terminates the stream with data: [DONE].
This is unidirectional text streaming over SSE. It is separate from the bidirectional Gemini Live API.
Reasoning level
Gemini 4 Carbon, Gemini 4 Argon, Gemini 3.8 Flash, and Gemini 3.7 Flash accept low, medium, or high and default to medium. Gemini 3.5 Flash-Lite also accepts minimal, defaults to minimal, and recommends it for extraction and other straightforward, latency-sensitive tasks.
Gemini 3.5 Flash-Lite constraints
Gemini 3.5 Flash-Lite ignores custom temperature, top_p, and top_k values. It rejects frequency_penalty and presence_penalty, and the final non-system message must not use the assistant role.
Parameters
Parameter
Type
Description
messages
array
Required conversation history. system and developer messages become the Gemini system instruction; text, image, video, and audio parts are supported.
reasoning_effort
string
Hydrogen and Neon support low, medium, high (default), and xhigh. low, medium, or high for Gemini 4 Carbon, Gemini 4 Argon, Gemini 3.8 Flash, and Gemini 3.7 Flash; Gemini 3.5 Flash-Lite also supports minimal.
Nucleus-sampling threshold from 0 to 1. Gemini 3.5 Flash-Lite ignores custom values.
top_k
number
Restricts sampling to the most likely K tokens. Gemini 3.5 Flash-Lite ignores custom values.
max_tokens / max_completion_tokens
integer
Maximum generated tokens.
stop
string or string[]
One or more stop sequences.
frequency_penalty
number
Penalizes repeated token frequency. Not supported by Gemini 4 Neon, Gemini 4 Hydrogen, Gemini 4 Carbon, or Gemini 3.5 Flash-Lite.
presence_penalty
number
Penalizes tokens already present in the output. Not supported by Gemini 4 Neon, Gemini 4 Hydrogen, Gemini 4 Carbon, or Gemini 3.5 Flash-Lite.
seed
integer
Best-effort deterministic sampling seed.
response_format
object
Use json_object or json_schema for structured output.
stream
boolean
Enables SSE streaming.
providerOptions.google
object
Advanced Google generationConfig, safetySettings, tools, and toolConfig. Normalized parameters above take precedence.
The API fixes candidateCount to 1 so the OpenAI-compatible response always contains one generated choice. Repeated requests with the same seed are not guaranteed to produce identical output.See the Gemini 3.8 Flash, Gemini 3.7 Flash and Gemini 3.5 Flash-Lite model pages for details.Gemini 3.8 Flash defaults to medium reasoning and rejects minimal, unsupported reasoning levels, and thinkingBudget overrides. Use low, medium, or high.
Function calling and built-in tools
Function calling, Code execution, and Computer use are supported for all listed Gemini models.
See Gemini tools for complete requests, multi-turn
result submission, thought signature preservation, streaming behavior, and billing.
Gemini 4 Carbon and Argon limits
gemini-4-carbon and gemini-4-argon share a 1,048,576-token window between input, reasoning, and output. The default output budget is 32,768 tokens for non-streaming requests and 65,536 with stream: true. Set a larger budget to enable automatic continuation.Reasoning defaults to medium; use low, medium, or high. Thinking budgets and minimal return HTTP 400. Custom temperature, top_p, and top_k values are ignored. Implicit caching is automatic; explicit cache management is not exposed.
{"model":"gemini-4-carbon","messages":[{"role":"user","content":"Review this algorithm for correctness."}],"reasoning_effort":"medium","max_output_tokens":4096,"stream":true}
Carbon, Hydrogen, and Neon conversation constraints
Gemini 4 Carbon, Hydrogen, and Neon reject frequency_penalty, presence_penalty, and candidate counts other than one (n or advanced candidateCount). End your history with a user message or completed tool results. Assistant prefills are not supported.Return every tool result in the order of the preceding calls, using the matching tool_call_id (Chat Completions) or call_id (Responses). Submit all pending results before another conversation turn. Preserve Google metadata as described in Gemini tools.
Gemini 4 Hydrogen and Neon
Hydrogen and Neon support Google Search, URL Context and Agentic video.
Use Count input tokens before generation without a wallet charge.gemini-4-neon and gemini-4-hydrogen default to 65,536 output tokens for synchronous and streaming requests. To allow a longer turn, set the output budget to an integer up to 1,048,576. Input, reasoning, tool calls, and final output share this window.GENGEN follows Gemini 4 continuation segments automatically while the request is open. Usage includes input processed again on later segments, cache reads, and generated tokens. Use streaming for large responses. Foreground calls have a 13-minute upstream deadline, and generation can finish before reaching the requested budget.Use reasoning_effort: "low", "medium", "high" (default), or "xhigh".
Thinking budgets and minimal return HTTP 400. Custom temperature, top_p, and
top_k are ignored. Implicit caching applies automatically to shared prefixes of
at least 4,096 tokens; explicit cache references are not accepted.Preserve providerMetadata.google.parts on every returned assistant item,
including final text and previous tool turns. Only the first function call in a
parallel turn carries a thought signature. If your application edits or compacts
previous history, set the following option; otherwise the default ERROR behavior
rejects signatures whose original conversation prefix has changed:
DROP discards mismatched reasoning signatures while retaining visible history;
it does not replace missing tool-call metadata. See Gemini tools.Supply Office and OpenDocument inputs through file / input_file content parts
using file_data Base64 data URLs with the document’s correct MIME type. The same
content parts are accepted inside tool results. Cloud Storage object references
are not accepted by the GENGEN media-input interface.
Authorizations
Authorization
string
header
required
A workspace API key beginning with gengen_live_.
Body
application/json
model
enum<string>
required
Public Gemini text model ID.
Available options:
gemini-4-neon,
gemini-4-hydrogen,
gemini-4-carbon,
gemini-4-argon,
gemini-3.8-flash,
gemini-3.7-flash,
gemini-3.5-flash-lite
messages
object[]
required
Conversation messages. Gemini 4 Carbon, Hydrogen, and Neon require a final user or tool-result turn and tool results in function-call order; assistant prefills are not supported. System and developer messages become the Gemini system instruction.
Minimum array length: 1
Show child attributes
n
integer
Carbon, Hydrogen, and Neon accept only one candidate. Omit this field or set it to 1.
reasoning_effort
enum<string>
Gemini thinking level. Hydrogen and Neon support low, medium, high (default), and xhigh; thinking budgets and minimal are rejected. minimal is supported by Gemini 3.5 Flash-Lite but not Gemini 4 Carbon, Gemini 4 Argon, Gemini 3.8 Flash or Gemini 3.7 Flash. Gemini 4 Carbon, Gemini 4 Argon, and Gemini 3.8 Flash default to medium and reject thinking budgets.
Available options:
minimal,
low,
medium,
high,
xhigh
temperature
number
Sampling temperature. Higher values increase variation. Custom values are ignored by Gemini 4 Neon, Gemini 4 Hydrogen, Gemini 4 Carbon, Gemini 4 Argon, and Gemini 3.5 Flash-Lite.
top_p
number
Nucleus-sampling probability threshold. Custom values are ignored by Gemini 4 Neon, Gemini 4 Hydrogen, Gemini 4 Carbon, Gemini 4 Argon, and Gemini 3.5 Flash-Lite.
Required range: 0 <= x <= 1
top_k
number
Limits sampling to the most likely K tokens. Custom values are ignored by Gemini 4 Neon, Gemini 4 Hydrogen, Gemini 4 Carbon, Gemini 4 Argon, and Gemini 3.5 Flash-Lite.
Required range: x >= 1
max_tokens
integer
Gemini 4 accepts integer output budgets from 1 through 1048576 with automatic continuation. Input and output share the context window. Neon and Hydrogen default to 65536. Carbon and Argon default to 32768 synchronously and 65536 with streaming. max_completion_tokens is an accepted alias.
Required range: x >= 1
max_completion_tokens
integer
Gemini 4 accepts integer output budgets from 1 through 1048576 with automatic continuation. Input and output share the context window. Neon and Hydrogen default to 65536. Carbon and Argon default to 32768 synchronously and 65536 with streaming.
Required range: x >= 1
stop
stringstring[]
One or more sequences that stop generation.
frequency_penalty
number
Penalizes tokens according to how often they already appear. Gemini 4 Neon, Gemini 4 Hydrogen, Gemini 4 Carbon, and Gemini 3.5 Flash-Lite reject this parameter.
presence_penalty
number
Penalizes tokens that have already appeared at least once. Gemini 4 Neon, Gemini 4 Hydrogen, Gemini 4 Carbon, and Gemini 3.5 Flash-Lite reject this parameter.
seed
integer
Best-effort sampling seed. Identical outputs are not guaranteed.
response_format
object
Show child attributes
stream
boolean
default:false
Return Server-Sent Events when true.
stream_options
object
Streaming compatibility options.
Show child attributes
tools
object[]
Function declarations. Chat uses nested function objects; Responses uses flat function declarations. Built-in tools belong in providerOptions.google.tools.
tool_choice
enum<string>object
auto, none, required, or a named function object. The function name must be declared in tools.
Available options:
auto,
none,
required
parallel_tool_calls
boolean
Omit or use true. Gemini can return multiple calls; false is rejected.
providerOptions
object
Show child attributes
Response
An OpenAI-compatible chat completion or SSE stream.
id
string
object
string
Allowed value: "chat.completion"
created
integer
model
string
choices
object[]
usage
object
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"GENGEN API","description":"Build video, image, and multimodal applications with the GENGEN API.","colors":{"primary":"#007F7C","light":"#05FFFB","dark":"#007F7C"},"logo":{"light":"https://mintcdn.com/apifarm/8i6PZnnhDG4uij12/logo-light.svg?fit=max\u0026auto=format\u0026n=8i6PZnnhDG4uij12\u0026q=85\u0026s=44296f0917d75c0ed5aa05513ec6c402","dark":"https://mintcdn.com/apifarm/8i6PZnnhDG4uij12/logo.svg?fit=max\u0026auto=format\u0026n=8i6PZnnhDG4uij12\u0026q=85\u0026s=e575f6379e1249d846c63539492c6b94","href":"https://gengen.farm"},"favicon":"https://mintcdn.com/apifarm/8i6PZnnhDG4uij12/favicon.svg?fit=max\u0026auto=format\u0026n=8i6PZnnhDG4uij12\u0026q=85\u0026s=32c70fe233096e49352a91ec312e3193","api":{"params":{"expanded":"closed"},"playground":{"display":"interactive"},"examples":{"defaults":"required","languages":["curl","python","javascript"]}},"appearance":{"default":"dark","strict":false},"background":{"color":{"light":"#FFFFFF","dark":"#000000"}},"navbar":{"links":[{"href":"https://gengen.farm/playground","label":"Playground"}],"primary":{"type":"button","label":"Dashboard","href":"https://gengen.farm/dashboard"}},"seo":{"indexing":"navigable"},"icons":{"library":"lucide"},"styling":{"eyebrows":"section","codeblocks":"dark","latex":false},"contextual":{"options":["copy","view"],"display":"header"},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"apifarm","hasAudioNarration":false,"actualSubdomain":"apifarm","customDomains":["docs.gengen.farm"],"gitSource":{"type":"github","owner":"sprout-technologies","repo":"apifarm","deployBranch":"main","contentDirectory":"mintlify","isPrivate":true,"mountPath":"","label":""},"entitlements":{},"buildId":"6b001407ff5bb0c4681a8975","clientVersion":"0.0.4270","searchFilterCounts":[{"language":"default","tag":"Models","count":138},{"language":"default","tag":"API Reference","count":111},{"language":"default","tag":"ElevenLabs","count":30},{"language":"default","tag":"Video","count":29},{"language":"default","tag":"BytePlus","count":23},{"language":"default","tag":"Video API","count":23},{"language":"default","tag":"LLM","count":19},{"language":"default","tag":"Image","count":17},{"language":"default","tag":"Help","count":14},{"language":"default","tag":"Assets API","count":13}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":".gengen-model-unavailable{color:#007f7c}html.dark .gengen-model-unavailable,html[data-theme=\"dark\"] .gengen-model-unavailable{color:#05fffb}main div.whitespace-pre-wrap.prose-sm.mt-6:has(>.inline-block>code){display:none}html.dark #navbar a[href=\"https://gengen.farm/dashboard\"],html[data-theme=\"dark\"] #navbar a[href=\"https://gengen.farm/dashboard\"]{color:#000000!important}html.dark #navbar a[href=\"https://gengen.farm/dashboard\"] *,html[data-theme=\"dark\"] #navbar a[href=\"https://gengen.farm/dashboard\"] *{color:#000000!important}@media (min-width: 1280px){body:has(#gengen-pricing-page) #content-container>div:has(>#content-area){gap:24px}body:has(#gengen-pricing-page) #content-area{flex:1 1 0%;width:0;min-width:0}body:has(#gengen-pricing-page) #content-side-layout{flex:0 0 176px;max-width:176px}body:has(#gengen-pricing-page) #table-of-contents-layout{width:100%;padding-left:16px}body:has(#gengen-pricing-page) #table-of-contents{width:100%}}.gengen-pricing{--pricing-text: #18181b;--pricing-muted: #71717a;--pricing-border: #e4e4e7;--pricing-header: #fafafa;--pricing-accent: #007f7c}html.dark .gengen-pricing,html[data-theme=\"dark\"] .gengen-pricing{--pricing-text: #ffffff;--pricing-muted: #a1a1aa;--pricing-border: #27272a;--pricing-header: #111113;--pricing-accent: #05fffb}.gengen-pricing-recommendations{padding-bottom:16px}.gengen-pricing .gengen-pricing-recommendations h2{margin:0;color:var(--pricing-text);font-size:20px;font-weight:600;line-height:28px}.gengen-pricing .gengen-pricing-recommendations-description{margin:6px 0 16px;color:var(--pricing-muted);font-size:13px;line-height:20px}.gengen-pricing-recommendation-grid{display:grid;grid-template-columns:repeat(auto-fit, minmax(min(100%, 240px), 1fr));gap:12px}.gengen-pricing-recommendation{display:flex;flex-direction:column;min-width:0;padding:16px;border:1px solid var(--pricing-border);border-radius:8px;background:var(--pricing-header)}.gengen-pricing-offer{display:flex;flex:1;flex-direction:column;gap:16px}.gengen-pricing-offer+.gengen-pricing-offer{margin-top:16px;padding-top:16px;border-top:1px solid var(--pricing-border)}.gengen-pricing .gengen-pricing-offer-models{margin:0;padding:0;color:var(--pricing-text);list-style:none;font-size:14px;font-weight:500;line-height:22px}.gengen-pricing .gengen-pricing-offer-models li{margin:0;padding:0}.gengen-pricing-offer-saving{margin-top:auto}.gengen-pricing-offer-discount{color:var(--pricing-accent);font-size:24px;font-weight:600;font-variant-numeric:tabular-nums;line-height:32px;overflow-wrap:anywhere}.gengen-pricing-offer-standard{color:var(--pricing-muted);font-size:18px}.gengen-pricing-groups{display:grid;gap:12px}.gengen-pricing-group{min-width:0;overflow:hidden;border:1px solid var(--pricing-border);border-radius:8px}.gengen-pricing .gengen-pricing-group-heading{margin:0;font-size:16px;line-height:24px}.gengen-pricing-group-toggle{scroll-margin-top:128px;display:flex;align-items:center;gap:12px;width:100%;min-height:56px;padding:16px 20px;color:inherit;background:var(--pricing-header);text-align:left;font:inherit;font-weight:600;cursor:pointer}.gengen-pricing-group-toggle:hover{color:var(--pricing-accent)}.gengen-pricing-group-count{margin-left:auto;color:var(--pricing-muted);font-size:12px;font-weight:400;white-space:nowrap}.gengen-pricing-group-chevron{flex:0 0 16px;width:16px;height:16px}.gengen-pricing-group-toggle[aria-expanded=\"true\"] .gengen-pricing-group-chevron{transform:rotate(90deg)}.gengen-pricing-group>div[hidden]{display:none}.gengen-pricing-group .gengen-pricing-model{border-top:1px solid var(--pricing-border)}.gengen-pricing-model{min-width:0}.gengen-pricing-model-header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;padding:20px}.gengen-pricing-model-header h3{margin:0}.gengen-pricing-model-header select{min-height:40px}.gengen-pricing-scroll-hint{display:none}.gengen-pricing-scroll{overflow-x:auto;overscroll-behavior-x:contain}.gengen-pricing .gengen-pricing-table{width:100%;min-width:680px;margin:0;border-collapse:collapse;table-layout:fixed;font-size:13px;line-height:20px}@media (min-width: 1024px){.gengen-pricing .gengen-pricing-table{min-width:0}}.gengen-pricing-table thead{background:var(--pricing-header)}.gengen-pricing .gengen-pricing-table th,.gengen-pricing .gengen-pricing-table td{padding:14px 16px;border:0;border-top:1px solid var(--pricing-border);text-align:left;vertical-align:middle}.gengen-pricing .gengen-pricing-table thead th{color:var(--pricing-muted);font-size:12px;font-weight:500}.gengen-pricing .gengen-pricing-table tbody th{font-weight:400}.gengen-pricing-table th:nth-child(1){width:22%}.gengen-pricing-table th:nth-child(2){width:28%}.gengen-pricing-table th:nth-child(3){width:19%}.gengen-pricing-table th:nth-child(4){width:12%}.gengen-pricing-table th:nth-child(5){width:19%}.gengen-pricing-number{font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}.gengen-pricing-estimate,.gengen-pricing-table td:nth-child(3) .gengen-pricing-number,.gengen-pricing-table td:nth-child(5) .gengen-pricing-number{color:var(--pricing-accent);font-weight:600;white-space:nowrap}.gengen-pricing-rate{display:flex;flex-direction:column;gap:4px}.gengen-pricing-discount{display:flex;flex-wrap:wrap;align-items:center;gap:6px;color:var(--pricing-muted);font-size:11px;font-variant-numeric:tabular-nums}.gengen-pricing-discount>span{border-radius:4px;padding:0 5px;background:rgba(5, 255, 251, 0.08);color:var(--pricing-accent)}.gengen-pricing-muted,.gengen-pricing-unit,.gengen-pricing-quantity-unit{color:var(--pricing-muted)}.gengen-pricing-quantity-unit{display:block;font-size:11px}.gengen-pricing :focus-visible{outline:1px solid var(--pricing-accent);outline-offset:-2px}@media (max-width: 640px){.gengen-pricing-scroll-hint{display:block;color:var(--pricing-muted);font-size:12px}.gengen-pricing-model-header{padding:16px}}"}]}
{"page":{"pagePath":"api-reference/google/chat-completions","slug":"/api-reference/google/chat-completions","pageMetadata":{"title":"Chat completions with Gemini","sidebarTitle":"Chat completions","description":"Generate synchronous or streaming text with Gemini 4 Neon, Gemini 4 Hydrogen, Gemini 4 Carbon, Gemini 4 Argon, Gemini 3.8 Flash, Gemini 3.7 Flash, or Gemini 3.5 Flash-Lite through the GENGEN Chat Completions API.","openapi":"openapi/google.yaml POST /chat/completions","href":"/api-reference/google/chat-completions"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Generate synchronous or streaming text with Gemini 4 Neon, Gemini 4 Hydrogen, Gemini 4 Carbon, Gemini 4 Argon, Gemini 3.8 Flash, Gemini 3.7 Flash, or Gemini 3.5 Flash-Lite through the GENGEN Chat Completions API.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{CodeBlock,Heading,Note,Table}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!Table)_missingMdxReference(`Table`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Use the OpenAI-compatible Chat Completions endpoint with `,_jsx(_components.code,{children:`gemini-4-neon`}),`, `,_jsx(_components.code,{children:`gemini-4-hydrogen`}),`, `,_jsx(_components.code,{children:`gemini-4-carbon`}),`, `,_jsx(_components.code,{children:`gemini-4-argon`}),`, `,_jsx(_components.code,{children:`gemini-3.8-flash`}),`, `,_jsx(_components.code,{children:`gemini-3.7-flash`}),`, or `,_jsx(_components.code,{children:`gemini-3.5-flash-lite`}),`.`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Property`}),_jsx(_components.th,{children:`Value`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Method`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`POST`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Endpoint`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`/api/gengen/v1/chat/completions`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Models`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`gemini-4-neon`}),`, `,_jsx(_components.code,{children:`gemini-4-hydrogen`}),`, `,_jsx(_components.code,{children:`gemini-4-carbon`}),`, `,_jsx(_components.code,{children:`gemini-4-argon`}),`, `,_jsx(_components.code,{children:`gemini-3.8-flash`}),`, `,_jsx(_components.code,{children:`gemini-3.7-flash`}),`, `,_jsx(_components.code,{children:`gemini-3.5-flash-lite`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Streaming`}),_jsx(_components.td,{children:`Server-Sent Events (SSE)`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`non-streaming-request`,children:`Non-streaming request`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`20`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`20`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --request`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#D7BA7D`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --url`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` https://gengen.farm/api/gengen/v1/chat/completions`}),_jsx(_components.span,{style:{color:`#D7BA7D`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --header`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` 'Authorization: Bearer gengen_live_xxxxxxxxxxxxxxxx'`}),_jsx(_components.span,{style:{color:`#D7BA7D`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --header`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` 'Content-Type: application/json'`}),_jsx(_components.span,{style:{color:`#D7BA7D`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --data`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"model\": \"gemini-3.5-flash-lite\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"messages\": [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"role\": \"system\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"content\": \"You are a concise technical assistant.\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"role\": \"user\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"content\": \"Explain idempotency in two sentences.\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` ],`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"reasoning_effort\": \"minimal\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"max_tokens\": 512,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"stream\": false`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`The response uses the OpenAI-compatible `,_jsx(_components.code,{children:`choices`}),` and `,_jsx(_components.code,{children:`usage`}),` fields.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`20`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`20`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"id\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"google-response-id\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"object\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"chat.completion\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"model\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"gemini-3.5-flash-lite\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"choices\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: [`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"index\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"message\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"role\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"assistant\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"content\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Idempotency means repeating the same operation produces the same intended effect. It prevents retries from creating duplicate changes.\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"finish_reason\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"stop\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"usage\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"prompt_tokens\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`32`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"completion_tokens\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`28`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"total_tokens\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`60`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`streaming-request`,children:`Streaming request`}),`\n`,_jsxs(_components.p,{children:[`Set `,_jsx(_components.code,{children:`stream`}),` to `,_jsx(_components.code,{children:`true`}),`. GENGEN returns `,_jsx(_components.code,{children:`text/event-stream`}),`, emits partial Chat Completions chunks, includes final usage, and terminates the stream with `,_jsx(_components.code,{children:`data: [DONE]`}),`.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`17`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`17`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --no-buffer`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --request`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#D7BA7D`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --url`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` https://gengen.farm/api/gengen/v1/chat/completions`}),_jsx(_components.span,{style:{color:`#D7BA7D`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --header`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` 'Authorization: Bearer gengen_live_xxxxxxxxxxxxxxxx'`}),_jsx(_components.span,{style:{color:`#D7BA7D`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --header`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` 'Content-Type: application/json'`}),_jsx(_components.span,{style:{color:`#D7BA7D`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --data`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"model\": \"gemini-3.8-flash\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"messages\": [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"role\": \"user\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"content\": \"Write a one-line product description.\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` ],`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"stream\": true,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"stream_options\": {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"include_usage\": true`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`6`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`6`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`data: {\"id\":\"google-response-id\",\"object\":\"chat.completion.chunk\",\"model\":\"gemini-3.8-flash\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"A fast\"},\"finish_reason\":null}]}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`data: {\"id\":\"google-response-id\",\"object\":\"chat.completion.chunk\",\"model\":\"gemini-3.8-flash\",\"choices\":[],\"usage\":{\"prompt_tokens\":16,\"completion_tokens\":8,\"total_tokens\":24}}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`data: [DONE]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Note,{children:_jsx(_components.p,{children:`This is unidirectional text streaming over SSE. It is separate from the bidirectional Gemini Live API.`})}),`\n`,_jsx(Heading,{level:`2`,id:`reasoning-level`,children:`Reasoning level`}),`\n`,_jsxs(_components.p,{children:[`Gemini 4 Carbon, Gemini 4 Argon, Gemini 3.8 Flash, and Gemini 3.7 Flash accept `,_jsx(_components.code,{children:`low`}),`, `,_jsx(_components.code,{children:`medium`}),`, or `,_jsx(_components.code,{children:`high`}),` and default to `,_jsx(_components.code,{children:`medium`}),`. Gemini 3.5 Flash-Lite also accepts `,_jsx(_components.code,{children:`minimal`}),`, defaults to `,_jsx(_components.code,{children:`minimal`}),`, and recommends it for extraction and other straightforward, latency-sensitive tasks.`]}),`\n`,_jsx(Heading,{level:`2`,id:`gemini-3-5-flash-lite-constraints`,children:`Gemini 3.5 Flash-Lite constraints`}),`\n`,_jsxs(_components.p,{children:[`Gemini 3.5 Flash-Lite ignores custom `,_jsx(_components.code,{children:`temperature`}),`, `,_jsx(_components.code,{children:`top_p`}),`, and `,_jsx(_components.code,{children:`top_k`}),` values. It rejects `,_jsx(_components.code,{children:`frequency_penalty`}),` and `,_jsx(_components.code,{children:`presence_penalty`}),`, and the final non-system message must not use the `,_jsx(_components.code,{children:`assistant`}),` role.`]}),`\n`,_jsx(Heading,{level:`2`,id:`parameters`,children:`Parameters`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Parameter`}),_jsx(_components.th,{children:`Type`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`messages`})}),_jsx(_components.td,{children:`array`}),_jsxs(_components.td,{children:[`Required conversation history. `,_jsx(_components.code,{children:`system`}),` and `,_jsx(_components.code,{children:`developer`}),` messages become the Gemini system instruction; text, image, video, and audio parts are supported.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`reasoning_effort`})}),_jsx(_components.td,{children:`string`}),_jsxs(_components.td,{children:[`Hydrogen and Neon support `,_jsx(_components.code,{children:`low`}),`, `,_jsx(_components.code,{children:`medium`}),`, `,_jsx(_components.code,{children:`high`}),` (default), and `,_jsx(_components.code,{children:`xhigh`}),`. `,_jsx(_components.code,{children:`low`}),`, `,_jsx(_components.code,{children:`medium`}),`, or `,_jsx(_components.code,{children:`high`}),` for Gemini 4 Carbon, Gemini 4 Argon, Gemini 3.8 Flash, and Gemini 3.7 Flash; Gemini 3.5 Flash-Lite also supports `,_jsx(_components.code,{children:`minimal`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`temperature`})}),_jsx(_components.td,{children:`number`}),_jsx(_components.td,{children:`Sampling temperature. Gemini 3.5 Flash-Lite ignores custom values.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`top_p`})}),_jsx(_components.td,{children:`number`}),_jsxs(_components.td,{children:[`Nucleus-sampling threshold from `,_jsx(_components.code,{children:`0`}),` to `,_jsx(_components.code,{children:`1`}),`. Gemini 3.5 Flash-Lite ignores custom values.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`top_k`})}),_jsx(_components.td,{children:`number`}),_jsx(_components.td,{children:`Restricts sampling to the most likely K tokens. Gemini 3.5 Flash-Lite ignores custom values.`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`max_tokens`}),` / `,_jsx(_components.code,{children:`max_completion_tokens`})]}),_jsx(_components.td,{children:`integer`}),_jsx(_components.td,{children:`Maximum generated tokens.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`stop`})}),_jsx(_components.td,{children:`string or string[]`}),_jsx(_components.td,{children:`One or more stop sequences.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`frequency_penalty`})}),_jsx(_components.td,{children:`number`}),_jsx(_components.td,{children:`Penalizes repeated token frequency. Not supported by Gemini 4 Neon, Gemini 4 Hydrogen, Gemini 4 Carbon, or Gemini 3.5 Flash-Lite.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`presence_penalty`})}),_jsx(_components.td,{children:`number`}),_jsx(_components.td,{children:`Penalizes tokens already present in the output. Not supported by Gemini 4 Neon, Gemini 4 Hydrogen, Gemini 4 Carbon, or Gemini 3.5 Flash-Lite.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`seed`})}),_jsx(_components.td,{children:`integer`}),_jsx(_components.td,{children:`Best-effort deterministic sampling seed.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`response_format`})}),_jsx(_components.td,{children:`object`}),_jsxs(_components.td,{children:[`Use `,_jsx(_components.code,{children:`json_object`}),` or `,_jsx(_components.code,{children:`json_schema`}),` for structured output.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`stream`})}),_jsx(_components.td,{children:`boolean`}),_jsx(_components.td,{children:`Enables SSE streaming.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`providerOptions.google`})}),_jsx(_components.td,{children:`object`}),_jsxs(_components.td,{children:[`Advanced Google `,_jsx(_components.code,{children:`generationConfig`}),`, `,_jsx(_components.code,{children:`safetySettings`}),`, `,_jsx(_components.code,{children:`tools`}),`, and `,_jsx(_components.code,{children:`toolConfig`}),`. Normalized parameters above take precedence.`]})]})]})]}),`\n`,_jsxs(_components.p,{children:[`The API fixes `,_jsx(_components.code,{children:`candidateCount`}),` to `,_jsx(_components.code,{children:`1`}),` so the OpenAI-compatible response always contains one generated choice. Repeated requests with the same `,_jsx(_components.code,{children:`seed`}),` are not guaranteed to produce identical output.`]}),`\n`,_jsxs(_components.p,{children:[`See the `,_jsx(_components.a,{href:`/models/gemini-3.8-flash`,children:`Gemini 3.8 Flash`}),`, `,_jsx(_components.a,{href:`/models/gemini-3.7-flash`,children:`Gemini 3.7 Flash`}),` and `,_jsx(_components.a,{href:`/models/gemini-3.5-flash-lite`,children:`Gemini 3.5 Flash-Lite`}),` model pages for details.`]}),`\n`,_jsxs(_components.p,{children:[`Gemini 3.8 Flash defaults to `,_jsx(_components.code,{children:`medium`}),` reasoning and rejects `,_jsx(_components.code,{children:`minimal`}),`, unsupported reasoning levels, and `,_jsx(_components.code,{children:`thinkingBudget`}),` overrides. Use `,_jsx(_components.code,{children:`low`}),`, `,_jsx(_components.code,{children:`medium`}),`, or `,_jsx(_components.code,{children:`high`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`function-calling-and-built-in-tools`,children:`Function calling and built-in tools`}),`\n`,_jsxs(_components.p,{children:[`Function calling, Code execution, and Computer use are supported for all listed Gemini models.\nSee `,_jsx(_components.a,{href:`/api-reference/google/tools`,children:`Gemini tools`}),` for complete requests, multi-turn\nresult submission, thought signature preservation, streaming behavior, and billing.`]}),`\n`,_jsx(Heading,{level:`2`,id:`gemini-4-carbon-and-argon-limits`,children:`Gemini 4 Carbon and Argon limits`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.a,{href:`/models/gemini-4-carbon`,children:_jsx(_components.code,{children:`gemini-4-carbon`})}),` and `,_jsx(_components.a,{href:`/models/gemini-4-argon`,children:_jsx(_components.code,{children:`gemini-4-argon`})}),` share a 1,048,576-token window between input, reasoning, and output. The default output budget is 32,768 tokens for non-streaming requests and 65,536 with `,_jsx(_components.code,{children:`stream: true`}),`. Set a larger budget to enable automatic continuation.`]}),`\n`,_jsxs(_components.p,{children:[`Reasoning defaults to `,_jsx(_components.code,{children:`medium`}),`; use `,_jsx(_components.code,{children:`low`}),`, `,_jsx(_components.code,{children:`medium`}),`, or `,_jsx(_components.code,{children:`high`}),`. Thinking budgets and `,_jsx(_components.code,{children:`minimal`}),` return HTTP 400. Custom `,_jsx(_components.code,{children:`temperature`}),`, `,_jsx(_components.code,{children:`top_p`}),`, and `,_jsx(_components.code,{children:`top_k`}),` values are ignored. Implicit caching is automatic; explicit cache management is not exposed.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`\"model\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"gemini-4-carbon\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`\"messages\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`:[{`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`\"role\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"user\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`\"content\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Review this algorithm for correctness.\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}],`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`\"reasoning_effort\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"medium\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`\"max_output_tokens\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`4096`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`\"stream\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`true`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`carbon-hydrogen-and-neon-conversation-constraints`,children:`Carbon, Hydrogen, and Neon conversation constraints`}),`\n`,_jsxs(_components.p,{children:[`Gemini 4 Carbon, Hydrogen, and Neon reject `,_jsx(_components.code,{children:`frequency_penalty`}),`, `,_jsx(_components.code,{children:`presence_penalty`}),`, and candidate counts other than one (`,_jsx(_components.code,{children:`n`}),` or advanced `,_jsx(_components.code,{children:`candidateCount`}),`). End your history with a user message or completed tool results. Assistant prefills are not supported.`]}),`\n`,_jsxs(_components.p,{children:[`Return every tool result in the order of the preceding calls, using the matching `,_jsx(_components.code,{children:`tool_call_id`}),` (Chat Completions) or `,_jsx(_components.code,{children:`call_id`}),` (Responses). Submit all pending results before another conversation turn. Preserve Google metadata as described in `,_jsx(_components.a,{href:`/api-reference/google/tools`,children:`Gemini tools`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`gemini-4-hydrogen-and-neon`,children:`Gemini 4 Hydrogen and Neon`}),`\n`,_jsxs(_components.p,{children:[`Hydrogen and Neon support `,_jsx(_components.a,{href:`/api-reference/google/tools`,children:`Google Search, URL Context and Agentic video`}),`.\nUse `,_jsx(_components.a,{href:`/api-reference/google/token-counts`,children:`Count input tokens`}),` before generation without a wallet charge.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.a,{href:`/models/gemini-4-neon`,children:_jsx(_components.code,{children:`gemini-4-neon`})}),` and `,_jsx(_components.a,{href:`/models/gemini-4-hydrogen`,children:_jsx(_components.code,{children:`gemini-4-hydrogen`})}),` default to `,_jsx(_components.strong,{children:`65,536 output tokens`}),` for synchronous and streaming requests. To allow a longer turn, set the output budget to an integer up to `,_jsx(_components.strong,{children:`1,048,576`}),`. Input, reasoning, tool calls, and final output share this window.`]}),`\n`,_jsx(_components.p,{children:`GENGEN follows Gemini 4 continuation segments automatically while the request is open. Usage includes input processed again on later segments, cache reads, and generated tokens. Use streaming for large responses. Foreground calls have a 13-minute upstream deadline, and generation can finish before reaching the requested budget.`}),`\n`,_jsxs(_components.p,{children:[`Use `,_jsx(_components.code,{children:`reasoning_effort: \"low\"`}),`, `,_jsx(_components.code,{children:`\"medium\"`}),`, `,_jsx(_components.code,{children:`\"high\"`}),` (default), or `,_jsx(_components.code,{children:`\"xhigh\"`}),`.\nThinking budgets and `,_jsx(_components.code,{children:`minimal`}),` return HTTP 400. Custom `,_jsx(_components.code,{children:`temperature`}),`, `,_jsx(_components.code,{children:`top_p`}),`, and\n`,_jsx(_components.code,{children:`top_k`}),` are ignored. Implicit caching applies automatically to shared prefixes of\nat least 4,096 tokens; explicit cache references are not accepted.`]}),`\n`,_jsxs(_components.p,{children:[`Preserve `,_jsx(_components.code,{children:`providerMetadata.google.parts`}),` on every returned assistant item,\nincluding final text and previous tool turns. Only the first function call in a\nparallel turn carries a thought signature. If your application edits or compacts\nprevious history, set the following option; otherwise the default `,_jsx(_components.code,{children:`ERROR`}),` behavior\nrejects signatures whose original conversation prefix has changed:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`9`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`9`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"providerOptions\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"google\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"generationConfig\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"thinkingConfig\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: { `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`\"prefixMismatchBehavior\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"DROP\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`DROP`}),` discards mismatched reasoning signatures while retaining visible history;\nit does not replace missing tool-call metadata. See `,_jsx(_components.a,{href:`/api-reference/google/tools`,children:`Gemini tools`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`Supply Office and OpenDocument inputs through `,_jsx(_components.code,{children:`file`}),` / `,_jsx(_components.code,{children:`input_file`}),` content parts\nusing `,_jsx(_components.code,{children:`file_data`}),` Base64 data URLs with the document’s correct MIME type. The same\ncontent parts are accepted inside tool results. Cloud Storage object references\nare not accepted by the GENGEN media-input interface.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"codeStyling":"dark","config":{},"pageMetadata":{"title":"Chat completions with Gemini","sidebarTitle":"Chat completions","description":"Generate synchronous or streaming text with Gemini 4 Neon, Gemini 4 Hydrogen, Gemini 4 Carbon, Gemini 4 Argon, Gemini 3.8 Flash, Gemini 3.7 Flash, or Gemini 3.5 Flash-Lite through the GENGEN Chat Completions API.","openapi":"openapi/google.yaml POST /chat/completions","href":"/api-reference/google/chat-completions"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Non-streaming request","slug":"non-streaming-request","depth":2,"children":[]},{"title":"Streaming request","slug":"streaming-request","depth":2,"children":[]},{"title":"Reasoning level","slug":"reasoning-level","depth":2,"children":[]},{"title":"Gemini 3.5 Flash-Lite constraints","slug":"gemini-3-5-flash-lite-constraints","depth":2,"children":[]},{"title":"Parameters","slug":"parameters","depth":2,"children":[]},{"title":"Function calling and built-in tools","slug":"function-calling-and-built-in-tools","depth":2,"children":[]},{"title":"Gemini 4 Carbon and Argon limits","slug":"gemini-4-carbon-and-argon-limits","depth":2,"children":[{"title":"Carbon, Hydrogen, and Neon conversation constraints","slug":"carbon-hydrogen-and-neon-conversation-constraints","depth":3,"children":[]}]},{"title":"Gemini 4 Hydrogen and Neon","slug":"gemini-4-hydrogen-and-neon","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"operationId":"createGoogleChatCompletion","summary":"Create a Gemini chat completion","description":"Generate synchronous or streaming text with Gemini 4 Neon, Gemini 4 Hydrogen, Gemini 4 Carbon, Gemini 4 Argon, Gemini 3.8 Flash, Gemini 3.7 Flash, or Gemini 3.5 Flash-Lite through the GENGEN Chat Completions API.","requestBody":"7c9815c5-0d30-4959-81eb-567938c3ceea","responses":{"200":"46b3ebf3-d3c7-475b-85a4-996d2c8eb343","default":"7297b20c-de5f-4436-a3f8-7bfd45b42de1"},"method":"post","type":"path","servers":["eb5966f5-4cc6-4266-88bc-fe8469af0d3f"],"security":["3075ff68-cb7b-4712-a78d-1c234e453e38"],"path":"/chat/completions","baseUrlOptions":["https://gengen.farm/api/gengen/v1"],"title":"Create a Gemini chat completion","codeSamples":[],"requestExampleLanguages":["bash","python","javascript"],"requiredOnlyExamples":true,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","messages"],"properties":{"model":{"type":"string","enum":["gemini-4-neon","gemini-4-hydrogen","gemini-4-carbon","gemini-4-argon","gemini-3.8-flash","gemini-3.7-flash","gemini-3.5-flash-lite"],"description":"Public Gemini text model ID.","isRequired":true,"uniqueKey":"model","typeLabel":"enum\u003cstring>"},"messages":{"type":"array","minItems":1,"description":"Conversation messages. Gemini 4 Carbon, Hydrogen, and Neon require a final user or tool-result turn and tool results in function-call order; assistant prefills are not supported. System and developer messages become the Gemini system instruction.","items":{"type":"object","required":["role"],"properties":{"role":{"type":"string","enum":["system","developer","user","assistant","tool"],"description":"Message author. Assistant messages become Gemini `model` content. Gemini 3.5 Flash-Lite rejects a request whose final non-system message is `assistant`.","isRequired":true,"uniqueKey":"messages.items.[INDEX].role","typeLabel":"enum\u003cstring>"},"content":{"oneOf":[{"type":"null","uniqueKey":"messages.items.[INDEX].content.oneOf.0","typeLabel":"null"},{"type":"string","uniqueKey":"messages.items.[INDEX].content.oneOf.1","typeLabel":"string"},{"type":"array","items":{"oneOf":[{"type":"object","required":["type","text"],"properties":{"type":{"type":"string","enum":["input_text","output_text","text"],"isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.2.items.[INDEX].oneOf.0.type","typeLabel":"enum\u003cstring>"},"text":{"type":"string","description":"Text supplied to Gemini.","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.2.items.[INDEX].oneOf.0.text","typeLabel":"string"}},"uniqueKey":"messages.items.[INDEX].content.oneOf.2.items.[INDEX].oneOf.0","typeLabel":"object"},{"type":"object","required":["type","image_url"],"properties":{"type":{"type":"string","enum":["input_image","image_url"],"isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.2.items.[INDEX].oneOf.1.type","typeLabel":"enum\u003cstring>"},"image_url":{"oneOf":[{"type":"string","description":"Public or signed HTTPS URL, or Base64 data URL. Raw `gs://` URIs are not accepted.","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.2.items.[INDEX].oneOf.1.image_url.oneOf.0","typeLabel":"string"},{"type":"object","description":"Public or signed HTTPS URL, or Base64 data URL. Raw `gs://` URIs are not accepted.","required":["url"],"properties":{"url":{"type":"string","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.2.items.[INDEX].oneOf.1.image_url.oneOf.1.url","typeLabel":"string"}},"isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.2.items.[INDEX].oneOf.1.image_url.oneOf.1","typeLabel":"object"}],"isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.2.items.[INDEX].oneOf.1.image_url","typeLabel":"string | object"}},"uniqueKey":"messages.items.[INDEX].content.oneOf.2.items.[INDEX].oneOf.1","typeLabel":"object"},{"type":"object","required":["type","video_url"],"properties":{"type":{"type":"string","const":"input_video","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.2.items.[INDEX].oneOf.2.type","typeLabel":"string"},"video_url":{"oneOf":[{"type":"string","description":"Public or signed HTTPS URL, or Base64 data URL. Raw `gs://` URIs are not accepted.","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.2.items.[INDEX].oneOf.2.video_url.oneOf.0","typeLabel":"string"},{"type":"object","description":"Public or signed HTTPS URL, or Base64 data URL. Raw `gs://` URIs are not accepted.","required":["url"],"properties":{"url":{"type":"string","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.2.items.[INDEX].oneOf.2.video_url.oneOf.1.url","typeLabel":"string"}},"isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.2.items.[INDEX].oneOf.2.video_url.oneOf.1","typeLabel":"object"}],"isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.2.items.[INDEX].oneOf.2.video_url","typeLabel":"string | object"},"mediaProcessing":{"type":"string","enum":["STATIC","AGENTIC"],"default":"STATIC","description":"Hydrogen and Neon only. STATIC samples the video; AGENTIC lets Gemini inspect relevant segments. AGENTIC cannot share a request with Google Search. Snake-case media_processing is also accepted.","uniqueKey":"messages.items.[INDEX].content.oneOf.2.items.[INDEX].oneOf.2.mediaProcessing","typeLabel":"enum\u003cstring>"},"fps":{"type":"number","exclusiveMinimum":0,"maximum":24,"default":1,"description":"Video sampling rate in frames per second.","uniqueKey":"messages.items.[INDEX].content.oneOf.2.items.[INDEX].oneOf.2.fps","typeLabel":"number"},"startOffset":{"oneOf":[{"type":"number","description":"Clip start in seconds, such as `2` or `2s`.","uniqueKey":"messages.items.[INDEX].content.oneOf.2.items.[INDEX].oneOf.2.startOffset.oneOf.0","typeLabel":"number"},{"type":"string","description":"Clip start in seconds, such as `2` or `2s`.","uniqueKey":"messages.items.[INDEX].content.oneOf.2.items.[INDEX].oneOf.2.startOffset.oneOf.1","typeLabel":"string"}],"uniqueKey":"messages.items.[INDEX].content.oneOf.2.items.[INDEX].oneOf.2.startOffset","typeLabel":"number | string"},"endOffset":{"oneOf":[{"type":"number","description":"Clip end in seconds, such as `8.5` or `8.5s`.","uniqueKey":"messages.items.[INDEX].content.oneOf.2.items.[INDEX].oneOf.2.endOffset.oneOf.0","typeLabel":"number"},{"type":"string","description":"Clip end in seconds, such as `8.5` or `8.5s`.","uniqueKey":"messages.items.[INDEX].content.oneOf.2.items.[INDEX].oneOf.2.endOffset.oneOf.1","typeLabel":"string"}],"uniqueKey":"messages.items.[INDEX].content.oneOf.2.items.[INDEX].oneOf.2.endOffset","typeLabel":"number | string"},"mediaResolution":{"type":"string","enum":["low","medium","high"],"description":"Per-video tokenization quality.","uniqueKey":"messages.items.[INDEX].content.oneOf.2.items.[INDEX].oneOf.2.mediaResolution","typeLabel":"enum\u003cstring>"}},"uniqueKey":"messages.items.[INDEX].content.oneOf.2.items.[INDEX].oneOf.2","typeLabel":"object"},{"type":"object","required":["type","audio_url"],"properties":{"type":{"type":"string","const":"input_audio","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.2.items.[INDEX].oneOf.3.type","typeLabel":"string"},"audio_url":{"oneOf":[{"type":"string","description":"Public or signed HTTPS URL, or Base64 data URL. Raw `gs://` URIs are not accepted.","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.2.items.[INDEX].oneOf.3.audio_url.oneOf.0","typeLabel":"string"},{"type":"object","description":"Public or signed HTTPS URL, or Base64 data URL. Raw `gs://` URIs are not accepted.","required":["url"],"properties":{"url":{"type":"string","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.2.items.[INDEX].oneOf.3.audio_url.oneOf.1.url","typeLabel":"string"}},"isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.2.items.[INDEX].oneOf.3.audio_url.oneOf.1","typeLabel":"object"}],"isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.2.items.[INDEX].oneOf.3.audio_url","typeLabel":"string | object"}},"uniqueKey":"messages.items.[INDEX].content.oneOf.2.items.[INDEX].oneOf.3","typeLabel":"object"},{"type":"object","required":["type","file_data"],"properties":{"type":{"type":"string","const":"input_file","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.2.items.[INDEX].oneOf.4.type","typeLabel":"string"},"file_data":{"type":"string","description":"Base64 data URL for an inline file, including CSV for Code execution.","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.2.items.[INDEX].oneOf.4.file_data","typeLabel":"string"}},"uniqueKey":"messages.items.[INDEX].content.oneOf.2.items.[INDEX].oneOf.4","typeLabel":"object"}],"uniqueKey":"messages.items.[INDEX].content.oneOf.2.items.[INDEX]","typeLabel":"object"},"uniqueKey":"messages.items.[INDEX].content.oneOf.2","typeLabel":"object[]"}],"uniqueKey":"messages.items.[INDEX].content","typeLabel":"null | string | object[]"},"tool_calls":{"type":"array","items":{"type":"object","additionalProperties":true,"uniqueKey":"messages.items.[INDEX].tool_calls.items.[INDEX]","typeLabel":"object"},"description":"Assistant function calls. Preserve call IDs and extra_content.","uniqueKey":"messages.items.[INDEX].tool_calls","typeLabel":"object[]"},"tool_call_id":{"type":"string","description":"Matching call ID for a tool result.","uniqueKey":"messages.items.[INDEX].tool_call_id","typeLabel":"string"},"providerMetadata":{"type":"object","additionalProperties":true,"description":"Preserve google.parts unchanged when replaying model output, including thought signatures and execution results.","uniqueKey":"messages.items.[INDEX].providerMetadata","typeLabel":"object"}},"uniqueKey":"messages.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"messages","typeLabel":"object[]"},"n":{"type":"integer","description":"Carbon, Hydrogen, and Neon accept only one candidate. Omit this field or set it to 1.","uniqueKey":"n","typeLabel":"integer"},"reasoning_effort":{"type":"string","enum":["minimal","low","medium","high","xhigh"],"description":"Gemini thinking level. Hydrogen and Neon support low, medium, high (default), and xhigh; thinking budgets and minimal are rejected. `minimal` is supported by Gemini 3.5 Flash-Lite but not Gemini 4 Carbon, Gemini 4 Argon, Gemini 3.8 Flash or Gemini 3.7 Flash. Gemini 4 Carbon, Gemini 4 Argon, and Gemini 3.8 Flash default to `medium` and reject thinking budgets.","uniqueKey":"reasoning_effort","typeLabel":"enum\u003cstring>"},"temperature":{"type":"number","description":"Sampling temperature. Higher values increase variation. Custom values are ignored by Gemini 4 Neon, Gemini 4 Hydrogen, Gemini 4 Carbon, Gemini 4 Argon, and Gemini 3.5 Flash-Lite.","uniqueKey":"temperature","typeLabel":"number"},"top_p":{"type":"number","minimum":0,"maximum":1,"description":"Nucleus-sampling probability threshold. Custom values are ignored by Gemini 4 Neon, Gemini 4 Hydrogen, Gemini 4 Carbon, Gemini 4 Argon, and Gemini 3.5 Flash-Lite.","uniqueKey":"top_p","typeLabel":"number"},"top_k":{"type":"number","minimum":1,"description":"Limits sampling to the most likely K tokens. Custom values are ignored by Gemini 4 Neon, Gemini 4 Hydrogen, Gemini 4 Carbon, Gemini 4 Argon, and Gemini 3.5 Flash-Lite.","uniqueKey":"top_k","typeLabel":"number"},"max_tokens":{"type":"integer","minimum":1,"description":"Gemini 4 accepts integer output budgets from 1 through 1048576 with automatic continuation. Input and output share the context window. Neon and Hydrogen default to 65536. Carbon and Argon default to 32768 synchronously and 65536 with streaming. `max_completion_tokens` is an accepted alias.","uniqueKey":"max_tokens","typeLabel":"integer"},"max_completion_tokens":{"type":"integer","minimum":1,"description":"Gemini 4 accepts integer output budgets from 1 through 1048576 with automatic continuation. Input and output share the context window. Neon and Hydrogen default to 65536. Carbon and Argon default to 32768 synchronously and 65536 with streaming.","uniqueKey":"max_completion_tokens","typeLabel":"integer"},"stop":{"oneOf":[{"type":"string","description":"One or more sequences that stop generation.","uniqueKey":"stop.oneOf.0","typeLabel":"string"},{"type":"array","items":{"type":"string","uniqueKey":"stop.oneOf.1.items.[INDEX]","typeLabel":"string"},"description":"One or more sequences that stop generation.","uniqueKey":"stop.oneOf.1","typeLabel":"string[]"}],"uniqueKey":"stop","typeLabel":"string | string[]"},"frequency_penalty":{"type":"number","description":"Penalizes tokens according to how often they already appear. Gemini 4 Neon, Gemini 4 Hydrogen, Gemini 4 Carbon, and Gemini 3.5 Flash-Lite reject this parameter.","uniqueKey":"frequency_penalty","typeLabel":"number"},"presence_penalty":{"type":"number","description":"Penalizes tokens that have already appeared at least once. Gemini 4 Neon, Gemini 4 Hydrogen, Gemini 4 Carbon, and Gemini 3.5 Flash-Lite reject this parameter.","uniqueKey":"presence_penalty","typeLabel":"number"},"seed":{"type":"integer","description":"Best-effort sampling seed. Identical outputs are not guaranteed.","uniqueKey":"seed","typeLabel":"integer"},"response_format":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["text","json_object","json_schema"],"description":"Structured JSON modes are supported by both public Gemini text models.","isRequired":true,"uniqueKey":"response_format.type","typeLabel":"enum\u003cstring>"},"json_schema":{"type":"object","properties":{"name":{"type":"string","uniqueKey":"response_format.json_schema.name","typeLabel":"string"},"strict":{"type":"boolean","uniqueKey":"response_format.json_schema.strict","typeLabel":"boolean"},"schema":{"type":"object","additionalProperties":true,"uniqueKey":"response_format.json_schema.schema","typeLabel":"object"}},"description":"JSON Schema definition for `json_schema` output.","uniqueKey":"response_format.json_schema","typeLabel":"object"},"schema":{"type":"object","additionalProperties":true,"description":"Responses-style JSON Schema definition.","uniqueKey":"response_format.schema","typeLabel":"object"}},"uniqueKey":"response_format","typeLabel":"object"},"stream":{"type":"boolean","default":false,"description":"Return Server-Sent Events when true.","uniqueKey":"stream","typeLabel":"boolean"},"stream_options":{"type":"object","description":"Streaming compatibility options.","properties":{"include_usage":{"type":"boolean","description":"Include usage in the final stream event.","uniqueKey":"stream_options.include_usage","typeLabel":"boolean"}},"uniqueKey":"stream_options","typeLabel":"object"},"tools":{"type":"array","description":"Function declarations. Chat uses nested function objects; Responses uses flat function declarations. Built-in tools belong in providerOptions.google.tools.","items":{"type":"object","additionalProperties":true,"uniqueKey":"tools.items.[INDEX]","typeLabel":"object"},"uniqueKey":"tools","typeLabel":"object[]"},"tool_choice":{"oneOf":[{"type":"string","description":"auto, none, required, or a named function object. The function name must be declared in tools.","enum":["auto","none","required"],"uniqueKey":"tool_choice.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"object","description":"auto, none, required, or a named function object. The function name must be declared in tools.","additionalProperties":true,"uniqueKey":"tool_choice.oneOf.1","typeLabel":"object"}],"uniqueKey":"tool_choice","typeLabel":"enum\u003cstring> | object"},"parallel_tool_calls":{"type":"boolean","const":true,"description":"Omit or use true. Gemini can return multiple calls; false is rejected.","uniqueKey":"parallel_tool_calls","typeLabel":"boolean"},"providerOptions":{"type":"object","properties":{"google":{"type":"object","properties":{"tools":{"type":"array","description":"Native Google tools. Each entry defines functionDeclarations, codeExecution, computerUse, or (Hydrogen and Neon only) googleSearch or urlContext. Search and URL Context accept empty objects only. Use Search separately from other built-in tools and AGENTIC video so their different input billing can be measured. User-defined functions can coexist with Search.","items":{"type":"object","additionalProperties":true,"uniqueKey":"providerOptions.google.tools.items.[INDEX]","typeLabel":"object"},"examples":[[{"codeExecution":{}}],[{"computerUse":{"environment":"ENVIRONMENT_BROWSER"}}],[{"googleSearch":{}}],[{"urlContext":{}}]],"uniqueKey":"providerOptions.google.tools","typeLabel":"object[]"},"toolConfig":{"type":"object","additionalProperties":true,"description":"Google ToolConfig. Normalized tool_choice takes precedence. streamFunctionCallArguments=true is rejected; SSE emits complete call arguments.","uniqueKey":"providerOptions.google.toolConfig","typeLabel":"object"},"thinkingLevel":{"type":"string","enum":["MINIMAL","LOW","MEDIUM","HIGH","XHIGH"],"description":"Provider-native alias for `reasoning_effort`. MINIMAL is supported only by Gemini 3.5 Flash-Lite; XHIGH is supported by Hydrogen and Neon, which default to HIGH.","uniqueKey":"providerOptions.google.thinkingLevel","typeLabel":"enum\u003cstring>"},"generationConfig":{"type":"object","description":"Advanced generation options. Hydrogen and Neon thinkingConfig accepts thinkingLevel (LOW, MEDIUM, HIGH, XHIGH) and prefixMismatchBehavior (ERROR by default, or DROP for edited or compacted history). Explicit caches and continuation tokens are not supported.","properties":{"thinkingConfig":{"type":"object","properties":{"thinkingLevel":{"type":"string","enum":["MINIMAL","LOW","MEDIUM","HIGH","XHIGH"],"description":"Model-specific thinking level. Hydrogen and Neon accept LOW, MEDIUM, HIGH (default), or XHIGH.","uniqueKey":"providerOptions.google.generationConfig.thinkingConfig.thinkingLevel","typeLabel":"enum\u003cstring>"},"prefixMismatchBehavior":{"type":"string","enum":["ERROR","DROP"],"description":"Hydrogen and Neon only. ERROR is the default; DROP discards mismatched signatures after earlier history is edited or compacted.","uniqueKey":"providerOptions.google.generationConfig.thinkingConfig.prefixMismatchBehavior","typeLabel":"enum\u003cstring>"}},"uniqueKey":"providerOptions.google.generationConfig.thinkingConfig","typeLabel":"object"},"mediaResolution":{"type":"string","enum":["MEDIA_RESOLUTION_LOW","MEDIA_RESOLUTION_MEDIUM","MEDIA_RESOLUTION_HIGH"],"uniqueKey":"providerOptions.google.generationConfig.mediaResolution","typeLabel":"enum\u003cstring>"},"responseLogprobs":{"type":"boolean","uniqueKey":"providerOptions.google.generationConfig.responseLogprobs","typeLabel":"boolean"},"logprobs":{"type":"integer","minimum":1,"maximum":20,"uniqueKey":"providerOptions.google.generationConfig.logprobs","typeLabel":"integer"}},"uniqueKey":"providerOptions.google.generationConfig","typeLabel":"object"},"safetySettings":{"type":"array","description":"Optional content safety settings.","items":{"type":"object","additionalProperties":true,"uniqueKey":"providerOptions.google.safetySettings.items.[INDEX]","typeLabel":"object"},"uniqueKey":"providerOptions.google.safetySettings","typeLabel":"object[]"}},"uniqueKey":"providerOptions.google","typeLabel":"object"}},"uniqueKey":"providerOptions","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"example":{"model":"gemini-3.5-flash-lite","messages":[{"role":"system","content":"You are a concise technical assistant."},{"role":"user","content":"Explain idempotency in two sentences."}],"reasoning_effort":"minimal","max_tokens":512,"stream":false},"examples":{"Example":{"title":"Example","value":{"model":"gemini-3.5-flash-lite","messages":[{"role":"system","content":"You are a concise technical assistant."},{"role":"user","content":"Explain idempotency in two sentences."}],"reasoning_effort":"minimal","max_tokens":512,"stream":false}}},"exampleType":"examples"}},"exampleType":"examples"},"responses":{"46b3ebf3-d3c7-475b-85a4-996d2c8eb343":{"description":"An OpenAI-compatible chat completion or SSE stream.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","uniqueKey":"id","typeLabel":"string"},"object":{"type":"string","const":"chat.completion","uniqueKey":"object","typeLabel":"string"},"created":{"type":"integer","uniqueKey":"created","typeLabel":"integer"},"model":{"type":"string","uniqueKey":"model","typeLabel":"string"},"choices":{"type":"array","items":{"type":"object","additionalProperties":true,"uniqueKey":"choices.items.[INDEX]","typeLabel":"object"},"uniqueKey":"choices","typeLabel":"object[]"},"usage":{"type":"object","additionalProperties":true,"uniqueKey":"usage","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"id":"\u003cstring>","object":"chat.completion","created":123,"model":"\u003cstring>","choices":[{}],"usage":{}}}},"exampleType":"generated"}},"exampleType":"generated"},"7297b20c-de5f-4436-a3f8-7bfd45b42de1":{"description":"The request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","uniqueKey":"error.message","typeLabel":"string"}},"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"code":"\u003cstring>","message":"\u003cstring>"}}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"3075ff68-cb7b-4712-a78d-1c234e453e38":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"GENGEN API key","description":"A workspace API key beginning with `gengen_live_`.","scopes":[],"schemeName":"bearerAuth"}}},"servers":{"eb5966f5-4cc6-4266-88bc-fe8469af0d3f":{"url":"https://gengen.farm/api/gengen/v1","description":"Production"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","bearerFormat":"GENGEN API key","description":"A workspace API key beginning with `gengen_live_`.","scopes":[],"schemeName":"bearerAuth"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"A workspace API key beginning with `gengen_live_`.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"bearerAuth","name":"Authorization"}],"title":"bearerAuth"}]},"originalFileLocation":"openapi/google.yaml"},"subdomain":"apifarm","siteName":"GENGEN API","title":"Chat completions with Gemini - GENGEN API","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-20T05:15:38.437Z","originalFileLocation":"api-reference/google/chat-completions.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"dark\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Generate synchronous or streaming text with Gemini 4 Neon, Gemini 4 Hydrogen, Gemini 4 Carbon, Gemini 4 Argon, Gemini 3.8 Flash, Gemini 3.7 Flash, or Gemini 3.5 Flash-Lite through the GENGEN Chat Completions API.\">\u003cmeta data-mint-head name=\"application-name\" content=\"GENGEN API\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/apifarm/L9vLMowDZG_ohQU0/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/apifarm/L9vLMowDZG_ohQU0/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/apifarm/L9vLMowDZG_ohQU0/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/apifarm/L9vLMowDZG_ohQU0/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/apifarm/L9vLMowDZG_ohQU0/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/apifarm/L9vLMowDZG_ohQU0/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/apifarm/L9vLMowDZG_ohQU0/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/apifarm/L9vLMowDZG_ohQU0/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/apifarm/L9vLMowDZG_ohQU0/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Chat completions with Gemini - GENGEN API\">\u003cmeta data-mint-head property=\"og:description\" content=\"Generate synchronous or streaming text with Gemini 4 Neon, Gemini 4 Hydrogen, Gemini 4 Carbon, Gemini 4 Argon, Gemini 3.8 Flash, Gemini 3.7 Flash, or Gemini 3.5 Flash-Lite through the GENGEN Chat Completions API.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"GENGEN API\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.gengen.farm/api-reference/google/chat-completions\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://apifarm.mintlify.site/_mintlify/api/og/v2?division=Text+API\u0026amp;title=Chat+completions+with+Gemini\u0026amp;description=Generate+synchronous+or+streaming+text+with+Gemini+4+Neon%2C+Gemini+4+Hydrogen%2C+Gemini+4+Carbon%2C+Gemini+4+Argon%2C+Gemini+3.8+Flash%2C+Gemini+3.7+Flash%2C+or+Gemini+3.5\u0026amp;theme=2ec39a2db59b215c26a0196f\u0026amp;signature=8509ca585a6bcf1581691d5755abc227ae3397ffb5ef0aeaef4d6e56e5c43632\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Chat completions with Gemini - GENGEN API\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Generate synchronous or streaming text with Gemini 4 Neon, Gemini 4 Hydrogen, Gemini 4 Carbon, Gemini 4 Argon, Gemini 3.8 Flash, Gemini 3.7 Flash, or Gemini 3.5 Flash-Lite through the GENGEN Chat Completions API.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://apifarm.mintlify.site/_mintlify/api/og/v2?division=Text+API\u0026amp;title=Chat+completions+with+Gemini\u0026amp;description=Generate+synchronous+or+streaming+text+with+Gemini+4+Neon%2C+Gemini+4+Hydrogen%2C+Gemini+4+Carbon%2C+Gemini+4+Argon%2C+Gemini+3.8+Flash%2C+Gemini+3.7+Flash%2C+or+Gemini+3.5\u0026amp;theme=2ec39a2db59b215c26a0196f\u0026amp;signature=8509ca585a6bcf1581691d5755abc227ae3397ffb5ef0aeaef4d6e56e5c43632\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/apifarm/L9vLMowDZG_ohQU0/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"GENGEN API\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#007F7C\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.gengen.farm/api-reference/google/chat-completions\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/google/chat-completions.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.gengen.farm/#organization\",\"name\":\"GENGEN API\",\"url\":\"https://docs.gengen.farm\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/apifarm/8i6PZnnhDG4uij12/logo-light.svg?fit=max\u0026auto=format\u0026n=8i6PZnnhDG4uij12\u0026q=85\u0026s=44296f0917d75c0ed5aa05513ec6c402\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.gengen.farm#website\",\"name\":\"GENGEN API\",\"url\":\"https://docs.gengen.farm\",\"publisher\":{\"@id\":\"https://docs.gengen.farm/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.gengen.farm/api-reference/google/chat-completions#webpage\",\"url\":\"https://docs.gengen.farm/api-reference/google/chat-completions\",\"name\":\"Chat completions with Gemini\",\"description\":\"Generate synchronous or streaming text with Gemini 4 Neon, Gemini 4 Hydrogen, Gemini 4 Carbon, Gemini 4 Argon, Gemini 3.8 Flash, Gemini 3.7 Flash, or Gemini 3.5 Flash-Lite through the GENGEN Chat Completions API.\",\"dateModified\":\"2026-11-20T05:15:38.437Z\",\"isPartOf\":{\"@id\":\"https://docs.gengen.farm#website\"},\"breadcrumb\":{\"@id\":\"https://docs.gengen.farm/api-reference/google/chat-completions#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.gengen.farm/api-reference/google/chat-completions#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"GENGEN API\",\"item\":\"https://docs.gengen.farm\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Chat completions with Gemini\",\"item\":\"https://docs.gengen.farm/api-reference/google/chat-completions\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.gengen.farm/api-reference/google/chat-completions#apireference\",\"headline\":\"Chat completions with Gemini\",\"name\":\"Chat completions with Gemini\",\"description\":\"Generate synchronous or streaming text with Gemini 4 Neon, Gemini 4 Hydrogen, Gemini 4 Carbon, Gemini 4 Argon, Gemini 3.8 Flash, Gemini 3.7 Flash, or Gemini 3.5 Flash-Lite through the GENGEN Chat Completions API.\",\"url\":\"https://docs.gengen.farm/api-reference/google/chat-completions\",\"mainEntityOfPage\":{\"@id\":\"https://docs.gengen.farm/api-reference/google/chat-completions#webpage\"},\"dateModified\":\"2026-11-20T05:15:38.437Z\",\"publisher\":{\"@id\":\"https://docs.gengen.farm/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.gengen.farm#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"GENGEN API\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"GENGEN API\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api-reference/google/chat-completions.md","siteName":"GENGEN API","nav":{"global":null,"tabs":[{"tab":"Get Started","pages":[{"title":"Get Started","href":""}]},{"tab":"Models","pages":[{"title":"Models","href":"/models/overview"}]},{"tab":"API Reference","groups":[{"group":"Reference","pages":[{"title":"API reference","href":"/api-reference/introduction"},{"title":"Video capabilities","href":"/api-reference/video-capabilities"},{"title":"Function calling","href":"/tool-calling"}]},{"group":"BytePlus","pages":[{"group":"Text API","pages":[{"title":"Create a chat completion","deprecated":null,"version":null,"sidebarTitle":"Chat completions","openapi":"/openapi/gengen-v1.yaml post /chat/completions","href":"/api-reference/byteplus/text-generation/chat-completions"}]},{"group":"Video API","pages":[{"title":"Create a video generation task","deprecated":null,"version":null,"sidebarTitle":"Create task","openapi":"/openapi/gengen-v1.yaml post /contents/generations/tasks","href":"/api-reference/byteplus/video-generation/create-task"},{"title":"Retrieve a video generation task","deprecated":null,"version":null,"sidebarTitle":"Retrieve task","openapi":"/openapi/gengen-v1.yaml get /contents/generations/tasks/{id}","href":"/api-reference/byteplus/video-generation/retrieve-task"},{"title":"List video generation tasks","deprecated":null,"version":null,"sidebarTitle":"List tasks","openapi":"/openapi/gengen-v1.yaml get /contents/generations/tasks","href":"/api-reference/byteplus/video-generation/list-tasks"},{"title":"Cancel or delete a video generation task","deprecated":null,"version":null,"sidebarTitle":"Cancel or delete task","openapi":"/openapi/gengen-v1.yaml delete /contents/generations/tasks/{id}","href":"/api-reference/byteplus/video-generation/cancel-task"},{"title":"Create a video understanding response","deprecated":null,"version":null,"sidebarTitle":"Create response","openapi":"/openapi/gengen-v1.yaml post /responses","href":"/api-reference/byteplus/video-understanding/create-response"}]},{"group":"Video Enhancement API","pages":[{"title":"Video enhancement","href":"/api-reference/byteplus/video-enhancement/overview"},{"title":"Create a video enhancement task","deprecated":null,"version":null,"sidebarTitle":"Create task","openapi":"/openapi/gengen-v1.yaml post /video/enhancements","href":"/api-reference/byteplus/video-enhancement/create-task"},{"title":"Retrieve a video enhancement task","deprecated":null,"version":null,"sidebarTitle":"Retrieve task","openapi":"/openapi/gengen-v1.yaml get /video/enhancements/{id}","href":"/api-reference/byteplus/video-enhancement/retrieve-task"}]},{"group":"Image API","pages":[{"title":"Generate images","deprecated":null,"version":null,"sidebarTitle":"Generate images","openapi":"/openapi/gengen-v1.yaml post /images/generations","href":"/api-reference/byteplus/image-generation/create-image"}]},{"group":"Assets API","pages":[{"title":"Create an asset group","sidebarTitle":"Create asset group","openapi":"openapi/byteplus-assets.yaml POST /assets/groups","href":"/api-reference/byteplus/assets/create-asset-group"},{"title":"List asset groups","sidebarTitle":"List asset groups","openapi":"openapi/byteplus-assets.yaml POST /assets/groups/list","href":"/api-reference/byteplus/assets/list-asset-groups"},{"title":"Get an asset group","sidebarTitle":"Get asset group","openapi":"openapi/byteplus-assets.yaml POST /assets/groups/get","href":"/api-reference/byteplus/assets/get-asset-group"},{"title":"Update an asset group","sidebarTitle":"Update asset group","openapi":"openapi/byteplus-assets.yaml POST /assets/groups/update","href":"/api-reference/byteplus/assets/update-asset-group"},{"title":"Create an asset","sidebarTitle":"Create asset","openapi":"openapi/byteplus-assets.yaml POST /assets","href":"/api-reference/byteplus/assets/create-asset"},{"title":"Get an asset","sidebarTitle":"Get asset","openapi":"openapi/byteplus-assets.yaml POST /assets/get","href":"/api-reference/byteplus/assets/get-asset"},{"title":"Update an asset","sidebarTitle":"Update asset","openapi":"openapi/byteplus-assets.yaml POST /assets/update","href":"/api-reference/byteplus/assets/update-asset"},{"title":"List assets","sidebarTitle":"List assets","openapi":"openapi/byteplus-assets.yaml POST /assets/list","href":"/api-reference/byteplus/assets/list-assets"},{"title":"List public assets","sidebarTitle":"List public assets","openapi":"openapi/byteplus-assets.yaml GET /assets/public","href":"/api-reference/byteplus/assets/public-assets"},{"title":"Delete an asset","sidebarTitle":"Delete asset","openapi":"openapi/byteplus-assets.yaml POST /assets/delete","href":"/api-reference/byteplus/assets/delete-asset"},{"title":"Delete an asset group","sidebarTitle":"Delete asset group","openapi":"openapi/byteplus-assets.yaml POST /assets/groups/delete","href":"/api-reference/byteplus/assets/delete-asset-group"},{"title":"Create a real-person verification session","sidebarTitle":"Create verification session","openapi":"openapi/byteplus-assets.yaml POST /assets/real-human/verification-sessions","href":"/api-reference/byteplus/assets/create-real-human-session"},{"title":"Get a real-person verification result","sidebarTitle":"Get verification result","openapi":"openapi/byteplus-assets.yaml POST /assets/real-human/verification-results","href":"/api-reference/byteplus/assets/get-real-human-result"}]}]},{"group":"OpenAI","pages":[{"group":"Text API","pages":[{"title":"Chat","sidebarTitle":"Chat","openapi":"openapi/openai-llm.yaml POST /chat/completions","href":"/api-reference/openai/chat-completions"}]},{"group":"Image API","pages":[{"title":"OpenAI image generation","sidebarTitle":"Image generation","openapi":"openapi/openai.yaml POST /images/generations","href":"/api-reference/openai/image-generation"}]}]},{"group":"Kling","pages":[{"group":"Video API","pages":[{"title":"Create a Kling video task","sidebarTitle":"Create task","openapi":"openapi/kling-video.yaml POST /contents/generations/tasks","href":"/api-reference/kling/video-generation/create-task"},{"title":"Retrieve a Kling video task","sidebarTitle":"Retrieve task","openapi":"openapi/kling-video.yaml GET /contents/generations/tasks/{id}","href":"/api-reference/kling/video-generation/retrieve-task"},{"title":"Kling errors and task status","sidebarTitle":"Errors and task status","href":"/api-reference/kling/video-generation/errors-and-callbacks"}]},{"group":"Kling 4.0","pages":[{"title":"Kling 4.0 API","sidebarTitle":"Overview","href":"/api-reference/kling/4.0/overview"},{"title":"Create a Kling 4.0 task","sidebarTitle":"Create task","openapi":"openapi/kling-40-video.yaml POST /contents/generations/tasks","href":"/api-reference/kling/4.0/create-task"},{"title":"Retrieve a Kling 4.0 task","sidebarTitle":"Retrieve task","openapi":"openapi/kling-40-video.yaml GET /contents/generations/tasks/{id}","href":"/api-reference/kling/4.0/retrieve-task"},{"title":"List Kling voices","sidebarTitle":"List voices","openapi":"openapi/kling-40-video.yaml GET /video/kling/voices","href":"/api-reference/kling/4.0/voices"},{"title":"Create a private Kling voice","sidebarTitle":"Create a voice","openapi":"openapi/kling-40-video.yaml POST /video/kling/voices","href":"/api-reference/kling/4.0/create-voice"},{"title":"Get a Kling voice operation","sidebarTitle":"Get voice operation","openapi":"openapi/kling-40-video.yaml GET /video/kling/voice-operations/{operationId}","href":"/api-reference/kling/4.0/get-voice-operation"},{"title":"Delete a private Kling voice","sidebarTitle":"Delete a voice","openapi":"openapi/kling-40-video.yaml DELETE /video/kling/voices/{voiceId}","href":"/api-reference/kling/4.0/delete-voice"}]}]},{"group":"MiniMax","pages":[{"group":"Video API","pages":[{"title":"Create a MiniMax video task","sidebarTitle":"Create task","openapi":"openapi/minimax-video.yaml POST /contents/generations/tasks","href":"/api-reference/minimax/video-generation/create-task"},{"title":"Retrieve a MiniMax video task","sidebarTitle":"Retrieve task","openapi":"openapi/minimax-video.yaml GET /contents/generations/tasks/{id}","href":"/api-reference/minimax/video-generation/retrieve-task"},{"title":"List MiniMax video tasks","sidebarTitle":"List tasks","openapi":"openapi/minimax-video.yaml GET /contents/generations/tasks","href":"/api-reference/minimax/video-generation/list-tasks"},{"title":"Cancel or delete a MiniMax task","sidebarTitle":"Cancel task","openapi":"openapi/minimax-video.yaml DELETE /contents/generations/tasks/{id}","href":"/api-reference/minimax/video-generation/cancel-task"},{"title":"MiniMax errors and task status","sidebarTitle":"Errors and task status","href":"/api-reference/minimax/video-generation/errors-and-callbacks"}]}]},{"group":"Happy Horse","pages":[{"title":"Create a Happy Horse video task","sidebarTitle":"Create task","openapi":"openapi/happy-horse-video.yaml POST /contents/generations/tasks","href":"/api-reference/happy-horse/video-generation/create-task"},{"title":"Retrieve Happy Horse video task","sidebarTitle":"Retrieve task","description":"Retrieve normalized status and video outputs for a Happy Horse 1.1 task.","api":"GET https://gengen.farm/api/gengen/v1/contents/generations/tasks/{id}","playground":"none","href":"/api-reference/happy-horse/video-generation/retrieve-task"}]},{"group":"Google","pages":[{"group":"Text API","pages":[{"title":"Chat completions with Gemini","sidebarTitle":"Chat completions","openapi":"openapi/google.yaml POST /chat/completions","href":"/api-reference/google/chat-completions"}]},{"group":"Multimodal API","pages":[{"title":"Multimodal responses with Gemini","sidebarTitle":"Responses","description":"Analyze text, image, video, and audio inputs with Gemini 4 Neon, Gemini 4 Hydrogen, Gemini 4 Carbon, Gemini 4 Argon, Gemini 3.8 Flash, Gemini 3.7 Flash, or Gemini 3.5 Flash-Lite through the GENGEN Responses API.","openapi":"openapi/google.yaml POST /responses","href":"/api-reference/google/responses"}]},{"group":"Tools","pages":[{"title":"Gemini tools","href":"/api-reference/google/tools"},{"title":"Count input tokens","openapi":"openapi/google.yaml POST /token-counts","href":"/api-reference/google/token-counts"}]},{"group":"Image API","pages":[{"title":"Generate images with Gemini","sidebarTitle":"Image generation","openapi":"openapi/google.yaml POST /images/generations","href":"/api-reference/google/image-generation"}]},{"group":"Video API","pages":[{"title":"Generate and edit videos with Omni","sidebarTitle":"Omni: Create task","openapi":"openapi/omni-video.yaml POST /contents/generations/tasks","href":"/api-reference/google/omni-video-generation"},{"title":"Retrieve an Omni video task","sidebarTitle":"Omni: Retrieve task","openapi":"openapi/omni-video.yaml GET /contents/generations/tasks/{id}","href":"/api-reference/google/omni-retrieve-task"},{"title":"Generate videos with Veo","sidebarTitle":"Create task","openapi":"openapi/veo-video.yaml POST /contents/generations/tasks","href":"/api-reference/google/veo-video-generation"},{"title":"Retrieve a Veo video task","sidebarTitle":"Retrieve task","openapi":"openapi/veo-video.yaml GET /contents/generations/tasks/{id}","href":"/api-reference/google/veo-retrieve-task"}]}]},{"group":"Flash VSR","pages":[{"group":"Video Upscale","pages":[{"title":"Create a Flash VSR task","sidebarTitle":"Create task","openapi":"openapi/flash-vsr-video.yaml POST /contents/generations/tasks","href":"/api-reference/flash-vsr/video-upscale/create-task"},{"title":"Retrieve Flash VSR task","sidebarTitle":"Retrieve task","api":"GET https://gengen.farm/api/gengen/v1/contents/generations/tasks/{id}","playground":"none","href":"/api-reference/flash-vsr/video-upscale/retrieve-task"},{"title":"Delete Flash VSR task","sidebarTitle":"Delete task","api":"DELETE https://gengen.farm/api/gengen/v1/contents/generations/tasks/{id}","playground":"none","href":"/api-reference/flash-vsr/video-upscale/delete-task"}]}]},{"group":"Wan","pages":[{"group":"Spicy","pages":[{"group":"Video API","pages":[{"title":"Create a Wan video task","sidebarTitle":"Create task","openapi":"openapi/wan-video.yaml POST /contents/generations/tasks","href":"/api-reference/wan/video-generation/create-task"},{"title":"Retrieve Wan video task","sidebarTitle":"Retrieve task","api":"GET https://gengen.farm/api/gengen/v1/contents/generations/tasks/{id}","playground":"none","href":"/api-reference/wan/video-generation/retrieve-task"},{"title":"Delete Wan video task","sidebarTitle":"Delete task","api":"DELETE https://gengen.farm/api/gengen/v1/contents/generations/tasks/{id}","playground":"none","href":"/api-reference/wan/video-generation/delete-task"}]},{"group":"Image API","pages":[{"title":"Create a z-image task","sidebarTitle":"Create z-image task","openapi":"openapi/wan-z-image.yaml POST /z-images/generations","href":"/api-reference/wan/image-generation/z-image"},{"title":"Retrieve a z-image task","sidebarTitle":"Retrieve task","openapi":"openapi/wan-z-image.yaml GET /z-images/generations/{id}","href":"/api-reference/wan/image-generation/z-image/tasks"},{"title":"Delete a z-image task","sidebarTitle":"Delete task","openapi":"openapi/wan-z-image.yaml DELETE /z-images/generations/{id}","href":"/api-reference/wan/image-generation/z-image/tasks-delete"},{"title":"Create a Wan face swap task","sidebarTitle":"Create face swap task","openapi":"openapi/wan-face-swap.yaml POST /wan-face-swaps/generations","href":"/api-reference/wan/image-generation/face-swap"},{"title":"Retrieve a Wan face swap task","sidebarTitle":"Retrieve task","openapi":"openapi/wan-face-swap.yaml GET /wan-face-swaps/generations/{id}","href":"/api-reference/wan/image-generation/face-swap/tasks"},{"title":"Delete a Wan face swap task","sidebarTitle":"Delete task","openapi":"openapi/wan-face-swap.yaml DELETE /wan-face-swaps/generations/{id}","href":"/api-reference/wan/image-generation/face-swap/tasks-delete"}]}]},{"group":"Standard","pages":[{"group":"Video API","pages":[{"title":"Create Wan video task","sidebarTitle":"Create task","openapi":"openapi/wan-standard-video.yaml POST /contents/generations/tasks","href":"/api-reference/wan/standard/video-generation/create-task"},{"title":"Retrieve Wan video task","sidebarTitle":"Retrieve task","openapi":"openapi/wan-standard-video.yaml GET /contents/generations/tasks/{id}","href":"/api-reference/wan/standard/video-generation/retrieve-task"},{"title":"Cancel Wan video task","sidebarTitle":"Cancel task","openapi":"openapi/wan-standard-video.yaml DELETE /contents/generations/tasks/{id}","href":"/api-reference/wan/standard/video-generation/cancel-task"}]}]}]},{"group":"Qwen","pages":[{"group":"Image API","pages":[{"title":"Generate or edit images with Qwen Image 3.0","sidebarTitle":"Qwen Image 3.0","openapi":"openapi/qwen-image-3.yaml POST /qwen-images/generations","href":"/api-reference/qwen/image-generation/qwen-image-3-0"},{"title":"Create a Qwen image edit task","sidebarTitle":"Create image edit task","openapi":"openapi/qwen-image-edit.yaml POST /qwen-image-edits/generations","href":"/api-reference/qwen/image-generation/qwen-image-edit"},{"title":"Retrieve a Qwen image edit task","sidebarTitle":"Retrieve task","openapi":"openapi/qwen-image-edit.yaml GET /qwen-image-edits/generations/{id}","href":"/api-reference/qwen/image-generation/qwen-image-edit/tasks"},{"title":"Delete a Qwen image edit task","sidebarTitle":"Delete task","openapi":"openapi/qwen-image-edit.yaml DELETE /qwen-image-edits/generations/{id}","href":"/api-reference/qwen/image-generation/qwen-image-edit/tasks-delete"}]}]},{"group":"ElevenLabs","pages":[{"title":"Audio API","href":"/api-reference/elevenlabs/overview"},{"group":"Voices","pages":[{"group":"Create voices","pages":[{"title":"Clone a voice from recordings","openapi":"openapi/audio.yaml POST /audio/voices/clone","href":"/api-reference/elevenlabs/clone-voice"},{"title":"Estimate voice design cost","openapi":"openapi/audio.yaml POST /audio/voice-designs/estimate","href":"/api-reference/elevenlabs/estimate-voice-design"},{"title":"Voice Design v3","openapi":"openapi/audio.yaml POST /audio/voice-designs","href":"/api-reference/elevenlabs/voice-designs"},{"title":"Save a Voice Design candidate","openapi":"openapi/audio.yaml POST /audio/voice-designs/{generationId}/save","href":"/api-reference/elevenlabs/save-candidate"},{"title":"Check a pending voice creation","openapi":"openapi/audio.yaml GET /audio/voice-operations/{operationId}","href":"/api-reference/elevenlabs/get-voice-operation"}]},{"group":"Find and manage voices","pages":[{"title":"List voices","openapi":"openapi/audio.yaml GET /audio/voices","href":"/api-reference/elevenlabs/voices"},{"title":"Get a voice","openapi":"openapi/audio.yaml GET /audio/voices/{voiceId}","href":"/api-reference/elevenlabs/get-voice"},{"title":"Favorite a public voice","openapi":"openapi/audio.yaml PUT /audio/voices/{voiceId}/favorite","href":"/api-reference/elevenlabs/favorite-voice"},{"title":"Unfavorite a public voice","openapi":"openapi/audio.yaml DELETE /audio/voices/{voiceId}/favorite","href":"/api-reference/elevenlabs/unfavorite-voice"},{"title":"Delete a private voice","openapi":"openapi/audio.yaml DELETE /audio/voices/{voiceId}","href":"/api-reference/elevenlabs/delete-voice"}]}]},{"group":"Speech and dialogue","pages":[{"title":"List audio models","openapi":"openapi/audio.yaml GET /audio/models","href":"/api-reference/elevenlabs/models"},{"title":"Speech language codes","href":"/api-reference/elevenlabs/language-codes"},{"title":"Estimate audio price","openapi":"openapi/audio.yaml POST /audio/estimate","href":"/api-reference/elevenlabs/estimate"},{"title":"Generate speech audio","openapi":"openapi/audio.yaml POST /audio/speech","href":"/api-reference/elevenlabs/speech"},{"title":"Create dialogue","href":"/api-reference/elevenlabs/dialogue"},{"title":"Create audio generation","openapi":"openapi/audio.yaml POST /audio/generations","href":"/api-reference/elevenlabs/create-generation"},{"title":"List audio generations","openapi":"openapi/audio.yaml GET /audio/generations","href":"/api-reference/elevenlabs/list-generations"},{"title":"Get audio generation","openapi":"openapi/audio.yaml GET /audio/generations/{id}","href":"/api-reference/elevenlabs/get-generation"}]},{"group":"Realtime connections","pages":[{"title":"Create realtime session","openapi":"openapi/audio.yaml POST /audio/realtime/sessions","href":"/api-reference/elevenlabs/create-session"},{"title":"Get realtime session","openapi":"openapi/audio.yaml GET /audio/realtime/sessions/{id}","href":"/api-reference/elevenlabs/get-session"},{"title":"Create reconnection ticket","openapi":"openapi/audio.yaml POST /audio/realtime/sessions/{id}/tokens","href":"/api-reference/elevenlabs/create-token"},{"title":"Close realtime session","openapi":"openapi/audio.yaml DELETE /audio/realtime/sessions/{id}","href":"/api-reference/elevenlabs/close-session"}]},{"group":"Webhooks","pages":[{"title":"Create webhook endpoint","openapi":"openapi/audio.yaml POST /webhook-endpoints","href":"/api-reference/elevenlabs/create-webhook"},{"title":"List webhook endpoints","openapi":"openapi/audio.yaml GET /webhook-endpoints","href":"/api-reference/elevenlabs/list-webhooks"},{"title":"Update webhook endpoint","openapi":"openapi/audio.yaml PATCH /webhook-endpoints/{id}","href":"/api-reference/elevenlabs/update-webhook"},{"title":"Disable webhook endpoint","openapi":"openapi/audio.yaml DELETE /webhook-endpoints/{id}","href":"/api-reference/elevenlabs/disable-webhook"},{"title":"Rotate webhook secret","openapi":"openapi/audio.yaml POST /webhook-endpoints/{id}/rotate-secret","href":"/api-reference/elevenlabs/rotate-secret"},{"title":"List webhook deliveries","openapi":"openapi/audio.yaml GET /webhook-endpoints/{id}/deliveries","href":"/api-reference/elevenlabs/deliveries"},{"title":"Retry a failed delivery","openapi":"openapi/audio.yaml POST /webhook-endpoints/{id}/deliveries/{deliveryId}/retry","href":"/api-reference/elevenlabs/retry-delivery"}]}]},{"group":"Higgsfield","pages":[{"group":"Genjutsu","pages":[{"title":"Genjutsu","href":"/api-reference/higgsfield/genjutsu/overview"},{"title":"Motion Transfer","href":"/api-reference/higgsfield/genjutsu/motion-transfer"},{"title":"Object Swap","href":"/api-reference/higgsfield/genjutsu/object-swap"},{"title":"Restyle","href":"/api-reference/higgsfield/genjutsu/restyle"},{"title":"Create a Genjutsu task","openapi":"openapi/genjutsu-video.yaml POST /contents/generations/tasks","href":"/api-reference/higgsfield/genjutsu/create-task"},{"title":"List Genjutsu styles","openapi":"openapi/genjutsu-video.yaml GET /video/genjutsu/styles","href":"/api-reference/higgsfield/genjutsu/styles"},{"title":"Retrieve a Genjutsu task","openapi":"openapi/genjutsu-video.yaml GET /contents/generations/tasks/{id}","href":"/api-reference/higgsfield/genjutsu/retrieve-task"},{"title":"Cancel a Genjutsu task","openapi":"openapi/genjutsu-video.yaml DELETE /contents/generations/tasks/{id}","href":"/api-reference/higgsfield/genjutsu/cancel-task"}]}]}]},{"tab":"Help","pages":[{"title":"Help","href":"/helpful-tips"}]}]},"basePath":"","title":"Chat completions with Gemini - GENGEN API","deploymentId":"dpl_DyXGnKeCjZyA3sUdfMJ7FjkdBefg","buildId":"dpl_DyXGnKeCjZyA3sUdfMJ7FjkdBefg","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-CiUHMMOm.js","snippetPresets-BgfXU7Bw.js","utils-DWvOwgy_.js","style-to-object-BY3JEAdk.js","utils-BN7RXSMJ.js","v4-DIgz8zy6.js","addUniqueKeysToSchema-CFw8bq89.js","conditional-requirements-CFM0id0Q.js","cloneDeep-CAwdfOU2.js","_Uint8Array-BJr8e-ZL.js","isObject-FP1Yky1u.js","ApiExamples-XX0UgMZK.js","usePlaygroundInputsStore-DXDFSa1V.js","shallow-CdX5aREi.js","isEqual-CoOaxexF.js","CodeSnippets-Cg2wpzWm.js","CodeSnippet-D_HwgQO_.js","getApiPlaygroundDisplay-CmCoerhe.js","Page-CVJ-f_k1.js","DynamicMarkdown-CQM9Bhbv.js","SectionHeading-DpbrP8nQ.js","icon-BPCgijHy.js","MethodPill-GQ8DuY0c.js","getPastedJson-Cb5mT31m.js","Check2Icon-a7bUI6e8.js","axios-CsQoIw0U.js","Markdown-CX2QY19L.js","AssistantPageLink-CY3bFglh.js","dist-Dl6_zDnT.js","lib-DMeTj1gb.js","lib-B8HbPgcC.js","katex-Dbtb6Wk7.js","html-void-elements-mCSPHezU.js","marked.esm-CZWythHk.js"]}