1. Key Types
Your account has two API keys that together make up your credentials:2. Authentication Mechanism
OriginBills uses standard HTTP Basic Authentication. You construct the header as follows:- Concatenate keys: Combine your Public Key and Secret Key, separated by a colon (
:). - Encode to Base64: Encode the concatenated string into Base64 format.
- Set the Header: Add the string to your request’s
Authorizationheader, prefixed withBasic.
3. Code Examples
Below are examples of how to configure theAuthorization header in various languages.
cURL
Node.js (Fetch API)
Python (requests)
4. Query Parameter Authorization (GET requests only)
For convenience in client environments or simple testing,GET endpoints support sending the Authorization credentials via the authorization query parameter:
5. Security Best Practices
[!WARNING] Keep your credentials secure. Your API keys have full access to view wallet balances and place recharges.
- Never commit secret keys to public repositories or front-end client bundles.
- Rotate your API keys regularly from the OriginBills dashboard if you suspect a leak.
- Use HTTPS always: Plain HTTP requests transmitting credentials will be rejected.
6. Authentication Errors
If your credentials are missing, invalid, or formatted incorrectly, the API returns401 Unauthorized with one of the following schemas:

