Authentication
Everything that sends data to ANTS Platform authenticates with a project key pair: a public key and a secret key. Data is written to the project that owns the key.
| Part | Format | Notes |
|---|---|---|
| Public key | pk-ap-... | Identifies the key. |
| Secret key | sk-ap-... | The credential. Shown in full only once, when the key is created. |
Treat the secret key like a password. Keep it on the server, out of source control, logs and browser code.
Create a key
- Open Project Settings > API Keys.
- Select Create API keys.
- Copy the Secret Key, Public Key and Host from the sheet. The secret key cannot be shown again.
Among built-in roles, only the Owner can create project keys. Keys expire 6 months after creation. See API Keys for expiry, notes, rotation and the organization keys used for the Admin API.
Use the keys in an SDK
Set environment variables and let the SDK read them:
Or pass them explicitly:
If either key is missing, the client logs a warning and sends nothing.
Always set the host. Both SDKs default to https://api.agenticants.ai, which
may not be your deployment. Use the Host value shown when you create the
key, or ask your administrator.
Use the keys over HTTP
OpenTelemetry exporters and direct API calls use HTTP Basic authentication: the public key is the username and the secret key is the password.
See OpenTelemetry (OTLP) and API Authentication.
Store keys safely
Load the secret key from your platform's secret store into the environment variables above.
Good practice:
- Use a separate project, and so separate keys, per environment or team.
- Add a note to each key saying which service uses it.
- Never ship the secret key in a browser or mobile app.
Rotate a key
There is no rotate button. Create a new key, roll it out to your services, then delete the old key. A deleted key stops working within a few minutes. Plan rotations before the 6-month expiry; Owners are notified ahead of time. See API Keys.
Test your keys
Troubleshooting
| Response | Cause |
|---|---|
401 | Wrong or expired key, keys from different pairs, or extra whitespace. Organization keys and public-key-only (Bearer) requests are also refused on ingestion endpoints. |
402 | Ingestion is blocked for billing reasons. See Credit System. |
403 on read requests | The deployment limits project keys to sending data. Ingestion still works. |
429 | Rate limit reached. Retry with backoff. |
| No error, no data | Wrong host. Check ANTS_PLATFORM_HOST (Python) or ANTS_PLATFORM_BASE_URL (JS/TS). |