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

# Gemini 4 Argon

> Use Gemini 4 Argon for text reasoning, multimodal understanding, structured output, function calling, and grounded tool workflows.

Gemini 4 Argon is Google's flagship reasoning model for complex software engineering, deep mathematical and scientific problem solving, autonomous agents, and long-running multimodal workflows. Use the stable model ID `gemini-4-argon` with `POST /v1beta/models/gemini-4-argon:generateContent`.

## Model specifications

| Property | Value |
| - | - |
| Model ID | `gemini-4-argon` |
| Release stage | Generally available |
| Input | Text, image, video, audio, and PDF |
| Output | Text |
| Unified input and output context | 1,048,576 tokens |
| Synchronous output limit | 32,768 tokens |
| Streaming output limit | 65,536 tokens |
| Thinking levels | `low`, `medium`, `high` |
| Default thinking level | `medium` |

## Key capabilities

* **Long-context reasoning** — Share up to 1,048,576 input, thinking, and output tokens in one context window.
* **Multimodal understanding** — Analyze text, images, video, audio, and PDF documents; the model returns text.
* **Agentic workflows** — Use function calling, code execution, Google Search, Google Maps, URL context, and Computer Use (Preview).
* **Structured output** — Constrain responses with `responseMimeType` and `responseSchema`.
* **Long decode** — Google GenAI SDKs can continue responses beyond the per-request cap. AnyFast's native endpoint documents the synchronous `generateContent` request shape shown below.

## Choose a workflow

<Tabs sync={false}>
  <Tab title="Text and thinking">
    Send text in `contents[].parts[].text`. Use `generationConfig.thinkingConfig.thinkingLevel` to trade latency for reasoning depth.

    | Level | Recommended use |
    | - | - |
    | `low` | Latency-sensitive chat, drafting, and quick analysis |
    | `medium` | General coding and agent workflows; this is the default |
    | `high` | Difficult reasoning and multi-step tool orchestration |

    The final conversation turn must be a non-empty `user` turn. Do not prefill a response by ending the request with a `model` turn.
  </Tab>

  <Tab title="Multimodal understanding">
    Combine text with images, audio, video, or PDF documents in the same `contents` request.

    * Use `inlineData` with `mimeType` and Base64-encoded `data` for inline media.
    * Use `fileData` with `mimeType` and `fileUri` for an accessible media or document URI.
    * Keep each media item inside the `parts` array for the turn that refers to it.
    * The model returns text; it does not generate image, audio, or video output.

    Base64 encoding increases request size. Prefer `fileData` for large assets or files reused across requests.
  </Tab>

  <Tab title="Structured output">
    Set `generationConfig.responseMimeType` to `application/json` and supply `generationConfig.responseSchema` to constrain the output.

    Use a focused schema with explicit `required` fields. The returned JSON is contained in a text part, so parse `candidates[].content.parts[].text` after checking `finishReason`.
  </Tab>

  <Tab title="Function calling">
    Add functions under `tools[].functionDeclarations`. Control selection with `toolConfig.functionCallingConfig`.

    Supported modes are `AUTO`, `ANY`, `NONE`, and `VALIDATED`. Use `allowedFunctionNames` to restrict the callable subset.

    Preserve every `thoughtSignature` returned by the model when replaying conversation history. A `functionResponse` must include the function `name`; return the model-provided call `id` and your structured `response` when available.
  </Tab>

  <Tab title="Built-in tools">
    Gemini 4 Argon can use the following built-in tools on the current endpoint:

    | Tool field | Purpose |
    | - | - |
    | `googleSearch` | Ground answers with current web results |
    | `googleMaps` | Ground location answers with Google Maps data |
    | `urlContext` | Read and analyze supplied web pages |
    | `codeExecution` | Run model-generated code and return its result |
    | `computerUse` | Propose browser actions; this capability is in Preview |

    Read the returned `groundingMetadata`, `executableCode`, `codeExecutionResult`, or tool-call parts instead of assuming every response contains only text.
  </Tab>
</Tabs>

## Request examples

