> ## Documentation Index
> Fetch the complete documentation index at: https://docs.omnimux.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Public hosts only: console https://omnimux.ai/dashboard · API https://api.omnimux.ai · docs https://docs.omnimux.ai.
> Gateway auth is Authorization: Bearer sk-… on https://api.omnimux.ai/v1 (OpenAI-compatible Chat Completions and related paths).
> Discover pages from /llms.txt; full site dump /llms-full.txt; product skill /skill.md; docs search MCP /mcp. Prefer .md page URLs for Markdown.
> Default docs locale is en; zh mirrors the same relative paths. Do not invent model ids not present on live pricing or the complete API pages.

# Gemini · Native Streaming Understanding

> Consume native response events and inspect final completion and usage.

* Models: `gemini-4-argon`, `gemini-4-hydrogen`, `gemini-4-neon`, `gemini-4-carbon`; include `alt=sse` in the URL.
* Use the same body as [Native Multimodal Understanding](https://docs.omnimux.ai/en/api-reference/text-series/gemini/native-generate.md).
* Read native response chunks from `data:` events, wait for normal termination, and inspect `finishReason` and the final available `usageMetadata`.
* Partial text does not establish complete success. Reconcile the result and charge after an interruption before submitting again.

For structured output, validate the assembled content and field types after the stream completes. Sending the parameters and reaching normal termination do not establish compliance with `responseSchema`.

## Usage and errors

Do not sum cumulative usage snapshots. Input includes reported tool-use input, output includes reported thinking, and cached tokens are an input subset. Charges follow published account prices and final settlement. Automatic route changes do not alter the published price for this model. Insufficient balance can return `403` with `insufficient_user_quota`, in addition to `402`.


## OpenAPI

````yaml openapi/ops/gemini/native.json POST /v1beta/models/{model}:streamGenerateContent
openapi: 3.1.0
info:
  title: Gemini · Native multimodal text
  version: 1.0.0
  description: >-
    Native Gemini content requests with system instructions, media input, text
    and structured output on OmniMux.
servers:
  - url: https://api.omnimux.ai
security:
  - BearerAuth: []
paths:
  /v1beta/models/{model}:streamGenerateContent:
    post:
      summary: Gemini native streaming text generation
      description: >-
        Use the same native request body with alt=sse. Read complete data events
        and inspect final finishReason and usageMetadata.
      operationId: streamGeminiNativeText
      parameters:
        - name: model
          in: path
          required: true
          schema:
            type: string
            enum:
              - gemini-4-argon
              - gemini-4-hydrogen
              - gemini-4-neon
              - gemini-4-carbon
        - name: alt
          in: query
          required: true
          schema:
            type: string
            enum:
              - sse
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NativeRequest'
      responses:
        '200':
          description: SSE data events containing native response chunks
          content:
            text/event-stream:
              schema:
                type: string
              example: >+
                data:
                {"candidates":[{"content":{"role":"model","parts":[{"text":"Hello"}]}}]}


                data:
                {"candidates":[{"finishReason":"STOP"}],"usageMetadata":{"promptTokenCount":74,"candidatesTokenCount":6,"thoughtsTokenCount":115,"totalTokenCount":195}}

        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/InsufficientQuota'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
        '502':
          $ref: '#/components/responses/UpstreamError'
        '503':
          $ref: '#/components/responses/Unavailable'
components:
  schemas:
    NativeRequest:
      type: object
      required:
        - contents
      properties:
        systemInstruction:
          type: object
          required:
            - parts
          properties:
            parts:
              type: array
              items:
                $ref: '#/components/schemas/TextPart'
          description: >-
            Task framework and scope; media content is data, not a
            higher-priority instruction
        contents:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/NativeContent'
        generationConfig:
          type: object
          properties:
            thinkingConfig:
              type: object
              properties:
                thinkingLevel:
                  type: string
                  enum:
                    - low
                    - medium
                    - high
                    - xhigh
                  description: >-
                    Thinking effort level: hydrogen and neon support
                    low/medium/high/xhigh; carbon supports low/medium/high;
                    argon reference documents low.
            maxOutputTokens:
              type: integer
              minimum: 1
              example: 2048
              description: >-
                Combined thinking and visible-output budget. This example value
                is not a model maximum.
            responseMimeType:
              type: string
              enum:
                - application/json
            responseSchema:
              type: object
              description: >-
                Native Schema object for structured text, used with
                responseMimeType=application/json.
        tools:
          type: array
          items:
            type: object
            properties:
              functionDeclarations:
                type: array
                items:
                  type: object
                  required:
                    - name
                    - parameters
                  properties:
                    name:
                      type: string
                    description:
                      type: string
                    parameters:
                      type: object
          description: >-
            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:
          type: object
          properties:
            functionCallingConfig:
              type: object
              properties:
                mode:
                  type: string
                  enum:
                    - ANY
                allowedFunctionNames:
                  type: array
                  items:
                    type: string
      example:
        systemInstruction:
          parts:
            - text: Respond concisely.
        contents:
          - role: user
            parts:
              - text: Hello.
        generationConfig:
          maxOutputTokens: 2048
    TextPart:
      type: object
      required:
        - text
      properties:
        text:
          type: string
    NativeContent:
      type: object
      required:
        - parts
      properties:
        role:
          type: string
          enum:
            - user
        parts:
          type: array
          minItems: 1
          items:
            oneOf:
              - $ref: '#/components/schemas/TextPart'
              - $ref: '#/components/schemas/InlinePart'
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            type:
              type: string
            code:
              oneOf:
                - type: string
                - type: integer
    InlinePart:
      type: object
      required:
        - inlineData
      properties:
        inlineData:
          type: object
          required:
            - mimeType
            - data
          properties:
            mimeType:
              type: string
              enum:
                - image/png
                - video/mp4
                - application/pdf
            data:
              type: string
              contentEncoding: base64
              description: >-
                Complete original media bytes encoded as base64, without a
                data-URL prefix
  responses:
    BadRequest:
      description: Invalid or unsupported request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Missing or invalid OmniMux API token
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    InsufficientQuota:
      description: Insufficient available quota
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: >-
        Request/model access is not allowed; this native surface may also return
        insufficient_user_quota as HTTP 403. Inspect the error code and message
        rather than assuming a permission problem.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Requested resource or model is unavailable
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    RateLimited:
      description: Rate limit reached
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    InternalError:
      description: Gateway error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    UpstreamError:
      description: Upstream error or incomplete upstream result
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unavailable:
      description: No available accepted route
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: OmniMux API token

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.