All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.
API Keys
Authentication to the API is performed via HTTP Bearer authentication. Provide your API key as a bearer token in theAuthorization
header.
Getting Your API Key
You can find and manage your API keys in the AnyAPI.ai Dashboard. Keep your API keys secure and rotate them regularly for optimal security.
Bearer Token Format
Include your API key in theAuthorization
header using the Bearer authentication scheme:
Basic Authentication Example
Advanced cURL Examples
Basic Chat Completion
Streaming Response
With Custom Headers (Optional)
Error Handling
If your API key is missing or invalid, you’ll receive an error response:Security Best Practices
Never expose your API keys in client-side code. API keys should only be used in server-side applications where they can be kept secure.