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

# Lava Pages

> Lava's first-party page hosting API.

Lava's first-party page hosting API. Post an HTML document and get back a public URL at lava.so/p/{id} that anyone can open in a browser. Designed for agent-generated artifacts (research summaries, dashboards, reports, share-links) that the agent wants the user to view as a real page rather than parse from a tool result. Pages are editable in place: PUT /v1/pages/{id} updates the content and the URL stays stable, so fix content instead of minting a new link. Full CSS works (inline styles and https stylesheets, fonts, images); JavaScript, iframes, and form posts are blocked by CSP. Every page renders a small 'Made with Lava' share bar. 1MB max, no expiry.

4 endpoints available through Lava's AI Gateway. See the [Lava Pages API docs](https://www.lava.so/docs) for full documentation.

<Info>This provider is **managed** — no additional setup required.</Info>

## Endpoints

### Create a public HTML page hosted at lava.so/p/\{id}. Body: \{ html: string } (max 1MB; full CSS supported, JavaScript blocked by CSP; every page renders a 'Made with Lava' share bar). Returns \{ id, url }. To change a page later, PUT /v1/pages/\{id} instead of creating a new one.

**POST** `https://api.lava.so/v1/pages` — \$0.03 / request

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://api.lava.so/v1/pages', {
      body: {
    "html": "<!doctype html><html><body><h1>Hello</h1></body></html>"
    },
    });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X POST "https://api.lava.so/v1/forward?u=https%3A%2F%2Fapi.lava.so%2Fv1%2Fpages" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY" \
      -H "Content-Type: application/json" \
      -d '{"html":"<!doctype html><html><body><h1>Hello</h1></body></html>"}'
    ```
  </Tab>
</Tabs>

### Read back a page you created: \{ id, url, html, created\_at }. Billed at the standard \$0.005 platform-fee floor.

**GET** `https://api.lava.so/v1/pages/pg_01ABC123` — \$0.005 / request

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://api.lava.so/v1/pages/pg_01ABC123', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Fapi.lava.so%2Fv1%2Fpages%2Fpg_01ABC123" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY"
    ```
  </Tab>
</Tabs>

### Update a page in place; the lava.so/p/\{id} URL stays stable. Body: \{ html: string }. Billed at the standard \$0.005 platform-fee floor.

**PUT** `https://api.lava.so/v1/pages/pg_01ABC123` — \$0.005 / request

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://api.lava.so/v1/pages/pg_01ABC123', {
      method: 'PUT',
      body: {
    "html": "<!doctype html><html><body><h1>Updated</h1></body></html>"
    },
    });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X PUT "https://api.lava.so/v1/forward?u=https%3A%2F%2Fapi.lava.so%2Fv1%2Fpages%2Fpg_01ABC123" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY" \
      -H "Content-Type: application/json" \
      -d '{"html":"<!doctype html><html><body><h1>Updated</h1></body></html>"}'
    ```
  </Tab>
</Tabs>

### Delete a page; its public URL starts returning 410 Gone. Billed at the standard \$0.005 platform-fee floor.

**DELETE** `https://api.lava.so/v1/pages/pg_01ABC123` — \$0.005 / request

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://api.lava.so/v1/pages/pg_01ABC123', { method: 'DELETE' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X DELETE "https://api.lava.so/v1/forward?u=https%3A%2F%2Fapi.lava.so%2Fv1%2Fpages%2Fpg_01ABC123" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY" \
      -H "Content-Type: application/json"
    ```
  </Tab>
</Tabs>

## Next Steps

<CardGroup cols={2}>
  <Card title="All Providers" icon="grid" href="/gateway/supported-providers">
    Browse all supported AI providers
  </Card>

  <Card title="Forward Proxy" icon="route" href="/gateway/forward-proxy">
    Learn how to construct proxy URLs and authenticate requests
  </Card>
</CardGroup>
