Skip to main content

Scenario

You have an open-source LLM inference endpoint (e.g., running via vLLM, Ollama, or Python FastAPI) exposing:
You want to charge AI agents 0.01 USDC per completed inference request without requiring user accounts or credit cards.

Step 1: Upstream FastAPI Service

Assume your FastAPI service is listening on http://127.0.0.1:8000:

Step 2: Configure the Proxy

Create config.yaml:
Start the proxy:

Step 3: Agent Client Request

An autonomous caller executes the query using @stellar-x402/client:
The gateway manages the 402 challenge negotiation, the client signs the authorization, the request reaches your FastAPI server, and payment is verified on-chain.