Authentication
The Cura’s AI Model API uses API key authentication to secure all requests. You must include your API key with every request to access the API endpoints.Setup
Server Configuration
Set an environment variable on your Cura server:Client Authentication
Include your API key in every request using one of these methods:Header Authentication (Recommended)
Include the API key in the request headers:Example with cURL
Example with Node.js
Example with Python
Query Parameter Authentication
Alternatively, you can pass the API key as a query parameter:Example with cURL
Header authentication is preferred over query parameters for better security, as query parameters may be logged in server access logs.
Error Responses
Missing or Invalid API Key
If no API key is provided or an invalid key is used:401 Unauthorized for authentication failures.
Best Practices
Security
Security
- Store API keys securely using environment variables
- Never commit API keys to version control
- Use different API keys for different environments (dev, staging, production)
- Rotate API keys regularly
Implementation
Implementation
- Use header authentication when possible
- Implement proper error handling for authentication failures
- Cache authentication tokens appropriately
- Use HTTPS for all API requests

