gemini-4-argon
Use Gemini 4 Argon with native Google GenerateContent requests, streaming, thinking controls, JSON schemas, tool calls, and explicit continuation on reAPI.
Use gemini-4-argon with reAPI's native Google GenerateContent endpoints; see the model page for current availability and pricing.
Quick example
These examples make one non-streaming request without automatic retries or continuation. Your reAPI key belongs in x-goog-api-key; a Google account key is not required. Python uses the standard library. The JavaScript example uses @google/genai 2.29.1 with explicit retry and continuation controls.
curl https://reapi.ai/api/v1beta/models/gemini-4-argon:generateContent \
-H "x-goog-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [{"role":"user","parts":[{"text":"Review this design and suggest a minimal verification plan."}]}],
"generationConfig": {
"maxOutputTokens": 4096,
"thinkingConfig": {"thinkingLevel":"medium"}
}
}'import json
from urllib.request import Request, urlopen
body = {
"contents": [{"role": "user", "parts": [{"text": "Review this design and suggest a minimal verification plan."}]}],
"generationConfig": {
"maxOutputTokens": 4096,
"thinkingConfig": {"thinkingLevel": "medium"},
},
}
request = Request(
"https://reapi.ai/api/v1beta/models/gemini-4-argon:generateContent",
data=json.dumps(body).encode("utf-8"),
headers={"x-goog-api-key": "YOUR_API_KEY", "Content-Type": "application/json"},
method="POST",
)
with urlopen(request, timeout=120) as response:
result = json.load(response)
print(json.dumps(result, indent=2))import { GoogleGenAI } from "@google/genai";
const ai = new GoogleGenAI({
apiKey: "YOUR_API_KEY",
httpOptions: {
baseUrl: "https://reapi.ai/api",
apiVersion: "v1beta",
retryOptions: { attempts: 1 },
},
});
const response = await ai.models.generateContent({
model: "gemini-4-argon",
contents: "Review this design and suggest a minimal verification plan.",
config: {
maxOutputTokens: 4096,
thinkingConfig: { thinkingLevel: "medium" },
automaticContinuation: false,
},
});
console.log(response.text);package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
body := []byte(`{
"contents":[{"role":"user","parts":[{"text":"Review this design and suggest a minimal verification plan."}]}],
"generationConfig":{"maxOutputTokens":4096,"thinkingConfig":{"thinkingLevel":"medium"}}
}`)
req, err := http.NewRequest("POST",
"https://reapi.ai/api/v1beta/models/gemini-4-argon:generateContent",
bytes.NewReader(body))
if err != nil { panic(err) }
req.Header.Set("x-goog-api-key", "YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil { panic(err) }
defer resp.Body.Close()
out, err := io.ReadAll(resp.Body)
if err != nil { panic(err) }
fmt.Println(resp.Status, string(out))
}Endpoints and authentication
| Method | URL | Response |
|---|---|---|
POST | https://reapi.ai/api/v1beta/models/gemini-4-argon:generateContent | Native JSON |
POST | https://reapi.ai/api/v1beta/models/gemini-4-argon:streamGenerateContent?alt=sse | Native SSE |
Send Content-Type: application/json and x-goog-api-key: YOUR_API_KEY. Authorization: Bearer YOUR_API_KEY and the Google-compatible ?key=YOUR_API_KEY parameter are also accepted. Prefer the header examples. An explicitly supplied Google key takes precedence over bearer or browser-session credentials. Create your key in API Keys.
The JavaScript Google SDK base URL is https://reapi.ai/api, with apiVersion: "v1beta". The SDK adds /v1beta/models/gemini-4-argon:generateContent, or its streaming equivalent. Do not put /v1beta in both the base URL and API version. Direct HTTP clients use the complete endpoint shown above.
Choose streaming by endpoint, not a stream body field. generateContent returns JSON; streamGenerateContent?alt=sse returns text/event-stream. There is no asynchronous task ID or task polling. This integration exposes these generation methods, not Google's Files, cache-management, Interactions, or token-counting APIs.
Request parameters
The native JSON body is forwarded unchanged, including unknown fields and nested schemas. This inventory describes Google's request format; it is not a field allowlist. The model service determines parameter acceptance and behavior. Authentication, billing admission, request size, and the platform media policy remain separate checks.
The model is selected in the URL. Do not replace contents with OpenAI messages or put reasoning_effort in a native request.
| Field | Type | Required / default | Meaning |
|---|---|---|---|
contents | Content array | Required | Conversation history plus the current input; each content has role (user or model) and parts |
tools | Tool array | Optional; omitted | Native function declarations and supported built-in tools |
toolConfig | object | Optional; omitted | Native function-calling and other tool configuration |
safetySettings | array | Optional; model defaults | Per-category thresholds; Google permits at most one setting per category |
continuationToken | string | Optional; omitted | Opaque checkpoint token returned by a candidate; reuse the original contents when continuing |
labels | string-valued object | Optional; omitted | Request metadata; Google specifies lowercase letters, digits, underscores and dashes, at most 63 characters per key/value, with keys beginning with a letter |
systemInstruction | Content object | Optional; omitted | Top-level text instructions, such as {"parts":[{"text":"Be concise."}]} |
generationConfig | object | Optional; model defaults | Output budget, thinking, stop sequences, schemas and other generation settings |
cachedContent | string | Optional; omitted | Explicit cache resource; Google documents explicit caching as unsupported on Argon. The field still passes through |
serviceTier | string enum | Optional; standard | unspecified, standard, flex, priority; availability depends on the model service |
store | boolean | Optional; omitted | Google request-logging control; reAPI does not add a default |
For media, use native fileData parts with a public HTTP(S) fileUri and the correct mimeType. inlineData, base64 media and data: media URIs are not accepted. Opaque thought signatures and continuation tokens are protocol state, not media inputs; preserve them exactly. Google documents image, audio, video and PDF inputs for Argon and text output. A format's presence in the generic API does not establish model-specific availability.
generationConfig
All fields below are optional. Unless stated, omission leaves the model default in effect; reAPI does not fill in a sampling setting or rewrite a schema.
| Field | Type | Documented behavior |
|---|---|---|
maxOutputTokens | integer | Thinking plus output budget; REST defaults/per-request caps are 32,768 for JSON and 65,536 for SSE. Larger budgets can require continuation. Input, thinking and output share 1,048,576 tokens |
thinkingConfig | object | thinkingLevel: low, medium (Argon default), high; includeThoughts requests available thought summaries. thinkingBudget is deprecated; Google rejects combining budget and level |
stopSequences | string array | Up to five sequences; the matched sequence is excluded from output |
responseMimeType | string | text/plain by default; application/json and text/x.enum are documented alternatives |
responseJsonSchema | JSON value | JSON Schema output constraint; forward the complete schema, with support determined by Google |
responseSchema | object | Legacy output schema, deprecated in the current reference; do not combine with responseJsonSchema |
_responseJsonSchema | JSON value | Deprecated compatibility field; prefer the documented public output-format fields |
responseFormat | object | Current Google reference's per-modality format configuration; model support varies |
responseModalities | string array | Omitted/empty requests text; Argon is a text-output model |
candidateCount | integer | Generic reference default 1; model-specific behavior is determined upstream |
temperature, topP, topK | number, number, integer | The current Google reference says these are ignored on Gemini 3.6 Flash and newer models; they still pass through |
seed | integer | Optional decoding seed; omission leaves selection to the service |
presencePenalty, frequencyPenalty | number | Native repetition settings; model behavior varies |
responseLogprobs | boolean | Requests candidate log probabilities where supported |
logprobs | integer | 0–20 alternatives in the generic reference; requires responseLogprobs |
mediaResolution | string enum | MEDIA_RESOLUTION_UNSPECIFIED, MEDIA_RESOLUTION_LOW, MEDIA_RESOLUTION_MEDIUM, MEDIA_RESOLUTION_HIGH; support depends on media and model |
enableEnhancedCivicAnswers, enableAffectiveDialog | boolean | Generic Google options; model availability varies |
speechConfig, imageConfig | object | Generic output configurations; their presence does not mean Argon generates audio or images |
translationConfig, audioTranscriptionConfig | object | Generic task configurations; model availability varies |
The Google GenerateContent reference defines nested content, tool, safety and configuration objects. All nested and additional fields remain accessible through the request JSON.
Structured output
This native configuration requests an object matching a JSON Schema:
{
"generationConfig": {
"responseMimeType": "application/json",
"responseJsonSchema": {
"type": "object",
"properties": {"answer": {"type": "string"}},
"required": ["answer"],
"additionalProperties": false
}
}
}OpenAI-compatible requests
Existing OpenAI clients can use POST https://reapi.ai/api/v1/chat/completions, an OpenAI SDK base URL of https://reapi.ai/api/v1, and bearer authentication. That body uses model, messages, stream and the OpenAI parameter names. Keep it separate from the native body above.
Google documents the compatibility mapping reasoning_effort: minimal → low, low → low, medium → medium, and high → high. Prefer the native generationConfig.thinkingConfig format when working directly with Gemini-specific settings and signed parts. A parameter being accepted does not prove its effect. Google OpenAI compatibility.
OpenAI compatibility is partial on reAPI for this model. The current reasoning_effort compatibility requests can fail; use the native Gemini endpoints and thinkingConfig for the verified integration.
Pricing dimensions
SaaS calculates the charge from the response's usageMetadata and the configured token rates frozen when the request starts. JSON and SSE use the same billing path. Rates and current availability are shown on the model page. Explicit caching is not supported on Argon; do not assume that a repeated prompt produced an implicit cache hit unless usage reports it.
Each continuation is a separate HTTP request with its own usage and charge. reAPI performs one generation attempt per request, with no automatic retries or continuation loop. Your application's SDK can otherwise issue additional requests, which is why the examples disable both behaviors.
Bill formula
Input usage is promptTokenCount + toolUsePromptTokenCount; output usage is candidatesTokenCount + thoughtsTokenCount. Cached input is already included in the prompt count. With rates expressed per token, billed_usd = (input_tokens − cached_tokens) × input_rate + cached_tokens × cache_read_rate + output_tokens × output_rate. Use the applicable reAPI rates, including the configured price group. If no separate cache-read rate is configured, cached input uses the normal input rate. A configured long-context tier applies when its input threshold condition is met. This token calculation adds no separate flat tool fee.
For SSE, the final cumulative usage is settled once after complete delivery; usage counts from successive chunks are not added together. Thinking tokens are included once, even when thought summaries are hidden. A separate fee field or fee event is not required.
The final billed USD amount is rounded upward to micro-units: micro_units = ceil(billed_usd × 1,000,000), then credits = micro_units / 1,000. One credit equals $0.001; token requests are not rounded up to a whole credit individually. Failed delivery, cancellation, incomplete streams, or missing trusted usage follow the no-charge settlement path.
Responses, tools and continuation
| Field | Meaning |
|---|---|
candidates[] | Native response candidates; inspect each candidate's content, finishReason and optional continuationToken |
content.parts[] | Text, thought summaries, signed parts, function calls and other native output parts |
usageMetadata | Prompt, candidate, thinking, cached-content and applicable tool-use token counters |
promptFeedback | Prompt blocking/safety feedback when returned |
groundingMetadata, citationMetadata | Candidate-level grounding or citation data when returned |
modelVersion, responseId | Model and response identifiers when supplied |
Text comes from candidate parts with text; parts marked thought: true are thought summaries. Preserve the complete model content for later turns, including thoughtSignature, part ordering and functionCall objects. Do not reconstruct a signed turn from the displayed text alone.
Your application executes client functions and sends functionResponse parts in a subsequent user content. reAPI does not execute those functions. When supplying Python callables to the Google SDK, set automatic_function_calling=types.AutomaticFunctionCallingConfig(disable=True) if your application must control each tool round trip explicitly.
For streaming, change the curl URL to :streamGenerateContent?alt=sse and add --no-buffer. Each SSE data: frame contains a native JSON response fragment. The stream ends at EOF, with no OpenAI [DONE] sentinel. Read in-stream error frames and finishReason; do not interpret any received text as proof that the stream completed.
CONTINUATION means the per-request cap was reached before generation finished. The candidate supplies an opaque continuationToken; it can have no visible text if the hop was spent thinking. To continue, make another request with the original contents unchanged and that token. If resuming after MAX_TOKENS, raise maxOutputTokens. Keep the token intact; do not generate or decode it yourself. Google's Argon and long-output guidance.
Errors
Native errors use Google's shape, with an HTTP status code and status name:
{
"error": {
"code": 400,
"message": "Request body must be a JSON object.",
"status": "INVALID_ARGUMENT"
}
}The response includes a request-id header for support. Native model error details are preserved where returned. OpenAI-compatible errors retain that endpoint's separate format.
| HTTP status | Native status | Meaning |
|---|---|---|
| 400 | INVALID_ARGUMENT | Invalid JSON/request or a model-rejected parameter combination |
| 401 | UNAUTHENTICATED | Missing or invalid reAPI key |
| 402 | FAILED_PRECONDITION | Insufficient balance for admission |
| 403 | PERMISSION_DENIED | Access denied |
| 404 | NOT_FOUND | Unknown model or method |
| 413 | INVALID_ARGUMENT | Request body exceeds 32 MB |
| 429 | RESOURCE_EXHAUSTED | Rate or concurrency limit |
| 502 | INTERNAL | Invalid response or incomplete delivery |
| 503 | UNAVAILABLE | Service or pricing unavailable |
| 504 | DEADLINE_EXCEEDED | Request deadline exceeded |
An error can arrive inside an already-open SSE stream. Handle it before treating the result as complete. See the platform error catalog for the other reAPI surfaces.
Tips
- Start with medium thinking and an explicit output budget appropriate to the task. Thinking consumes that budget even when summaries are not requested.
- Keep original signed parts for tool turns and keep the original request separately for continuation.
- Use native JSON for Gemini-specific tools and generation settings. Do not paste OpenAI field names into a native request.
- Use public media URLs and their actual MIME types; this API does not upload files to Google for you.
- Inspect usage and finish reasons. HTTP 200 alone does not verify grounding, caching, schema adherence, or a particular parameter's effect.
Related
Official references reviewed 2026-10-14: GenerateContent, Argon model, thinking, JavaScript HTTP options, JavaScript retry options, JavaScript continuation, Python SDK types.