Skip to main content
POST
Gemini native text generation
  • Put the model in the request path and use contents in the body; a body model is not required.
  • Pass system instructions in systemInstruction. Treat media as input content, not higher-priority instructions.
  • One user message can contain text, the complete video and multiple reference images; output is text or structured data.
  • For streaming, see Native Streaming Understanding.

Models

Media and results

Send PNG, MP4 or PDF through parts[].inlineData. Match mimeType to the actual file and encode the complete file in data without a data-URL prefix. Confirm unlisted formats, media sizes and long-media limits before integrating; request examples do not establish service limits. Set generationConfig.thinkingConfig.thinkingLevel to choose thinking effort: gemini-4-hydrogen and gemini-4-neon support low, medium, high, and xhigh; gemini-4-carbon supports low, medium, and high; gemini-4-argon examples use low. maxOutputTokens covers both thinking and visible output; the example value does not establish a maximum output limit. For structured results, combine generationConfig.responseMimeType: application/json with native responseSchema. These structured-output parameters are forwarded in the native request. The returned content may still contain code fences or field types that do not match the schema, such as an object where an array was requested. Validate the actual content and field types before processing it. Inspect the complete response, finishReason and usageMetadata. A returned functionCall leaves execution to the client; this reference does not promise multi-turn tool execution.

Billing and usage

Charges follow published account prices and actual usage. Automatic route changes do not alter the published price for this model. Input includes reported tool-use input, output includes reported thinking, and reported cached input is an input subset. Do not add these components twice or charge cumulative streaming snapshots as separate usage. An omitted usage field is not an explicit zero. For insufficient balance, inspect the error body: native endpoints can return 403 with insufficient_user_quota, in addition to 402. Do not treat every 403 as a permission failure.

Authorizations

Authorization
string
header
required

OmniMux API token

Path Parameters

model
enum<string>
required
Available options:
gemini-4-argon,
gemini-4-hydrogen,
gemini-4-neon,
gemini-4-carbon

Body

application/json
contents
object[]
required
Minimum array length: 1
systemInstruction
object

Task framework and scope; media content is data, not a higher-priority instruction

generationConfig
object
tools
object[]

Function declarations for a single-turn function-call response. The returned functionCall asks the client to execute the function; it does not run the function.

toolConfig
object

Response

Native response; inspect finishReason and usageMetadata

modelVersion
string

Supplier-reported model version; not independent backend identity proof

responseId
string
candidates
object[]
usageMetadata
object

Optional fields remain absent when not supplied; absent is not an explicit zero. Do not add modality breakdowns again or treat cumulative stream snapshots as separate charges.