Authorization header, and OTP.ID validates it before processing the request. There are no cookies, sessions, or OAuth flows to configure. If the key is valid, the request proceeds; if not, you receive a clear error response telling you exactly what went wrong.
Get Your API Key
Your API key lives in the OTP.ID dashboard:- Log in at https://app.otp.id.
- Open the Integration page.
- In the API Key card, click Reveal — the key is displayed with a copy button. The key is masked again when you close the dialog.
550e8400-e29b-41d4-a716-446655440000). You can reveal it again at any time from the Integration page.
To rotate the key, click Rotate API Key in the same card and confirm the action. The old key stops working immediately — update every integration right away.
Each merchant account has exactly one active API key. All credit deductions, rate limits, and transaction records are tracked against your account. There is no multi-key or per-environment key management — if you need isolated environments, use separate merchant accounts.
Include the Key in Every Request
Pass your API key as a Bearer token in theAuthorization header on every request to any /v3/* endpoint:
curl:
Code Examples
The following examples show how to attach theAuthorization header when making requests from common environments.
Authentication Errors
All authentication failures return HTTP401 with success: false. The error.code is always "UNAUTHORIZED", and error.message describes the specific problem.
IP allowlisting is a separate control from API-key authentication. If it is enabled for your merchant, a valid key can still receive HTTP 403 with IP_NOT_ALLOWED when the request comes from an unlisted server IP. See the API V3 IP allowlist guide.
Missing or Malformed Authorization Header
If you omit theAuthorization header entirely, or its value does not start with Bearer :
Empty API Key
If you include the header but provide an empty string as the token:Unknown or Invalid API Key
If the key is present but does not match any active key in OTP.ID’s system:Best Practices
- Use environment variables to store your API key rather than hardcoding it in source files. Reference it as
process.env.OTPID_API_KEY(Node.js) oros.environ["OTPID_API_KEY"](Python). - Rotate the key periodically — and immediately if you suspect exposure. Remember that rotation invalidates the old key at once, so coordinate the update across your services.
- Call the API from your server only. Because your account has a single key, treating it as a server-side secret is essential — never ship it to browsers or mobile apps.
- Monitor
last_balancein send responses to detect unexpected usage spikes that could indicate a leaked key.

