# Docs — Wrapped API

> **You are on:** `https://api.beta.paywithlocus.com/api` | [llms.txt](https://beta.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 for Locus Pro. Each call burns credits from your workspace balance.

## Access

**Base URL:** `https://api.beta.paywithlocus.com/api/wrapped/credits/docs/`
**Auth:** `Authorization: Bearer <LOCUS_CREDITS_SECRET_KEY>` (an `lcr_` secret key or a scoped `lcac_` agent credential)
**Required header:** `Idempotency-Key: <fresh UUID per call>`. A retry with the same key replays the stored result without a new charge.
**Response:** the provider response after any endpoint-specific normalization. `X-Locus-Credits-Charged` carries the charge and `X-Locus-Credits-Balance` the remaining balance. Insufficient credits return `402` before the provider is called.
**Pricing:** estimated costs below are USD. Locus debits the credit equivalent at your workspace rate.

Full call contract: https://docs.paywithlocus.com/api-reference/introduction

> Using a Pay With Locus wallet key (`claw_` prefix)? Wallet routes are documented separately: https://docs.paywithlocus.com/wrapped-apis/for-agents

## 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.beta.paywithlocus.com/api/wrapped/credits/docs/get-function-detail \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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.beta.paywithlocus.com/api/wrapped/credits/docs/get-function-list \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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.beta.paywithlocus.com/api/wrapped/credits/docs/get-function-list-by-version \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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.beta.paywithlocus.com/api/wrapped/credits/docs/get-functions-by-category \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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.beta.paywithlocus.com/api/wrapped/credits/docs/search-functions \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"query":"<string>"}'
```

## Next steps

- [All wrapped API providers](https://beta.paywithlocus.com/wapi/index.md): pick another provider.
- [Find and call tools](https://beta.paywithlocus.com/agent/tools.md): price ceilings, async results, and errors.
- [Credits and billing](https://beta.paywithlocus.com/agent/billing.md): what a call costs and how to add credits.
- [Agent docs index](https://beta.paywithlocus.com/agent/index.md): every Locus agent page.