> ## Documentation Index
> Fetch the complete documentation index at: https://docs.paywithlocus.com/llms.txt
> Use this file to discover all available pages before exploring further.

# x402 payments

> Create and fund a Build workspace with USDC on Base or Polygon.

Use **USDC on Base or Polygon** to create a Build with Locus workspace and pay for deployment credits. An x402-compatible client handles the HTTP payment challenge, then receives a token for the Build API.

## How it works

1. Call the sign-up or top-up endpoint.
2. Read the HTTP `402` payment terms.
3. Authorize payment from your wallet and resend through your x402 client.
4. Receive a JWT and workspace details after settlement.

Your client handles the payment headers. Send your agent the [Build skill](https://buildwithlocus.com/SKILL.md) for the full request contract.

## Sign up via x402

```bash theme={null}
curl -sS -X POST https://api.buildwithlocus.com/v1/auth/x402-sign-up \
  -H "Content-Type: application/json"
```

The first request returns `402`. After payment, the response includes `jwt`, `workspaceId`, and, for a new external wallet, `claimUrl`.

The JWT lasts **30 days**. Use it as a Bearer token for Build API requests. x402 workspaces receive **\$6.00** in initial credits.

## Top up credits via x402

Send the amount you want to add to the workspace:

```bash theme={null}
curl -sS -X POST https://api.buildwithlocus.com/v1/billing/x402-top-up \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"amount": 5.00}'
```

Your x402 client completes the payment challenge. Check `creditBalance` in the successful response. See [billing](https://buildwithlocus.com/billing.md) for credit management.

## Claim links

Open the returned `claimUrl` to connect your email and access the dashboard. Your agent can deploy with its JWT before the workspace is claimed.

## Git push deploys with x402

Use your JWT as the password in the Locus git remote:

```bash theme={null}
git remote add locus https://x:$JWT_TOKEN@git.buildwithlocus.com/{workspaceId}/{projectId}.git
git push locus main
```

Replace the workspace and project IDs with your own. Keep the credential-bearing remote private.

## MPP vs x402

Choose the protocol for the chain holding your funds:

| | MPP | x402 |
| - | - | - |
| Chain | Tempo (`4217`) | Base (`8453`) or Polygon (`137`) |
| Sign-up cost | \$0.001 USDC | Shown in the payment challenge |
| Initial credits | \$0.00 | \$6.00 |

Both create a Build workspace with the same deployment API. See [MPP payments](/build/mpp) for Tempo.

## Network details

| Network | USDC contract |
| - | - |
| Polygon | `0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359` |
| Base | `0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913` |

Payments settle through `https://facilitator.payai.network`. Compatible client libraries include `@x402/core` and `@x402/evm`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.