Workspace API
The Workspace API is the programmatic SDK surface for Xagent. Use it to create and manage agents, provision them from templates, and run tasks — all without the web UI. It lives under the /v1 prefix and is designed for stable, versioned integration.
Authentication
Requests authenticate with one of two keys (see Authentication):
| Key | Use it to | Format |
|---|---|---|
| Personal key | User-scoped. Manage agents and templates. | xag_personal_<prefix>_<secret> |
| Runtime key | Run tasks for a single agent. | xag_<prefix>_<secret> |
Send the key as a bearer token:
Authorization: Bearer xag_Ab3xY9_Qw7Rt2Kp9Lm4Nz8Vc1Bd6Hf5Jg0Xs3TrEndpoints at a Glance
GET /v1/me # identity behind the key
GET /v1/agents # list agents
POST /v1/agents # create an agent
POST /v1/agents/from-template # create from a template
POST /v1/agents/{agent_id}/api-key # mint a runtime key
GET /v1/templates # list templates
POST /v1/chat/tasks # run a taskTypical Flow
- Create an agent with a personal key (or from a template), requesting a runtime key.
- Use the returned runtime key to create tasks for that agent.
- Poll the task for status, steps, files, and output.
Versioning
The Workspace API is versioned under /v1. Breaking changes ship under a new version prefix so existing integrations keep working.