Levain LabsLevain Labs

Quickstart

Create and run your first agent in about five minutes.

This walks you from signup to a working agent. The first half happens in the dashboard — no code required. The second half uses the API to run the agent and watch it work.

1. Create your agent

Sign in and open the dashboard. Create a new agent and describe, in plain language, what you want it to do. A sentence or two is enough:

Read an incoming support ticket, classify its urgency, and route it to the right team.

Submit. The platform scaffolds the agent for you and lands you on its detail page, where you'll see its name, status, and the identifiers you'll need next.

New agents start in draft. Activate the agent when you're ready for it to accept runs.

2. Get an API key

You'll trigger the run from the API, so you'll need a key. In the dashboard, go to Settings → API Keys, create a key, and copy it — it's shown once.

export LEVAIN_API_KEY="sk_live_..."

3. Trigger a run

Runs take an agent ID and a config payload — the input your agent should work on. You'll find the agent's ID on its detail page.

RUN_ID=$(curl -s -X POST https://api.levainlabs.com/api/v1/runs \
  -H "Authorization: Bearer $LEVAIN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_id": "YOUR_AGENT_ID",
    "config": {
      "subject": "Cannot access my account",
      "body": "I get a 403 every time I try to log in."
    }
  }' | jq -r .id)

The response returns the run's full record (status, agent, etc.); the snippet above captures the id into $RUN_ID for the next step.

4. Watch it work

Poll the run to see state transitions, token spend, and cost accumulating in real time:

curl https://api.levainlabs.com/api/v1/runs/$RUN_ID \
  -H "Authorization: Bearer $LEVAIN_API_KEY"

Or stream the step-by-step log to see what the agent is actually doing:

curl https://api.levainlabs.com/api/v1/runs/$RUN_ID/logs \
  -H "Authorization: Bearer $LEVAIN_API_KEY"

Next steps

On this page