API Reference
Auto-generated
Runs
API reference for runs endpoints.
Auto-generated
This page was generated from the OpenAPI spec. Run
make generate-docs to refresh after spec changes.POST /api/v1/runs
POST
/api/v1/runsCreate a run from a plan and estimate it
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| Idempotency-Key | string | Optional | Idempotency-Key |
| max_credits | integer | Required | Hard credit budget for the run (required) |
| auto_approve | boolean | Optional | Auto ApproveDefault: False |
| webhook_url | string | Optional | webhook_url |
| dry_run | boolean | Optional | Validate and estimate only; store nothingDefault: False |
| dataset_id | string | Optional | dataset_id |
| steps | object[] | Required | Steps |
Request Example
Bash
curl -X POST https://api.alterlab.io/api/v1/runs \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"max_credits": 0,
"auto_approve": false,
"dry_run": false
}'Response Example
JSON
{
"status": "ok"
}GET /api/v1/runs/{run_id}
GET
/api/v1/runs/{run_id}Get a run: state, estimate, spend and step summaries
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| run_id | string | Required | run_id |
Request Example
Bash
curl -X GET https://api.alterlab.io/api/v1/runs/<run_id> \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json"Response Example
JSON
{
"id": "example",
"status": "example",
"dry_run": true,
"max_credits": 0,
"auto_approve": true,
"spent_credits": 0
}POST /api/v1/runs/{run_id}/approve
POST
/api/v1/runs/{run_id}/approveApprove a run: reserve its budget and start executing
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| run_id | string | Required | run_id |
| max_credits | integer | Optional | max_credits |
Request Example
Bash
curl -X POST https://api.alterlab.io/api/v1/runs/<run_id>/approve \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json"Response Example
JSON
{
"id": "example",
"status": "example",
"dry_run": true,
"max_credits": 0,
"auto_approve": true,
"spent_credits": 0
}POST /api/v1/runs/{run_id}/cancel
POST
/api/v1/runs/{run_id}/cancelCancel a run: stop pending steps and refund the unused reserve
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| run_id | string | Required | run_id |
Request Example
Bash
curl -X POST https://api.alterlab.io/api/v1/runs/<run_id>/cancel \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json"Response Example
JSON
{
"id": "example",
"status": "example",
"dry_run": true,
"max_credits": 0,
"auto_approve": true,
"spent_credits": 0
}GET /api/v1/runs/{run_id}/events
GET
/api/v1/runs/{run_id}/eventsStream run events (SSE, resumable)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| run_id | string | Required | run_id |
| last_event_id | string | Optional | last_event_id |
| Last-Event-ID | string | Optional | Last-Event-ID |
Request Example
Bash
curl -X GET https://api.alterlab.io/api/v1/runs/<run_id>/events \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json"Response Example
JSON
{
"status": "ok"
}GET /api/v1/runs/{run_id}/result
GET
/api/v1/runs/{run_id}/resultThe run's dataset version with per-field provenance
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| run_id | string | Required | run_id |
| page | integer | Optional | pageDefault: 1 |
| page_size | integer | Optional | page_sizeDefault: 100 |
| format | "json" | "ndjson" | Optional | formatDefault: json |
Request Example
Bash
curl -X GET https://api.alterlab.io/api/v1/runs/<run_id>/result \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json"Response Example
JSON
{
"run_id": "example",
"dataset_id": "example",
"version": "example",
"page": 0,
"page_size": 0,
"total": 0
}