Skip to content
NEW GPT-5.5 / Claude 4.6 is now live — try it today →
Getting Started 3 min read

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"}]}'