Create Run
Start an asynchronous workflow run. Returns 202 Accepted with a run id and polling URLs.
curl --fail-with-body --silent --show-error -X POST 'https://api.edgaze.ai/v1/runs' \
-H "Authorization: Bearer $EDGAZE_API_KEY" \
-H 'Content-Type: application/json' \
--data '{"workflow":"550e8400-e29b-41d4-a716-446655440000","inputs":{"input_node_id":"replace with a value matching inputSchema"},"idempotencyKey":"replace-with-one-stable-request-id"}'Developers building with the Edgaze API.
https://api.edgaze.ai/v1/runsOverview#
This is the primary execution endpoint. It accepts a workflow id and an inputs object, validates required inputs, entitlement, and spend caps synchronously, then returns 202 Accepted with a run id and URLs for polling.
Runs are asynchronous. A successful response means the request was accepted, not that the run finished. Always follow statusUrl until the run reaches a terminal state, then read outputs from the same response or from GET /runs/{id}/events for step-level progress.
Build inputs from the selected workflow's current inputSchema; there is no universal field such as topic. Every key must match either one published nodeId or its exact input name. Unknown keys are rejected so spelling mistakes cannot be silently ignored. Send an Idempotency-Key header and reuse it when retrying the same logical POST so a network retry does not create another billable run.
You may use a field's nodeId or name alias. Do not send both with different values: conflicting aliases return 400 invalid_inputs. Sending both is accepted only when their values are identical. When two published fields share a name, that name is ambiguous and you must use their node IDs.
Authorization#
Requires run:execute.
run:executeParameters#
Headers
AuthorizationstringheaderrequiredBearer token with run:execute scope.
Example: Bearer edgaze_sk_live_…
Idempotency-KeystringheaderCurrently optional for backward compatibility, but strongly recommended for every request. Preferred location; maximum 255 characters. If the body field is also present, both values must match.
Example: order_8f31_run_1
Request body
workflowstringbodyrequiredWorkflow UUID.
Example: 550e8400-e29b-41d4-a716-446655440000
inputsobjectbodyStrict map of exact input names (or nodeIds) to values matching inputSchema. Unknown keys and conflicting aliases are rejected. May be empty only when the workflow has no required inputs.
Example: {"topic": "AI agents", "tone": "Technical"}
versionstringbodyOptional immutable workflow version UUID. The caller must be entitled to this version.
Example: 8f57e8f7-7b74-4fe2-a425-722a135d93aa
idempotencyKeystringbodyCompatibility body location for the idempotency key. Prefer the Idempotency-Key header.
Version resolution#
POST /runs pins each run to one immutable workflow version. The same workflow id can therefore execute different graphs for different callers, and the resolution rules are as follows:
- Explicit pin. When you set
versionin the request body to an immutable version id you are entitled to, the run executes that exact graph. Owners can select any version in the workflow's history; buyers can select the version their purchase pin already covers. - Pinned access. When you omit
versionand your access is pinned to a version, the run executes that version. A creator publishing a newer version does not silently upgrade you. - Current version. When you omit
versionand your access is not pinned, the run executes the workflow's current active version.
Cache pinnedVersionId, activeVersionId, and updateAvailable from GET /workflows/{id} to reason about drift. When updateAvailable flips to true, review the new version before the next run: input shapes and output shapes can change between versions.
Sending an unknown or forbidden version returns 403 forbidden. The public API never reveals whether an unknown version id belongs to another workflow.
Idempotency#
Use the Idempotency-Key HTTP header. The compatibility field idempotencyKey in the JSON body is also accepted. If both are present they must be identical after surrounding whitespace is removed; otherwise the request returns 400 invalid_request. Header names are case-insensitive under HTTP, while key values are case-sensitive.
The public v1 API keeps this key optional for backward compatibility. New integrations should treat it as required for every POST /runs: without a key, an ambiguous network retry can create and charge a second run. Edgaze's own first-party run clients are rejected when they omit their attempt key.
Keys may contain any non-empty string up to 255 characters. Uniqueness is scoped to the Edgaze account behind the API key, not to one API key or workflow.
The request fingerprint covers the workflow, normalized inputs, and requested version. Reusing a key with the same request returns 202 and the original run URLs without creating or charging another run. Reusing it with a different request returns 409 idempotency_conflict. A failed or cancelled run is still the original result for that key. To intentionally retry execution as a new run, use a new key.
Funding and acceptance behavior#
The table below describes behavior visible to an API client.
| Condition | API result | Charge | Safe retry |
|---|---|---|---|
| Valid request | 202 accepted | Final charge is reported with the run | Reuse the same key for the same logical request |
| API-key spend cap exceeded | 402 spend_cap_reached | No charge | Raise the cap or wait for its window to reset |
| Insufficient wallet or eligible bundle | 202, followed by status: failed | No charge | Add funds, then use a new key for a new run |
| Invalid published inputs | 400 invalid_inputs | No charge | Correct the input, then use a new key |
| Run reaches its compute limit | 202, followed by a failed status | The run response and wallet history apply | Use a new key only when another execution is intended |
| Payment card issue | Not handled by POST /runs | Runs use existing wallet or bundle funding | Resolve the separate wallet top-up checkout |
File inputs#
POST /runs accepts JSON, not multipart form data. For an input whose schema type is file, send a JSON-safe WorkflowMedia object under that input's nodeId:
{
"__workflowMedia": true,
"kind": "image",
"url": "https://example.com/input.png",
"mimeType": "image/png",
"filename": "input.png"
}Use an HTTPS URL your workflow can retrieve, or replace url with a raw base64 field. Never put an API key or authorization token in the media URL.
Response#
Only POST /runs is rate-limited (60 req/min per key). Invalid JSON returns 400 invalid_json. Missing workflow returns 400 missing_workflow. Missing, unknown, conflicting, or incorrectly typed workflow inputs return 400 invalid_inputs. Reusing an idempotency key with a different workflow, normalized inputs, or requested version returns 409 idempotency_conflict.
Example payloads are in the request/response panel above.
Edge cases#
POST returns 202 before wallet funding is verified. If balance is insufficient, the run fails asynchronously. Poll GET /runs/{id} and check for status failed.
spend_cap_reachedSpend cap checks happen before the run row is created. A cap breach returns 402 immediately with no run ID.
rate_limitedRate limiting is enforced before run execution. A 429 never creates a partial run.
API runs use identical entitlement, wallet, bundle, and BYOK billing paths as runs started from the web app.
Send idempotencyKey and reuse the same value when retrying one logical request. Use a new value only for a genuinely new run.
invalid_inputsUnknown keys, ambiguous name aliases, and different values supplied for the same field by name and nodeId return 400 invalid_inputs before billing or run creation.
Was this useful?
Your response helps us improve the documentation.