BazaarLinkBazaarLink
Sign in

Let AI agents pay with OKXand sign up on their own

Pay with the OKX Wallet over x402 and get an API key and balance in a single request.

  • USD₮0 on X Layer, settled through OKX
  • No credit card, no sign-up form
  • Regular users can top up with x402 too
Ask to register without paying. The 402 response says what the server accepts.
Request
curl -i -X POST https://bazaarlink.ai/api/v1/agents/register/x402 \
  -H "Content-Type: application/json" \
  -d '{"name":"my-agent","amountUsd":1.1}'
Sample responseSample data
HTTP/1.1 402 Payment Required
Content-Type: application/json

{
  "x402Version": 2,
  "resource": {
    "url": "https://bazaarlink.ai/api/v1/agents/register/x402",
    "description": "BazaarLink paid agent registration",
    "mimeType": "application/json"
  },
  "accepts": [
    {
      "scheme": "exact",
      "network": "eip155:196",
      "payTo": "0xPAY_TO_ADDRESS",
      "asset": "0xASSET_CONTRACT",
      "amount": "1100000",
      "maxTimeoutSeconds": 300,
      "extra": { "name": "USD₮0", "version": "1" }
    }
  ]
}
/x402

What is x402

  1. POST/api/v1/agents/register/x402
  2. ← 402accepts[ network, asset, amount, payTo ]
  3. signEIP-3009
  4. POSTX-PAYMENT: …
  5. ← 201api_key, credits, claim_token

Payments settle on-chain through OKX's x402 facilitator; the server checks each one before it acts.

HTTP 402 asks for payment

The server answers with status 402 and lists what it accepts: network, asset, amount and pay-to address. The client signs a payment authorization and sends the same request again. BazaarLink settles each payment through OKX's x402 facilitator on X Layer.

api_keysk-bl-…
credits5
claim_token…
payment.txHash0x…

No account needed first

An agent does not fill in a form or create an account beforehand. The request that carries the payment creates the account, issues the API key and adds the balance.

/register

Four steps from request to API key

01

Send the request

POST to /api/v1/agents/register/x402 with a name and the amount you want to pay, in US dollars.

02

Receive a 402

The server replies 402 with the payment requirements. Nothing is created at this point.

03

Sign and resend

Sign the payment authorization with your own wallet, put it in the X-PAYMENT header and send the same request again.

04

Get your API key

After the payment is confirmed you receive a 201 with the API key, the balance and a claim link. The key appears only in this response, so store it right away.

/topup

Already have an account? Top up with x402 too

Agents use the API key they already have. Regular users sign in and top up from the credits page.

Agents and scripts

POST to /api/x402/topup with an Authorization header and amountUsd. The flow is the same as registration: quote, sign, resend.

Regular users

Sign in, open the credits page and choose x402. Your browser wallet signs the payment.

/network

Supported network and asset

One combination is supported today.

Network
X Layer, settled through OKX's x402 facilitator
Asset
USD₮0
Credit
A platform top-up fee applies, so the credited balance is lower than the amount paid (see pricing)
Amount per payment
Has a minimum and maximum; the 402 response and GET /api/x402/topup show the current limits

On-chain payments cannot be reversed. Check the amount and network before you sign.

Not paid yet? Free models still work

An agent account that has not paid uses the existing free-model allowance and rate limits (auto:free). Once it has paid, the account follows the normal rules for paid accounts.

/faq

Frequently asked questions

What is x402?

x402 is a protocol that uses the HTTP 402 status code to ask for payment. The server states the amount, network and pay-to address; the client signs a payment authorization and sends the same request again.

What do I need to pay with x402?

The OKX Wallet, or any wallet key that can sign an EIP-3009 authorization, and some USD₮0 on X Layer. The integration docs include TypeScript code using the x402 client to do the signing.

Which network and asset are supported?

USD₮0 on X Layer, settled through OKX's x402 facilitator. A platform top-up fee applies, so the balance you receive is lower than the amount you pay; see pricing.

What happens if I pay or resend twice?

Each payment is credited once. Resending the same payment to top-up returns already_credited. For registration, the same result comes back for 15 minutes; after that you get already_registered and the API key is not shown again.

Can I get a refund?

On-chain payments cannot be reversed and the system does not refund automatically. Contact support if something went wrong.

Is there a limit on registrations?

Yes. Registrations from the same network source are limited over a short period. When you hit the limit you get a 429 with a Retry-After header; wait and try again.

Can a person take over an agent account?

Yes. The registration response includes a claim_token and an upgrade_url. A person signs in and claims the account, and the API key and balance move to their account. claim_expires gives the deadline.

Let your agent
handle its own payment

Copied
Support
Support
Hi! How can we help you?
Send a message and we'll get back to you soon.