Skip to main content
POST
Start an endpoint run

Authorizations

Authorization
string
header
required

Monid API key

Scopes

runs:create

Headers

idempotency-key
string

Optional. Send the same key when you repeat this request to get the same run instead of a new run and a new charge. The repeat gets the response the first request got, whatever the run's outcome; a synchronous run that is still running is waited for. To try again after a run failed, send a new key. Keys are per workspace and last 7 days.

Pattern: ^[\x20-\x7E]{1,255}$
Example:

"wf_01JGXYZ:step-3"

Body

application/json
provider
string
required

Provider slug.

Minimum string length: 1
Example:

"exa"

endpoint
string
required

Endpoint path within the provider.

Minimum string length: 1
Example:

"search"

maxCost
number

Maximum US dollars for this run's estimated cost. If the estimate is higher, the call fails with status 400 and errorCode MAX_COST_EXCEEDED. Metered and per-result endpoints are billed on actual usage and can end above it. At most 6 decimals. 0 allows only free runs.

Required range: x >= 0
Example:

0.05

input
object

Composite endpoint input — body + URL query + URL path. All sub-fields optional.

tag
string

Optional label for grouping and finding runs later with GET /v1/runs?tag= (exact, case-sensitive match), e.g. your customer or job ID. 1-128 printable ASCII characters, no '#', no leading or trailing space. Set at creation; never editable.

Required string length: 1 - 128
Pattern: ^[\x21-\x22\x24-\x7E](?:[\x20-\x22\x24-\x7E]*[\x21-\x22\x24-\x7E])?$

Response

The finished run. It is COMPLETED when the provider answered, or BLOCKED when a workspace control stopped it. When the provider answers with a non-2xx status, this API returns that same status with this same body. The one exception is a provider 402, which is returned as 502.

runId
string
required
provider
string
required
endpoint
string
required
status
enum<string>
required

Run lifecycle status. Always one of the UPPERCASE enum values (e.g. COMPLETED, never completed) — compare case-sensitively. In progress: READY (created, not started), RUNNING, STOPPING (a stop is being finalized; ends COMPLETED or STOPPED). Terminal: COMPLETED (the provider responded, with any HTTP status — read providerResponse.httpStatus; a user stop the provider could not confirm in time also ends COMPLETED, billed by elapsed time, with a synthetic httpStatus 200 and output.billingBasis "ESTIMATED"), FAILED (an infrastructure failure), BLOCKED (a workspace control such as a budget, run cap or the wallet balance refused the run; see reason), STOPPED (stopped on request), TIMED_OUT (the run exceeded its time budget).

Available options:
READY,
RUNNING,
STOPPING,
COMPLETED,
FAILED,
BLOCKED,
STOPPED,
TIMED_OUT
providerResponse
object
required
price
object
required

Your price: markup and your workspace's contract (if any) applied.

createdAt
string<date-time>
required
tag
string

The caller-chosen tag the run was created with. Omitted when the run has no tag.

Example:

"customer-42"

output
any

Provider output data (terminal runs only; may be null). Endpoints that generate FILES (e.g. audio) surface each file INSIDE output as an artifact object under a stable key: { download_link (fresh signed URL, valid until link_expires_at — re-fetch the run for a new one), content_type, link_expires_at, file_expires_at? }. After the file's retention lapses the object becomes { expired: true, file_expired_at, message }.

billing
object
resultCount
number
Required range: x >= 0
billedUnits
number
Required range: x >= 0
resources
object[]
stopRequestedAt
string<date-time>
completedAt
string<date-time>
hints
object