svc-ai — API Routes
Auto-generated from source on
2026-10-30 15:00 UTC. Do not edit manually — runmake specto regenerate.
/agents · agents
Source:
modules/svc-ai/app/routers/agent.py
| Method | Path | Handler | Description |
|---|---|---|---|
GET | /agents/agents | list_agents | Return all agent roles available in the system. |
POST | /agents/execute/stream | execute_stream | Stream an execution result token-by-token via Server-Sent Events. |
POST | /agents/execute/stream/resume | execute_stream_resume | Resume a HITL-interrupted graph execution and stream the remainder. |
DELETE | /agents/execute/threads/{thread_id} | discard_paused_thread | Drop a paused run's checkpoint without resuming it. |
POST | /agents/execute | execute_agent | Generic entrypoint used by other components (models, agents, graphs, pipelines). |
POST | /agents/graph | execute_graph | Run a graph configuration and initial input. |
POST | /agents/analysis | run_analysis | Execute the standard 'analysis' graph (planner → analyzer → validator). |
POST | /agents/rag | run_rag | Execute the built-in RAG pipeline graph. |
POST | /agents/skill | execute_skill | Execute a stored Skill as a dynamic multi-agent LangGraph. |
POST /agents/execute/stream
Stream an execution result token-by-token via Server-Sent Events.
All execution types (model, agent, skill, graph, pipeline) are handled by the inference engine for the requested type. The SSE event format is uniform across all types:
data: {"type": "graphplan", "stages": [...]} data: {"type": "status", "message": "..."} data: {"type": "token", "token": "..."} data: {"type": "tokenreset", "workeragentslug": "..."} data: {"type": "toolcall", ...} data: {"type": "nodestart", ...} data: {"type": "node_end", ...} data: {"type": "citations", "citations": [...]} data: {"type": "done", "output": "...", "usage": {...}} data: {"type": "error", "message": "..."}
POST /agents/execute/stream/resume
Resume a HITL-interrupted graph execution and stream the remainder.
The client sends this after receiving a `hitl_interrupt SSE frame. The graph is rebuilt from the same spec, then resumed via Command(resume={approved, feedback}) against the saved checkpoint. SSE frames are identical to the initial stream, ending with a done` frame.
DELETE /agents/execute/threads/{thread_id}
Drop a paused run's checkpoint without resuming it.
Checkpoints are kept in-process so a paused run can resume; one whose caller cancelled it, or gave up waiting, would otherwise stay for good.
/agents · agent-setup
Source:
modules/svc-ai/app/routers/agent_setup.py
| Method | Path | Handler | Description |
|---|
/documents · documents
Source:
modules/svc-ai/app/routers/documents.py
| Method | Path | Handler | Description |
|---|
/execute · execute
Source:
modules/svc-ai/app/routers/execute.py
| Method | Path | Handler | Description |
|---|
/ · health
Source:
modules/svc-ai/app/routers/health.py
| Method | Path | Handler | Description |
|---|
/knowledge · knowledge
Source:
modules/svc-ai/app/routers/knowledge.py
| Method | Path | Handler | Description |
|---|---|---|---|
POST | /knowledge/retrieve | retrieve | Run the retrieval pipeline over the given knowledge bases. |
GET | /knowledge/embedding | embedding_identity | The deployment's active embedding model. |
POST | /knowledge/embed | embed | Embed texts with the deployment's embedding model (batched, ordered). |
POST | /knowledge/web/fetch | web_fetch | Fetch one page of a website knowledge source. |
POST | /knowledge/web/document | web_document | Download one document for a file knowledge source — a PDF or an |
POST | /knowledge/web/favicon | web_favicon | A site's icon, fetched by the platform so the user's browser never asks |
GET /knowledge/node-types
Return all built-in knowledge graph node type definitions.
Each definition includes a property_schema that describes the fields available for that entity type, used by the frontend to render schema-driven property editing forms.
POST /knowledge/retrieve
Run the retrieval pipeline over the given knowledge bases.
Returns ranked passages (with document / page / chunk provenance), graph facts, the rendered Markdown context an agent would receive, and the machine-readable citation list. Traced: the query embeddings, and the planning and reranking calls when a model is given.
GET /knowledge/embedding
The deployment's active embedding model.
svc-core sizes its collections by it and stamps them with its key.
POST /knowledge/embed
Embed texts with the deployment's embedding model (batched, ordered).
Traced against the embedding model, one row per request.
POST /knowledge/web/fetch
Fetch one page of a website knowledge source.
Always 200: a page that could not be read is a result the crawl records (`status` says why), not a failure of this call.
POST /knowledge/web/document
Download one document for a file knowledge source — a PDF or an office or text document, never a page (`knowledge/web.fetch_document`).
The bytes come back as they are, with where they came from in headers (percent-encoded: a header is ASCII). A document that could not be had is a 422 saying why, safe to show beside the URL.
POST /knowledge/web/favicon
A site's icon, fetched by the platform so the user's browser never asks a third party (knowledge/favicon.py). svc-core caches the result.
/knowledge · knowledge-setup
Source:
modules/svc-ai/app/routers/knowledge_setup.py
| Method | Path | Handler | Description |
|---|---|---|---|
POST | /knowledge/discover/plan | plan_discovery | The web searches that would find the material (discovery's one model |
POST | /knowledge/discover/search | search_discovery | Run a plan's searches (no model). Each search is recorded as a |
POST | /knowledge/discover/check | check_discovery | Probe what the searches found (no model): robots.txt, the public https |
POST | /knowledge/discover/assign | assign_sources | Fill the given sources with checked candidates, by handle (one model |
POST /knowledge/discover/plan
The web searches that would find the material (discovery's one model call). A 422 says why none could be planned.
POST /knowledge/discover/search
Run a plan's searches (no model). Each search is recorded as a `web_search` tool invocation, as an agent's is.
POST /knowledge/discover/check
Probe what the searches found (no model): robots.txt, the public https guard, what each address is. In the order asked.
POST /knowledge/discover/assign
Fill the given sources with checked candidates, by handle (one model call). With no candidates there is nothing to choose, and no call.
/mcp · MCP Servers
Source:
modules/svc-ai/app/routers/mcp.py
| Method | Path | Handler | Description |
|---|---|---|---|
POST | /mcp/servers/probe | probe_server | Connect to an MCP server descriptor and return its exposed tools. |
POST /mcp/servers/probe
Connect to an MCP server descriptor and return its exposed tools.
Never raises for a bad/unreachable server — the failure reason comes back in `error so svc-core can surface it to the user verbatim. The connection is bounded by mcp_connect_timeout_s` and the same transport policy (stdio allowlist, URL validation) as agent execution.
/memory · memory
Source:
modules/svc-ai/app/routers/memory.py
| Method | Path | Handler | Description |
|---|---|---|---|
GET | /memory | list_user_memory | Everything any agent remembers from one user's conversations. |
DELETE | /memory | delete_user_memory | Delete everything any agent remembers of one person — what svc-core |
GET | /memory/{agent_id} | list_agent_memory | |
DELETE | /memory/{agent_id}/{memory_id} | delete_memory_entry | |
DELETE | /memory/{agent_id} | clear_agent_memory |
GET /memory/summary
How much each agent remembers, from which conversations.
Read by svc-core's network views: one call for a whole fleet, rather than listing every agent's entries to count them. `recent` adds that many of each agent's newest entries, as a task line rather than the full text. Every requested agent is answered, with zeroes if it remembers nothing.
GET /memory
Everything any agent remembers from one user's conversations.
The user's data export reads this. Per agent would miss what a deleted agent still holds and what a shared agent (CHAINR Bot) remembers, and both are the user's. `user_id` is required: this route has no agent to narrow by, so without it it would return every user's memories.
DELETE /memory
Delete everything any agent remembers of one person — what svc-core calls when the person's account is deleted. `user_id` is required: without it this would delete every person's memories.
/models · models
Source:
modules/svc-ai/app/routers/models.py
| Method | Path | Handler | Description |
|---|---|---|---|
POST | /models/providers | create_provider | |
PATCH | /models/providers/{provider_id} | update_provider | |
DELETE | /models/providers/{provider_id} | delete_provider | Delete a provider that has never had a model. |
GET | /models/available | list_available_models | Models discoverable via LiteLLM for providers that are both registered |
POST | /models/validate | validate_model | Check whether a provider/model combination is usable: |
GET | /models/lookup | lookup_model | Resolve a model by its natural key (provider + model_name). |
GET | /models | list_models | The catalogue. `include_archived` adds the models taken out of it — |
POST | /models | create_model | |
GET | /models/{model_id} | get_model | |
PATCH | /models/{model_id} | update_model | |
DELETE | /models/{model_id} | delete_model | Take a model out of the catalogue by archiving it. |
POST | /models/{model_id}/restore | restore_model | Put an archived model back in the catalogue, under the id it had. |
DELETE /models/providers/{provider_id}
Delete a provider that has never had a model.
A provider with models — archived ones included — is refused: deleting it would delete them, and with them the catalogue record every trace and conversation on those models is linked to. Disable it instead.
GET /models/available
Models discoverable via LiteLLM for providers that are both registered in the DB (enabled) and have an API key in settings. Useful for populating a UI picker when adding new models.
POST /models/validate
Check whether a provider/model combination is usable:
Provider must exist in DB and be enabled.
Provider must have an API key in settings.
Model must appear in LiteLLM's known list for the provider.
GET /models/lookup
Resolve a model by its natural key (provider + model_name). Used by svc-core to fetch capability metadata without cross-DB FKs.
GET /models
The catalogue. `include_archived` adds the models taken out of it — for naming what old records ran on, never for choosing a model.
DELETE /models/{model_id}
Take a model out of the catalogue by archiving it.
The row is kept, so the traces, calls and conversations that used the model still name it; it disappears from every catalogue read, so nothing can select or run it. Archiving an archived model changes nothing.
/rules · rule-setup
Source:
modules/svc-ai/app/routers/rules_setup.py
| Method | Path | Handler | Description |
|---|
/simulate · Simulation
Source:
modules/svc-ai/app/routers/simulate.py
| Method | Path | Handler | Description |
|---|
POST /simulate/run
Run a simulation, traced as one invocation: its agents may each run on a different model, and every call names its own.
/skills · skill-setup
Source:
modules/svc-ai/app/routers/skill_setup.py
| Method | Path | Handler | Description |
|---|
/skills · skills
Source:
modules/svc-ai/app/routers/skills.py
| Method | Path | Handler | Description |
|---|---|---|---|
GET | /skills/available/{name} | get_available_skill | Return a single skill template by name. |
GET | /skills/agents | list_agent_definitions | List all worker agent definitions available for use in skill graphs. |
GET | /skills/agents/{name} | get_agent_definition | Fetch a single worker agent definition by name. |
POST | /skills/agents | create_agent_definition | Create a custom worker agent definition, optionally cloning a base. |
PATCH | /skills/agents/{name} | update_agent_definition | Update a custom worker agent definition (builtins are immutable). |
DELETE | /skills/agents/{name} | delete_agent_definition | Delete a custom worker agent definition (builtins are protected). |
GET /skills/available
Return all built-in skill graph templates.
Each template includes:
Full node slot metadata (which agent definition sits at each node)
The ready-to-store graphdefinition (agentname refs, edges, start/end)
Clients use graph_definition as the `graph_definition` field when creating a Skill record in svc-core.
GET /skills/agents
List all worker agent definitions available for use in skill graphs.
Filterable by:
`
role` — AgentRole value (e.g. "analyzer", "reviewer")`
tag` — Tag substring match`
is_builtin` — true = built-in only, false = custom only
/skillsets · skillset-setup
Source:
modules/svc-ai/app/routers/skillset_setup.py
| Method | Path | Handler | Description |
|---|
/ · spend
Source:
modules/svc-ai/app/routers/spend.py
| Method | Path | Handler | Description |
|---|
GET /spend
What model calls have cost this UTC day and calendar month, each ceiling, what is left and when it resets (`app.services.spend_guard`). svc-core's platform benchmark reads it before starting a run, so the benchmark never spends what people need.
/stats · stats
Source:
modules/svc-ai/app/routers/stats.py
| Method | Path | Handler | Description |
|---|---|---|---|
GET | /stats/turns/{core_invocation_id} | get_turn | The model and tool calls behind one svc-core turn — an answer, a skill |
GET | /stats/traces | get_trace_stats | Return LLM and tool invocation counts with per-conversation avg ± stddev. |
GET | /stats/usage | get_usage_stats | Return token usage aggregated from LLMInvocation records. |
GET | /stats/meter | get_daily_meter | Every model call metered on one UTC day, summed by workspace, purpose, |
POST | /stats/steps | get_step_usage | Where a set of turns' tokens went: every model call they made, summed |
GET | /stats/web-search-domains | web_search_domain_stats | Aggregate web_search result citations by source domain. |
GET /stats/invocations
List individual LLM invocation traces, newest first.
Covers every recorded LLM call — conversation executions and platform flows such as generative agent setup alike. `user_id scopes the list to calls attributed to that user. offset pages past limit`, which is how the activity feed reaches calls older than its first page.
GET /stats/turns/{core_invocation_id}
The model and tool calls behind one svc-core turn — an answer, a skill run, an evaluation cell — by the id svc-core sent with it (`X-Invocation-Id; core_invocation_id on the rows). In the order they were made. user_id` narrows it to that person's rows, as every read here does; svc-core sends the turn's owner.
Turns from before the id was sent have no rows: an empty answer means "not recorded by turn", not "made no calls".
GET /stats/traces
Return LLM and tool invocation counts with per-conversation avg ± stddev. Provides both current-month and all-time totals. `user_id` scopes both to the traces attributed to that user; without it the figures cover the whole deployment.
GET /stats/usage
Return token usage aggregated from LLMInvocation records. Provides both current-month and all-time totals. `user_id` scopes both to the invocations attributed to that user; without it the figures cover the whole deployment.
GET /stats/meter
Every model call metered on one UTC day, summed by workspace, purpose, model and outcome — the deployment's whole spend, platform work included, for svc-core's daily economics export.
POST /stats/steps
Where a set of turns' tokens went: every model call they made, summed by graph node, step, pass and model. For svc-core's "where the tokens go" views, and the measurements that show what a change to the pipeline saved.
GET /stats/web-search-domains
Aggregate web_search result citations by source domain.
Reports how often each domain was surfaced in search results and its average trust/quality score (0.0-1.0, from the domain quality tiering applied when results were fetched). `user_id scopes the aggregation to a single user's tool calls; since/until` scope it to the tool calls whose invocation fell within that window.
/toolkits · toolkit-setup
Source:
modules/svc-ai/app/routers/toolkit_setup.py
| Method | Path | Handler | Description |
|---|
/tools · tools
Source:
modules/svc-ai/app/routers/tools.py
| Method | Path | Handler | Description |
|---|
GET /tools/available
Return all built-in tools with their category.
`category` is "general" for tools auto-injected into every agent and "specialist" for tools that must be explicitly configured. Sourced from the BUILTIN_TOOLS registry so the list stays in sync with registered implementations automatically.