The REST API runs Pecta quality gates server-side and returns a gate verdict in a single HTTP response. This is the right integration mode when you cannot run Node.js in-process — for example, in Python or Go services, batch pipelines, or automated testing. Gate latency is 50–100 ms end-to-end because the evaluation happens on Pecta’s infrastructure rather than inside your process. AllDocumentation Index
Fetch the complete documentation index at: https://docs.pecta.ai/llms.txt
Use this file to discover all available pages before exploring further.
/v1/* endpoints require an Authorization: Bearer <key> header. Use your publishable key (pk_live_...) for evaluation requests.
Get an API key
Sign in at pecta.ai, open Settings → API keys, and create a new key. Copy the
pk_live_... value — it is only shown once.Store it in an environment variable:Send your first evaluation
POST agent output to
/v1/evaluate. The minimum required fields are agent_id and output. Include tool and latency_ms to enable the latency gate and to improve dashboard visibility.Read the response
A successful evaluation returns HTTP 200 with the verdict, per-gate detail, total latency, and the agent’s current reputation score.When a gate fails,
passed is false and the failing gate includes a reason string:Request body reference
| Field | Type | Required | Description |
|---|---|---|---|
agent_id | string | Yes | Identifier for the agent. Determines which reputation score is updated. |
output | unknown | Yes | The agent’s output to evaluate. Passed to each gate but never stored. |
tool | string | No | Name of the tool that produced the output (e.g. shell.run). |
latency_ms | number | No | Time taken for the agent to produce the output. Required to trigger the latency gate. |
input | unknown | No | Original tool input. Used by RTB gates for request/response matching. Never stored. |