Overview
Artemis City exposes three primary API surfaces:- Agent API: Task submission and execution
- ATP (Artemis Transmission Protocol): Structured inter-agent messaging
- System APIs: Registry, Memory Bus, Governance (admin-only)
Artemis transmission protocol (ATP)
ATP is the structured message format for agent-to-agent communication and kernel-to-agent direction.ATP message format
ATP tags specification
ActionType values
Query Operations:query: Read/lookup operationsearch: Semantic or keyword searchlist: Enumerate itemsget_status: Check current state
create: Insert new recordupdate: Modify existing recorddelete: Remove recordupsert: Create or update
execute: Run task/agentschedule: Queue for later executioncancel: Abort running taskretry: Re-execute failed task
register: Register agent or capabilityrevoke: Remove registrationapprove: Approve pending actionreject: Deny pending action
propose_update: Submit self-updaterollback: Revert to checkpointoverride: Bypass policy check
ATP message examples
Example 1: query task from memory bus
Example 2: submit task for execution (Kernel)
Example 3: batch agent communication
Example 4: async governance update proposal
Kernel API
Submit task
Endpoint:POST /api/v1/tasks
Request:
Get task status
Endpoint:GET /api/v1/tasks/{task_id}
Returns a single task by exact ID regardless of execution status. Use this to hydrate deep links to a task detail view (for example /tasks/:taskId in the console) after the task has moved out of the pending queue. The list endpoint (GET /api/v1/tasks) only returns pending work; this endpoint remains addressable for completed, failed, and cancelled tasks.
The identifier is matched against parsed task metadata only; it is never used to construct a filesystem path. Requests with an empty or oversized (> 255 chars) task_id return 404.
Response:
Get task activity trail
Endpoint:GET /api/v1/tasks/{task_id}/activity
Returns the governed activity trail for one exact task: task metadata, resolved routing decision, the ordered execution event log, and any reports produced by the task. The activity trail is a read-only projection over the task note, the canonical run log, and server-generated report summaries.
Use this endpoint to power a task detail or audit view that needs to answer:
- Which agent handled the task, under what capability and provider?
- What routing decision selected that agent?
- What ordered events did the run emit, with timing and provenance IDs?
- Which reports did the run produce?
task_id against parsed event metadata before being returned, so a similarly named task cannot borrow another task’s provenance.
Query parameters:
limit: Maximum number of events to return. Integer between1and500. Defaults to200. Requests outside that range return400.
400—limitis not between 1 and 500.404—task_idis empty, exceeds 255 characters, or no matching task and no matching events exist.500— the task index or run-log database could not be read, or reports could not be linked.
provenance_id, agent_name, capability, routing, provider, outcome_class, and learning_eligible may be null when the corresponding event has not been emitted yet — for example while a task is still queued. reports is an empty array until the task produces a report.
Cancel task
Endpoint:POST /api/v1/tasks/{task_id}/cancel
Response:
List tasks
Endpoint:GET /api/v1/tasks?status=completed&limit=100&offset=0
Query Parameters:
status: Filter by statusagent_id: Filter by assigned agentcreated_after: ISO 8601 timestamplimit: Result limit (default: 100, max: 1000)offset: Pagination offset
Get task by ID (dashboard read API)
Endpoint:GET /api/tasks/{task_id}
Returns one parsed task note by exact task ID across every status (pending, executing, completed, failed). Use this instead of GET /api/v1/tasks when you need a task to stay addressable after execution moves it out of the pending queue. This is what the dashboard’s task detail page (/tasks/:taskId) calls to render a refreshable deep link.
The task ID is compared against parsed task metadata only. It is never concatenated with the vault root or passed to a note-read operation, so a similarly named task cannot leak another task’s content. IDs longer than 255 characters are rejected with 404.
Authentication: Requires the dashboard API key.
Response (200 OK):
404 Not Found— no task note matches the given ID, or the ID is empty or longer than 255 characters.500 Internal Server Error— the vault could not be read.
Get task activity trail
Endpoint:GET /api/tasks/{task_id}/activity
Returns the governed activity trail for one exact task ID. The response stitches together the task record, the routing decision, the provenance chain, every run-log event whose metadata matches that task ID, and any reports the task produced. Use this to render a task detail or replay view when you need routing, dispatch, memory, and learning events correlated by parent and child provenance ID. It is the read path behind the dashboard’s task activity page (/tasks/:taskId/activity).
Events are read from the canonical run log and filtered by exact task_id in metadata, so a task cannot borrow another task’s provenance. The browser supplies only the task ID; it cannot select a note path or report filename.
Authentication: Requires the dashboard API key.
Query Parameters:
limit: Maximum number of events to return. Integer between1and500. Defaults to200.
task: The parsed task record, ornullif only run-log events remain for the ID.status: Latest known status. Taken from the task record and overridden by any laterstatusfield emitted in event metadata.provenance_id: Root provenance ID for the task. Resolved from the firstprompt_receivedevent and used to correlate downstream events.agent_name,capability,provider: The agent, required capability, and provider recorded on the routing decision or on later events.routing: The full routing decision object as emitted by the router, when available.outcome_class,learning_eligible: Learning gates from the outcome event.learning_eligiblecontrols whether Hebbian weights update for this task.reports: Reports whosetask_idmatches this task, in the same shape returned byGET /api/reports.events: The matching run-log events in ascending chronological order, capped bylimit.
400 Bad Request—limitis outside the range1–500.404 Not Found— no task record and no matching events exist for the given ID, or the ID is empty or longer than 255 characters.500 Internal Server Error— the run log or reports could not be read.
Memory bus API
Write document
Endpoint:POST /api/v1/memory/write
Request:
Read document (exact)
Endpoint:GET /api/v1/memory/read/exact?path={path}
Response:
Search documents (keyword)
Endpoint:POST /api/v1/memory/search/keyword
Request:
Search documents (semantic)
Endpoint:POST /api/v1/memory/search/semantic
Request:
Get memory health
Endpoint:GET /api/v1/memory/health
Response:
Agent registry API
Register agent
Endpoint:POST /api/v1/registry/agents
Request:
Get agent
Endpoint:GET /api/v1/registry/agents/{agent_id}
Response:
List agents
Endpoint:GET /api/v1/registry/agents?capability=nlp&status=active&limit=100
Query Parameters:
capability: Filter by capabilitystatus: Filter by statustrust_tier: Filter by tierlimit: Result limit
Update agent scores
Endpoint:PATCH /api/v1/registry/agents/{agent_id}
Request:
Get agent violations
Endpoint:GET /api/v1/registry/agents/{agent_id}/violations
Response:
Clear agent violations
Endpoint:POST /api/v1/registry/agents/{agent_id}/clear-violations
Request:
Governance API
Propose update
Endpoint:POST /api/v1/governance/updates
Request: (See ATP Example 4 in section above)
Response (202 Accepted):
Get update status
Endpoint:GET /api/v1/governance/updates/{update_id}
Response:
List pending approvals
Endpoint:GET /api/v1/governance/approvals?tier=2&status=pending
Response:
Approve update
Endpoint:POST /api/v1/governance/updates/{update_id}/approve
Request:
Reject update
Endpoint:POST /api/v1/governance/updates/{update_id}/reject
Request:
Propose rollback
Endpoint:POST /api/v1/governance/rollbacks
Request:
Get rollback status
Endpoint:GET /api/v1/governance/rollbacks/{rollback_id}
Response:
Hebbian learning API
Get Hebbian weights
Endpoint:GET /api/v1/hebbian/weights?agent_id={agent_id}
Response:
Get learning history
Endpoint:GET /api/v1/hebbian/history/{agent_id}?limit=100
Response:
ATP REST endpoints
In addition to the ATP message format above, the API exposes endpoints for building, validating, routing, and inspecting ATP messages directly over HTTP. Use these when you want the server to handle ATP queueing and routing instead of constructing raw messages yourself. All ATP endpoints require authentication.Send ATP message
Endpoint:POST /api/v1/atp/send
Submits a structured ATP message. The server validates the message, assigns it a messageId, and queues it for routing.
Request:
Route ATP message
Endpoint:POST /api/v1/atp/route
Resolves a message to the agent(s) that would handle it without dispatching it. Use this to preview routing decisions.
Request:
Validate ATP message
Endpoint:POST /api/v1/atp/validate
Checks an ATP message for structural and field-level errors without sending it. Useful for client-side form validation or CI tooling.
Response:
Format ATP message
Endpoint:POST /api/v1/atp/format
Accepts the same body as POST /api/v1/atp/send and returns the formatted ATP wire string alongside the stored message. Use this to inspect what a message looks like on the wire.
Inspect modes, priorities, and action types
Look up messages, responses, and queue depth
LLM API
The LLM API is the gateway agents use to call configured LLM providers (Anthropic Claude, OpenAI, local providers via Exo, and others). It centralizes provider configuration, model selection, ATP-aware prompting, and token usage tracking. Use the LLM API when you want:- A single HTTP surface across multiple providers and models.
- Streaming responses for chat UIs.
- ATP-formatted prompts handled and routed automatically.
- Per-provider usage and quota tracking.
Chat completion
Endpoint:POST /api/v1/llm/chat
Sends a multi-turn chat completion to the selected provider.
Request:
Text completion
Endpoint:POST /api/v1/llm/complete
Single-prompt completion for providers and models that support raw text completion.
Request:
Embeddings
Endpoint:POST /api/v1/llm/embed
Generates embeddings for use with the memory bus or the semantic search endpoints.
Request:
Stream chat completion
Endpoint:POST /api/v1/llm/stream
Streams a chat completion using Server-Sent Events (SSE). The request body matches POST /api/v1/llm/chat. The response sets Content-Type: text/event-stream and emits one data: line per chunk, terminated by data: [DONE].
List models
Endpoint:GET /api/v1/llm/models
Returns the models that the API can route to across all configured providers.
List providers
Endpoint:GET /api/v1/llm/providers
Returns providers that have been configured on the server (for example anthropic, openai, exo) and whether each is currently reachable.
Configure provider
Endpoint:POST /api/v1/llm/provider
Registers or updates credentials and base URL for a provider at runtime. Prefer environment variables for long-lived credentials; use this endpoint for runtime overrides such as rotating an API key or pointing at a local Exo instance.
Request:
Process ATP message through LLM
Endpoint:POST /api/v1/llm/atp
Hands an ATP message to the LLM router. The server picks an appropriate model, executes the prompt encoded in the message, and returns the LLM response together with the original ATP context. Use this when you want ATP routing semantics and LLM execution in a single call.
Request:
Usage statistics
Endpoint:GET /api/v1/llm/usage?startDate=2026-06-01&endDate=2026-06-04&provider=anthropic
Returns aggregated token usage and cost estimates. All query parameters are optional; omit provider to receive a breakdown across every configured provider.
Trust API
The Trust API exposes the runtime trust store that gates what each agent (or other entity) is allowed to do. Use it to read or adjust an entity’s trust score, record successes and failures that drive the score, check which operations an entity is permitted to perform, and read or update the Hebbian connection weights between agents. Trust scores are floats in the range[0, 1]. Each score maps to a trust level that controls allowed operations. Successes and failures move the score; idle entities decay over time.
All endpoints require authentication.
Get trust report
Endpoint:GET /api/v1/trust/report
Returns a snapshot of every tracked entity, its current score, level, and recent activity. Useful for dashboards and audits.
Get trust score
Endpoint:GET /api/v1/trust/{entityId}
Returns 404 if the entity is unknown.
Response:
Set trust score
Endpoint:PUT /api/v1/trust/{entityId}
Sets an explicit score. Use this for manual overrides — for normal operation, prefer recording successes and failures so the score evolves from observed behavior.
Request:
score must be between 0 and 1. entityType defaults to agent.
Record success
Endpoint:POST /api/v1/trust/{entityId}/success
Increments the entity’s trust score after a successful operation. Default reinforcement is +0.02; pass amount to override.
Request:
Record failure
Endpoint:POST /api/v1/trust/{entityId}/failure
Decrements the entity’s trust score after a failed or unsafe operation. Default penalty is -0.05; pass amount to override.
Request:
Get permissions
Endpoint:GET /api/v1/trust/{entityId}/permissions
Returns the operations the entity is currently allowed to perform, derived from its trust level.
Response:
Check a specific operation
Endpoint:POST /api/v1/trust/{entityId}/can-perform
Use this in gating code paths before dispatching an operation.
Request:
Get trust levels
Endpoint:GET /api/v1/trust/levels
Returns the trust level definitions used to map scores to operations, plus the decay and reinforcement parameters. Use this to render UI legends or to keep clients in sync with server policy.
Response:
Get Hebbian connection weights
Endpoint:GET /api/v1/trust/hebbian/weights
Returns the matrix of agent-to-agent Hebbian weights used for co-activation-based routing. See Hebbian learning for the underlying model.
Update a Hebbian connection weight
Endpoint:PUT /api/v1/trust/hebbian/weights
Reinforces or weakens the connection between two agents. Positive delta strengthens the link; negative delta weakens it.
Request:
Monitoring API
The Monitoring API powers the Monitoring dashboard page. It exposes governance state straight from the SQLite stores and a slimmed view of Prometheus alerts and scrape targets. Both endpoints require authentication withX-API-Key.
The two endpoints are deliberately independent so the durable governance snapshot stays available even when the Prometheus stack is off.
Get governance snapshot
Endpoint:GET /api/monitoring/governance
Returns a JSON-ready snapshot of the governance stores. Reads the same SQLite stores as the /metrics collector, with the same strictly read-only access. Always available, including SQLite-only mode with the monitoring stack down.
Use this when you want per-agent status alongside trust and violations in one payload — for example when rendering an operator dashboard or building a nightly governance report.
Response (200 OK):
agents: One row per registered agent.trust_scoreisnull(rendered asunscoredin the dashboard) when the agent has not been scored yet, never0.00.status_counts: Counts by agent status (active,suspended,quarantined), always present even when zero.sentinel: One row per(agent, task_type)scope tracked by the Hebbian Sentinel, with the current oscillation rate against its configured threshold.stores: Mirrors theartemis_governance_scrape_okgauge. Each flag istruewhen the corresponding SQLite store was readable during this request, andfalsewhen the read failed. Afalsehere is how the dashboard surfaces “governance store unreadable” without pretending the counts are complete.
Get Prometheus snapshot
Endpoint:GET /api/monitoring/prometheus
Returns alert-rule states and scrape-target health, proxied server-side from the Prometheus HTTP API (/api/v1/rules and /api/v1/targets). Use this when the browser needs Prometheus data but should not open a second origin — the frontend keeps a single API host.
The upstream Prometheus URL is configured with ARTEMIS_PROMETHEUS_URL (defaults to http://prometheus:9090 under the shipped Docker Compose stack). Set ARTEMIS_PROMETHEUS_TIMEOUT (seconds, defaults to 3) to raise or lower the client timeout.
Response when the stack is up (200 OK):
200 with available: false — not a 5xx — whenever Prometheus is unreachable, returns a non-2xx status, or the response is not valid JSON. This lets the Monitoring page keep rendering the durable governance snapshot and show a “start the metrics stack” hint instead of an error state.
Example:
Health checks
The API exposes lightweight, unauthenticated health endpoints suitable for load balancers and orchestration probes:Error responses
All error responses follow this format:Common error codes
Rate limiting
All endpoints are subject to rate limiting:- Default: 100 requests/minute per API key
- Burst: 200 requests for 10 seconds
- Headers:
X-RateLimit-Limit: Requests per minuteX-RateLimit-Remaining: Remaining requestsX-RateLimit-Reset: Unix timestamp of reset
Authentication
Authenticate with either anAuthorization: Bearer token or an X-API-Key header:
/health, /api/v1/health/*) are public. Every other endpoint requires a valid key.
Configuring API keys
API keys are loaded from environment variables at startup. Each key encodes its user, role, and permissions in a single value:ARTEMIS_API_KEY_* variables are set, the server falls back to MCP_API_KEY with full admin permissions. Set explicit per-user keys in any production environment.
Webhook events
Subscribe to events viaPOST /api/v1/webhooks:
