Public API
XeroML exposes a RESTful public API that gives you full read and write access to traces, observations, scores, prompts, datasets, and more. Any operation available in the UI is also available via the API.
Base URL
https://cloud.xeroml.com/api/public/v2For self-hosted deployments, replace with your instance URL.
Authentication
Use HTTP Basic auth with your project API keys:
# Public key as username, secret key as passwordcurl -u "pk-xm-...:sk-xm-..." \ "https://cloud.xeroml.com/api/public/v2/traces"API keys are available in Project Settings → API Keys.
Key Endpoints
Traces
# List traces with filtersGET /api/public/v2/traces?page=1&limit=50&userId=user-123&tags=feature:chat
# Get a specific traceGET /api/public/v2/traces/{traceId}
# Create a trace (for manual ingestion)POST /api/public/v2/tracesScores
# Create a score for a tracePOST /api/public/v2/scores{ "traceId": "trace_abc123", "name": "accuracy", "value": 0.92, "dataType": "NUMERIC"}
# List scores for a traceGET /api/public/v2/scores?traceId=trace_abc123
# Delete a scoreDELETE /api/public/v2/scores/{scoreId}Prompts
# List all promptsGET /api/public/v2/prompts
# Get a specific prompt versionGET /api/public/v2/prompts/{promptName}?label=production
# Create or update a promptPOST /api/public/v2/prompts
# Update a prompt labelPATCH /api/public/v2/prompts/{promptName}Datasets
# List datasetsGET /api/public/v2/datasets
# Get dataset itemsGET /api/public/v2/datasets/{datasetName}/items
# Add an item to a datasetPOST /api/public/v2/datasets/{datasetName}/itemsMetrics
# Get aggregated metricsGET /api/public/v2/metrics/daily?startDate=2025-01-01&endDate=2025-01-31&groupBy=userIdPagination
All list endpoints support pagination:
GET /api/public/v2/traces?page=2&limit=100Response includes meta.total and meta.page for cursor navigation.
Rate Limits
| Plan | Requests/minute |
|---|---|
| Free | 100 |
| Pro | 1,000 |
| Enterprise | Custom |
Rate limit headers are included in every response:
X-RateLimit-LimitX-RateLimit-RemainingX-RateLimit-Reset
OpenAPI Spec
The full API specification (OpenAPI 3.0) is available at:
https://cloud.xeroml.com/api/public/v2/openapi.jsonImport it into Postman, Insomnia, or any OpenAPI-compatible client for interactive exploration.