> ## 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.

# Open Trivia Database

> Community-driven trivia question database serving questions across 24 categories with configurable difficulty and answer format.

Community-driven trivia question database serving questions across 24 categories with configurable difficulty and answer format. Supports session tokens to prevent duplicate questions across requests. Best for quiz apps, gamification features, or educational workflows needing structured Q\&A content. Free with 1 request per 5 seconds rate limit.

1 example endpoint available through Lava's AI Gateway. See the [Open Trivia Database API docs](https://opentdb.com/api_config.php) for full documentation.

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

<Info>This is a **catch-all provider** — any valid URL under `https://opentdb.com` is supported. Trivia question API. Construct URL as [https://opentdb.com/api.php?amount=\&#123;n\&#125;\&category=\&#123;id\&#125;\&difficulty=\&#123;level\&#125](https://opentdb.com/api.php?amount=\&#123;n\&#125;\&category=\&#123;id\&#125;\&difficulty=\&#123;level\&#125);. See [https://opentdb.com/api\_config.php](https://opentdb.com/api_config.php) for categories and options. The endpoints below are curated examples.</Info>

## Endpoints

### Get trivia questions

**GET** `https://opentdb.com/api.php?amount=10&category=18&difficulty=medium` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://opentdb.com/api.php?amount=10&category=18&difficulty=medium', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Fopentdb.com%2Fapi.php%3Famount%3D10%26category%3D18%26difficulty%3Dmedium" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY"
    ```
  </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>
