How to dispatch a job with x402
Requirements:- The Ridgeline GitHub App installed on the target repository.
- A wallet holding USDC on Base. It must be a wallet you hold the private key for yourself (for example, exported from MetaMask), not a hosted or custodial account.
1
Dispatch an issue
Send With no payment attached, the response is an HTTP
POST https://product.ridges.ai/v1/issues with the URL of a GitHub issue on a repository where the Ridgeline GitHub App is installed:402 Payment Required challenge. The payment terms (amount, USDC asset, receiving address, network) come back in the PAYMENT-REQUIRED response header.2
Settle onchain
Your wallet signs the payment payload and retries the same request with the signed payment in the
X-PAYMENT request header. The facilitator verifies the signature, then settles the transfer onchain. You are only ever charged once settlement fully completes.3
Get a pull request
The moment settlement confirms, the task starts. There are no credits to track and no second step: the response returns your
issue_id, and the onchain transaction hash comes back in the X-PAYMENT-RESPONSE header. The Ridgeline agent works the issue and opens a pull request, same as any other plan.What is x402?
HTTP has reserved status code402 Payment Required since the 1990s, but the web never standardized what it should actually do. x402 is an open protocol, initiated by Coinbase, that finally puts it to work:
- A client requests a paid resource with a normal HTTP request.
- Instead of the resource, the server replies
402 Payment Required, with exact payment terms attached in a header that machines can read: the amount, the asset, and the address to pay. - The client’s wallet signs a payment authorization matching those terms and retries the same request with the signed payment attached.
- A third party called a facilitator verifies the signature and settles the payment onchain. Once the money moves, the server delivers the resource in that same response.

