Authentication
All API requests require authentication via Bearer token in the Authorization header.
Bearer Token Authentication
Include your API key in the Authorization header as a Bearer token:
Authorization: Bearer pk_live_YOUR_API_KEYExample Request
curl "text-cyan-400">-X GET "https://localstitch.co/api/v1/credits" \
"text-cyan-400">-H "Authorization: Bearer pk_live_abc123def456..."Creating API Keys
API keys can be created and managed in the API Console. Each key is scoped to your workspace and grants access to all data within it.
API Key Format
LocalStitch API keys use the following format:
pk_live_[64 character hex string]The pk_live_ prefix identifies production API keys.
Security Best Practices
Keep your API keys secure
Do store keys in environment variables or a secrets manager
Do rotate keys periodically
Do revoke compromised keys immediately
Don't expose keys in client-side JavaScript
Don't commit keys to version control
Don't share keys via unencrypted channels
Authentication Errors
If your API key is invalid or missing, you'll receive a 401 Unauthorized response:
{
"error": "unauthorized",
"message": "Invalid or missing API key"
}Plan Requirements
API access requires a paid plan (Starter, Growth, or Professional). Free plans will receive a 403 Forbidden response with:
{
"error": "api_access_denied",
"message": "API access requires a paid plan"
}View pricing to upgrade your plan.
