API Reference
The MutagenT REST API provides programmatic access to all platform features.Base URL
Authentication
All API requests require authentication. MutagenT supports two authentication methods:API Key scoping determines which headers are required. Workspace-scoped keys require no additional headers. Organization-scoped keys require
x-workspace-id. User-scoped keys require both x-workspace-id and x-organization-id. See API Keys for details.Endpoints Overview
All endpoints are prefixed with/api.
Prompts
| Method | Endpoint | Description |
|---|---|---|
GET | /api/prompt | List all prompts |
POST | /api/prompt | Create a new prompt |
GET | /api/prompt/:id | Get prompt by ID |
PATCH | /api/prompt/:id | Update prompt |
DELETE | /api/prompt/:id | Delete prompt |
POST | /api/prompt/:id/versions | Create new version |
POST | /api/prompt/:id/playground | Run prompt in playground |
Datasets
| Method | Endpoint | Description |
|---|---|---|
GET | /api/prompts/datasets | List all datasets |
GET | /api/prompt/:id/datasets | List datasets for a prompt |
POST | /api/prompt/:id/datasets | Create dataset for a prompt |
GET | /api/prompts/datasets/:id | Get dataset by ID |
PATCH | /api/prompts/datasets/:id | Update dataset |
DELETE | /api/prompts/datasets/:id | Delete dataset |
POST | /api/prompts/datasets/:id/clone | Clone dataset |
GET | /api/prompts/datasets/:id/export | Export dataset |
GET | /api/prompts/datasets/:id/items | List dataset items |
POST | /api/prompts/datasets/:id/items | Add single item |
POST | /api/prompts/datasets/:id/items/bulk | Bulk add items |
Evaluations
| Method | Endpoint | Description |
|---|---|---|
GET | /api/prompts/evaluations | List evaluations |
POST | /api/prompts/evaluations | Create evaluation |
GET | /api/prompts/evaluations/:id | Get evaluation by ID |
POST | /api/prompts/evaluations/:id/run | Run evaluation |
GET | /api/prompts/evaluations/:id/result | Get evaluation results |
Optimization
| Method | Endpoint | Description |
|---|---|---|
POST | /api/prompt/:id/optimize | Start optimization job |
GET | /api/optimization | List optimization jobs |
GET | /api/optimization/:id | Get job status |
GET | /api/optimization/:id/progress | Get score progression |
POST | /api/optimization/:id/pause | Pause job |
POST | /api/optimization/:id/resume | Resume job |
POST | /api/optimization/:id/cancel | Cancel job |
Traces
| Method | Endpoint | Description |
|---|---|---|
GET | /api/traces | List traces |
POST | /api/traces | Ingest trace data |
GET | /api/traces/:id | Get trace by ID |
POST | /api/traces/otlp | OTLP bridge endpoint |
Agents
| Method | Endpoint | Description |
|---|---|---|
GET | /api/agents | List agents |
POST | /api/agents | Create agent |
GET | /api/agents/:id | Get agent by ID |
PATCH | /api/agents/:id | Update agent |
DELETE | /api/agents/:id | Delete agent |
Organizations and Workspaces
| Method | Endpoint | Description |
|---|---|---|
GET | /api/organizations | List organizations |
GET | /api/workspaces | List workspaces |
GET | /api/workspaces/:id | Get workspace by ID |
Providers
| Method | Endpoint | Description |
|---|---|---|
GET | /api/providers | List configured providers |
GET | /api/providers/:id | Get provider by ID |
API Keys
| Method | Endpoint | Description |
|---|---|---|
GET | /api/api-keys | List API keys |
POST | /api/api-keys | Create API key |
DELETE | /api/api-keys/:id | Revoke API key |
Rate Limits
| Plan | Requests/minute | Requests/day |
|---|---|---|
| Free | 60 | 1,000 |
| Pro | 300 | 10,000 |
| Enterprise | Custom | Custom |
Response Format
All responses are JSON:Error Responses
Common Status Codes
| Code | Description |
|---|---|
| 200 | Success |
| 201 | Created |
| 400 | Bad Request |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not Found |
| 429 | Rate Limited |
| 500 | Server Error |
SDKs
We recommend using our official SDKs instead of direct API calls:TypeScript SDK
Type-safe TypeScript/JavaScript SDK
Python SDK
Python SDK (coming soon)