> ## 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

> Generate Gemini 4 Argon responses from text and multimodal input, structured schemas, functions, and built-in tools.

Gemini 4 Argon exposes text reasoning, multimodal understanding, structured output, function calling, and built-in tools through one `generateContent` endpoint. Select a capability to view its request and response shape.

<Tabs sync={false}>
  <Tab title="Text and thinking">
    ## Generate content

    `POST /v1beta/models/gemini-4-argon:generateContent`

    <div className="kling-api-example-panel">
      ```bash cURL theme={null}
      curl --request POST \
        --url 'https://www.anyfast.ai/v1beta/models/gemini-4-argon:generateContent?key=YOUR_API_KEY' \
        --header 'Content-Type: application/json' \
        --data '{
          "contents": [{
            "role": "user",
            "parts": [{
              "text": "Review this retry design, identify race conditions, and propose a safe implementation plan."
            }]
          }],
          "generationConfig": {
            "thinkingConfig": {"thinkingLevel": "medium"},
            "maxOutputTokens": 2048
          }
        }'
      ```
    </div>

    ## Authentication and headers

    <ParamField query="key" type="string" required>AnyFast API key.</ParamField>
    <ParamField header="Content-Type" type="string" default="application/json" required>Request media type.</ParamField>

    ## Request body

    <ParamField body="contents" type="object[]" required>Conversation history and the current user request. The final item must be a non-empty `user` turn.</ParamField>
    <ParamField body="contents[].role" type="string" default="user">Conversation role: `user` or `model`. Do not end the request with a `model` turn.</ParamField>
    <ParamField body="contents[].parts" type="object[]" required>Content parts for the turn.</ParamField>
    <ParamField body="contents[].parts[].text" type="string" required>Text prompt or conversation content.</ParamField>
    <ParamField body="generationConfig.thinkingConfig.thinkingLevel" type="string" default="medium">Thinking level: `low`, `medium`, or `high`.</ParamField>
    <ParamField body="generationConfig.maxOutputTokens" type="integer">Maximum generated tokens for a synchronous request, from 1 through 32,768.</ParamField>

    ## Successful response

    <div className="kling-api-example-panel">
      ```json 200 theme={null}
      {
        "candidates": [{
          "content": {
            "parts": [{"text": "The design has a race between timeout handling and retry scheduling..."}],
            "role": "model"
          },
          "finishReason": "STOP",
          "index": 0,
          "safetyRatings": []
        }],
        "usageMetadata": {
          "promptTokenCount": 18,
          "candidatesTokenCount": 121,
          "thoughtsTokenCount": 86,
          "totalTokenCount": 225,
          "trafficType": "ON_DEMAND"
        },
        "modelVersion": "gemini-4-argon",
        "responseId": "response-example-001"
      }
      ```
    </div>

    <ResponseField name="candidates" type="object[]">Generated candidates.</ResponseField>
    <ResponseField name="candidates[].content" type="object">Model response turn.</ResponseField>
    <ResponseField name="candidates[].content.parts[].text" type="string">Generated text.</ResponseField>
    <ResponseField name="candidates[].finishReason" type="string">Why generation stopped, such as `STOP`, `MAX_TOKENS`, or `SAFETY`.</ResponseField>
    <ResponseField name="candidates[].safetyRatings" type="object[]">Safety assessments returned when the candidate is evaluated.</ResponseField>
    <ResponseField name="usageMetadata" type="object">Input, output, reasoning, tool, cache, and total token counts.</ResponseField>
    <ResponseField name="modelVersion" type="string">Model version that produced the response.</ResponseField>
    <ResponseField name="responseId" type="string">Response identifier.</ResponseField>
  </Tab>

  <Tab title="Multimodal understanding">
    ## Generate content

    `POST /v1beta/models/gemini-4-argon:generateContent`

    <div className="kling-api-example-panel">
      ```bash cURL theme={null}
      curl --request POST \
        --url 'https://www.anyfast.ai/v1beta/models/gemini-4-argon:generateContent?key=YOUR_API_KEY' \
        --header 'Content-Type: application/json' \
        --data '{
          "contents": [{
            "role": "user",
            "parts": [
              {"text": "Summarize this architecture and identify the likely bottleneck."},
              {
                "fileData": {
                  "mimeType": "image/png",
                  "fileUri": "https://example.com/architecture.png"
                }
              }
            ]
          }]
        }'
      ```
    </div>

    ## Authentication and headers

    <ParamField query="key" type="string" required>AnyFast API key.</ParamField>
    <ParamField header="Content-Type" type="string" default="application/json" required>Request media type.</ParamField>

    ## Request body

    <ParamField body="contents" type="object[]" required>Conversation turns containing text and media.</ParamField>
    <ParamField body="contents[].role" type="string" default="user">Conversation role: `user` or `model`.</ParamField>
    <ParamField body="contents[].parts" type="object[]" required>One or more text or media parts.</ParamField>
    <ParamField body="contents[].parts[].text" type="string">Instruction or question about the media.</ParamField>
    <ParamField body="contents[].parts[].inlineData" type="object">Inline image, audio, video, or document data.</ParamField>
    <ParamField body="contents[].parts[].inlineData.mimeType" type="string" required>Media MIME type, such as `image/jpeg`, `audio/mpeg`, `video/mp4`, or `application/pdf`.</ParamField>
    <ParamField body="contents[].parts[].inlineData.data" type="string" required>Base64-encoded media bytes.</ParamField>
    <ParamField body="contents[].parts[].fileData" type="object">Media or document supplied by URI.</ParamField>
    <ParamField body="contents[].parts[].fileData.mimeType" type="string" required>Media MIME type.</ParamField>
    <ParamField body="contents[].parts[].fileData.fileUri" type="string" required>Accessible media or document URI.</ParamField>

    ## Successful response

    <div className="kling-api-example-panel">
      ```json 200 theme={null}
      {
        "candidates": [{
          "content": {
            "parts": [{"text": "The diagram shows a queue-backed worker tier. The database connection pool is the likely bottleneck..."}],
            "role": "model"
          },
          "finishReason": "STOP",
          "index": 0
        }],
        "usageMetadata": {
          "promptTokenCount": 846,
          "candidatesTokenCount": 94,
          "totalTokenCount": 940,
          "promptTokensDetails": [
            {"modality": "TEXT", "tokenCount": 18},
            {"modality": "IMAGE", "tokenCount": 828}
          ]
        },
        "modelVersion": "gemini-4-argon",
        "responseId": "response-example-002"
      }
      ```
    </div>

    <ResponseField name="candidates[].content.parts[].text" type="string">Text analysis of the supplied media.</ResponseField>
    <ResponseField name="candidates[].finishReason" type="string">Reason generation stopped.</ResponseField>
    <ResponseField name="usageMetadata.promptTokensDetails" type="object[]">Input token counts grouped by modality.</ResponseField>
    <ResponseField name="usageMetadata.candidatesTokensDetails" type="object[]">Output token counts grouped by modality when returned.</ResponseField>
    <ResponseField name="modelVersion" type="string">Model version that produced the response.</ResponseField>
    <ResponseField name="responseId" type="string">Response identifier.</ResponseField>
  </Tab>

  <Tab title="Structured output">
    ## Generate content

    `POST /v1beta/models/gemini-4-argon:generateContent`

    <div className="kling-api-example-panel">
      ```bash cURL theme={null}
      curl --request POST \
        --url 'https://www.anyfast.ai/v1beta/models/gemini-4-argon:generateContent?key=YOUR_API_KEY' \
        --header 'Content-Type: application/json' \
        --data '{
          "contents": [{
            "role": "user",
            "parts": [{"text": "Extract the service, severity, and action: 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"]
            }
          }
        }'
      ```
    </div>

    ## Authentication and headers

    <ParamField query="key" type="string" required>AnyFast API key.</ParamField>
    <ParamField header="Content-Type" type="string" default="application/json" required>Request media type.</ParamField>

    ## Request body

    <ParamField body="contents" type="object[]" required>Conversation turns containing the extraction or generation instruction.</ParamField>
    <ParamField body="contents[].parts[].text" type="string" required>Instruction and source text.</ParamField>
    <ParamField body="generationConfig.responseMimeType" type="string" required>Use `application/json` for JSON structured output or `text/x.enum` for a single enum value.</ParamField>
    <ParamField body="generationConfig.responseSchema" type="object" required>Schema that constrains the generated JSON. Define explicit properties and required fields.</ParamField>

    ## Successful response

    <div className="kling-api-example-panel">
      ```json 200 theme={null}
      {
        "candidates": [{
          "content": {
            "parts": [{
              "text": "{\"service\":\"checkout-api\",\"severity\":\"critical\",\"action\":\"rollback\"}"
            }],
            "role": "model"
          },
          "finishReason": "STOP",
          "index": 0
        }],
        "usageMetadata": {
          "promptTokenCount": 27,
          "candidatesTokenCount": 24,
          "totalTokenCount": 51
        },
        "modelVersion": "gemini-4-argon",
        "responseId": "response-example-003"
      }
      ```
    </div>

    <ResponseField name="candidates[].content.parts[].text" type="string">JSON serialized as text and conforming to the requested schema.</ResponseField>
    <ResponseField name="candidates[].finishReason" type="string">Reason generation stopped.</ResponseField>
    <ResponseField name="usageMetadata" type="object">Token accounting for the request.</ResponseField>
    <ResponseField name="modelVersion" type="string">Model version that produced the response.</ResponseField>
    <ResponseField name="responseId" type="string">Response identifier.</ResponseField>
  </Tab>

  <Tab title="Function calling">
    ## Generate function call

    `POST /v1beta/models/gemini-4-argon:generateContent`

    <div className="kling-api-example-panel">
      ```bash cURL theme={null}
      curl --request POST \
        --url 'https://www.anyfast.ai/v1beta/models/gemini-4-argon:generateContent?key=YOUR_API_KEY' \
        --header 'Content-Type: application/json' \
        --data '{
          "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"]
            }
          }
        }'
      ```
    </div>

    ## Authentication and headers

    <ParamField query="key" type="string" required>AnyFast API key.</ParamField>
    <ParamField header="Content-Type" type="string" default="application/json" required>Request media type.</ParamField>

    ## Request body

    <ParamField body="contents" type="object[]" required>Conversation turns containing the user request and, for later steps, previous model calls and function results.</ParamField>
    <ParamField body="tools[].functionDeclarations" type="object[]" required>Functions available to the model.</ParamField>
    <ParamField body="tools[].functionDeclarations[].name" type="string" required>Function name.</ParamField>
    <ParamField body="tools[].functionDeclarations[].description" type="string">When and how the model should use the function.</ParamField>
    <ParamField body="tools[].functionDeclarations[].parameters" type="object">JSON Schema for function arguments.</ParamField>
    <ParamField body="toolConfig.functionCallingConfig.mode" type="string" default="AUTO">`AUTO`, `ANY`, `NONE`, or `VALIDATED`.</ParamField>
    <ParamField body="toolConfig.functionCallingConfig.allowedFunctionNames" type="string[]">Subset of declared functions the model may call.</ParamField>
    <ParamField body="contents[].parts[].functionResponse.name" type="string" required>Function name when returning a tool result.</ParamField>
    <ParamField body="contents[].parts[].functionResponse.id" type="string">Call ID returned by the model.</ParamField>
    <ParamField body="contents[].parts[].functionResponse.response" type="object">Structured function result.</ParamField>
    <ParamField body="contents[].parts[].thoughtSignature" type="string">Opaque signature returned by the model. Preserve it exactly in later requests.</ParamField>

    ## Function-call response

    <div className="kling-api-example-panel">
      ```json 200 theme={null}
      {
        "candidates": [{
          "content": {
            "parts": [{
              "functionCall": {
                "id": "call-example-001",
                "name": "get_deployment_status",
                "args": {"service": "checkout-api"}
              },
              "thoughtSignature": "opaque-signature-placeholder"
            }],
            "role": "model"
          },
          "finishReason": "STOP",
          "index": 0
        }],
        "usageMetadata": {
          "promptTokenCount": 86,
          "candidatesTokenCount": 18,
          "toolUsePromptTokenCount": 64,
          "totalTokenCount": 168
        },
        "modelVersion": "gemini-4-argon",
        "responseId": "response-example-004"
      }
      ```
    </div>

    <ResponseField name="candidates[].content.parts[].functionCall" type="object">Function requested by the model.</ResponseField>
    <ResponseField name="candidates[].content.parts[].functionCall.id" type="string">Call ID to associate with a returned function result.</ResponseField>
    <ResponseField name="candidates[].content.parts[].functionCall.name" type="string">Function name.</ResponseField>
    <ResponseField name="candidates[].content.parts[].functionCall.args" type="object">Model-generated function arguments.</ResponseField>
    <ResponseField name="candidates[].content.parts[].thoughtSignature" type="string">Opaque signature that must be preserved when the model turn is replayed.</ResponseField>
    <ResponseField name="usageMetadata.toolUsePromptTokenCount" type="integer">Tokens used for tool context when this metric is reported.</ResponseField>
    <ResponseField name="responseId" type="string">Response identifier.</ResponseField>
  </Tab>

  <Tab title="Built-in tools">
    ## Generate grounded content

    `POST /v1beta/models/gemini-4-argon:generateContent`

    <div className="kling-api-example-panel">
      ```bash cURL theme={null}
      curl --request POST \
        --url 'https://www.anyfast.ai/v1beta/models/gemini-4-argon:generateContent?key=YOUR_API_KEY' \
        --header 'Content-Type: application/json' \
        --data '{
          "contents": [{
            "role": "user",
            "parts": [{"text": "Find the latest stable Gemini API model and cite the source."}]
          }],
          "tools": [{"googleSearch": {}}]
        }'
      ```
    </div>

    ## Authentication and headers

    <ParamField query="key" type="string" required>AnyFast API key.</ParamField>
    <ParamField header="Content-Type" type="string" default="application/json" required>Request media type.</ParamField>

    ## Request body

    <ParamField body="contents" type="object[]" required>Conversation turns containing the tool-assisted request.</ParamField>
    <ParamField body="tools[].googleSearch" type="object">Ground the response with current Google Search results.</ParamField>
    <ParamField body="tools[].googleMaps" type="object">Ground location-related answers with Google Maps data.</ParamField>
    <ParamField body="tools[].urlContext" type="object">Read and analyze URLs supplied in the prompt.</ParamField>
    <ParamField body="tools[].codeExecution" type="object">Allow the model to execute code.</ParamField>
    <ParamField body="tools[].computerUse" type="object">Allow the model to propose computer-use actions. This tool is in Preview.</ParamField>
    <ParamField body="tools[].computerUse.environment" type="string">Computer-use environment, such as `ENVIRONMENT_BROWSER`.</ParamField>

    ## Grounded response

    <div className="kling-api-example-panel">
      ```json 200 theme={null}
      {
        "candidates": [{
          "content": {
            "parts": [{"text": "Gemini 4 Argon is the latest stable Flash model..."}],
            "role": "model"
          },
          "finishReason": "STOP",
          "groundingMetadata": {
            "webSearchQueries": ["latest stable Gemini API model"],
            "searchEntryPoint": {
              "renderedContent": "<style>...</style><div>...</div>"
            },
            "groundingChunks": [{
              "web": {
                "uri": "https://ai.google.dev/gemini-api/docs/models",
                "title": "Gemini models"
              }
            }],
            "groundingSupports": [{
              "segment": {"startIndex": 0, "endIndex": 56, "text": "Gemini 4 Argon is the latest stable Flash model"},
              "groundingChunkIndices": [0]
            }]
          }
        }],
        "usageMetadata": {
          "promptTokenCount": 15,
          "candidatesTokenCount": 58,
          "toolUsePromptTokenCount": 43,
          "totalTokenCount": 116
        },
        "modelVersion": "gemini-4-argon",
        "responseId": "response-example-005"
      }
      ```
    </div>

    <ResponseField name="candidates[].content.parts" type="object[]">Text, executable code, code results, or other returned parts.</ResponseField>
    <ResponseField name="candidates[].groundingMetadata.webSearchQueries" type="string[]">Search queries issued when grounding metadata is returned.</ResponseField>
    <ResponseField name="candidates[].groundingMetadata.searchEntryPoint.renderedContent" type="string">Google-provided HTML and CSS for the search suggestions UI when returned.</ResponseField>
    <ResponseField name="candidates[].groundingMetadata.groundingChunks" type="object[]">Web or Maps sources returned for the response.</ResponseField>
    <ResponseField name="candidates[].groundingMetadata.groundingSupports" type="object[]">Links generated text segments to grounding sources when returned.</ResponseField>
    <ResponseField name="candidates[].content.parts[].executableCode" type="object">Code returned when `codeExecution` is enabled and the model selects code execution.</ResponseField>
    <ResponseField name="candidates[].content.parts[].codeExecutionResult" type="object">Execution outcome and output returned after code execution.</ResponseField>
    <ResponseField name="usageMetadata.toolUsePromptTokenCount" type="integer">Tokens used for tool context when this metric is reported.</ResponseField>
    <ResponseField name="responseId" type="string">Response identifier.</ResponseField>
  </Tab>
