Access Tokens
CostHawk uses access tokens to authenticate requests to the API and MCP server. Tokens are scoped to your account and can be created and revoked from your dashboard.Creating a Token
- Go to your CostHawk dashboard
- Navigate to Settings → Developer
- Click Create Token
- Give your token a descriptive name (e.g., “Claude Code - Work Laptop”)
- Copy the token immediately - you won’t be able to see it again
Tokens are prefixed with
ch_sk_ to help you identify them in your code and configs.Token Security
Best practices:- Use environment variables to store tokens
- Create separate tokens for different environments (dev, staging, prod)
- Rotate tokens periodically
- Revoke tokens you no longer need
Revoking a Token
If a token is compromised or no longer needed:- Go to Settings → Developer in your dashboard
- Find the token in the list
- Click the trash icon to revoke it
Using Tokens
MCP Server
Set theCOSTHAWK_API_KEY environment variable in your MCP configuration:
API Requests
Include the token in theAuthorization header:
Error Responses
| Status Code | Meaning |
|---|---|
401 | Missing or invalid token |
403 | Token doesn’t have required permissions |
429 | Rate limit exceeded |
