agent-on-demand-api
Agent on Demand API Skill
Reference for driving the Agent on Demand REST API — three resources (agents, environments, sessions) used to run AI coding agents inside Sprites.
When This Skill Applies
Use this skill when:
- Calling the Agent on Demand API from code, tests, or curl (creating agents, environments, or sessions)
- Writing or maintaining e2e tests in
tests/e2e/ - Adding new endpoints — keep the conventions here consistent
- Debugging 4xx responses (especially 409, 422, 429, or the
detail-is-a-list edge case)
Canonical spec: docs/openapi.yaml. The operator site is rendered at https://ravi-hq.github.io/agent-on-demand. This skill is the shorter operator view with the gotchas front-loaded.
Base URL & Auth
- Dev:
http://localhost:8777(whatmake devserves) - E2E default when invoking through
make: samehttp://localhost:8777; rawpytestdefaults tohttp://localhost:8000 - Every endpoint except
GET /healthrequiresAuthorization: Bearer aod_<token>. Tokens are created server-side viaAPIKey.create_key(user, name)(Django shell/management command).
More from ravi-hq/agent-on-demand
aod-sdk-python
Use when writing Python code that calls the Agent on Demand API via `aod-sdk` (package `aod` — `Client`/`AsyncClient`, `client.agents`/`environments`/`sessions`, `client.sessions.stream(...)`). Covers install, `AOD_API_URL`/`AOD_API_TOKEN` env fallbacks, typed pydantic models, sync-vs-async method parity, the `StreamEvent` SSE iterator (context manager + `.extra` dict), typed `AodHTTPError` subclasses (`ConflictError`/`ValidationError`/`RateLimitError.limit`/`active`), and the runtime-scoped `aod.pretty` formatters. Defers to the `agent-on-demand-api` skill for HTTP semantics, status codes, and state-machine edges.
1aod-sdk-typescript
Use when writing TypeScript or JavaScript that calls the Agent on Demand API via `@ravi-hq/aod-sdk` — `new Client({...})`, `client.agents`/`environments`/`sessions`, `client.sessions.stream(...)`. Covers install, `AOD_API_URL`/`AOD_API_TOKEN` env fallbacks (Node only), the single async client (no sync variant), the `StreamHandle` async iterable with `.close()`, `AbortSignal` cancellation, typed `AodHTTPError` subclasses (`ConflictError`/`ValidationError`/`RateLimitError.limit`/`active`), and Node-vs-browser differences. Defers to the `agent-on-demand-api` skill for HTTP semantics, status codes, and state-machine edges.
1