Skip to main content

Overview

This topic provides detailed information about the Agent API and its access methods.

Endpoints

Over REST, authenticate with the x-api-key header against https://api.seltz.ai. The SDKs speak gRPC to grpc.seltz.ai; pass your API key to the client constructor, which sends it on every call. Each endpoint has an interactive request/response playground: Start a run, List runs, Retrieve a run, and Cancel a run.

SDK methods

create, get, cancel, and the waiters all return the bare AgentRun envelope: the per-RPC response messages carry nothing else. list returns the page (runs plus the next cursor).
wait / createAndWait and manual polling via get are the only ways to observe completion. There is no webhook or streaming option for Agent, unlike Monitor.

Request

REST rejects an unknown field in the body; the SDKs’ request types have no room for one to begin with.

Run envelope

create, get, cancel, and each entry list returns all share this one AgentRun shape, unchanged across REST, gRPC, and the SDKs:

Output

Run status and stop reason

status is the coarse outcome; stop_reason appears only once a run reaches a terminal state, and only these pairs are legal:

Enum spelling

Each surface spells the same enum value differently. stop_reason follows the same pattern: REST/JSON is lowercase ("finished", "budget_reached", …), TypeScript is AgentRunStopReason.FINISHED, and Python is AgentRunStopReason.AGENT_RUN_STOP_REASON_FINISHED.
run.status prints as a raw integer in Python unless compared against the named constant. See Poll for completion.

Pagination

list takes limit (1–100, default 20) and after, the previous page’s next. next is unset on the last page; there is no has_more field on this listing.

Errors

A rejected request is a non-200 with the same {"error": {"code": ..., "message": ...}} envelope every other Seltz endpoint uses. code is the stable field to branch on; message is prose and can change.
Over gRPC the same failures arrive as status codes (INVALID_ARGUMENT, UNAUTHENTICATED, NOT_FOUND, …) rather than as this body.
A failed run is not a rejection. The call itself succeeds, and the failure arrives as status: "failed" with stop_reason explaining why. See Handle errors.

Timing

Runs typically finish in well under a minute for a simple question. A harder one can take several minutes, and up to around an hour in the worst case. There is no fixed SLA on run duration; budget_reached and timeout exist precisely because a run does not run forever.