The Bila API authenticates requests via API keys. Manage your keys in the Bila Console.Documentation Index
Fetch the complete documentation index at: https://docs.usebila.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
Key Types
| Key Type | Prefix | Environment | Description |
|---|---|---|---|
| Live Secret Key | sk_live_ | Production | Use for live transactions |
| Test Secret Key | sk_test_ | Sandbox | Use for testing and development |
Making Authenticated Requests
Include your API key in thex-api-key header with every request:
Authentication Errors
Failed authentication returns a401 response:
Common Authentication Issues
| Error | Cause | Solution |
|---|---|---|
| Missing API key | No x-api-key header | Add the header to your request |
| Invalid API key | Key doesn’t exist or is malformed | Check your key in the dashboard |
| Expired API key | Key has been revoked | Generate a new key |
| Wrong environment | Using test key in production | Use the correct key type |
Best Practices
Store keys securely
Store keys securely
Use environment variables or a secrets manager to store your API keys. Never hardcode them in your source code.
Use different keys for different environments
Use different keys for different environments
Use test keys (
sk_test_) for development and live keys (sk_live_) for production.Rotate keys periodically
Rotate keys periodically
Regularly rotate your API keys as a security best practice.
Restrict key permissions
Restrict key permissions
If available, create keys with only the permissions your application needs.
