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
Environment Variables
Store your API key in environment variables:Rate Limiting
Your API key has rate limits associated with it. Include proper error handling for rate limit responses:Testing Your Authentication
Use this simple curl command to test if your API key is working:Next Steps
Make Your First Request
Learn how to make your first API call with AnyAPI.ai