# Gemini 4 Argon

> Google’s flagship Gemini 4 reasoning model — text, image, and video with deep reasoning and 1M-token context.

## Overview

- **Model ID**: `gemini-4-argon`
- **Workflow**: `gemini`
- **Provider**: Google
- **Category**: Video → Text (text)
- **Output**: Generated text.
- **Tags**: premium, vision, video input, thinking
- **Unified endpoint**: `POST https://api.picsart.com/workflows/v1/models/execute` (model id in the body)
- **Compatibility endpoint**: `POST https://api.picsart.com/workflows/gemini/execute` (vendor's own parameters)
- **Execution**: sync (`/execute`) returns the result in one call; async is also available
- **Model page**: https://picsart.com/api-platform/models/gemini-4-argon

## Pricing

Rates are in USD. Every row below is an exact rate for the settings it names — the columns are the settings that change the price for this model. Every response reports what was actually charged in `response.usage.credits`.

| Tier | Rate |
| --- | --- |
| Cached input | $0.10 / 1M cached input tokens |
| Input | $2.00 / 1M input tokens |
| Cache write | $3.75 / 1M cache write tokens |
| Output text | $10.00 / 1M output text tokens |

Published rates. Volume pricing, invoicing and annual agreements: https://picsart.com/api-platform/contact-sales

## Authentication

The SDK and the REST API authenticate with a Picsart API key sent as a bearer token. Create a key in the console at https://picsart.com/api-platform/dashboard/api-keys, keep it in a server-side environment variable, and never ship it in browser code or commit it.

```bash
export PICSART_API_KEY="YOUR_KEY"
```

```http
Authorization: Bearer $PICSART_API_KEY
```

The CLI and the MCP server do not use an API key: `gen-ai login` signs in through the browser once per machine and stores a token locally.

## Interfaces

- **SDK** — `@picsart/ai-sdk` (TypeScript, Node 20+, ESM). Type-safe `ai.generate()` / `ai.generateText()` with per-model parameter types; polls long jobs for you.
- **REST** — the API gateway at `https://api.picsart.com`. Sync `/execute`, or async `/submit` + `/{taskId}/result`.
- **CLI** — `@picsart/gen-ai` (`gen-ai`). Generate from a terminal, quote cost before spending, emit JSON for pipelines.
- **MCP** — the same models inside Claude Code, Cursor, Windsurf and other MCP hosts. Setup: https://picsart.com/gen-ai-mcp/

```bash
npm install @picsart/ai-sdk      # SDK
npm install -g @picsart/gen-ai   # CLI (also drives the MCP server)
```

## Unified API (recommended)

One parameter set, used by the SDK and by REST alike: the names below are what `ai.generate('gemini-4-argon', …)` takes, and what goes inside the inner `params` of a REST call. Over REST the model id travels in the body, not the path — one workflow, `v1/models`, fronts the whole catalogue.

### Execution modes

- **Sync** — `POST /workflows/v1/models/execute` returns the result in one call. Only for jobs that finish within ~20 seconds; otherwise it times out.
- **Async** — `POST /workflows/v1/models/submit` returns a task id; poll `GET /workflows/v1/models/{taskId}/result` until `response.status` is `COMPLETED` or `FAILED`. Task statuses: `ACCEPTED` · `IN_PROGRESS` · `COMPLETED` · `FAILED`.
- **SDK** — `ai.generate()` always awaits the finished result; polling is hidden.

### Input parameters

- **`prompt`** (`string`, _required_): Prompt
- **`imageUrls`** (`list<string>`, _optional_): Images
  - Accepts: image URLs (max 8)
- **`videoUrl`** (`string`, _optional_): Video
  - Accepts: video URL
- **`thinking`** (`string`, _optional_): Thinking
  - Default: `"off"`
  - Options: `off`, `low`, `high`

### Input JSON Schema

The inner `params` object. Over REST it is wrapped as `{ "params": { "model": "<id>", "params": <this> } }`; the SDK takes it directly.

```json
{
  "type": "object",
  "required": [
    "prompt"
  ],
  "properties": {
    "prompt": {
      "type": "string",
      "description": "Prompt"
    },
    "imageUrls": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uri",
        "description": "image URL"
      },
      "maxItems": 8,
      "description": "Images"
    },
    "videoUrl": {
      "type": "string",
      "format": "uri",
      "description": "Video"
    },
    "thinking": {
      "type": "string",
      "enum": [
        "off",
        "low",
        "high"
      ],
      "default": "off",
      "description": "Thinking"
    }
  },
  "additionalProperties": false
}
```

### Required parameters example

The required parameters plus the defaults that shape the output, as a REST body:

```json
{
  "params": {
    "model": "gemini-4-argon",
    "params": {
      "prompt": "A serene mountain lake at golden hour, ultra detailed"
    }
  }
}
```

### Response

The body is the gateway's status envelope: the output is at `response.result`, next to the task id, its status and the credits charged. Text models return `text`.

```json
{
  "status": "success",
  "response": {
    "id": "task_abc123",
    "status": "COMPLETED",
    "result": {
      "text": "…generated text…",
      "model": "gemini-4-argon"
    }
  }
}
```

What `ai.generate()` / `ai.generateText()` resolve to (the envelope already unwrapped):

```json
{
  "text": "…generated text…",
  "model": "gemini-4-argon"
}
```

### Usage examples

#### TypeScript (SDK)

```typescript
import { createClient } from '@picsart/ai-sdk';

const ai = createClient({
  apiKey: process.env.PICSART_API_KEY,
  apiUrl: 'https://api.picsart.com',
});

const { text } = await ai.generateText('gemini-4-argon', {
  prompt: "A serene mountain lake at golden hour, ultra detailed"
});

console.log(text);
```

#### cURL (sync)

```bash
curl -X POST 'https://api.picsart.com/workflows/v1/models/execute' \
  -H 'Authorization: Bearer $PICSART_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "params": {
    "model": "gemini-4-argon",
    "params": {
      "prompt": "A serene mountain lake at golden hour, ultra detailed"
    }
  }
}'
```

#### CLI

```bash
gen-ai login  # once per machine
gen-ai models info gemini-4-argon  # this model's parameters
gen-ai pricing gemini-4-argon  # quote before spending credits
gen-ai generate -m gemini-4-argon \
  -p "A serene mountain lake at golden hour"
```

## Compatibility API (vendor parameters)

Alongside the unified API, the `gemini` workflow takes Google's own parameters exactly as the vendor defines them — nothing renamed or reshaped. It is the shortest path onto Picsart for request bodies already written against the vendor; the trade is that a request is written for one vendor, and the result comes back in the vendor's own shape. Same authentication.

- **Endpoint**: `POST https://api.picsart.com/workflows/gemini/execute` (sync) · `POST …/submit` + `GET …/{taskId}/result` (async)
- **SDK**: `ai.apis.run('gemini', params, { mode })` — params forwarded verbatim

### Vendor parameters

| Parameter | Type | Required | Default | Details |
| --- | --- | --- | --- | --- |
| `contents` | `Content[]` | yes | — | Contents array with parts |
| └ `parts` | `GeminiPart[]` | yes | — | Array of parts containing text and/or image data |
| └   `text` | `string` | no | — | Text input · e.g. `Hi, This is a picture of me. Can you add a llama next to me` |
| └   `imageUrl` | `string` | no | — | — |
| └   `audioUrl` | `string` | no | — | URL pointing to the generated audio file |
| └   `type` | `string` | no | — | Only used for custom imageUrl data · _deprecated_ |
| └   `fileData` | `object` | no | — | File data |
| └   `inlineData` | `object` | no | — | Inline data |
| └   `functionCall` | `object` | no | — | A predicted FunctionCall returned from the model that contains a string representing the FunctionDeclaration.name with the arguments and their values. |
| └   `functionResponse` | `object` | no | — | The result output of a FunctionCall that contains a string representing the FunctionDeclaration.name and a structured JSON object containing any output from the function is used as context to the model. |
| └   `thought` | `boolean` | no | — | — |
| └   `thoughtSignature` | `string` | no | — | Optional. An opaque signature for the thought so it can be reused in subsequent requests. A base64-encoded string |
| └   `partMetadata` | `object` | no | — | Custom metadata associated with the Part |
| └   `videoMetadata` | `object` | no | — | Optional. Video metadata |
| └   `mediaProcessing` | `string` | no | — | How a video part is read. AGENTIC lets the model fetch only the segments it needs (Gemini 3.5+ Flash models only); default is STATIC fixed-rate frame extraction. · Options: `MEDIA_PROCESSING_UNSPECIFIED`, `STATIC`, `AGENTIC` |
| └ `role` | `string` | no | — | — |
| `generationConfig` | `object` | no | — | — |
| └ `temperature` | `number` | no | — | Temperature value for controlling randomness · e.g. `1.2` |
| └ `topK` | `number` | no | — | Top-K sampling value · e.g. `40` |
| └ `topP` | `number` | no | `1` | Top-P (nucleus) sampling value · e.g. `0.95` |
| └ `maxOutputTokens` | `number` | no | — | Maximum number of output tokens · e.g. `8192` |
| └ `candidateCount` | `number` | no | — | Number of response variations to return. · e.g. `2` |
| └ `responseMimeType` | `string` | no | — | Response MIME type · e.g. `text/plain` |
| └ `imageConfig` | `object` | no | — | Image config |
| └   `aspectRatio` | `string` | no | — | Image aspect ratio. Use "auto" to let the model choose — no aspect ratio is sent to the vendor in that case. Support is model-dependent: the extreme ratios 1:4, 4:1, 1:8, 8:1 are only supported by Gemini 3 image models. gemini-2.5-flash-image supports only 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9 and returns 400 unsupported_aspect_ratio for any other value. · Options: `auto`, `1:1`, `2:3`, `3:2`, `3:4`, `4:3`, `4:5`, `5:4`, `9:16`, `16:9`, `21:9`, `1:4`, `4:1`, `1:8`, `8:1` |
| └   `imageSize` | `string` | no | — | Image resolution. Support is model-dependent: gemini-2.5-flash-image and gemini-3.1-flash-lite-image support 1K only; gemini-3-pro-image supports 1K, 2K, 4K; gemini-3.1-flash-image supports 0.5K, 1K, 2K, 4K. · Options: `0.5K`, `1K`, `2K`, `4K` |
| └ `responseModalities` | `string[]` | no | — | Response modalities · e.g. `["Text","Image","Audio"]` |
| └ `thinkingConfig` | `object` | no | — | Configuration for the model's thinking/reasoning capabilities. Supported by gemini-2.5-pro, gemini-2.5-flash, gemini-3-pro, gemini-3.1-pro, gemini-3-pro-image. |
| └   `thinkingBudget` | `number` | no | — | Number of thinking tokens the model should use. Range: 0-24576. Set to 0 to disable thinking. Not supported by gemini-2.5-flash-image or gemini-3.1-flash-lite-image. · 0–24576 · e.g. `1024` |
| └   `includeThoughts` | `boolean` | no | `false` | Whether to include thought summaries in the response. When true, the response will contain thought parts. · e.g. `true` |
| └   `thinkingLevel` | `string` | no | — | Controls the depth of the model's internal reasoning process. Only LOW and HIGH are supported. Not supported by gemini-2.5-flash-image or gemini-3-pro-image. · Options: `MINIMAL`, `LOW`, `MEDIUM`, `HIGH` |
| └ `speechConfig` | `object` | no | — | Speech configuration for TTS. Use voiceConfig for single-speaker or multiSpeakerVoiceConfig for multi-speaker. |
| └   `voiceConfig` | `object` | no | — | Single-speaker voice config |
| └   `multiSpeakerVoiceConfig` | `object` | no | — | Multi-speaker voice config |
| `model` | `string` | no | `gemini-2.5-flash` | Model to run. Text (chat completion) models are post-charged by token; image models produce image output (requested via responseModalities) and are billed per-image. TTS/speech synthesis lives on GEMINI_V1_AUDIOS. · Options: `gemini-2.5-pro`, `gemini-2.5-flash`, `gemini-embedding-exp`, `gemini-2.5-flash-image`, `gemini-2.5-flash-image-preview`, `gemini-3-pro-image`, `gemini-3-pro-image-preview`, `gemini-3.1-flash-image`, `gemini-3.1-flash-image-preview`, `gemini-3-pro`, `gemini-3-pro-preview`, `gemini-3.1-pro-preview`, `gemini-3.1-flash-lite`, `gemini-3.5-flash-lite`, `gemini-3.6-flash`, `gemini-3.7-flash`, `gemini-3.8-flash`, `gemini-4-argon`, `gemini-3.1-flash-lite-preview` |
| `tools` | `object[]` | no | — | Optional tools with function declarations |

### Example request body

```json
{
  "params": {
    "contents": [
      {
        "parts": []
      }
    ]
  }
}
```

### Usage examples

#### TypeScript (`ai.apis.run`)

```typescript
import { createClient, ApiRunMode } from '@picsart/ai-sdk';

const ai = createClient({
  apiKey: process.env.PICSART_API_KEY,
  apiUrl: 'https://api.picsart.com',
});

// Calls the 'gemini' workflow directly — params are sent as-is.
const { result, usage } = await ai.apis.run('gemini', {
  contents: [
    {
      parts: []
    }
  ]
}, {
  mode: ApiRunMode.SYNC,
});

console.log(result); // workflow-specific output
console.log(usage?.credits); // amount charged, in $
```

#### cURL (sync)

```bash
curl -X POST 'https://api.picsart.com/workflows/gemini/execute' \
  -H 'Authorization: Bearer $PICSART_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "params": {
    "contents": [
      {
        "parts": []
      }
    ]
  }
}'
```

### Response

Over HTTP the vendor-shaped result arrives inside the gateway envelope at `response.result`:

```json
{
  "status": "success",
  "response": {
    "id": "wf_abc123",
    "status": "COMPLETED",
    "result": {
      "candidates": [
        {
          "content": {},
          "finishReason": "…",
          "index": 0
        }
      ],
      "usage": {
        "promptTokenCount": 0,
        "cachedContentTokenCount": 0,
        "toolUsePromptTokenCount": 0,
        "candidatesTokenCount": 0,
        "thoughtsTokenCount": 0,
        "totalTokenCount": 0,
        "credits": 0
      }
    }
  }
}
```

`ai.apis.run()` unwraps that envelope and resolves to `{ result, usage }`:

```json
{
  "result": {
    "candidates": [
      {
        "content": {
          "parts": []
        },
        "finishReason": "…",
        "index": 0
      }
    ],
    "usage": {
      "promptTokenCount": 0,
      "cachedContentTokenCount": 0,
      "toolUsePromptTokenCount": 0,
      "candidatesTokenCount": 0,
      "thoughtsTokenCount": 0,
      "totalTokenCount": 0,
      "credits": 0
    }
  }
}
```

## Additional resources

- Model page: https://picsart.com/api-platform/models/gemini-4-argon
- Try it: https://picsart.com/api-platform/models/gemini-4-argon/playground
- SDK: https://picsart.com/api-platform/models/gemini-4-argon/sdk
- REST API (unified): https://picsart.com/api-platform/models/gemini-4-argon/api
- Compatibility API (vendor parameters): https://picsart.com/api-platform/models/gemini-4-argon/advanced
- Pricing: https://picsart.com/api-platform/models/gemini-4-argon/pricing
- This document: https://picsart.com/api-platform/models/gemini-4-argon/llms.txt
- All models: https://picsart.com/api-platform/models
- Docs — quickstart https://picsart.com/api-platform/docs/quickstart, authentication https://picsart.com/api-platform/docs/authentication, SDK https://picsart.com/api-platform/docs/sdk, REST https://picsart.com/api-platform/docs/api-reference, CLI https://picsart.com/api-platform/docs/cli, MCP https://picsart.com/api-platform/docs/mcp
- CLI reference: https://picsart.github.io/picsart-mcp-cli-docs/guide/introduction
