API overview
Authentication, errors, idempotency, paging and streaming for the v1 HTTP API, with a first request.
On this page
The Argus API is a JSON HTTP API under /v1. Its contract is api/openapi.yaml (OpenAPI 3.1); the server and the TypeScript and Go clients are generated from it, and CI fails when a change would break a client. The API reference lists every operation.
Where it is
Production is https://api.kurthlabs.com/argus; there is no separate development environment.
Every call needs a token (see below); the API answers 401 without one. The app calls the API for you, so you need none of this to use the app.
Authentication
Every operation except health checks and signed webhook deliveries needs Authorization: Bearer <token>. The token is a Tessera access token with audience argus; the API checks its signature against the realm's published keys, its issuer, audience, client and age.
How you get one depends on who you are:
- A person, in the browser. You do not handle a token. The app keeps your tokens on its server and relays your calls; the browser holds only an HttpOnly cookie.
- A person, on the command line.
argus loginruns the OAuth device flow against Tessera: it prints a URL and a code, you approve it in a browser where you are signed in, and the CLI caches and refreshes the session. See Command line and SDK. - An app backend. A backend uses the OAuth client credentials grant with a confidential Tessera client, requesting the API as the resource. A project
adminregisters the client for the project (PUT /v1/projects/{project}/clients/{client_id}), after which it acts in that project, and only that one, with theapprole.
An app's token cannot do what a person's can: it starts and follows sessions, and operator-only features such as pinning a version are refused for it.
Roles are per operation and per project; the reference lists them for each operation as Roles. A project you do not belong to answers 404, never 403.
Your first token
Everything here is self-serve: no step waits on a person at Argus.
As a person, today. Sign in to Argus once in the app, so your address is verified. Then run the OAuth device flow (RFC 8628) against Tessera with the public client argus-cli. It needs only curl and jq:
ISSUER=https://login.kurthlabs.com
DEVICE=$(curl -sS "$ISSUER/.well-known/openid-configuration" | jq -r .device_authorization_endpoint)
TOKEN_URL=$(curl -sS "$ISSUER/.well-known/openid-configuration" | jq -r .token_endpoint)
curl -sS "$DEVICE" -d client_id=argus-cli -d "scope=openid offline_access" \
-d resource=https://api.kurthlabs.com/argusThe answer holds a verification_uri_complete, a user_code and a device_code. Open the address in a browser where you are signed in to Argus and approve. Then poll, no faster than the interval it gave (at least 5 seconds), until the answer holds an access_token:
curl -sS "$TOKEN_URL" -d client_id=argus-cli \
-d grant_type=urn:ietf:params:oauth:grant-type:device_code -d device_code=$DEVICE_CODE
export ARGUS_TOKEN=<access_token>authorization_pending means keep waiting; slow_down means poll less often; access_denied and expired_token mean start again. The same answer carries a refresh_token (grant refresh_token, same client) for getting a new access token without approving again. Tokens are short-lived: ask for a new one when yours is refused with 401 invalid-token. Then use A first request. A person's token acts with your own roles in your own projects, nothing more.
As an app backend, partly today. The API side is self-serve: a project owner opens Settings in the app, finds App clients, types the Tessera client id (lower-case letters, digits and dashes, for example orders-backend) under Client id and chooses Register client. That client then acts in this project, and only this one, with the app role; Remove next to it stops that. The same is PUT /v1/projects/{project}/clients/{client_id} for a project admin. argus-control and argus-cli are reserved ids. Planned: creating the confidential Tessera client (its id and secret) yourself. That is not self-serve yet, so there is no supported way to get a backend credential today; use the person's token above to build and try things in the meantime.
Planned: public CLI download and SDK package. The argus command and @kurthlabs/argus-sdk are not publicly downloadable yet. The curl calls on this page and the API reference do the same work with the token above. See Command line and SDK.
A first request
curl -sS https://api.kurthlabs.com/argus/v1/me \
-H "Authorization: Bearer $ARGUS_TOKEN"returns who you are and your projects. Start a session in one of them:
curl -sS -X POST https://api.kurthlabs.com/argus/v1/projects/$PROJECT/sessions \
-H "Authorization: Bearer $ARGUS_TOKEN" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"agent": "showcase/assistant", "input": [{"type": "text", "text": "Plan a free Saturday in Lisbon in five short lines."}]}'The answer is the session. Follow it with the event stream below.
Errors
Every error is an RFC 9457 problem document served as application/problem+json:
{
"type": "urn:argus:problem:eval-gate-failed",
"title": "Unprocessable Entity",
"status": 422,
"detail": "version 33 fails 1 case that production passes",
"request_id": "7c1f0c52"
}The type carries a stable slug, such as invalid-token, not-found, definition-invalid, variables-invalid, eval-gate-failed, budget-exhausted, rate-limited or concurrency-limit. Validation problems (400, 422) list every problem in errors, each with a JSON pointer path. Every response carries X-Request-Id, which is yours if you sent a well-formed one. Quote it when you ask for help.
Idempotency
Every operation that changes state (POST, PUT, PATCH, DELETE) requires an Idempotency-Key header of 8 to 200 characters. Repeating a request with the same key replays the stored response for 24 hours, so a retry after a timeout does not start a second session. The same key with a different request answers 422 idempotency-key-reuse, and while the first is still running it answers 409 idempotency-request-in-progress.
Lists
Lists are paged by an opaque cursor and a limit, and return next_cursor, which is null on the last page. JSON is snake_case, times are UTC RFC 3339, and a field that can be absent is null rather than omitted. Clients should ignore fields and event types they do not know: v1 only gains fields.
Streaming a session
curl -N https://api.kurthlabs.com/argus/v1/projects/$PROJECT/sessions/$SESSION/events \
-H "Authorization: Bearer $ARGUS_TOKEN" \
-H "Accept: text/event-stream"Each event has id equal to its seq, event its type and data its JSON. Reconnect with Last-Event-ID to receive exactly what you missed. With Accept: application/json the same path pages the history. See Sessions and runs.
Limits
A project can have 4 runs in flight and start 20 sessions a minute by default; above that the API answers 429 with Retry-After. See Budgets and limits.
Versioning
The path prefix is the major version. A breaking change is a new prefix (/v2), not an edit of /v1. Within v1, responses and events only gain fields.
Tracing
W3C trace context (traceparent, tracestate) is honoured on every request, so a trace that starts in your app continues into Argus.
Webhooks
Outbound events and inbound triggers are signed with Standard Webhooks headers. See Triggers and webhooks.