Platform
Cost & schedules
Two operational surfaces: a cost dashboard that accounts every token spent, and scheduled agentsthat run on a cron with zero external orchestration — the durable "individual running" story, entirely self-hosted.
The cost dashboard
/w/<workspace>/cost aggregates llm_calls over a window (default 30 days). Because every model call — chat, extraction, judge, embeddings, retries, agent steps — funnels through accounting middleware, nothing escapes the total. Money is a Postgres numeric(12,6), always returned as a 6-decimal string.
- Totals — cost, tokens in/out, cache read/write split, call count, and how many rows are estimated vs. finalized vs. errored.
- By slot — spend broken down by
chat/agent/extraction/judge/embeddings. - By model — per-model cost, tokens, and call count.
- By day — a daily time series (UTC).
- By agent and recent runs — spend attributed to each agent.
- Spend counters — the per-workspace monthly counters that back all-trigger admission.
Beyond per-run budgets: workspace admission
budget.cap alert is raised for the month. Queued and running work also consumes the workspace active-run cap. There is no general per-key request throttle (see Errors & rate limits), so per-run budgets plus workspace admission are the spend wall.Endpoints: GET /api/w/:workspaceId/cost, …/cost/by-agent, …/cost/recent.
Scheduled agents
A schedule fires an agent run with a preset input on a cron, via pg-boss in the worker. Manage them at /w/<workspace>/schedules.
Pick an agent and input
Choose an existing agent and the input string each run should receive (e.g. "Summarize this week's new interviews and flag open questions").Set a cron expression
A standard 5-field cron:minute hour day-of-month month day-of-week, with*, ranges, lists, and/step. Invalid expressions are rejected with a 400.Save
The desired schedule is committed toscheduled_jobsand reconciled to pg-boss with a stable key; audit rows remain history. Scheduled runs execute in the worker and count against the same budgets and admission caps.
Cloud-OK workspaces
Endpoints
GET/POST /api/w/:workspaceId/schedules— list / create.DELETE /api/w/:workspaceId/schedules/:agentSlug— unschedule.
See also Multi-provider AI for cost accounting internals and Creating agents for per-agent budgets.