# Learn Chatgpt — Wrapped API

> **You are on:** `https://api.paywithlocus.com/api` | [llms.txt](https://paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Access data from learn.chatgpt.com.

**Category:** Developer Tools | **Website:** [learn.chatgpt.com/docs](https://learn.chatgpt.com/docs) | **Docs:** [parse.bot/marketplace/998d0fd7-198c-4689-b3c9-edd940cc0d5f/learn-chatgpt-com-api](https://parse.bot/marketplace/998d0fd7-198c-4689-b3c9-edd940cc0d5f/learn-chatgpt-com-api)

Pay-per-use API proxy. Each call is automatically billed to your wallet in USDC.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/parse-learn-chatgpt-com-api-998d0fd7/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### search_docs

Full-text search across ChatGPT and OpenAI documentation. Returns ranked results with title, URL, section, hierarchy, and content snippets. Results are auto-iterated; each hit is one indexed documentation fragment (a heading or content block). Optional client-side filters narrow results by section, fragment type, hierarchy level, or pathname prefix.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `hierarchy_lvl0` | string | No | Filter results by the top-level hierarchy category (e.g. "Documentation"). |
| `hits_per_page` | integer | No | Maximum number of results to return per request. |
| `pathname_prefix` | string | No | Filter results to entries whose pathname starts with the given prefix (e.g. "/docs/prompting"). |
| `query` | string | Yes | Search query text to match against documentation titles and content. |
| `section` | string | No | Filter results to a specific documentation section (e.g. "chatgpt_docs", "api", "cookbook"). |
| `type` | string | No | Filter results by fragment type level (e.g. "lvl1", "lvl2", "lvl3"). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-learn-chatgpt-com-api-998d0fd7/search_docs \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"hierarchy_lvl0":"<string>","hits_per_page":"<integer>","pathname_prefix":"<string>","query":"<string>","section":"<string>","type":"<string>"}'
```
