Docs/Api Reference

API Reference

ANTS Platform has a public REST API for sending trace data, for reading and managing observability, evaluation and administration data, and for reading and changing governance, inventory and policy records. The SDKs use the same API.

Base path and OpenAPI spec

All public endpoints live under /api/public on your ANTS Platform host. Use the same host your SDKs are configured with (ANTS_PLATFORM_HOST in Python, ANTS_PLATFORM_BASE_URL in JS/TS and Java).

code
https://<your-host>/api/public

The full OpenAPI specification, with request and response schemas for every endpoint below, is served by the platform at:

code
https://<your-host>/generated/api/openapi.yml

Authentication

Use HTTP Basic auth with your public key as the username and your secret key as the password. Create keys under API Keys.

bash
curl https://<your-host>/api/public/traces \ -u "pk-ap-...:sk-ap-..."

There are two kinds of keys:

  • Project keys give access to one project's data. Most endpoints use them.
  • Organization keys are required for the organization management endpoints: projects, memberships, project API keys and SCIM.

See Authentication for details.

Resources

Paths are relative to /api/public.

Tracing and ingestion

ResourceEndpoints
IngestionPOST /ingestion accepts a batch of events such as trace-create, span-create, generation-create and score-create.
OpenTelemetryPOST /otel/v1/traces accepts OTLP/HTTP traces as application/x-protobuf or application/json.
TracesGET /traces, GET /traces/{traceId}, DELETE /traces/{traceId}, DELETE /traces
ObservationsGET /observations, GET /observations/{observationId}
SessionsGET /sessions, GET /sessions/{sessionId}
MediaPOST /media, GET /media/{mediaId}, PATCH /media/{mediaId}
CommentsPOST /comments, GET /comments, GET /comments/{commentId}
MetricsGET /metrics takes a JSON query to aggregate traces, observations or scores (for example count, latency or cost, grouped and filtered).

Evaluation

ResourceEndpoints
ScoresPOST /scores, DELETE /scores/{scoreId}, GET /v2/scores, GET /v2/scores/{scoreId}
Score configsPOST /score-configs, GET /score-configs, GET /score-configs/{configId}
DatasetsPOST /v2/datasets, GET /v2/datasets, GET /v2/datasets/{datasetName}
Dataset itemsPOST /dataset-items, GET /dataset-items, GET /dataset-items/{id}, DELETE /dataset-items/{id}
Dataset runsGET /datasets/{datasetName}/runs, GET /datasets/{datasetName}/runs/{runName}, DELETE /datasets/{datasetName}/runs/{runName}
Dataset run itemsPOST /dataset-run-items, GET /dataset-run-items
Annotation queuesCreate and list queues, and add, update, list and remove queue items and assignments under /annotation-queues

Prompts and models

ResourceEndpoints
PromptsPOST /v2/prompts, GET /v2/prompts, GET /v2/prompts/{promptName}, PATCH /v2/prompts/{name}/versions/{version} (update labels)
ModelsPOST /models, GET /models, GET /models/{id}, DELETE /models/{id}. These are model definitions used to match usage and calculate cost.
LLM connectionsGET /llm-connections, PUT /llm-connections (create or update a provider connection; secrets are never returned)

Governance, inventory and policy

The governance API is off by default. It needs the deployment to allow it and an administrator to turn on Governance public API in Organization Settings → Features. See Governance API for setup, every endpoint, examples and errors.

ResourceReadWriteKey
AgentsList a project's agents and get one agent-Project or organization key
Governance profilesGet an agent's governance profileUpdate governance profile fieldsReads: project or organization key. Writes: organization key
Framework coverageCoverage per framework for a project's agents-Project or organization key
Guardrail policyGet an agent's guardrail policyCreate and update an agent's guardrail policyReads: project or organization key. Writes: organization key
AI tool registryList the Discover AI tool registry-Organization key
Sanction statusGet the sanction status of each AI toolSet an AI tool's sanction statusOrganization key
Model approvalsList AI Inventory models with their organization approval status-Organization key

Every write needs an organization key with Governance write turned on, and the organization's access set to Read and write. A project key reads only its own project. Writes go through the same validation as the app, and every read and write is recorded in the audit log. See Agent profiles, Tool Registry and AI Guardrails for what each record means.

Organization and access management

ResourceEndpointsKey
ProjectsGET /projects returns the key's project. POST /projects, PUT /projects/{projectId}, DELETE /projects/{projectId}, GET /organizations/projectsProject key for GET /projects, organization key for the rest
MembershipsGET /organizations/memberships, PUT /organizations/memberships, GET /projects/{projectId}/memberships, PUT /projects/{projectId}/membershipsOrganization key
Project API keysGET /projects/{projectId}/apiKeys, POST /projects/{projectId}/apiKeys, DELETE /projects/{projectId}/apiKeys/{apiKeyId}Organization key
SCIM usersGET /scim/Users, POST /scim/Users, GET /scim/Users/{userId}, PUT /scim/Users/{userId}, PATCH /scim/Users/{userId}, DELETE /scim/Users/{userId}, plus ServiceProviderConfig, ResourceTypes and SchemasOrganization key
SCIM groupsGET /scim/Groups, POST /scim/Groups, GET /scim/Groups/{groupId}, PATCH /scim/Groups/{groupId}, DELETE /scim/Groups/{groupId}Organization key

Automations

Manage a project's automation rules with a project key.

