x-api-key header of each HTTP request, and the Vouch backend validates it before processing anything.
How API keys work
When the Vouch backend receives a request, it reads thex-api-key header and looks up the associated developer account. If the key is valid and active, the request proceeds. If the key is missing, expired, or revoked, the API returns a 401 Unauthorized response immediately — no part of the request is processed.
Keys follow a fixed format and begin with the vouch_live_ prefix, for example:
Getting an API key
You can generate an API key in two ways. From the dashboard — Sign in to your Vouch developer account, navigate to Settings → API Keys, and click Generate new key. Copy the key immediately; the dashboard only displays it once. From the API — Send aPOST request to /v1/developer/api-keys using an existing key to authenticate. See the API reference for the full request schema.
If you do not have a Vouch developer account yet, provision one by sending a
POST request to /v1/developer/provision with your email and platform details. The response includes your first API key.Using your key with the SDK
Pass your API key to theVouch constructor once when you initialise the client. The SDK stores it internally and attaches it as the x-api-key header on every outbound request — you never need to set the header yourself.
vouch instance — vouch.identity.verify(...), vouch.fraud.assess(...), vouch.escrow.create(...) — are automatically authenticated.
Using your key with direct HTTP requests
If you are calling the Vouch API directly without the SDK, add thex-api-key header to every request.
401 response (see Error responses below).
Environment variables
Store your API key and optional URL override as environment variables rather than hard-coded strings.VOUCH_API_URL defaults to https://vouch-fmql.onrender.com/v1 when not set. Override it to point at a local proxy, a staging environment, or a self-hosted Vouch instance. You can achieve the same effect by passing options.apiUrl to the constructor.
.env
Security best practices
Error responses
When authentication fails, the API returns a401 Unauthorized status with a JSON body describing the problem.
Missing key
401 response unexpectedly, verify that the key is being passed in the x-api-key header (not Authorization or another header), and confirm that the key has not been revoked in the dashboard.