Skip to navigation

Preview Run

Dry-run credit estimate for a workflow — no run is created.

Returns a per-node-type credit breakdown based on the workflow’s current definition. No run is enqueued, no credits are charged, and the workflow state is not modified. The optional request body accepts the same run-scoped script_text/source_language overrides as POST /runs (applied to this preview only, same as a run’s snapshot) — so estimating with a script and then running with that script prices the operation that will actually be charged. Use this before calling POST /runs to confirm the expected cost. Equivalent to POST /estimate.

Authentication

AuthorizationBearer
Clerk JWT token
OR
AuthorizationBearer

Onepin live API key (op_live_...). Test and public keys are reserved in Phase 1.

Path parameters

workflow_idstringRequiredformat: "uuid"

Headers

X-Workspace-Idstring or nullOptional

Request

This endpoint expects a nullable object.
script_textstring or nullOptional>=3 characters

Run this workflow with this script text instead of the text saved in the workflow's source_script node. Applied to the run's definition snapshot only.

source_languagestring or nullOptional

BCP-47 language of script_text (e.g. en-us). Optional; when omitted the saved source_language (or automatic detection) applies.

Response

Successful Response
dataobject

Pre-flight estimate range returned by POST /workflows/{id}/runs/preview.

min_credits ≤ owner balance is the run-start gate (don't refuse runs that might fit). FE displays "min-max credits" or single value if min == max.

metaobject

Errors

422
Unprocessable Entity Error