Gemini 4 Argon API
Complex coding, math, and reasoning with 1M-token context.
API Format: Google Gemini
This model uses Google Gemini request/response format.
POST /v2/gemini-4-argon · submit + poll 1# pip install "segmind>=1.1.0"
2# export SEGMIND_API_KEY="YOUR_API_KEY"
3import segmind
4
5payload = {
6 "messages": {
7 "system_instruction": {
8 "parts": {
9 "text": "You are a helpful assistant."
10 }
11 },
12 "contents": [
13 {
14 "role": "user",
15 "parts": [
16 {
17 "text": "Summarise this video in three sentences."
18 },
19 {
20 "fileData": {
21 "fileUri": "https://example.com/clip.mp4",
22 "mimeType": "video/mp4"
23 }
24 }
25 ]
26 }
27 ]
28 },
29 "effort": "medium",
30 "response_format": {
31 "type": "json_schema",
32 "json_schema": {
33 "name": "answer",
34 "strict": True,
35 "schema": {
36 "type": "object",
37 "properties": {"answer": {"type": "string"}},
38 "required": ["answer"],
39 "additionalProperties": False
40 }
41 }
42 }
43}
44
45# Async chat (v2): submit to the queue, block until COMPLETED.
46reply = segmind.chat("gemini-4-argon", **payload)
47print(reply.text)
48
49# --- Or get a handle (track request_id, control the poll cadence) ---
50job = segmind.submit_chat("gemini-4-argon", **payload)
51print(job.request_id) # available immediately
52reply = job.wait(timeout=600)
53print(reply.text) 1# pip install "segmind>=1.1.0"
2# export SEGMIND_API_KEY="YOUR_API_KEY"
3import segmind
4
5payload = {
6 "messages": {
7 "system_instruction": {
8 "parts": {
9 "text": "You are a helpful assistant."
10 }
11 },
12 "contents": [
13 {
14 "role": "user",
15 "parts": [
16 {
17 "text": "Summarise this video in three sentences."
18 },
19 {
20 "fileData": {
21 "fileUri": "https://example.com/clip.mp4",
22 "mimeType": "video/mp4"
23 }
24 }
25 ]
26 }
27 ]
28 },
29 "effort": "medium",
30 "response_format": {
31 "type": "json_schema",
32 "json_schema": {
33 "name": "answer",
34 "strict": True,
35 "schema": {
36 "type": "object",
37 "properties": {"answer": {"type": "string"}},
38 "required": ["answer"],
39 "additionalProperties": False
40 }
41 }
42 }
43}
44
45# Async chat (v2): submit to the queue, block until COMPLETED.
46reply = segmind.chat("gemini-4-argon", **payload)
47print(reply.text)
48
49# --- Or get a handle (track request_id, control the poll cadence) ---
50job = segmind.submit_chat("gemini-4-argon", **payload)
51print(job.request_id) # available immediately
52reply = job.wait(timeout=600)
53print(reply.text)API Endpoint
POST https://api.segmind.com/v1/gemini-4-argonParameters
messagesrequiredobject[]Object containing contents array with role and parts. Parts can contain text or inlineData for images.
rolerequiredstringRole of the message sender
"user""model"contentrequiredarrayArray of parts (text or inlineData)
messages.system_instructionoptionalobjectSystem instruction with parts containing text to guide model behavior.
partsoptionalobjecttextrequiredstringSystem instruction text
effortoptionalstringHow hard the model reasons before answering. Thinking is billed as output tokens, so higher levels cost more and take longer.
"low""low""medium""high"response_formatoptionalobjectJSON object forcing structured output (json_object or json_schema). Use when you need machine-readable, schema-valid results.
Response Format
{
"candidates": [
{
"content": {
"parts": [
{
"text": "I can see a beautiful sunset over the ocean with vibrant orange and pink hues in the sky."
}
],
"role": "model"
},
"finishReason": "STOP",
"index": 0,
"safetyRatings": []
}
],
"usageMetadata": {
"promptTokenCount": 56,
"candidatesTokenCount": 31,
"totalTokenCount": 87
}
}With response_format
The envelope is unchanged: your JSON arrives as a string in the same field, which you parse yourself. Structured outputs guide
{
"candidates": [
{
"content": {
"parts": [
{
"text": "{\"answer\":\"Paris\"}"
}
],
"role": "model"
},
"finishReason": "STOP",
"index": 0,
"safetyRatings": []
}
],
"usageMetadata": {
"promptTokenCount": 56,
"candidatesTokenCount": 31,
"totalTokenCount": 87
}
}Image Input Format
Important: Google Gemini Format
Images can be base64 encoded in an inlineData part (mimeType + data) or sent as a URL in a fileData part (fileUri + mimeType); the API fetches URLs for the model
This model supports vision capabilities. You can include images in your requests.
Video, Audio and Document Input
Send a file as a URL and the API fetches it for the model: files up to 14MB are inlined, larger ones (up to 2GB) go through the Gemini Files API, and a YouTube link is passed straight through. Two ways to attach:
- Inside
messages: afileDatapart withfileUriandmimeType(shown in the examples above), or a base64inlineDatapart. - Beside a flat
prompt:files(a list of URLs, any mix),video,audio,pdf, each taking a URL, a data URI, or a list of them.
Media is billed as input tokens by length: roughly 100 tokens per second of video, 32 per second of audio, and 258 per PDF page. An unsupported file type is refused with a 400 before anything is fetched.
Asynchronous requests (v2)
Use Async for video, long-running (>~60s), or high-concurrency workloads; Sync is simplest for fast image & LLM calls. Async submits a request and you poll it to completion.
- 1
POST /v2/gemini-4-argonSubmit — returns request_id, status_url, response_url
- 2
GET /v2/requests/{id}/statusPoll — until COMPLETED or FAILED
- 3
GET /v2/requests/{id}Result — final response body
Status states
- A FAILED request is served as HTTP 422 — the body still carries the error detail.
- An unknown or expired request_id returns HTTP 404.
- Results are retained for 1 hour, then expire.
- Content / RAI blocks surface as FAILED, not a separate state.
- Track completion by polling the status endpoint.
Common Error Codes
The API returns standard HTTP status codes. Detailed error messages are provided in the response body.
Bad Request
Invalid message format or parameters — including a response_format this model does not accept, or a json_schema sent without a schema object
Unauthorized
Missing or invalid API key
Forbidden
Insufficient permissions
Not Found
Model or endpoint not found
Insufficient Credits
Not enough credits to process request
Rate Limited
Too many requests
Server Error
Internal server error
Bad Gateway
Service temporarily unavailable
Timeout
Request timed out