Getting Your API Key
1
Create an Account
Sign up at modelslab.com if you haven’t already.
2
Access Dashboard
Navigate to your API Keys Dashboard.
3
Generate Key
Click Create New Key and copy your API key immediately.
4
Store Securely
Save your key in a secure location. You won’t be able to see it again.
Using Your API Key
Include your API key in every request using thekey parameter in the request body:
Code Examples
Environment Variables
Security Best Practices
Use Environment Variables
Never hardcode API keys in your source code. Use environment variables or secret management tools.
Separate Keys
Create different API keys for development, staging, and production environments.
Rotate Regularly
Periodically rotate your API keys, especially if you suspect they may have been compromised.
Monitor Usage
Regularly check your dashboard for unusual API activity.
Authentication Errors
| Status Code | Error Message | Solution |
|---|---|---|
| 401 | Invalid API key | Verify your API key is correct and hasn’t been revoked |
| 401 | API key required | Include the key parameter in your request body |
| 402 | Insufficient credits | Add credits to your account or upgrade your plan |
| 403 | Feature not available | This feature requires a higher subscription tier |
For detailed error handling, see our Error Codes documentation.
API Key Management
You can manage your API keys from the dashboard:- Create new keys for different applications
- Revoke compromised or unused keys
- View usage statistics per key
- Set rate limits (Enterprise plans)

