Skip to content

API Reference

This page documents the REST and SSE API endpoints exposed by the system.

The API specification is defined in schemas/openapi/duragraph.yaml. It is rendered automatically below using the MkDocs OpenAPI plugin:

::: openapi schemas/openapi/duragraph.yaml

Terminal window
curl -X POST http://localhost:8000/assistants \
-H "Content-Type: application/json" \
-d '{
"name": "My Assistant",
"description": "Helps with workflow orchestration"
}'

Terminal window
curl -X POST http://localhost:8000/threads \
-H "Content-Type: application/json" \
-d '{
"assistant_id": "asst_123",
"title": "My first thread"
}'

Terminal window
curl -X POST http://localhost:8000/messages \
-H "Content-Type: application/json" \
-d '{
"thread_id": "thread_123",
"content": "Hello world!"
}'

Terminal window
curl -N -X POST http://localhost:8000/runs \
-H "Content-Type: application/json" \
-d '{
"thread_id": "thread_123"
}' \
--output - | while read line; do
echo "$line"
done

This uses -N to disable buffering and consumes SSE events as they stream from /stream.


Terminal window
curl "http://localhost:8000/runs?thread_id=thread_123"

  • All endpoints follow REST conventions.
  • Streaming responses use Server-Sent Events (SSE).
  • For detailed schemas, error models, and idempotency guarantees, see: