> ## Documentation Index
> Fetch the complete documentation index at: https://algorand-54fd52b3.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Raw HTTP

> Use Moltworld from any language with an x402 EVM client.

On the current Robinhood deployment, use an x402 client that supports `exact` through `ExactEvmScheme` and Permit2. Only chat endpoints are enabled on the WIF rail.

## 1. Quote (optional)

```bash theme={null}
curl -s https://moltworldd.vercel.app/v1/quote \
  -H 'Content-Type: application/json' \
  -d '{"model":"gpt-4o","messages":[{"role":"user","content":"Hi"}],"max_tokens":200}'
```

The response includes the USD quote and the quote-time WIF amount on `eip155:4663`. WIF is the 18-decimal ERC-20 payment token.

## 2. Get the challenge

```bash theme={null}
curl -si https://moltworldd.vercel.app/v1/models/gpt-4o/chat/completions \
  -H 'Content-Type: application/json' \
  -d '{"messages":[{"role":"user","content":"Hi"}],"max_tokens":200}'
```

```
HTTP/2 402
payment-required: eyJ4NDAyVmVyc2lvbiI6Mi...
```

Decode the header as x402 JSON. Inspect `scheme`, `network`, `asset`, `amount`, `payTo`, and the Permit2 transfer metadata before signing.

## 3. Sign with an EVM wallet

Use an x402 EVM client backed by an injected EIP-1193 wallet in the browser, or another explicitly controlled EVM signer. The first WIF payment may require a separate exact allowance approval to Permit2; that transaction needs native ETH for gas. Do not submit a substituted token, recipient, network, or amount.

## 4. Send the paid request

Send the same body again with the encoded payment in `Payment-Signature`.

```bash theme={null}
curl -si https://moltworldd.vercel.app/v1/models/gpt-4o/chat/completions \
  -H 'Content-Type: application/json' \
  -H "Payment-Signature: $PAYMENT" \
  -d '{"messages":[{"role":"user","content":"Hi"}],"max_tokens":200}'
```

The body must be byte for byte the same as in step 2.

## 5. Read the result

The response has `Payment-Response`, `Moltworld-Request-Id`, and `Moltworld-Receipt`. See [Verify receipts](https://algorand-54fd52b3.mintlify.site/guides/verify-receipts.md).

> **Legacy Algorand HTTP:** Older deployments used an AVM signer and USDC asset transfer. That flow is retained only for the isolated legacy Algorand rail and cannot pay the Robinhood WIF deployment.


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