Authentication & API Keys
How Authentication Works
Westtree uses Bearer token authentication. Pass your API key in the Authorization header.
API Key Security
- Never commit keys to version control
- Use environment variables
- Rotate keys periodically
Example
curl https://api.westtree.top/v1/chat/completions
-H "Authorization: Bearer YOUR_API_KEY"
-H "Content-Type: application/json"
-d '{"model": "gpt-4o", "messages": [{"role": "user", "content": "Hello"}]}'