API keys
API keys are long-lived credentials used for all server-side API calls. They’re created and managed in Console.Key format
The key prefix tells you the environment:| Prefix | Environment | Billing |
|---|---|---|
sk_test_ | Test | Not billed |
sk_live_ | Production | Billed |
Usage
Include the API key in theAuthorization header as a Bearer token:
Bash
Key security
When you create an API key, the raw key is returned once. Palm stores a cryptographic hash — not the key itself. If you lose a key, you’ll need to create a new one. Each API key is tied to one organization. All requests authenticated with that key operate within that organization’s context.Test vs production
The key prefix determines the mode, which affects:- Billing: Production requests are metered and billed. Test requests are free.
- External providers: Some verification providers use different credentials in each mode.
- Data isolation: Test and production data are kept separate.
Error handling
| Status code | Meaning |
|---|---|
400 Bad Request | Invalid request parameters. |
401 Unauthorized | Missing or invalid credentials. |
403 Forbidden | Valid credentials but insufficient permissions. |
404 Not Found | Resource not found. |
429 Too Many Requests | Rate limit exceeded. |
500 Internal Server Error | Server error. |
401 errors: missing Authorization header, malformed Bearer token, or expired / revoked API key.
Error responses follow the RFC 7807 Problem Details format:
JSON
Best practices
- Store API keys securely: Use environment variables or a secrets manager. Never commit keys to source control.
- Use test keys for development: Reserve
sk_live_keys for production systems. - Rotate keys periodically: Create new keys and deprecate old ones on a regular schedule.
- Monitor key usage: Check Console for unusual activity patterns.
Rate limiting
All authenticated requests are subject to rate limits. When you exceed the limit, the API returns429 Too Many Requests with the following headers:
| Header | Description |
|---|---|
X-RateLimit-Limit | Maximum requests per minute. |
X-RateLimit-Remaining | Requests remaining in the current window. |
X-RateLimit-Reset | Unix timestamp when the window resets. |

