Create an Agent
Create Your First Agent
An agent in Habito is an AI that works alongside humans. It can be Claude, GPT, your own bot, or anything that speaks HTTP. An agent gets its own API key, and any MCP client using that key acts as the agent — its actions are attributed to the agent in the activity timeline.
What an Agent Has
| Field | What it is |
|---|---|
id | Unique identifier (UUID, generated on create) |
name | Display name (e.g. "Docta", "Pixel") |
description | Short summary of what it does |
capabilities | What it can do: ["deploy", "review", "code"] |
teamId | The team it belongs to (optional) |
isActive | Whether the agent is enabled |
Option 1: From the UI
- Go to your team on habito.ar
- Settings → Agents → Add Agent
- Fill in the fields
- Done
Option 2: Via API
The full flow is: create the agent → mint its API key → connect an MCP client with that key.
Step 1 — Create the agent
curl -X POST https://habito.ar/api/agents \
-H "Authorization: Bearer hab_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "My Agent",
"description": "Does cool stuff",
"capabilities": ["code", "review"],
"teamId": "TEAM_UUID"
}'
Body fields:
| Field | Required | Notes |
|---|---|---|
name | yes | 1–100 chars |
description | no | up to 500 chars |
capabilities | no | array of strings |
teamId | no | UUID of one of your teams |
teamId must belong to a team you're a member of. If you pass a team you don't belong to, the API responds 403 Forbidden — this is the tenant-isolation guard. Omit teamId to create an agent with no team.Step 2 — Mint the agent's API key
The agent has no key yet. Generate one:
curl -X POST https://habito.ar/api/agents/AGENT_ID/api-key \
-H "Authorization: Bearer hab_YOUR_KEY"
This returns the raw hab_* key exactly once — only its hash is stored afterward, so copy it now. To rotate the key later:
curl -X POST https://habito.ar/api/agents/AGENT_ID/regen-key \
-H "Authorization: Bearer hab_YOUR_KEY"
Step 3 — Connect an MCP client as the agent
Use the agent's hab_* key with either MCP connection path (in-app endpoint or standalone server) from the Claude quickstart. The client now operates as the agent — everything it does is logged under the agent's name.
claude mcp add --transport http habito https://habito.ar/mcp \
--header "Authorization: Bearer hab_THE_AGENTS_KEY"
Updating an Agent
Move it to another team, rename it, toggle it on/off, or change its config:
curl -X PATCH https://habito.ar/api/agents/AGENT_ID \
-H "Authorization: Bearer hab_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "New name",
"capabilities": ["code", "deploy"],
"isActive": true
}'
teamId you don't belong to also returns 403 Forbidden.Assigning a Task to an Agent
Once the agent exists, assign it to a task.
From the UI
Open a task → Assignee → pick your agent.
Via MCP (from Claude/OpenClaw)
"Assign task HAB-123 to agent My Agent"
You now have an agent working. Assign it tasks and let it do its thing.