# Docs — 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 comprehensive OpenGL and GLES function documentation by searching across all versions, filtering by category, or looking up specific function details. Quickly find the exact graphics programming reference you need organized by function categories and API versions.

**Category:** Developer Tools | **Website:** [docs.gl/](https://docs.gl/) | **Docs:** [parse.bot/marketplace/7749ddab-42a3-4008-bced-1f94bb339431/docs-gl-api](https://parse.bot/marketplace/7749ddab-42a3-4008-bced-1f94bb339431/docs-gl-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-docs-gl-api-7749ddab/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_function_detail

Fetches full documentation for a specific OpenGL/GLES function including its C signature, parameter descriptions, prose description, notes, error conditions, usage examples, version support matrix, and related functions. Not all functions exist under all version prefixes; legacy GL2-only functions may return upstream_error if the documentation page does not exist.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `function_name` | string | Yes | The name of the OpenGL/GLES function (e.g. 'glDrawArrays', 'glBindTexture'). |
| `version` | string | No | Version context for the documentation page URL. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-docs-gl-api-7749ddab/get_function_detail \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"function_name":"<string>","version":"<string>"}'
```

### get_function_list

Retrieves the complete catalog of OpenGL/GLES functions with the version strings each appears in. Returns every function known to docs.gl. The result set is large (4000+ entries) and not paginated server-side; a single request fetches everything.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-docs-gl-api-7749ddab/get_function_list \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### get_function_list_by_version

Returns a sorted list of function names available under a specific OpenGL/GLES version prefix. The prefix matches all sub-versions (e.g. 'gl4' matches gl4.0 through gl4.5). Useful for discovering the API surface of a particular GL generation.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `version` | string | No | OpenGL/GLES version prefix to filter by. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-docs-gl-api-7749ddab/get_function_list_by_version \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"version":"<string>"}'
```

### get_functions_by_category

Returns all OpenGL/GLES functions grouped by sidebar categories (e.g. Textures, Rendering, Frame Buffers). Categories and their member functions are extracted from the docs.gl sidebar navigation. Each function entry includes the GL/ES version tags it carries.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-docs-gl-api-7749ddab/get_functions_by_category \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### search_functions

Searches for OpenGL/GLES functions whose names contain the query string (case-insensitive substring match). Returns all matches across all versions, so a single function name may appear multiple times with different version qualifiers.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `query` | string | Yes | Search keyword to match against function names (case-insensitive substring match). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-docs-gl-api-7749ddab/search_functions \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query":"<string>"}'
```
