Skip to content

Endpoints Reference

Detailed reference for every endpoint in the generated FastAPI application.


Welcome page. Returns an HTML page with basic agent info and links to docs.

  • Auth: None
  • Response: HTMLResponse (not included in OpenAPI schema)

Health check for load balancers and orchestrators.

  • Auth: None
  • Response: HealthResponse
Terminal window
curl http://localhost:8080/health
{
"status": "ok",
"service": "runtime:my-agent",
"version": "0.1.0",
"timestamp": "2025-01-15T10:30:00Z",
"agent": "my-agent",
"framework": "custom"
}

Always returns 200 if the process is running.


Readiness probe. Returns 200 only when the agent adapter has been loaded successfully.

  • Auth: None
  • Response: ReadyResponse (200) or HTTPException (503)
Terminal window
curl http://localhost:8080/ready
{
"success": true,
"status": "ready",
"agent": "my-agent"
}

Returns 503 if state.ready is false or the adapter failed to load. Use this for Kubernetes readiness probes.


Prometheus-format metrics.

  • Auth: None
  • Response: text/plain with prometheus_client.CONTENT_TYPE_LATEST
Terminal window
curl http://localhost:8080/metrics

Returns standard Prometheus exposition format with dockrion_requests_total, dockrion_request_latency_seconds, and dockrion_active_requests.


Returns the agent’s input/output schema.

  • Auth: None
  • Response: SchemaResponse
{
"success": true,
"agent": "my-agent",
"input_schema": {
"type": "object",
"properties": { "query": { "type": "string" } },
"required": ["query"]
},
"output_schema": {
"type": "object",
"properties": { "answer": { "type": "string" } }
}
}

Agent metadata and configuration summary.

  • Auth: None
  • Response: InfoResponse
{
"success": true,
"agent": {
"name": "my-agent",
"framework": "custom",
"description": "My agent"
},
"auth_enabled": true,
"version": "0.1.0",
"metadata": {
"maintainer": "team@company.com",
"version": "1.0.0",
"tags": ["production"]
}
}

Invoke the agent synchronously.

  • Auth: Required (when auth is configured)
  • Request body: Dynamic model from io_schema.input
  • Response: Dynamic InvokeResponseModel
Terminal window
curl -X POST http://localhost:8080/invoke \
-H "Content-Type: application/json" \
-H "X-API-Key: your-key" \
-d '{"query": "explain quantum computing"}'
{
"success": true,
"output": {
"answer": "Quantum computing uses...",
"confidence": 0.95
},
"metadata": {}
}
{
"success": false,
"error": "Input validation failed",
"code": "VALIDATION_ERROR"
}
{
"success": false,
"error": "Agent execution failed: ...",
"code": "AGENT_EXECUTION_ERROR"
}

Invoke the agent with SSE streaming. Only registered when expose.streaming is "sse".

  • Auth: Required
  • Request body: Same as /invoke
  • Response: StreamingResponse (text/event-stream)

See 4.4 Streaming Consumption for client-side examples.


Create an async run. Only registered when streaming.async_runs is true and dockrion_events is installed.

  • Auth: Required
  • Request body: Same as /invoke
  • Query params: run_id (optional, for client-provided IDs)
  • Response: 202 Accepted
{
"run_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "ACCEPTED",
"events_url": "/runs/550e8400.../events",
"created_at": "2025-01-15T10:30:00Z"
}

Get the status of an async run.

  • Auth: Required
  • Response: Run details including status, output (if complete), error (if failed)

Subscribe to run events via SSE.

  • Auth: Required
  • Query params:
    • timeout (int, 1–3600, default 300) — connection timeout
    • from_sequence (int, ≥0, default 0) — replay events from this sequence
  • Response: StreamingResponse (text/event-stream)

Cancel a running async run.

  • Auth: Required
  • Query params: reason (optional string)
  • Response: 200 on success, 400 if already terminal, 404 if not found

Swagger UI. Auto-generated by FastAPI.

ReDoc documentation. Auto-generated by FastAPI.

OpenAPI 3.0 specification in JSON.


ModelFieldsUsed by
HealthResponsestatus, service, version, timestamp, agent, framework/health
ReadyResponsesuccess, status, agent/ready
SchemaResponsesuccess, agent, input_schema, output_schema/schema
InfoResponsesuccess, agent, auth_enabled, version, metadata/info
ErrorResponsesuccess (false), error, codeError responses
InvokeResponseModelsuccess, output (typed), metadata/invoke

InvokeResponseModel is dynamically created per agent — its output field uses the Pydantic model generated from io_schema.output.

Source: packages/runtime/dockrion_runtime/endpoints/, packages/common-py/dockrion_common/http_models.py


Next: 4.2 io_schema & Swagger →