EndpointWhat it does
GET /automationsLists the project's rules, each with its paths, actions, action health (consecutiveFailures, disabledReason), version, lastRunAt and lastRunStatus
POST /automationsCreates a rule. Returns 201 with the rule, and webhookSecrets (signing secrets keyed by action ID, shown once) when the rule has new webhooks.
GET /automations/{ruleId}Gets one rule
PUT /automations/{ruleId}Replaces a rule. Keep the path and action id values to keep their webhook secrets and health.
DELETE /automations/{ruleId}Deletes a rule and its runs. Returns 204.

The request body is the rule JSON, the same as the rule object of an exported rule: name, eventType (an event key such as guardrail.violation), conditions, matchMode (FIRST or ALL), paths with their actions, and the optional description, enabled, throttle, dedupe, aggregation, digest and activeHours. Secret header values are never returned.

bash
curl -X POST https://<your-host>/api/public/automations \ -u "pk-ap-...:sk-ap-..." \ -H "Content-Type: application/json" \ -d '{ "name": "Critical guardrail violations to SOAR", "eventType": "guardrail.violation", "conditions": { "kind": "condition", "field": "severity", "operator": "at_least", "value": "critical" }, "paths": [ { "name": "Default", "actions": [ { "type": "WEBHOOK", "config": { "url": "https://soar.example.com/hooks/ants" } } ] } ] }'

Rules go through the same validation and limits as in the app, and every change is written to the audit log. A key cannot:

  • add platform responses (suspend agent, block a Budget AI key, set a tool sanction, add to a case),
  • use events that carry admin or device data (audit.event, api_key.created, api_key.revoked, api_key.expiring, access.user_deprovisioned, device.alert, device.certificate_expiring),
  • delete a rule that a person created in the app.

Set those up in the app. Errors return message and an issues list of path and message: 400 for an invalid rule, 403 for a refused event or response, 404 for an unknown rule, 409 for a name already used in the project, and 422 when the project already has 100 rules. On a deployment where project keys are limited to trace ingestion, these endpoints return 403.

Health

GET /health reports API health.

Example: send a trace

bash
curl -X POST https://<your-host>/api/public/ingestion \ -u "pk-ap-...:sk-ap-..." \ -H "Content-Type: application/json" \ -d '{ "batch": [ { "id": "event-0001", "timestamp": "2026-01-01T00:00:00.000Z", "type": "trace-create", "body": { "id": "trace-0001", "name": "support-query", "input": "Where is my order?", "output": "Your order shipped yesterday.", "tags": ["support"] } } ] }'

The endpoint returns 207 with a successes list and an errors list, one entry per event. Use a new event id for every event. Reuse the same body.id to update a trace.

Not available in the public API

These features are managed in the app only. There are no public REST endpoints for them:

  • Changing model approvals in the AI Inventory, and the framework catalog
  • Agent evidence, compliance requests and risk scores
  • Discover AI usage reporting, users and devices
  • Gateway keys, budgets and limits
  • Dashboards and reports

Planned capabilities are listed on the roadmap.

Errors

Errors return a standard HTTP status code and a JSON body with a message field:

json
{ "message": "Invalid request data" }
StatusMeaning
400Invalid request
401Missing or invalid API key
402Ingestion blocked by the organization's plan or credit status
403The key does not have access to this operation
404Resource not found
405Method not allowed
429Rate limit exceeded
500Server error

Rate limits

Requests can be rate limited per organization and per resource, for example ingestion, datasets or metrics. A limited request returns 429 with these headers:

code
Retry-After: <seconds> X-RateLimit-Limit: <limit> X-RateLimit-Remaining: <remaining> X-RateLimit-Reset: <reset time>

Retry after the number of seconds in Retry-After.

Webhooks

Outbound webhooks are the Webhook action of an automation rule. Set rules up in Project Settings → Automations, or with the Automations endpoints. A rule can send a webhook for any of its 30 events, such as guardrail violations, drift alerts, Discover AI and device alerts, Budget AI thresholds, exports, audit log entries and prompt version changes.

Each webhook is an HTTP POST with a JSON body. New webhooks send the v2 event envelope with content-type: application/json; ants-api-version=v2. A prompt version change looks like this:

json
{ "id": "<event id>", "type": "prompt.version_changed", "version": 1, "occurredAt": "2026-01-01T00:00:00.000Z", "organizationId": "<organization id>", "projectId": "<project id>", "severity": "info", "subject": { "kind": "prompt", "id": "<prompt id>", "name": "support-agent" }, "actor": null, "links": { "app": "https://<your-host>/project/<project id>/prompts/support-agent" }, "data": { "action": "created", "promptId": "<prompt id>", "version": 3, "labels": ["production"], "tags": [], "type": "text", "commitMessage": null }, "test": false, "delivery": { "id": "<delivery id>", "ruleId": "<rule id>", "ruleName": "Prompt changes", "attempt": 1 } }

Prompt webhooks moved from the old automations keep their v1 body ("type": "prompt-version", "apiVersion": "v1"), which carries the full prompt version. The envelope fields and the v1 policy-violation body are documented in Policy Violation Webhooks.

Verifying the signature

Each delivery includes a signature header:

code
x-ants-signature: t=<unix timestamp>,v1=<hex signature>

To verify it, compute HMAC-SHA256(secret, "<t>.<raw request body>") as a lowercase hex string, where <t> is the timestamp from the header and secret is the webhook action's signing secret, and compare it with the v1 value. Use t to reject old deliveries. x-langfuse-signature is no longer sent. See Headers and signature.

SDKs

The Python, JS/TS and Java SDKs handle authentication and call this API for you.

Next steps

© 2026 ANTS Platform, Inc.Docs v1.0 · Last updated June 2026