Create Run

POST
/v1/runs

Not available yet. This operation is part of the published contract and answers 501 not_implemented until it is built. The request and response shapes below are final for this contract version.

Run an agent once with typed input. With wait: true the response is the finished run.

Authorization

HTTPBearer
headerAuthorizationBearer <token>

Bearer credential. API keys look like sqk_<geo>_<key_id>_<secret>: treat them as opaque and never put one in a browser. Older keys without the geo part stay valid until rotated. Find a geo's endpoints through GET /.well-known/sparq-discovery before sending a key.

Header Parameters

Sparq-Workspace?string

For a person signed in to a console with several workspaces: the workspace this call is for, one of their memberships (listMyMemberships). Without it such a person gets workspace_required (400); a workspace they are not a member of is forbidden. It never grants anything, and other callers' credentials ignore it.

Formatuuid
Idempotency-Key?string

Makes a retry safe: the same key, route and body within 24 hours returns the stored response and the same result id. The same key with a different body or route is idempotency_conflict; while the first request runs, idempotency_in_progress.

Length8 <= length <= 128

Request Body

application/json
  1. body

Body of POST /v1/runs: run an agent once with typed input.

agent*Agent

Lower-case name: a letter, then letters, digits, '_' or '-'. Max 63.

Match^[a-z][a-z0-9_-]{0,62}$
input?
wait?Wait

Wait for the result (action buttons) or return at once.

Defaultfalse
session_id?|null
context_hints?
idempotency_key?|null

Response Body

Successful Response

application/json
  1. response
run_id*Run Id
Formatuuid
session_id*|null
parent_run_id*|null
project_id*Project Id
Formatuuid
release_id*Release Id
Formatuuid
agent*
status*RunStatus

Where a run is. The last eight values are terminal.

Value in"queued""running""awaiting_input""completed""cancelled""limit_hit""budget_exceeded""tool_unavailable""verify_failed""awaiting_input_expired""error"
question*|

Set while waiting for an answer.

approval*|

Set while waiting for an approval.

output*|

Typed result matching the agent's output schema, once completed.

error*|

Set when the run ended in a failure state.

usage*|null
credential_id*Credential Id
Formatuuid
created_at*Created At
Formatdate-time
ended_at*|null
Example Request
curl -X POST 'http://dev-sparq.centralindia.cloudapp.azure.com:8000/v1/runs' \  -H 'Content-Type: application/json' \  -d '{  "agent": "string"}'
Example Response
{  "run_id": "dded282c-8ebd-44cf-8ba5-9a234973d1ec",  "session_id": "1ffd059c-17ea-40a8-8aef-70fd0307db82",  "parent_run_id": "f8faf8c1-9778-49a4-9004-628cdb0047e5",  "project_id": "405d8375-3514-403b-8c43-83ae74cfe0e9",  "release_id": "51d53377-463c-43a4-a864-f9b3ed9178de",  "agent": {    "name": "string",    "version": "1.4.0"  },  "status": "queued",  "question": {    "question_id": "827e810a-4b1a-40f6-8bc2-c3dd6fcedc25",    "text": "string",    "options": [      "string"    ],    "allow_free_text": true,    "expires_at": "2019-08-24T14:15:22Z"  },  "approval": {    "approval_id": "15af2260-72db-4fc4-b587-6b841d6a3d55",    "tool": "tickets.get",    "effect": "read",    "summary": "string",    "arguments": {},    "editable": true,    "expires_at": "2019-08-24T14:15:22Z",    "invocation_id": "9efe53a2-0f4e-415e-a218-b405e1367798",    "arguments_hash": "string"  },  "output": null,  "error": {    "type": "about:blank",    "title": "string",    "status": 400,    "code": "no_compliant_model",    "detail": "string",    "instance": "string",    "request_id": "string",    "issues": [      {        "path": "string",        "message": "string"      }    ],    "geo_id": "string"  },  "usage": {    "input_tokens": 0,    "output_tokens": 0,    "cached_tokens": 0,    "reasoning_tokens": 0,    "estimated_cost_usd": "string",    "credential_id": "13c40afa-2996-4a0c-b2e9-68fba9462242"  },  "credential_id": "13c40afa-2996-4a0c-b2e9-68fba9462242",  "created_at": "2019-08-24T14:15:22Z",  "ended_at": "2019-08-24T14:15:22Z"}