Overview
The Treeship API uses Bearer token authentication to secure all API endpoints. You’ll need an API key to make authenticated requests.Getting your API key
- Sign up at treeship.dev
- Navigate to your dashboard
- Generate an API key from the API Keys section
- Store your API key securely
Never share your API key or commit it to version control. Use environment variables to store sensitive credentials.
Authentication methods
Bearer Token (Recommended)
Include your API key in the Authorization header as a Bearer token:JavaScript SDK
When using our JavaScript SDK, provide your API key during initialization:Python SDK
For Python applications, initialize the SDK with your API key:Environment variables
We recommend storing your API key in environment variables:Make sure to add
.env to your .gitignore file to prevent accidentally committing your API key.Rate limits
API requests are rate limited to ensure fair usage:- Free tier: 100 requests per minute
- Pro tier: 1,000 requests per minute
- Enterprise: Custom limits
Error responses
Authentication errors return a 401 status code:Security best practices
- Rotate keys regularly: Generate new API keys periodically
- Use environment variables: Never hardcode API keys
- Limit key permissions: Use keys with minimal required permissions
- Monitor usage: Check your dashboard for unusual activity
- Use HTTPS: Always make requests over HTTPS