Skip to content

Gemini 4 Argon ​

This page is generated from the upstream official OpenAPI documentation. Endpoints, parameters and examples match the official docs; brand and API domain are replaced with ModelFold.

Endpoint ​

POST /gemini/v1/models/gemini-4-argon:streamGenerateContent

Full URL: https://ai.modelfold.online/gemini/v1/models/gemini-4-argon:streamGenerateContent

Authentication: every request must include the Authorization: Bearer <API_KEY> header.

WARNING

⚠️ Chat only

This model currently supports chat requests only and has not yet been adapted for agent use. Connecting it to an agent may cause request errors or unexpected results.

Streaming Support ​

The Gemini endpoint returns streaming chunks from streamGenerateContent. Function calling responses appear in candidates[].content.parts[].functionCall.

Streaming Response Format:

  • Content-Type: text/event-stream. The last data chunk carries usageMetadata and credits_consumed, followed by data: [DONE].
  • Function calls are returned inside parts[].functionCall
  • Thinking output may be reflected through thoughtSignature and usage metadata

Features ​

  • Standard chat with contents.
  • Google Search grounding with googleSearch.
  • Function calling with functionDeclarations.
  • Thinking configuration with generationConfig.thinkingConfig.

Request Notes ​

  • Use contents as the primary conversation input.
  • Use tools.googleSearch to enable Google Search grounding.
  • Use tools.functionDeclarations to define callable functions.
  • Use generationConfig.thinkingConfig to control thoughts output and thinking level.

Authentication ​

Authentication: send your ModelFold API key as Authorization: Bearer YOUR_API_KEY.

Error Responses ​

Errors are returned with HTTP 200 and a JSON body {"code": <int>, "msg": "<reason>"}. Check code (200 = success) before reading choices/candidates.

Request Parameters ​

Body (application/json) ​

ParameterTypeRequiredDescription
contentsarray&lt;object&gt;YesConversation input for Gemini.
  contents[].rolestringYesContent role. Allowed values:user / model。 示例:user。
  contents[].parts`array<objectobjectobject>`
tools`array<objectobject>`No
generationConfigobjectNoGeneration configuration.
  generationConfig.thinkingConfigobjectNoThinking configuration.
    generationConfig.thinkingConfig.includeThoughtsbooleanNoWhether to include thought output. 示例:true。
    generationConfig.thinkingConfig.thinkingLevelstringNoThinking level. Allowed values:low / high。 示例:high。
streambooleanNoIf set to true, the response is returned as stream chunks. Default:true。 示例:true。

Request Example ​

bash
curl -X POST "https://ai.modelfold.online/gemini/v1/models/gemini-4-argon:streamGenerateContent" \
  -H "Authorization: Bearer $MODELFOLD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "stream": true,
  "contents": [
    {
      "role": "user",
      "parts": [
        {
          "text": "What is the weather in Beijing today?"
        }
      ]
    }
  ],
  "tools": [
    {
      "functionDeclarations": [
        {
          "name": "get_weather_forecast",
          "description": "Get the weather forecast for a given location",
          "parameters": {
            "type": "OBJECT",
            "properties": {
              "location": {
                "type": "STRING",
                "description": "The city name, e.g. Beijing"
              }
            },
            "required": [
              "location"
            ]
          }
        }
      ]
    }
  ],
  "generationConfig": {
    "thinkingConfig": {
      "includeThoughts": true,
      "thinkingLevel": "high"
    }
  }
}'
json
{
  "stream": true,
  "contents": [
    {
      "role": "user",
      "parts": [
        {
          "text": "What is the weather in Beijing today?"
        }
      ]
    }
  ],
  "tools": [
    {
      "functionDeclarations": [
        {
          "name": "get_weather_forecast",
          "description": "Get the weather forecast for a given location",
          "parameters": {
            "type": "OBJECT",
            "properties": {
              "location": {
                "type": "STRING",
                "description": "The city name, e.g. Beijing"
              }
            },
            "required": [
              "location"
            ]
          }
        }
      ]
    }
  ],
  "generationConfig": {
    "thinkingConfig": {
      "includeThoughts": true,
      "thinkingLevel": "high"
    }
  }
}

Response ​

200 — Request successful. ​

参数类型必填说明
candidatesarray&lt;object&gt;否Candidate results
  candidates[].contentobject否—
    candidates[].content.rolestring否示例:model。
    candidates[].content.partsarray&lt;object&gt;否—
      candidates[].content.parts[].functionCallobject否Function call payload
      candidates[].content.parts[].thoughtSignaturestring否Thought signature 示例:Es8CCswCAb4example。
      candidates[].content.parts[].textstring否Text output
  candidates[].finishReasonstring否Candidate finish reason 示例:STOP。
modelVersionstring否Returned model version. May be absent. 示例:gemini-3-8-flash。
usageMetadataobject否Token usage metadata
  usageMetadata.candidatesTokenCountinteger否示例:18。
  usageMetadata.thinkingTokenCountinteger否示例:55。
  usageMetadata.totalTokenCountinteger否示例:325。
  usageMetadata.promptTokenCountinteger否示例:252。
credits_consumednumber否Credits consumed by the request 示例:0.01。
json
{
  "candidates": [
    {
      "content": {
        "role": "model",
        "parts": [
          {
            "text": "Hello! How can I help you today?"
          }
        ]
      },
      "finishReason": "STOP"
    }
  ],
  "usageMetadata": {
    "promptTokenCount": 5,
    "candidatesTokenCount": 9,
    "thinkingTokenCount": 0,
    "totalTokenCount": 14
  },
  "credits_consumed": 0.01
}

ModelFold — one API for all the best AI models.