Integration guide
Pitch402 for agents
A curator opens a 100-spot Spotify playlist. You buy a numbered spot with USDC over x402, and the track goes on the playlist. Lower spot numbers cost more.
You do not need an account
There is no signup, no API key, and no onboarding. You bring a wallet that can sign an EIP-712 message and hold USDC. Pitch402 never takes custody of your funds, never sees your keys, and does not know who you are. Pay the 402 and the spot is yours.
You also never touch Spotify. Only the curator authorizes Spotify, once, over their own playlist. Your track is placed on your behalf.
What access requires
| An account with us | not required |
| An API key or token | not required |
| An allowlist | not required |
| A Spotify account | not required |
| ETH for gas | not required |
| A wallet that signs EIP-712 | required |
| USDC on Base Sepolia | required |
The endpoints are public and cross-origin, so an agent running in a page reaches them the same way a server does. Spam is self-limiting: taking a spot costs money.
Who pays whom
your wallet ──signs EIP-3009 authorization──▶ x402 facilitator
│ submits, pays the gas
▼
USDC contract
│
▼
0x691870275DA1DE4236f6f5Ca03Bf9B44837917B5
the curator's payout addressYou pay gas for nothing. The facilitator submits the transfer and covers it, which is why your wallet needs USDC but no ETH.
Three requests
Find what is for sale
curl https://pitch402-hackathon.vercel.app/api/v1/playlists
Or start from /.well-known/agent.json, which carries the price ladder, the networks, and the USDC contract address in one document.
Quote a spot — optionally for a specific track
curl "https://pitch402-hackathon.vercel.app/api/v1/playlists/demo/quote?next=1\ &track_uri=https://open.spotify.com/track/<id>"
Passing track_uri resolves the song against Spotify and returns its title, artist and album art, so you can confirm you picked the right track before spending anything. A track Spotify does not have is rejected here rather than after payment.
Buy it
curl -X POST https://pitch402-hackathon.vercel.app/api/v1/playlists/demo/spots/1 \
-H 'content-type: application/json' \
-d '{"track_uri":"spotify:track:<id>","term":"cycle"}'With no payment attached this answers HTTP 402 with x402 payment requirements in the payment-required header and a readable quote in the body. Sign it, retry with the payment attached, and you get 201 and a receipt.
Paying it in code
Any x402 client works. This is the whole integration with @x402/fetch — the 402 is handled for you.
import { x402Client } from '@x402/fetch'
import { registerExactEvmScheme } from '@x402/evm/exact/client'
const client = new x402Client()
client.setSpendControls({ maxAmountPerPayment: '$10' })
registerExactEvmScheme(client, {
signer: yourAccount, // any viem LocalAccount
networks: ['eip155:84532'], // pin the chain; a wildcard signs anywhere
})
const res = await client.fetch(
'https://pitch402-hackathon.vercel.app/api/v1/playlists/demo/spots/1',
{
method: 'POST',
headers: { 'content-type': 'application/json' },
body: JSON.stringify({ track_uri: 'spotify:track:<id>' }),
},
)
const receipt = await res.json()A complete runnable version is in the repo at examples/buy-spot.ts — a plain private key, no SDK of ours, no credentials from us. That is the whole integration.
Two settings worth copying. maxAmountPerPayment because the client default is $1 and spot 1 costs 10 USDC, so an uncapped-looking buy is refused before it leaves your process. And an explicit networks list, because without it the scheme registers an eip155:* wildcard and your agent will sign for any EVM chain a server asks it to.
Give the wallet a spending limit
An agent that holds money should not hold unbounded authority over it. Our own demo buyer runs on a Privy wallet whose policy is evaluated inside an enclave, so it holds even if the agent process is compromised:
method eth_signTypedData_v4 never eth_sendTransaction chainId eq 84532 Base Sepolia only verifyingContract eq 0x036CbD…F7e the verified USDC, not a lookalike to eq <payout address> one payee and no other value lte 10000000 10 USDC per payment
Everything not explicitly allowed is denied. You do not have to use Privy — the point is that whatever wallet you bring should be scoped this narrowly.
Using a coding agent
An agent with a shell and a wallet key needs no integration work from you at all. Install the skill and ask:
mkdir -p .claude/skills/pitch402 curl -o .claude/skills/pitch402/SKILL.md https://pitch402-hackathon.vercel.app/skill.md export BUYER_PRIVATE_KEY=0x… # funded with Base Sepolia USDC
Then, in the agent:
Buy spot 7 on Pitch402 for spotify:track:4cOdK2wGLETKBW3PvgPWqT
The skill tells it to quote before paying, never to assume a price, what to do when a spot is taken underneath it, and what it must not claim on our behalf. Without the skill it can still work it out from /llms.txt — the skill just removes the guessing.
Prices
| Spot | Price |
|---|---|
| 1 | 10 USDC |
| 2–3 | 5 USDC |
| 4–10 | 3 USDC |
| 11–100 | 1 USDC |
Multiply by the term: cycle ×1, 3m ×3, 1y ×10. The price is snapshotted at payment — a paid spot is never repriced, whatever the curator changes afterwards.
Networks
| Network | Chain | USDC | Settlement |
|---|---|---|---|
base-sepolia | eip155:84532 | 0x036CbD53842c5426634e7929541eC2318f3dCF7e | live |
hsk-testnet | eip155:133 | none verified | unavailable |
Base Sepolia is the only network a spot can actually be bought on. The others are advertised for coverage; selecting one returns 402 settlement_unavailable_on_network rather than payment requirements nobody can settle.
What we do not claim
- These are curator-owned playlists. Pitch402 never touches Spotify editorial playlists and cannot put you on one.
- No stream counts. The Spotify Web API reports no plays, saves or royalties attributable to a playlist, so we show none. Anything labelled an estimate came from a curator uploading their own Spotify for Artists data.
- No guaranteed outcome. You are buying a numbered position on a playlist for a term. That is all it is.
- A paid spot whose Spotify write fails stays yours — the receipt says
failedwith Spotify’s own error, andPOST /api/v1/receipts/:id/placeretries it for free.