API Reference
Complete REST API documentation for ANTS Platform platform.
Base URL
Authentication
All API requests require authentication via API key:
Rate Limits
| Plan | Rate Limit | Burst |
|---|---|---|
| Pro | 1,000 req/min | 100 |
| Enterprise | Custom | Custom |
Rate limit headers:
Common Headers
Request Headers
Response Headers
Endpoints
Traces
Create Trace
Request:
Response:
Get Trace
Response:
List Traces
Query Parameters:
limit- Number of results (default: 100, max: 1000)offset- Pagination offsetstatus- Filter by status:in_progress,completed,erroragent- Filter by agent namestartDate- ISO 8601 dateendDate- ISO 8601 date
Response:
Update Trace
Request:
Spans
Create Span
Request:
End Span
Request:
Metrics
Metrics and trends are not available through the SDK or REST API. View latency, throughput, error rate, token usage, and cost over time in the dashboard at https://app.antsplatform.ai, where you can filter by agent and time range.
Available Metrics
| Metric | Description | Unit |
|---|---|---|
latency_p50 | 50th percentile latency | ms |
latency_p95 | 95th percentile latency | ms |
latency_p99 | 99th percentile latency | ms |
throughput | Requests per second | req/s |
error_rate | Error percentage | % |
token_count | Total tokens used | tokens |
cost | Total cost | USD |
Agents
List Agents
Response:
Agent Metrics
Per-agent metrics (request volume, average latency, error rate, total cost) are a dashboard feature. Open the agent in the dashboard at https://app.antsplatform.ai to view them.
Webhooks (Automations)
Webhooks are configured as an Automation, not through a REST endpoint. An automation pairs a trigger (an event in your project) with an action (an outbound webhook, Slack, or PagerDuty). Set them up in the dashboard at app.antsplatform.ai → Automations:
- Trigger - choose an event source and the actions to fire on.
- Action - select Webhook, enter your endpoint URL, and generate a signing secret.
Available Events
The trigger event source is currently prompt versions. Each delivery carries a
type and an action:
type | action | Fires when |
|---|---|---|
prompt-version | created | A new prompt version is created |
prompt-version | updated | A prompt version is updated (e.g. labels changed) |
prompt-version | deleted | A prompt version is deleted |
Webhook Payload
The webhook is delivered as an HTTP POST to your endpoint with this body:
Verifying the Signature
Every delivery includes an x-langfuse-signature header so you can verify it came from
ANTS Platform:
Compute HMAC-SHA256(secret, requestBody) over the raw request body using your
webhook signing secret, then compare against the v1= value. The t= value is the unix
timestamp the signature was generated (use it to reject stale deliveries).
Error Handling
Error Response Format
Error Codes
| Code | HTTP Status | Description |
|---|---|---|
invalid_request | 400 | Invalid request body |
authentication_failed | 401 | Invalid API key |
permission_denied | 403 | Insufficient permissions |
not_found | 404 | Resource not found |
rate_limit_exceeded | 429 | Too many requests |
internal_error | 500 | Server error |
SDKs
JavaScript/TypeScript
The REST client (AntsPlatformClient) covers prompts, datasets, and scores. It does not capture traces — use the OpenTelemetry-based tracing setup for that.
Python
Code Examples
Complete Trace Example
Versioning
API version is specified in the URL: /v1/
- Current version: v1
- Stable: Yes
- Deprecation notice: 6 months minimum
Support
- Documentation: https://antsplatform.ai/docs
- Status: https://status.antsplatform.ai
- Support: support@antsplatform.ai
Next Steps
- Authentication - Detailed auth guide
- Traces API - Complete traces documentation
- Webhooks - Set up webhooks