</Tabs>

## Common optional request fields

<ParamField body="systemInstruction" type="object">Text-only system instruction with a `parts` array.</ParamField>
<ParamField body="generationConfig.stopSequences" type="string[]">Up to five strings that stop generation when encountered.</ParamField>
<ParamField body="safetySettings" type="object[]">Safety thresholds applied by harm category.</ParamField>
<ParamField body="safetySettings[].category" type="string">Supported category, such as `HARM_CATEGORY_HATE_SPEECH` or `HARM_CATEGORY_DANGEROUS_CONTENT`.</ParamField>
<ParamField body="safetySettings[].threshold" type="string">Blocking threshold, such as `BLOCK_MEDIUM_AND_ABOVE`, `BLOCK_ONLY_HIGH`, or `BLOCK_NONE`.</ParamField>

## Error responses

<ResponseField name="error.code" type="integer">HTTP-compatible error code.</ResponseField>
<ResponseField name="error.message" type="string">Human-readable error description.</ResponseField>
<ResponseField name="error.status" type="string">Canonical error status.</ResponseField>

<Info>
  A `400` response commonly indicates an invalid final conversation turn, an unsupported thinking level or tool, or an incomplete function response. A `401` response indicates an invalid API key; `429` indicates rate limiting.
</Info>

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


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