PZERO Agent API
Agent self-service (Bearer pzero_... API key, no browser)
Agent self-service (Bearer pzero_... API key, no browser)
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/pzero-studio:pzero-studio-agent-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Pzero Studio Agent API
version: 1.0.0
contact:
url: /
description: 'Operations tagged agent across 2 of this provider''s published API definitions: pzero-studio-openapi.json, pzero-studio-openapi2.json. Each path carries the servers of the definition it was published in.'
servers:
- url: /
description: Same origin that served this OpenAPI document
tags:
- name: Agent
description: Agent self-service (Bearer pzero_... API key, no browser)
paths:
/v1/x402/refill:
post:
tags:
- Agent
summary: Fund prepaid USDC with a Bearer key instead of a session
description: 'Bearer twin of POST /v1/x402/top-up: an agent funds its own account without a browser. A session cookie is rejected. The payment payer must be the wallet behind the presented key, checked before settlement. Refill moves balance only; it mints no key. Inference is never paid per request.'
operationId: x402Refill
security:
- bearerAuth: []
parameters:
- name: X-PAYMENT
in: header
required: false
schema:
type: string
description: Base64-encoded signed x402 payment payload. Omit on the first call to receive requirements.
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
amountMicroUsdc:
type: integer
format: int64
minimum: 1000000
maximum: 1000000000
description: Integer micro-USDC (6 decimals on Base). 1000000 = 1.000000 USDC. Not a decimal string — send 1234567 for 1.234567 USDC.
required:
- amountMicroUsdc
responses:
'200':
description: Payment settled; credit recorded (pending until confirmed on-chain)
headers:
X-PAYMENT-RESPONSE:
schema:
type: string
description: Base64 settlement receipt
content:
application/json:
schema:
$ref: '#/components/schemas/TopUpSuccess'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'402':
description: 'Payment required: requirements in accepts[], or the submitted payment failed before settlement. A 402 always carries accepts and always means no money moved. Settled money that could not be credited is 409.'
content:
application/json:
schema:
$ref: '#/components/schemas/TopUpPaymentRequired'
'403':
description: Payment payer is not the wallet behind the presented API key
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'409':
description: 'Settled but not completed. The payment moved on chain and the request did not finish; the body carries transaction and reconciling. reconciling: true means the payment is queued and will be credited from the chain; reconciling: false means even that write failed and a human has to recover it. Do not send the payment again.'
headers:
X-PAYMENT-RESPONSE:
schema:
type: string
description: Base64 settlement receipt
content:
application/json:
schema:
$ref: '#/components/schemas/SettledIncomplete'
servers:
- url: /
description: Same origin that served this OpenAPI document
/v1/agent/me:
get:
tags:
- Agent
summary: Runway for the presented key
description: A fresh top-up lands pending and is only spendable once it confirms, so an agent polls this to know when it can spend and how much runway is left. A session cookie is rejected.
operationId: getAgentMe
security:
- bearerAuth: []
responses:
'200':
description: Wallet, balances, max price, and confirmation depth
content:
application/json:
schema:
$ref: '#/components/schemas/AgentMe'
'401':
$ref: '#/components/responses/Unauthorized'
servers:
- url: /
description: Same origin that served this OpenAPI document
/v1/agent/requests/{support_reference}:
get:
tags:
- Agent
summary: Resolve one own request by support reference
description: Every inference response carries X-Pzero-Support-Reference. This resolves one the caller's own account owns, and is how the cost of a streamed completion is recovered when the client did not read the chat pzero.cost SSE frame or the Responses completed/incomplete metadata. Video readiness polls store no attempt row and send no support reference.
operationId: getAgentRequest
security:
- bearerAuth: []
parameters:
- name: support_reference
in: path
required: true
schema:
type: string
format: uuid
responses:
'200':
description: Request detail including cost and clearing price
content:
application/json:
schema:
$ref: '#/components/schemas/AgentRequestDetail'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'404':
description: Support reference not found on this account
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
servers:
- url: /
description: Same origin that served this OpenAPI document
/v1/agent/max-price:
patch:
tags:
- Agent
summary: Move the caller's own price ceiling
description: 'The highest cents-per-dollar this account will clear against. Signup can set a ceiling once, but posted prices move, so an agent that only ever gets 503 no_eligible_supply is holding a stale ceiling, not an empty balance: that refusal names cheapestPostedCents, which is the value to send here. Bearer only, like the rest of the agent surface; a request carrying a session cookie is rejected. Any walletAddress in the body is ignored — the account is the one the key authenticates.'
operationId: patchAgentMaxPrice
security:
- bearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
maxPriceCentsPerDollar:
type: integer
minimum: 30
maximum: 80
required:
- maxPriceCentsPerDollar
responses:
'200':
description: Ceiling updated
content:
application/json:
schema:
type: object
properties:
walletAddress:
type: string
maxPriceCentsPerDollar:
type: integer
required:
- walletAddress
- maxPriceCentsPerDollar
'400':
description: Outside the 30–80 corridor, or missing; nothing is changed and nothing is clamped
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'401':
$ref: '#/components/responses/Unauthorized'
servers:
- url: /
description: Same origin that served this OpenAPI document
/v1/agent/keys:
post:
tags:
- Agent
summary: Mint another key on the caller's own account
description: 'Rotation without a browser: mint, store, verify, then revoke the old key. Each step is separately recoverable, unlike one atomic rotate whose lost response would leave the caller with a revoked key and no replacement. Plaintext is returned once.'
operationId: createAgentKey
security:
- bearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
name:
type: string
maxLength: 64
required:
- name
responses:
'201':
description: Key created; plaintext shown once
content:
application/json:
schema:
type: object
properties:
apiKey:
type: string
description: Plaintext pzero_... key
name:
type: string
keyPrefix:
type: string
required:
- apiKey
- name
- keyPrefix
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'409':
description: Active key limit reached; revoke a key before minting another
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
get:
tags:
- Agent
summary: List active keys on the caller's own account
description: Metadata only; plaintext exists once at create. This is how a compromised key's siblings are found before revoking.
operationId: listAgentKeys
security:
- bearerAuth: []
responses:
'200':
description: Active keys and the cap
content:
application/json:
schema:
$ref: '#/components/schemas/AgentKeyList'
'401':
$ref: '#/components/responses/Unauthorized'
servers:
- url: /
description: Same origin that served this OpenAPI document
/v1/agent/keys/{id}:
delete:
tags:
- Agent
summary: Revoke one key on the caller's own account
description: Includes the calling key, so an agent can retire the credential it is holding.
operationId: revokeAgentKey
security:
- bearerAuth: []
parameters:
- name: id
in: path
required: true
schema:
type: string
format: uuid
responses:
'200':
description: Key revoked
content:
application/json:
schema:
$ref: '#/components/schemas/StatusOk'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'404':
description: API key not found on this account
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
servers:
- url: /
description: Same origin that served this OpenAPI document
components:
schemas:
SettledIncomplete:
type: object
description: 'A payment that settled on chain and could not be turned into balance. Carries no accepts: the money already moved, so there is nothing to pay again. Reconciliation credits whatever the chain confirms.'
properties:
error:
type: string
description: What stopped the request after settlement
transaction:
type: string
description: 'Settlement transaction hash. Keep this value: it is the handle on the money.'
reconciling:
type: boolean
description: 'True when the payment is queued for reconciliation, which credits whatever the chain confirms with no further action from you. False when even that queue write failed: the money still moved, so do not pay again — keep transaction and quote it to support.'
example: true
message:
type: string
credited:
type: boolean
description: 'Signup only: true when the payment was credited but no API key was issued because the wallet is at the active key limit'
maxActiveApiKeys:
type: integer
description: 'Signup only: the active key ceiling that refused the mint'
example: 10
additionalProperties: true
Error:
type: object
properties:
error:
type: string
description: HTTP status text
message:
type: string
TopUpPaymentRequired:
type: object
properties:
x402Version:
type: integer
example: 1
amountMicroUsdc:
type: integer
format: int64
description: Integer micro-USDC echoed from the request (1000000 = 1.000000 USDC).
error:
type: string
description: Present when a submitted payment failed
accepts:
type: array
items:
$ref: '#/components/schemas/X402Requirement'
additionalProperties: true
TopUpSuccess:
type: object
properties:
balanceUsdc:
type: string
description: Alias of confirmedUsdc
confirmedUsdc:
type: string
pendingUsdc:
type: string
topUpAmountUsdc:
type: string
walletAddress:
type: string
idempotent:
type: boolean
description: True when this transaction was already credited
confirmationBlocks:
type: integer
description: Confirmations required before a pending top-up becomes spendable
example: 20
AgentMe:
type: object
properties:
walletAddress:
type: string
accountId:
type: string
format: uuid
keyPrefix:
type: string
description: Prefix of the key that made this call
confirmedUsdc:
type: string
description: Spendable balance; only this funds inference
pendingUsdc:
type: string
hasEverFunded:
type: boolean
description: True once any top-up has been credited (pending or confirmed). Distinguishes never-funded from spent-to-zero.
firstFundedAt:
type: string
format: date-time
description: UTC timestamp of the first top-up credit; omitted when hasEverFunded is false
maxPriceCentsPerDollar:
type: integer
topUpConfirmationBlocks:
type: integer
AgentRequestDetail:
type: object
properties:
supportReference:
type: string
format: uuid
requestId:
type: string
format: uuid
occurredAt:
type: string
format: date-time
model:
type: string
modality:
type: string
enum:
- text
- image
- video
status:
type: string
httpStatus:
type: integer
errorCode:
type: string
errorMessage:
type: string
costUsdc:
type: string
description: What this request cost; empty when nothing settled
clearingPriceCents:
type: integer
diemCleared:
type: string
totalMs:
type: integer
inferenceMs:
type: integer
AgentKeyList:
type: object
properties:
activeApiKeys:
type: array
items:
type: object
properties:
id:
type: string
format: uuid
name:
type: string
keyPrefix:
type: string
createdAt:
type: string
format: date-time
lastUsedAt:
type:
- string
- 'null'
format: date-time
activeApiKeyCount:
type: integer
maxActiveApiKeys:
type: integer
X402Requirement:
type: object
properties:
scheme:
type: string
example: exact
network:
type: string
example: base
maxAmountRequired:
type: string
example: '10000000'
resource:
type: string
example: https://api.example/v1/x402/top-up
description:
type: string
mimeType:
type: string
payTo:
type: string
description: Deployment settlement address
maxTimeoutSeconds:
type: integer
asset:
type: string
example: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'
description: USDC on Base mainnet
extra:
type: object
additionalProperties: true
StatusOk:
type: object
properties:
status:
type: string
example: ok
responses:
BadRequest:
description: Invalid request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
Unauthorized:
description: Valid session or credential required
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
securitySchemes:
bearerAuth:
type: http
scheme: bearer
description: Persistent pzero_... API key. Inference only; rejected on account and supply routes.
sessionCookie:
type: apiKey
in: cookie
name: pzero_session
description: HttpOnly session cookie from POST /auth/privy/verify. Rejected on POST /v1/chat/completions.
x-refined-from:
- pzero-studio-openapi.json
- pzero-studio-openapi2.json