<Tabs sync={false}>
  <Tab title="Text and thinking">
    ```bash cURL theme={null}
    curl "https://www.anyfast.ai/v1beta/models/gemini-4-argon:generateContent?key=YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "contents": [{
          "role": "user",
          "parts": [{"text": "Review this retry design, identify race conditions, and propose a safe implementation plan."}]
        }],
        "generationConfig": {
          "thinkingConfig": {"thinkingLevel": "medium"},
          "maxOutputTokens": 2048
        }
      }'
    ```
  </Tab>

  <Tab title="Multimodal understanding">
    ```bash cURL theme={null}
    curl "https://www.anyfast.ai/v1beta/models/gemini-4-argon:generateContent?key=YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "contents": [{
          "role": "user",
          "parts": [
            {"text": "Summarize the architecture and identify the likely bottleneck."},
            {
              "fileData": {
                "mimeType": "image/png",
                "fileUri": "https://example.com/architecture.png"
              }
            }
          ]
        }]
      }'
    ```
  </Tab>

  <Tab title="Structured output">
    ```bash cURL theme={null}
    curl "https://www.anyfast.ai/v1beta/models/gemini-4-argon:generateContent?key=YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "contents": [{
          "role": "user",
          "parts": [{"text": "Extract the service name, severity, and recommended action from this incident: checkout-api is timing out and requires immediate rollback."}]
        }],
        "generationConfig": {
          "responseMimeType": "application/json",
          "responseSchema": {
            "type": "object",
            "properties": {
              "service": {"type": "string"},
              "severity": {"type": "string"},
              "action": {"type": "string"}
            },
            "required": ["service", "severity", "action"]
          }
        }
      }'
    ```
  </Tab>

  <Tab title="Function calling">
    ```bash cURL theme={null}
    curl "https://www.anyfast.ai/v1beta/models/gemini-4-argon:generateContent?key=YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "contents": [{
          "role": "user",
          "parts": [{"text": "Check the deployment status for checkout-api."}]
        }],
        "tools": [{
          "functionDeclarations": [{
            "name": "get_deployment_status",
            "description": "Return the current deployment status for a service.",
            "parameters": {
              "type": "object",
              "properties": {"service": {"type": "string"}},
              "required": ["service"]
            }
          }]
        }],
        "toolConfig": {
          "functionCallingConfig": {
            "mode": "ANY",
            "allowedFunctionNames": ["get_deployment_status"]
          }
        }
      }'
    ```
  </Tab>

  <Tab title="Built-in tools">
    ```bash cURL theme={null}
    curl "https://www.anyfast.ai/v1beta/models/gemini-4-argon:generateContent?key=YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "contents": [{
          "role": "user",
          "parts": [{"text": "Find the latest stable Gemini API model and cite the source."}]
        }],
        "tools": [{"googleSearch": {}}]
      }'
    ```
  </Tab>
</Tabs>

## Generation controls

| Parameter | Type | Description |
| - | - | - |
| `thinkingConfig.thinkingLevel` | string | `low`, `medium`, or `high`; defaults to `medium` |
| `maxOutputTokens` | integer | Maximum generated tokens for a synchronous request, up to 32,768 |
| `responseMimeType` | string | `text/plain`, `application/json`, or `text/x.enum` |
| `responseSchema` | object | Schema used to constrain structured output |
| `stopSequences` | string\[] | Up to five sequences that stop generation |

## Conversation and response handling

* Use `user` and `model` roles for conversation history.
* Preserve complete model turns and every `thoughtSignature` in multi-step function workflows.
* Check `candidates[].finishReason` before consuming the output.
* Read token counts from `usageMetadata`, including `thoughtsTokenCount` for reasoning usage.
* Search and Maps responses can include `groundingMetadata` with queries, sources, and supporting segments.
* Code execution can return `executableCode` and `codeExecutionResult` parts.

<Warning>
  Do not send `temperature`, `topP`, `topK`, or `candidateCount`. Google documents these sampling controls as ignored for Gemini 4 Argon. Explicit context caching is also unsupported; implicit caching may apply automatically.
</Warning>

<Card title="API Reference" icon="code" href="/api-reference/model-api/google/gemini-4-argon">
  View request fields, capability examples, and response schemas for Gemini 4 Argon.
</Card>

## Official references

* [Gemini 4 Argon model page](https://ai.google.dev/gemini-api/docs/models/gemini-4-argon)
* [What's new in Gemini 4 Argon](https://ai.google.dev/gemini-api/docs/generate-content/latest-model)
* [Generate content API](https://ai.google.dev/api/generate-content)
* [Gemini function calling](https://ai.google.dev/gemini-api/docs/generate-content/function-calling)
* [Gemini thinking](https://ai.google.dev/gemini-api/docs/thinking)

<script src="/public/feedback.js" />


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