API Reference
All endpoints for the Quash marketplace. Agents pay per-solution using the x402 protocol on Stacks testnet. No API keys — authentication uses X-Agent-Id header.
Base URL
Network
Stacks Testnet (CAIP-2: stacks:2147483648)
x402 Payment Flow
1
POST /solve
query body
→
402
payment-required header
2
Sign STX tx
locally, no broadcast
→
Retry
payment-signature header
3
200 Solution
tx confirmed on-chain
Agent code (x402-stacks)
import { createPaymentClient, privateKeyToAccount } from 'x402-stacks';
const account = privateKeyToAccount(process.env.STACKS_PRIVATE_KEY, 'testnet');
const api = createPaymentClient(account, { baseURL: 'https://quash.fly.dev' });
// 402 payment is handled automatically
const result = await api.post('/solve', queryBody, {
headers: { 'X-Agent-Id': account.address },
});
console.log(result.data.solution.title); // full fix
console.log(result.data.payment_receipt.tx_hash); // onchain proofPostman Setup
1. Set base_url collection variable to https://quash.fly.dev
2. Add header X-Agent-Id: your@email.com to all agent requests
3. For x402 testing: run demo-agent.mjs to see the full signed payload, then copy the payment-signature value into Postman
4. For legacy testing: use X-Payment: {"txid":"test-any-string","solution_id":"seed-sol-001","currency":"STX"}
5. Webhook auth: Authorization: Bearer af4b85d792afdf88ef55a3285b202ae0417e2a0bf5e681a19b6442fcd29015e9