Run the agent

POST
/agent/invoke

Runs the agent as the key's owner. The tools it may reach are derived from the key's SCOPES, so a key holding only jobs:read gets an agent that can read jobs and nothing else. Rate limited far below the read endpoints, because each call runs a model. Send an Idempotency-Key and reuse it across retries: a repeat returns the original result instead of running the agent again.

Authorization

bearerAuth
AuthorizationBearer <token>

An API key from Settings > API access, sent as Authorization: Bearer sp_live_.... Send exactly one credential per request; a request carrying both a bearer token and a session cookie is rejected rather than resolved by precedence.

In: header

Header Parameters

Idempotency-Key?string

A unique value per logical request, reused across retries of that request. Without one, a network retry runs the agent twice.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/agent/invoke" \  -H "Content-Type: application/json" \  -d '{    "prompt": "string"  }'
{  "sessionId": "string",  "reply": "string",  "status": "completed",  "idempotentReplay": true,  "error": "string",  "failedCorrelationId": "string"}

Last updated on