Skip to content

GET /v1/agent/keys

Bearer self-service for minting, listing, and revoking pzero_… keys on your own account. Ten active keys per account across every mint route.

Rotate as mint, store, verify, then revoke the old key. Each step is separately recoverable.

List

List active keys. Metadata only. Never plaintext. Response includes activeApiKeys (id, name, keyPrefix, createdAt, lastUsedAt), activeApiKeyCount, and maxActiveApiKeys (10).

bash
curl "https://api.pzero.studio/v1/agent/keys" \
  -H "Authorization: Bearer pzero_..."

POST /v1/agent/keys

Mint another key. Body: { "name": "your-label" } (required, 1–64 characters). 201 returns once-visible apiKey plus name and keyPrefix. Store apiKey immediately.

bash
curl -X POST "https://api.pzero.studio/v1/agent/keys" \
  -H "Authorization: Bearer pzero_..." \
  -H "Content-Type: application/json" \
  -d '{ "name": "rotated" }'

At the ten-key cap: 409. Revoke one first. On POST /v1/x402/signup, the same cap returns 409 with credited: true (payment credited, no key).

DELETE /v1/agent/keys/{id}

Revoke one own key, including the key making the call. {id} is the UUID from the list response. Returns 200 with {"status":"ok"}. Unknown or foreign id404.

bash
curl -X DELETE "https://api.pzero.studio/v1/agent/keys/{id}" \
  -H "Authorization: Bearer pzero_..."

Next

PZERO Your AI Studio. Top up. Do your thing. Repeat.