API Keys
All API requests require authentication using Bearer tokens. Include your API key in theAuthorization header of every request.
Key types
Bipa provides two types of API keys:| Prefix | Environment | Purpose |
|---|---|---|
bipa_live_sk_ | Production | Real transactions with real money |
bipa_test_sk_ | Sandbox | Testing and development |
Making authenticated requests
Include your API key in theAuthorization header:
Obtaining API keys
- Log in to your Bipa Console
- Navigate to Developers → API Keys
- Click Create new key
- Copy your key immediately — it won’t be shown again
You can create multiple API keys for different services or environments. Each key can be revoked independently.
Sandbox environment
The sandbox environment uses the same base URL but with test API keys:- No real money is moved
- Pix payments are simulated
- Trades execute with test balances
- Webhooks are delivered normally
Authentication errors
If authentication fails, you’ll receive a401 Unauthorized response:
| Error Code | Cause | Solution |
|---|---|---|
invalid_api_key | Key doesn’t exist or is malformed | Check the key format and copy it again |
revoked_api_key | Key has been revoked | Generate a new key in the console |
missing_authorization | No Authorization header | Include the header in your request |
Security best practices
Use environment variables
Use environment variables
Store API keys in environment variables, not in code:
Rotate keys regularly
Rotate keys regularly
Create new keys periodically and revoke old ones. This limits the impact if a key is compromised.
Use separate keys per service
Use separate keys per service
Create different API keys for different services or environments. This makes it easier to revoke access if needed.
Monitor API usage
Monitor API usage
Review your API logs in the console regularly to detect unusual activity.
IP allowlisting
For additional security, you can restrict API key usage to specific IP addresses:- Go to Developers → API Keys in the console
- Select the key you want to restrict
- Add allowed IP addresses or CIDR ranges
IP allowlisting is optional but recommended for production environments.
