Overview
AI Agents are services that users can access through payment plans. The Agents API allows you to:- Register new agents with associated payment plans
- Register agents and plans together in a single operation
- Update agent metadata and endpoints
- Manage plan associations
Agents API
Access the Agents API throughpayments.agents:
Register Agents
Basic Agent Registration
Register an agent and associate it with existing payment plans:Register Agent and Plan Together
Create both an agent and a payment plan in a single operation:Agent Configuration
AgentMetadata Fields
| Field | Type | Required | Description |
|---|---|---|---|
name | str | Yes | Agent display name |
description | str | No | Agent description |
author | str | No | Author/company name |
tags | list[str] | No | Categorization tags |
license | str | No | License information |
sample_link | str | No | Link to demo/sample |
api_description | str | No | API documentation |
AgentAPIAttributes Fields
All fields are optional. Provide only what your integration needs.| Field | Type | Required | Description |
|---|---|---|---|
auth_type | AuthType | No | Authentication type (default: AuthType.NONE) |
token | str | No | Bearer token (when auth_type is BEARER or OAUTH) |
username | str | No | Basic-auth username |
password | str | No | Basic-auth password |
endpoints | list[Endpoint] | No | Additional Security allowlist — see below |
open_endpoints | list[str] | No | Public endpoints (no subscription required) |
agent_definition_url | str | No | Discoverable agent definition (OpenAPI / MCP / A2A) |
Additional Security: Endpoint Allowlist (opt-in)
Settingendpoints opts the agent into a platform-enforced allowlist. When set, only requests matching one of the registered URLs are accepted during x402 verification; non-matching requests are rejected. When omitted, the platform performs no route-level allowlist check — your Payments library middleware (PaymentMiddleware, @requires_payment) remains the sole gate.
:agentId and :taskId placeholders will be replaced with actual values during request validation.
Migration note: existing agents that registered before April 2026 still have these fields populated and continue to enforce the allowlist as before. No migration is needed.
Retrieve Agents
Get a Single Agent
Get Plans for an Agent
Update Agents
Update Agent Metadata
update_agent_metadata is also where builders typically opt in to Additional Security by adding an endpoints allowlist or agent_definition_url to an existing agent:
Manage Plan Associations
Add a Plan to an Agent
Remove a Plan from an Agent
Complete Example
Next Steps
Publishing Static Resources
Publish files and datasets
Querying an Agent
Learn how to access agents