Skip to main content
A complete example of an AI agent that discovers and pays for a protected API endpoint.

Client: the agent

agent.ts

Server: the paid API

server.ts

Running the example

The agent makes a POST request. The server responds with 402. Rides handles the payment. The server returns the analysis result.