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):

KeyUse it toFormat
Personal keyUser-scoped. Manage agents and templates.xag_personal_<prefix>_<secret>
Runtime keyRun tasks for a single agent.xag_<prefix>_<secret>

Send the key as a bearer token:

Authorization: Bearer xag_Ab3xY9_Qw7Rt2Kp9Lm4Nz8Vc1Bd6Hf5Jg0Xs3Tr

Endpoints 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 task

Typical Flow

  1. Create an agent with a personal key (or from a template), requesting a runtime key.
  2. Use the returned runtime key to create tasks for that agent.
  3. 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.

Next Steps