API Key Authentication
GPTProto API uses Bearer token authentication. All API requests must include your API key in the Authorization header.Getting Your API Key
- Sign up for a GPTProto account at https://gptproto.com
- Navigate to the API Keys section in your dashboard
- Generate a new API key
- Copy and securely store your API key
Keep Your API Key Secure
- Never commit API keys to version control
- Don’t share your API key publicly
- Use environment variables to store keys
- Rotate keys regularly for enhanced security
Making Authenticated Requests
Include your API key in theAuthorization header with the Bearer prefix:
Environment Variables
Recommended Setup
Store your API key in environment variables instead of hardcoding it:Using .env Files
For local development, use a.env file:
Always add
.env to your .gitignore file to prevent accidentally committing secrets.Authentication Errors
Common Error Responses
Your API key is missing or invalid.
Your API key doesn’t have permission to access this resource.
You’ve exceeded your rate limit.
Best Practices
Use Environment Variables
Use Environment Variables
Always store API keys in environment variables, never in your source code.
Implement Key Rotation
Implement Key Rotation
Regularly rotate your API keys to minimize security risks. Generate new keys and update your applications before revoking old ones.
Use Different Keys for Different Environments
Use Different Keys for Different Environments
Use separate API keys for development, staging, and production environments.
Monitor Usage
Monitor Usage
Regularly check your API usage in the dashboard to detect any unusual activity.
Implement Rate Limiting
Implement Rate Limiting
Implement client-side rate limiting to avoid hitting API rate limits.
API Key Management
Generating New Keys
- Log in to your dashboard
- Navigate to API Keys
- Click Generate New Key
- Give your key a descriptive name
- Copy the key immediately (you won’t be able to see it again)
Revoking Keys
If you suspect your API key has been compromised:- Go to your dashboard
- Find the compromised key in the API Keys section
- Click Revoke
- Generate a new key and update your applications
Set up key expiration policies to automatically rotate keys after a specified period.
Support
If you’re experiencing authentication issues:- Check that your API key is correctly formatted
- Verify your key hasn’t been revoked
- Ensure you’re using the correct API endpoint
- Contact [ [email protected]](mailto: [email protected]) for help

