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

# Context7

> Library documentation search that returns current, version-accurate docs and code examples for popular frameworks and SDKs.

Library documentation search that returns current, version-accurate docs and code examples for popular frameworks and SDKs. Use when a workflow needs accurate API signatures, configuration syntax, or migration guidance for a specific library. Unlike general web search, returns structured docs directly from the library's source — no stale blog posts or hallucinated APIs.

2 example endpoints available through Lava's AI Gateway. See the [Context7 API docs](https://context7.com/docs/api-guide) 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://context7.com/api/v2` is supported. Context7 library docs API. Construct URL as [https://context7.com/api/v2/\&#123;endpoint\&#125](https://context7.com/api/v2/\&#123;endpoint\&#125);. Common endpoints: /libs/search?query=react (resolve library), /context?libraryId=lib\_id\&query=hooks (query docs). Auth is automatic via Bearer token. The endpoints below are curated examples.</Info>

## Endpoints

### Resolve a library name to an ID

**GET** `https://context7.com/api/v2/libs/search?query=react` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://context7.com/api/v2/libs/search?query=react', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Fcontext7.com%2Fapi%2Fv2%2Flibs%2Fsearch%3Fquery%3Dreact" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY"
    ```
  </Tab>
</Tabs>

### Query documentation for a resolved library

**GET** `https://context7.com/api/v2/context?libraryId=/reactjs/react.dev&query=hooks` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://context7.com/api/v2/context?libraryId=/reactjs/react.dev&query=hooks', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Fcontext7.com%2Fapi%2Fv2%2Fcontext%3FlibraryId%3D%2Freactjs%2Freact.dev%26query%3Dhooks" \
      -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>
