Skip to main content
POST

Authorizations

Authorization
string
header
required

varg API key (varg_...). Get one at app.varg.ai or run bunx vargai login. App sessions may alternatively send a Supabase JWT.

Headers

Idempotency-Key
string

Any unique string. Retrying a request with the same key returns the existing job (HTTP 200) instead of creating and charging a new one (HTTP 202).

Body

application/json
model
string
required

Model id (flux_schnell) or provider-pinned (fal:flux_schnell)

Example:

"flux_schnell"

prompt
string
Maximum string length: 2000
aspect_ratio
string
Example:

"16:9"

files
object[]

Source images for editing / reference

Maximum array length: 10
provider_options
object

Provider-native overrides, keyed by provider id (e.g. a fal object with seed, num_images, ...). Discover per-model fields via GET /tools/{tool_key}?model=<model>.

options
object

Cross-cutting job options

Response

Idempotency replay — the existing job for this Idempotency-Key (no new charge).

id
string
Example:

"job_a1b2c3d4e5f6"

status
enum<string>

Lifecycle is queued then submitting then running, ending in a terminal status (completed, failed, or cancelled).

Available options:
queued,
submitting,
running,
completed,
failed,
cancelled
tool
string
Example:

"image"

input
object

The request body as submitted (model, prompt, ...)

output
object | null

Canonical output envelope. Present only when the job is completed.

error
object | null
progress_message
string | null
Example:

"stitching 3/8 (40%)"

progress
number | null

Fraction 0..1

progress_metadata
object | null
estimated_duration_ms
integer | null
estimated_cost_cents
integer | null
actual_cost_cents
integer | null
pricing
object

Structured pricing. 1 credit = 1 cent = $0.01.

provider
string | null
Example:

"fal"

provider_model
string | null
Example:

"fal:flux_schnell"

provider_status
string | null

The provider's raw status string

provider_job_id
string | null
created_at
string<date-time>
started_at
string<date-time> | null
completed_at
string<date-time> | null
urls
object

Lifecycle URLs (present on creation responses)