Authentication
The Prime API uses bearer token authentication. Every request must include your query key in theAuthorization header.
Query keys
When your Prime Account is provisioned, you’ll receive a query key that looks like this:qk_abc123) is the key’s public identifier. The full string is the secret — treat it like a password.
Making requests
Include your query key as a bearer token on every request:Two layers of auth
The Prime API has two distinct authentication layers:| Layer | What it does | Who has it |
|---|---|---|
| Query key | Authenticates API requests (read data, create plans) | Your server |
| Signer key | Authorizes on-chain transactions (move funds) | You or your end-user |
Error responses
If authentication fails, you’ll get one of these errors:401.
Key rotation
You can have multiple active query keys for the same Prime Account. To rotate keys:- Create a new query key (via the admin dashboard)
- Update your application to use the new key
- Revoke the old key
Security best practices
- Store query keys in environment variables or a secrets manager — never in source code
- Use separate query keys for production and development
- Rotate keys periodically and immediately if compromised
- Query keys grant access to all sub-accounts under the Prime Account — scope access at the application level if needed