SDK & API Keys
Xagent now exposes a separate/v1/* API surface for SDK and SaaS-style integrations.
/api/* vs /v1/*
Use /api/* when:
- You are acting as an authenticated owner in the web app model
- You manage agents, workforces, or knowledge with JWT-based auth
/v1/* when:
- You want a stable programmatic integration surface
- You are calling Xagent from your own backend or application
- You want API-key-based access instead of browser session auth
Two key types
Personal keys
Personal keys identify a user. They are suitable for:- Developer tooling
- Personal automation
- Service-to-service access tied to a user identity
Agent runtime keys
Agent runtime keys are scoped to a specific agent and are designed for the/v1/* agent execution flow.
They are managed by the agent owner and can be rotated independently of user JWT sessions.
Common SDK flow
The typical sequence is:- Create or choose an agent
- Generate the agent runtime key
- Call
POST /v1/chat/tasks - Poll
GET /v1/chat/tasks/{task_id} - Fetch steps or append messages as needed
Related endpoints
- Personal keys: API Reference
- Agent runtime key: API Reference
- SDK tasks: API Reference
- SDK task status: API Reference
- Append message to task: API Reference
When to document more
If your team is integrating Xagent into another product, you will usually want an internal guide that adds:- Request examples
- Retry strategy
- Error handling conventions
- Key rotation policy