Tools API
Tools runs
Run one tool once, wait for it or poll it, read what happened to it, cancel it, and delete its input and output.
A run executes one tool once with one input. Short runs answer in the same call; longer ones are polled. To find a tool and its input, see the Tools catalog. For a walkthrough, see Tools API.
Start a run#
POSThttps://api.sproutsdata.ai/tools/v1/runs
- Scope
- dsp.tools.write
- Cost
- Spends credits
- Idempotency-Key
- optional
Run one tool once.
Answers 200 when the run finished within wait_seconds (any final status: succeeded, no_match, failed and so on), else 202 with the run so far and a Location to poll. Refusals before the run is queued (bad input, a switched-off tool, the spend cap, too many runs in flight) are RFC 9457 errors.
Send Idempotency-Key to make a retry safe: a repeated key returns the first run and never runs the tool again.
Headers
Idempotency-KeystringSend one to make a retry safe: a retry with the same key on the same UTC day is charged once.
Request bodyJSON, required
toolstringrequiredat most 80 charactersinputobjectwait_secondsnumber or nullat least 0
Response 200application/json
costobjectrequired2 fields inside
credits_chargednumberrequiredprice_creditsnumber or nullrequired
created_atstring (date-time)requireddeadline_atstring (date-time)requiredrun_idstringrequiredstatusstringrequired"queued""running""succeeded""no_match""rejected""failed""unresolved""cancelled""expired"toolstringrequiredunitsintegerrequiredbillable_unitsinteger or nullcompleted_atstring (date-time) or nullerrorobject or null2 fields inside
codestringrequiredmessagestringrequired
estimated_start_secondsinteger or nullinputobject or nulllatency_msinteger or nulloutputanypayload_deletedbooleandefaultfalsepayload_expires_atstring (date-time) or nullqueue_positioninteger or nullqueue_reasonstring or null"capacity""paused"replayedbooleandefaultfalsesyntheticbooleandefaultfalseunits_boundinteger or null
Errors
- 401
No usable credential (auth.unauthorized).
- 403
Not allowed: the workspace (auth.tenant_not_allowed) or the key's scope.
- 404
No such tool, group or run for this workspace (tools.*_not_found).
- 409
A finished run (tools.run_finished), or an Idempotency-Key reused for another input (tools.idempotency_conflict).
- 410
A retired tool (tools.tool_disabled).
- 413
The body is too large (request.too_large).
- 422
Validation Error
- 429
Too many requests (rate_limit.exceeded), runs in flight (tools.too_many_runs) or today's spend (tools.spend_cap_exceeded).
- 501
Tools are not served by this deployment (
not_implemented). - 503
Tools could not be reached (upstream.unavailable), or a tool is switched off (tools.tool_disabled, service.unavailable).
- 504
Tools did not answer in time (upstream.timeout). A run may still finish.
curl -X POST "https://api.sproutsdata.ai/tools/v1/runs" \
-H "X-API-Key: $SPROUTS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"tool": "amazon/product",
"input": {
"asin": "B0CP9YB3Q4"
},
"wait_seconds": 20
}'{
"billable_units": 0,
"completed_at": "2026-11-27T09:30:00Z",
"cost": {
"credits_charged": 0,
"price_credits": 0
},
"created_at": "2026-11-27T09:30:00Z",
"deadline_at": "2026-11-27T09:30:00Z",
"error": {
"code": "string",
"message": "string"
},
"estimated_start_seconds": 0,
"input": {},
"latency_ms": 0,
"output": {},
"payload_deleted": false,
"payload_expires_at": "2026-11-27T09:30:00Z",
"queue_position": 0,
"queue_reason": "capacity",
"replayed": false,
"run_id": "string",
"status": "queued",
"synthetic": false,
"tool": "string",
"units": 0,
"units_bound": 0
}List runs#
GEThttps://api.sproutsdata.ai/tools/v1/runs
- Scope
- dsp.tools.read
- Cost
- Free
The caller's own runs, newest first, without their output. Only the credential that started a run can see it, as with usage history.
Query parameters
toolstring or nullat most 80 charactersstatusstring or nullat most 16 characterslimitintegerdefault201 to 100cursorstring or nullat most 40 characters
Response 200application/json
itemsarray of objectrequired21 fields inside
costobjectrequired2 fields inside
credits_chargednumberrequiredprice_creditsnumber or nullrequired
created_atstring (date-time)requireddeadline_atstring (date-time)requiredrun_idstringrequiredstatusstringrequired"queued""running""succeeded""no_match""rejected""failed""unresolved""cancelled""expired"toolstringrequiredunitsintegerrequiredbillable_unitsinteger or nullcompleted_atstring (date-time) or nullerrorobject or null2 fields inside
codestringrequiredmessagestringrequired
estimated_start_secondsinteger or nullinputobject or nulllatency_msinteger or nulloutputanypayload_deletedbooleandefaultfalsepayload_expires_atstring (date-time) or nullqueue_positioninteger or nullqueue_reasonstring or null"capacity""paused"replayedbooleandefaultfalsesyntheticbooleandefaultfalseunits_boundinteger or null
next_cursorstring or null
Errors
- 401
No usable credential (auth.unauthorized).
- 403
Not allowed: the workspace (auth.tenant_not_allowed) or the key's scope.
- 422
Validation Error
- 429
Too many requests (rate_limit.exceeded), runs in flight (tools.too_many_runs) or today's spend (tools.spend_cap_exceeded).
- 501
Tools are not served by this deployment (
not_implemented). - 503
Tools could not be reached (upstream.unavailable), or a tool is switched off (tools.tool_disabled, service.unavailable).
- 504
Tools did not answer in time (upstream.timeout). A run may still finish.
curl "https://api.sproutsdata.ai/tools/v1/runs?limit=20" \
-H "X-API-Key: $SPROUTS_API_KEY"{
"items": [
{
"billable_units": 0,
"completed_at": "2026-11-27T09:30:00Z",
"cost": {
"credits_charged": 0,
"price_credits": 0
},
"created_at": "2026-11-27T09:30:00Z",
"deadline_at": "2026-11-27T09:30:00Z",
"error": {
"code": "string",
"message": "string"
},
"estimated_start_seconds": 0,
"input": {},
"latency_ms": 0,
"output": {},
"payload_deleted": false,
"payload_expires_at": "2026-11-27T09:30:00Z",
"queue_position": 0,
"queue_reason": "capacity",
"replayed": false,
"run_id": "string",
"status": "queued",
"synthetic": false,
"tool": "string",
"units": 0,
"units_bound": 0
}
],
"next_cursor": "string"
}Get a run#
GEThttps://api.sproutsdata.ai/tools/v1/runs/{run_id}
- Scope
- dsp.tools.read
- Cost
- Free
One run: its status, and its output once it has succeeded.
Path parameters
run_idstringrequired
Response 200application/json
costobjectrequired2 fields inside
credits_chargednumberrequiredprice_creditsnumber or nullrequired
created_atstring (date-time)requireddeadline_atstring (date-time)requiredrun_idstringrequiredstatusstringrequired"queued""running""succeeded""no_match""rejected""failed""unresolved""cancelled""expired"toolstringrequiredunitsintegerrequiredbillable_unitsinteger or nullcompleted_atstring (date-time) or nullerrorobject or null2 fields inside
codestringrequiredmessagestringrequired
estimated_start_secondsinteger or nullinputobject or nulllatency_msinteger or nulloutputanypayload_deletedbooleandefaultfalsepayload_expires_atstring (date-time) or nullqueue_positioninteger or nullqueue_reasonstring or null"capacity""paused"replayedbooleandefaultfalsesyntheticbooleandefaultfalseunits_boundinteger or null
Errors
- 401
No usable credential (auth.unauthorized).
- 403
Not allowed: the workspace (auth.tenant_not_allowed) or the key's scope.
- 404
No such tool, group or run for this workspace (tools.*_not_found).
- 422
Validation Error
- 429
Too many requests (rate_limit.exceeded), runs in flight (tools.too_many_runs) or today's spend (tools.spend_cap_exceeded).
- 501
Tools are not served by this deployment (
not_implemented). - 503
Tools could not be reached (upstream.unavailable), or a tool is switched off (tools.tool_disabled, service.unavailable).
- 504
Tools did not answer in time (upstream.timeout). A run may still finish.
curl "https://api.sproutsdata.ai/tools/v1/runs/run_4b1e9c2a7d3f4e5a8b6c0d1e2f3a4b5c" \
-H "X-API-Key: $SPROUTS_API_KEY"{
"billable_units": 0,
"completed_at": "2026-11-27T09:30:00Z",
"cost": {
"credits_charged": 0,
"price_credits": 0
},
"created_at": "2026-11-27T09:30:00Z",
"deadline_at": "2026-11-27T09:30:00Z",
"error": {
"code": "string",
"message": "string"
},
"estimated_start_seconds": 0,
"input": {},
"latency_ms": 0,
"output": {},
"payload_deleted": false,
"payload_expires_at": "2026-11-27T09:30:00Z",
"queue_position": 0,
"queue_reason": "capacity",
"replayed": false,
"run_id": "string",
"status": "queued",
"synthetic": false,
"tool": "string",
"units": 0,
"units_bound": 0
}Read a run's events#
GEThttps://api.sproutsdata.ai/tools/v1/runs/{run_id}/events
- Scope
- dsp.tools.read
- Cost
- Free
What happened to one run, in order: queued, started, running, any retry or cancel, finished. Kept with the run, so a run can be traced long after it ended. Never names who served it.
Path parameters
run_idstringrequired
Response 200application/json
itemsarray of objectrequired3 fields inside
atstring (date-time)requiredstatusstringrequired"queued""running""succeeded""no_match""rejected""failed""unresolved""cancelled""expired"typestringrequired"queued""starting""running""retry_scheduled""waiting""cancel_requested""finished"
run_idstringrequired
Errors
- 401
No usable credential (auth.unauthorized).
- 403
Not allowed: the workspace (auth.tenant_not_allowed) or the key's scope.
- 404
No such tool, group or run for this workspace (tools.*_not_found).
- 422
Validation Error
- 429
Too many requests (rate_limit.exceeded), runs in flight (tools.too_many_runs) or today's spend (tools.spend_cap_exceeded).
- 501
Tools are not served by this deployment (
not_implemented). - 503
Tools could not be reached (upstream.unavailable), or a tool is switched off (tools.tool_disabled, service.unavailable).
- 504
Tools did not answer in time (upstream.timeout). A run may still finish.
curl "https://api.sproutsdata.ai/tools/v1/runs/run_4b1e9c2a7d3f4e5a8b6c0d1e2f3a4b5c/events" \
-H "X-API-Key: $SPROUTS_API_KEY"{
"items": [
{
"at": "2026-11-27T09:30:00Z",
"status": "queued",
"type": "queued"
}
],
"run_id": "string"
}Cancel a run#
POSThttps://api.sproutsdata.ai/tools/v1/runs/{run_id}/cancel
- Scope
- dsp.tools.write
- Cost
- Free
Stop a run. It ends as cancelled and costs nothing. A run that already finished answers 409.
Path parameters
run_idstringrequired
Response 200application/json
costobjectrequired2 fields inside
credits_chargednumberrequiredprice_creditsnumber or nullrequired
created_atstring (date-time)requireddeadline_atstring (date-time)requiredrun_idstringrequiredstatusstringrequired"queued""running""succeeded""no_match""rejected""failed""unresolved""cancelled""expired"toolstringrequiredunitsintegerrequiredbillable_unitsinteger or nullcompleted_atstring (date-time) or nullerrorobject or null2 fields inside
codestringrequiredmessagestringrequired
estimated_start_secondsinteger or nullinputobject or nulllatency_msinteger or nulloutputanypayload_deletedbooleandefaultfalsepayload_expires_atstring (date-time) or nullqueue_positioninteger or nullqueue_reasonstring or null"capacity""paused"replayedbooleandefaultfalsesyntheticbooleandefaultfalseunits_boundinteger or null
Errors
- 401
No usable credential (auth.unauthorized).
- 403
Not allowed: the workspace (auth.tenant_not_allowed) or the key's scope.
- 404
No such tool, group or run for this workspace (tools.*_not_found).
- 409
A finished run (tools.run_finished), or an Idempotency-Key reused for another input (tools.idempotency_conflict).
- 413
The body is too large (request.too_large).
- 422
Validation Error
- 429
Too many requests (rate_limit.exceeded), runs in flight (tools.too_many_runs) or today's spend (tools.spend_cap_exceeded).
- 501
Tools are not served by this deployment (
not_implemented). - 503
Tools could not be reached (upstream.unavailable), or a tool is switched off (tools.tool_disabled, service.unavailable).
- 504
Tools did not answer in time (upstream.timeout). A run may still finish.
curl -X POST "https://api.sproutsdata.ai/tools/v1/runs/run_4b1e9c2a7d3f4e5a8b6c0d1e2f3a4b5c/cancel" \
-H "X-API-Key: $SPROUTS_API_KEY"{
"billable_units": 0,
"completed_at": "2026-11-27T09:30:00Z",
"cost": {
"credits_charged": 0,
"price_credits": 0
},
"created_at": "2026-11-27T09:30:00Z",
"deadline_at": "2026-11-27T09:30:00Z",
"error": {
"code": "string",
"message": "string"
},
"estimated_start_seconds": 0,
"input": {},
"latency_ms": 0,
"output": {},
"payload_deleted": false,
"payload_expires_at": "2026-11-27T09:30:00Z",
"queue_position": 0,
"queue_reason": "capacity",
"replayed": false,
"run_id": "string",
"status": "queued",
"synthetic": false,
"tool": "string",
"units": 0,
"units_bound": 0
}Delete a run's data#
DELETEhttps://api.sproutsdata.ai/tools/v1/runs/{run_id}
- Scope
- dsp.tools.write
- Cost
- Free
Delete a finished run's input and output now. The run stays in your runs and in usage with its status and what it cost; it reads payload_deleted. You may delete the runs you can read: your own, your API keys', and as a workspace admin every run of the workspace. A run still queued or running answers 409: cancel it first. Changes no charge.
Path parameters
run_idstringrequired
Errors
- 422
Validation Error
curl -X DELETE "https://api.sproutsdata.ai/tools/v1/runs/run_4b1e9c2a7d3f4e5a8b6c0d1e2f3a4b5c" \
-H "X-API-Key: $SPROUTS_API_KEY"204 No Content200 or 202#
The start waits for the run for up to wait_seconds. If the run ends in that time, the answer is 200 with its final status, whichever it is: succeeded, no_match, failed and so on. If not, the answer is 202 with the run so far and a Location header: poll that address (GET /tools/v1/runs/{run_id}) until the status is final, waiting a few seconds between reads. The tool's latency in the catalog says how long a run typically takes. A refusal before the run is queued, such as an input that does not fit the tool or a balance that cannot cover it, is an error problem rather than a run.
If a start times out on your side, do not simply start again: send the same Idempotency-Key, which returns the first run instead of running, and paying for, the tool twice. A key is remembered for 24 hours, and using it for another tool answers 409 tools.idempotency_key_reused.
Cost#
Starting a run holds the most it can cost, the figure a quote gives; if the balance cannot cover it, the start answers 402. When the run ends, it is charged for what it returned, and the rest of the hold is released. A run that ends cancelled costs nothing. cost on the run, and meta.credits_charged once the charge is settled, say what it cost. Deleting a run's data changes no charge. See Credits and usage.