Jobs

Create a job

Run a model.

POST/v1/jobs

Authorization

Authorizationstringheaderrequired
Bearer ast_gw_.... The key needs the jobs:create scope.

Starts a job. The API checks the input, prices it, sets the price aside from your wallet and answers 202 with the job. Poll Get a job for the result.

Headers

Idempotency-Keystringheaderrequired
A unique value per new request, 1 to 200 visible ASCII characters. Reuse it only to retry the same request. See Idempotency.

Body

modelstringrequired
Model ID from GET /v1/models.
inputobjectrequired
The model's input. Must match its input_schema. Media fields take { "url": "https://..." } or { "file_id": "file_..." }.
max_charge_amountstring
The most this job may cost, such as "1.000000". Required unless the key has a per-request spend limit (not offered in the console yet; ask Astorie support). With both, the lower one is the ceiling.
quote_idstring
Run at a quoted price. The input must match the quote.
pricing_modestring
current or quoted. Inferred from quote_id, so you rarely need it.
client_reference_idstring
Your own reference, up to 200 characters. Returned on the job, and part of what makes a retry count as the same request.
capability_versionstring
The model_revision your input was written for. Stored on the job and part of what makes a retry the same request. It isn't checked against the current revision.

Response

idstring
Job ID, starting with job_.
objectstring
Always job.
modelstring
The model ID you ran.
statusstring
queued, running, cancel_requested, succeeded, failed or canceled.
versioninteger
Goes up with every change. Ignore a response with a lower version than one you have.
wait_reasonstring | null
While queued: account_capacity, provider_capacity or recovery.
waiting_expires_atstring | null
When a job waiting for account capacity gives up.
client_reference_idstring | null
Your own reference, as you sent it.
outputobject
availability (not_ready, available, expired, deleted) and assets, a list of { id, type, mime_type, url }. See Results.
errorobject | null
Set when the job failed: code, message, retryable, details.
billingobject
state, accepted_max_charge_amount, reserved_amount, charged_amount, released_amount, quote_id. See Wallet.
created_atstring
RFC 3339 UTC.
updated_atstring
RFC 3339 UTC.
Note
Any other body field is rejected with 400 invalid_request and reason unknown_field.