- ATB ZKP certificate — the agent presents a Falcon-1024 signed ATB Pass Certificate (Phase 2, Bulletproofs range proof). Open to all tenants.
- Federation token — the agent presents a pre-composed cross-issuer federation token. Available under the AlgoVoi Commercial License.
Why it exists
Standard API key authentication is stateless: every request to/x402, /mpp, /ap2, or /a2a presents the full API key. For high-frequency agentic workflows — where an agent may make dozens of payment decisions per session — this has two problems:
- Repeated key exposure — the API key travels on every request.
- No session-level spend governance — there is no in-gateway mechanism to cap total spend for a single agentic run, independent of the tenant-level volume caps.
Prerequisites
- An active AlgoVoi API key (
X-Tenant-Id+Authorization: Bearer <api_key>) - One of:
- A valid ATB ZKP certificate — issued by
agent-trust-bench.algovoi.co.ukwithpassed=trueand a Bulletproofs range proof. See ATB Pass Certificate for issuance. - A federation token — issued by the AlgoVoi federation validator. Commercial License required.
- A valid ATB ZKP certificate — issued by
Authentication flow
POST /auth/token
Exchange an ATB ZKP certificate for a session token.Request
| Field | Type | Required | Description |
|---|---|---|---|
atb_zk_credential | string | One of | Base64url-encoded ATB ZKP Phase 2 cert (X-ATB-ZK-Credential value from bench). |
federation_token | string | One of | Base64url-encoded cross-issuer federation token. Commercial License required. |
spend_cap_usd | float | No | Per-session spend ceiling in USD. Default: 100.0. Range: 0–10000. Set to 0 for a dry-run session (no payments). |
ttl_secs | integer | No | Session lifetime in seconds. Default: 3600 (1 hour). Max: 86400 (24 h). |
Response
| Field | Description |
|---|---|
token | HMAC-signed session JWT. Use as Authorization: Bearer <token> on payment routes. |
token_type | Always "Bearer". |
expires_in | Session lifetime in seconds from issuance. |
spend_cap_usd | Confirmed spend cap in USD. |
jti | JWT ID — unique session identifier for audit and status queries. |
Error responses
| Status | Detail | Meaning |
|---|---|---|
401 | Unauthorized | API key missing, invalid, or tenant inactive |
403 | atb_verification_failed | ZKP cert rejected — cert expired, sig invalid, range proof failed, or score below threshold |
403 | federation_token_invalid | Federation token rejected — HMAC invalid or expired |
422 | Provide atb_zk_credential or federation_token | Neither credential field was present in the request body |
503 | ATB ZKP credential verification is not enabled | Gateway not configured for ZKP (contact support) |
503 | Federation token auth is not enabled | Gateway not configured for federation (Commercial License) |
GET /auth/token/status
Check current spend vs cap for a live session.Request
X-Tenant-Id required — the tenant is resolved from the JWT claims.
Response
Spend cap mechanics
The spend cap is enforced in-process on every payment route (/x402/verify, /mpp/{resource_id}, /a2a task completion). After each confirmed settlement, the gateway records the amount against the session’s jti.
- Exceeded cap →
402 Payment Requiredwithdetail: "agent_spend_cap_exceeded". The payment is blocked before it reaches the facilitator. - Tenant volume caps (database-level) remain the hard enforcement floor regardless of session cap. Session caps are an additional advisory layer.
- Single-instance note — the in-process spend store resets on gateway restart. For multi-instance deployments, the spend counter should be moved to Redis. On the current single-VM1 production deployment this is not a concern.
ATB discount
When a valid ATB ZKP cert is presented andATB_DISCOUNT_ENABLED=true on the gateway, the effective payment amount is reduced by the discount factor (default 20%) at the resource price resolution step. The session token carries this discount forward automatically — no additional header is required on payment routes.
Using the session token
Once issued, the session token replaces the API key on all payment routes:X-Tenant-Id is not required — it is resolved from the JWT sub claim.
Quick start
Python
TypeScript
Backwards compatibility
Existing API key authentication is fully unaffected. The gateway’sGatewayAuth dependency accepts both API keys and agent session tokens (union). No changes to existing integrations are required.
On-premise deployment
The full AlgoVoi payment stack is available as a self-hosted Docker Compose deployment. See the On-Premise guide for setup instructions. Agent session authentication — both the ATB ZKP cert path and the federation token path — is supported in the on-premise stack. The local gateway validates a Falcon-1024 signed licence token issued by the AlgoVoi main gateway on startup; no API calls back to AlgoVoi during normal operation. Contact us for enterprise deployment and commercial licensing enquiries.See also
- ATB Pass Certificate — how to earn and obtain a ZKP cert
- Agent Trust Bench — the adversarial test harness
- ATB Hub Conformance — federation discovery
- Composite Trust Query — composing session evidence into audit chains