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

# Payments

> Pricing policy and x402 enforcement modes.

# Payments

Rhaios endpoints use a freemium pricing policy. Monitoring and execution endpoints are free. `POST /v1/yield/discover` and `POST /v1/yield/prepare` are priced per call and can be enforced via the [x402 protocol](https://www.x402.org/).

## Endpoint pricing policy

| Endpoint                  | Cost   | Category                                                 |
| ------------------------- | ------ | -------------------------------------------------------- |
| `POST /v1/yield/discover` | \$0.01 | Vault discovery and ranking                              |
| `POST /v1/yield/prepare`  | \$0.01 | Strategy and execution prep (deposit, redeem, rebalance) |
| `POST /v1/yield/execute`  | Free   | Execution                                                |
| `GET /v1/yield/status`    | Free   | Monitoring                                               |
| `GET /v1/yield/history`   | Free   | Monitoring                                               |

<Note>
  `POST /v1/yield/execute` is free to call but submits an on-chain transaction. Your smart wallet pays gas in USDC via the ERC-20 paymaster.
</Note>

<Note>
  Current pre-prod deployment keeps x402 disabled. That means `POST /v1/yield/discover` and `POST /v1/yield/prepare` are currently callable without payment even though the pricing policy is defined.
</Note>

## x402 enforcement modes

### Soft pre-prod mode (current)

* `POST /v1/yield/discover` and `POST /v1/yield/prepare` return normally (no HTTP `402`)
* Use this mode for integration and end-to-end testing

### Enforced mode (when enabled)

When x402 is enabled on the server:

1. `POST /v1/yield/prepare` responds with HTTP `402 Payment Required` and payment requirements
2. Your client attaches the `X-PAYMENT` header with the payment proof
3. Request is retried and returns results

Example with x402 payment header:

```bash theme={null}
curl -X POST https://api.staging.rhaios.com/v1/yield/prepare \
  -H "Content-Type: application/json" \
  -H "X-PAYMENT: <x402-payment-proof>" \
  -d '{
    "operation": "deposit",
    "asset": "USDC",
    "amount": "1000",
    "agentAddress": "0x...",
    "vaultId": "42"
  }'
```

## Cost example

A typical enforced deposit flow costs:

| Step                    | Endpoint                  | Cost             |
| ----------------------- | ------------------------- | ---------------- |
| Discover vaults         | `POST /v1/yield/discover` | \$0.01           |
| Get strategy + calldata | `POST /v1/yield/prepare`  | \$0.01           |
| Execute on-chain        | `POST /v1/yield/execute`  | Free (+ gas)     |
| Check position          | `GET /v1/yield/status`    | Free             |
| **Total**               |                           | **\$0.02 + gas** |

In current soft pre-prod mode, the same flow is effectively gas-only.

## Runtime interoperability

If you are integrating Rhaios through a larger agent runtime, keep payment handling in the runtime layer and call Rhaios for yield-specific execution prep.
