Skip to main content
This quickstart walks through the core Dari flow:
  1. Define the repo manifest
  2. Publish with dari
  3. Create a session
  4. Upload files
  5. Send a message
  6. Inspect session state and file output

1. Add dari.yml

Create dari.yml at the repo root. Example TypeScript repo:
name: support-agent
sdk: opencode
entrypoint: src/agent.ts:agent

runtime:
  language: "typescript"
  version: "20"
  timeout_seconds: 1800

retries:
  max_attempts: 3

secrets:
  - OPENAI_API_KEY
  - INTERNAL_API_TOKEN

env:
  APP_ENV: production
Example Python repo:
name: support-agent
sdk: openai-agents
entrypoint: agent.py:agent

runtime:
  language: "python"
  version: "3.11"
  timeout_seconds: 1800

retries:
  max_attempts: 3

secrets:
  - OPENAI_API_KEY
  - INTERNAL_API_TOKEN

env:
  APP_ENV: production
timeout_seconds is the maximum runtime for one message execution. It is not the lifetime of the session. If a turn times out, the session can still receive later messages, and a later turn may incur a cold start.

2. Publish with dari

dari deploy .
The CLI:
  • Reads and validates dari.yml
  • Packages the current checkout for upload
  • Uploads your repo to Dari
  • Creates the agent or publishes a new version

3. Create a session

curl -X POST https://api.dari.dev/v1/deployments/dep_123/sessions \
  -H "Authorization: Bearer $DARI_API_KEY" \
  -H "Content-Type: application/json"
Example response:
{
  "id": "sess_123",
  "deployment_id": "dep_123",
  "status": "idle",
  "version_id": "ver_9",
  "last_message_id": null,
  "last_message_status": null,
  "created_at": "2026-03-31T18:40:00Z"
}

4. Upload a file

curl -X POST https://api.dari.dev/v1/files \
  -H "Authorization: Bearer $DARI_API_KEY" \
  -F "file=@ticket.txt"
Uploaded files can later be referenced from message parts by file_id.

5. Send a multimodal message

curl -X POST https://api.dari.dev/v1/sessions/sess_123/messages \
  -H "Authorization: Bearer $DARI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "parts": [
      { "type": "text", "text": "Summarize this ticket and draft a reply." },
      { "type": "file", "file_id": "file_456" },
      { "type": "image", "file_id": "file_789" }
    ],
    "metadata": {
      "ticket_id": "T-1042"
    }
  }'
Example response:
{
  "id": "msg_123",
  "session_id": "sess_123",
  "status": "completed",
  "output": {
    "parts": [
      {
        "type": "text",
        "text": "Here is a draft response for the customer..."
      }
    ]
  },
  "files_changed": [
    {
      "path": "/output/reply.md",
      "change": "created",
      "size_bytes": 3274
    }
  ],
  "attempt": 1,
  "created_at": "2026-03-31T18:40:00Z",
  "completed_at": "2026-03-31T18:40:12Z"
}

6. Inspect the session filesystem

List a directory:
curl "https://api.dari.dev/v1/sessions/sess_123/files?path=/output" \
  -H "Authorization: Bearer $DARI_API_KEY"
Example response:
{
  "path": "/output",
  "entries": [
    {
      "path": "/output/reply.md",
      "type": "file",
      "size_bytes": 3274
    }
  ]
}
Inspect files changed by a message:
curl "https://api.dari.dev/v1/messages/msg_123/files" \
  -H "Authorization: Bearer $DARI_API_KEY"

Next steps