Skip to main content

Authentication

First complete Set up your project and save your project API key. This page explains how to authenticate requests and manage that key over time.

Authenticate a request​

Use your project API key for all product APIs, including free endpoints. Pass the full key in the HTTP Authorization header:

Authorization: Bearer <your-platform-api-key>

Send requests to https://api.antapi.dev, using the path and method in the selected product guide or API Reference. The Gateway checks the key, project state, and access to the requested operation. An existing asynchronous job remains scoped to its original project; a key from another project cannot access it.

Store keys securely​

Keep keys in a server-side secret manager or protected local environment. Direct product request examples use ANTAPI_KEY; follow MCP setup for OAuth agent connections or CLI setup for terminal placeholders and configuration.

Never place a key in a query string, browser code, public environment variable, analytics event, or request log. Send requests over HTTPS in production. Console's session cookie authenticates Console access; it does not replace an API key for product calls. Do not send internal service authentication headers.

Rotate and revoke​

Manage keys in Console → API keys for the intended organization and project. The full key is shown only when it is first issued; Console displays only its identifying prefix and last four characters afterward.

For a planned rotation, create a replacement key in the same project, update your application's secret, confirm requests work with the replacement, and revoke the old key. If a key is exposed, revoke it immediately and replace it in your application. Use separate keys where application access needs to be revoked or rotated independently.

Diagnose an authentication failure​

For HTTP 401, verify that the header uses Bearer followed by the full key, the key has not been revoked, and the organization and project are available. Avoid logging the key while investigating. See errors and recovery for other status codes.

Authentication identifies your project. An idempotency key separately identifies a logical operation and lets you retry it safely.

Make your first request​

Continue to the WHOIS quickstart or HTTP API setup. Both use the project key you prepared; each product guide explains its request and response formats.