Skip to main content

HTTP API

Use the official Gateway at https://api.antapi.dev for production product API requests. Keep your project API key in a trusted terminal or server environment. Console's session cookie authenticates Console access and does not authenticate Gateway calls.

Authenticate with a project key​

Complete Set up your project, then send the full key in one Authorization header, including for free product endpoints:

Authorization: Bearer <YOUR_AK>

The key identifies one organization and project. Changing the selected project in Console does not change an existing key's scope. Keep keys out of browser bundles, URLs, cookies, and shared diagnostics; Authentication explains storage and rotation.

Use the HTTP setup page to select a published API and operation, or open Make your first request from its product page. The copied request keeps that selection; replace example inputs and the saved operation key before sending.

Build the request URL​

Product endpoints use /<product-slug>/v1, for example https://api.antapi.dev/whois/v1/tlds. Use the method and path published for the selected operation; a website or Console URL is not an API base.

A client may expect the origin, versioned base, or complete endpoint. Check the resulting URL to avoid duplicated or omitted path segments. Product endpoint paths and parameters come from the released API Reference.

Send and read the response​

Send Content-Type: application/json for JSON request bodies. Use only fields and query parameters accepted by the endpoint.

JSON product APIs use a code, data, and error envelope. Check both HTTP status and the endpoint's result fields. Asynchronous HTTP 202 confirms acceptance, not completed work or a final charge. The WHOIS quickstart shows a free request followed by a lookup.

TTS success returns a complete audio/wav file; its errors use the JSON envelope. Check HTTP status and Content-Type before treating a response as audio. Upload endpoints use multipart/form-data; let your client generate the Content-Type boundary.

Product guides​

Use the product guide for its input format, success definition, billing unit, and retry behavior. Availability, complete API Reference, and prices follow the published Catalog; reading a guide does not mean the API is already enabled.

TaskGuide
Search webpages or extract MarkdownSearch and fetch
Recognize document or image textOCR
Transcribe a short recordingASR
Synthesize complete WAV audioTTS
Query domain registrationWHOIS

Preserve identity and diagnostics​

Save a unique Idempotency-Key before a logical operation that may need recovery; asynchronous product creation requires it. Preserve the original key and request for an unchanged retry. A timeout or disconnect does not establish that work stopped or was free, and a new key can create another paid operation. Use Idempotency and retries for the shared rules and the selected product guide for its recovery behavior.

Save the platform's X-Request-ID, timestamp, HTTP status, and stable error code when available. Paid final settlement may also provide X-AntAPI-Receipt-ID and X-AntAPI-Debit-Atoms; their absence does not establish zero cost. Use Usage and receipts to inspect the original recorded result. Remove credentials and sensitive content before sharing diagnostics.