Reference
API reference documentation.
Complete reference documentation for Risicare APIs.
Overview
Python SDK
SDK API reference
Learn more
REST API
HTTP API reference
Learn more
MCP Server
Read-only tools for coding agents
Learn more
Quick Links
SDK
import risicare
from risicare import SemanticPhase
# Core
risicare.init() # reads RISICARE_API_KEY
risicare.flush() # -> bool: True when the gateway accepted every span and score
risicare.shutdown() # stops the SDK: call it only where the process ends
# Decorators
@risicare.agent(name=..., role=...)
@risicare.session(session_id_arg="session_id", user_id_arg="user_id")
@risicare.trace_think
@risicare.trace_decide
@risicare.trace_act
@risicare.trace_message(target=..., target_name=...)
@risicare.trace_delegate(target=..., target_name=...)
# Context Managers
risicare.session_context(session_id, user_id=...)
risicare.agent_context(agent_id, agent_name=..., agent_role=...)
risicare.phase_context(SemanticPhase.THINK)
risicare.restore_trace_context(ctx) # ctx: a TraceContextREST API
An API key can call the routes below. What a key may do inside a route depends on its class and scopes. These are the routes that the docs cover for an API key. For the rest, use the dashboard — see REST API.
# Ingest host — https://ingest.risicare.ai
POST /v1/spans
POST /v1/spans/batch
POST /v1/traces
POST /v1/otlp/v1/traces
# API host — https://api.risicare.ai
GET /v1/datasets
POST /v1/datasets
GET /v1/datasets/{dataset_id}/export
POST /v1/datasets/{dataset_id}/items
POST /v1/datasets/{dataset_id}/imports
POST /v1/evaluations
GET /v1/evaluations/{evaluation_id}
PATCH /v1/evaluations/{evaluation_id}
GET /v1/evaluations/{evaluation_id}/cases
POST /v1/evaluations/{evaluation_id}/cases/copy
GET /v1/evaluations/{evaluation_id}/inputs
GET /v1/evaluations/{evaluation_id}/results
POST /v1/evaluations/{evaluation_id}/results
GET /v1/evaluations/{evaluation_id}/verdict
GET /v1/fixes/active
GET /v1/prompts/resolve
POST /v1/scores
The OTLP endpoint is POST /v1/traces. It takes OTLP over HTTP as JSON or as binary protobuf.
Authentication
Send the API key in the Authorization header:
curl -H "Authorization: Bearer rsk-..."Base URLs
| Use | URL |
|---|---|
| Span ingest (the SDK default) | https://ingest.risicare.ai |
| API host: scores, datasets, evaluations, prompts and active fixes (the SDK default) | https://api.risicare.ai |
| Dashboard | https://app.risicare.ai |
| MCP server for coding agents (read-only) | https://app.risicare.ai/api/mcp |
Rate Limits
| Endpoint | Default Limit |
|---|---|
Ingestion (/v1/*) | Limited per project and per client IP — see API Keys |
Response Format
The ingest gateway and the scores route have different response and error bodies — see Gateway Responses and Error Responses.