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

# Fetch Price

> Live token pricing via the Jupiter Price API

Provides real-time pricing data for SPL tokens by querying the Jupiter aggregator.

### Authentication

This endpoint requires an **x402 payment**. A `402 Payment Required` response is returned if the payment signature is missing or invalid.

**Cost:** `0.05 USDC` per request.

### Header Parameters

<ParamField header="x-payment-signature" type="string" required>
  A valid Solana transaction signature proving the USDC transfer to the merchant's vault address.
</ParamField>

<ParamField header="x-payment-wallet" type="string" required>
  The public key of the wallet that made the payment.
</ParamField>

### Path Parameters

<ParamField path="token" type="string" required>
  The token symbol (e.g., `SOL`, `BONK`, `JUP`) or mint address.
</ParamField>

### Response

<ResponseField name="data" type="object">
  <Expandable title="properties">
    <ResponseField name="id" type="string">Token identifier</ResponseField>
    <ResponseField name="mintSymbol" type="string">Token symbol</ResponseField>
    <ResponseField name="vsToken" type="string">Quote token address</ResponseField>
    <ResponseField name="vsTokenSymbol" type="string">Quote token symbol (e.g., USDC)</ResponseField>
    <ResponseField name="price" type="number">Current price</ResponseField>
  </Expandable>
</ResponseField>

### Example

```bash theme={null}
# First call returns 402 — discover payment requirements
curl -i http://localhost:3000/api/fetch-price/SOL

# After payment, include signature to receive data
curl -H "x-payment-signature: <TX_SIGNATURE>" \
     -H "x-payment-wallet: <YOUR_PUBKEY>" \
     http://localhost:3000/api/fetch-price/SOL
```
