Two kinds of key
The split matters because they do different things. A secret key creates and
manages payment sessions — it can move money on your behalf. A publishable
key reads reference data, prices routes and reads balances. The customer-wallet
Deposit creation path is available when you configure the key’s exact origin
and Hypermid enables publishable Deposits for the partner; otherwise the server
rejects the request with a setup error.
The prefix picks the environment
A secret key’s prefix is not decoration — it is the environment switch:sk_test_…→ sandbox. Testnets only. No real money can move.sk_live_…→ production. Mainnets only.
Why Bearer, not x-api-key
The backend reads the secret from Authorization only, deliberately. A
header that leaks into a log line or a proxy trace must not be replayable as a
secret, so the two channels are kept apart. Sending a secret as x-api-key
fails auth rather than quietly working.
Sending a publishable key where a secret is required returns a specific error
rather than doing less:
Public routes
Some payer-facing reads take no key at all —GET /v1/payments/{id}/public,
GET /v1/payments/quote, the pay and deposit calls, and the anonymous
GET /v1/status. They are scoped to a single session id and return only what
is safe to render to the person paying.
This is why the Postman collection marks them noauth:
attaching a bearer token to a route that never needed one is how a secret key
ends up somewhere it should not be.
Keeping keys safe
Rotate on exposure, not on a schedule
Rotate on exposure, not on a schedule
If a secret key reaches a repo, a log aggregator or a support ticket,
treat it as compromised and ask us to reissue it. Rotating an uncompromised
key on a timer mostly creates outages.
Webhook secrets are separate
Webhook secrets are separate
A webhook signing secret is not an API key. It only verifies that a
delivery came from us — see Webhooks.