# Law Cornell — 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.

> Search thousands of legal definitions and explanations from Cornell Law's Wex encyclopedia to understand legal terms, concepts, and their relationships across different practice areas. Browse entries alphabetically or by legal category to quickly find the legal information you need.

**Category:** Government & Public Data | **Website:** [www.law.cornell.edu/wex](https://www.law.cornell.edu/wex) | **Docs:** [parse.bot/marketplace/791e5030-f2e7-41c2-9749-844692ddca4f/law-cornell-edu-api](https://parse.bot/marketplace/791e5030-f2e7-41c2-9749-844692ddca4f/law-cornell-edu-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/law-cornell/`
**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 category entries

Get entries belonging to a specific legal area/category with pagination support. Returns paginated results with term names, slugs, and text snippets. Categories correspond to the /wex/category/ paths on the Cornell Law site. Page numbering is 0-indexed.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `category` | string | Yes | Category slug (e.g., 'contracts', 'constitutional_law', 'criminal_law_and_procedure', 'property'). |
| `limit` | integer | No | Maximum entries per page. 0 returns all entries on the page. |
| `page` | integer | No | Page number (0-indexed). |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/law-cornell/get-category-entries \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"category":"<string>","limit":"<integer>","page":"<integer>"}'
```

### Get entry

Get the full definition, legal areas/categories, and related terms for a specific Wex entry by its slug. The slug corresponds to the URL path segment after /wex/ on the Cornell Law site. Returns the complete text definition, a list of legal areas the entry belongs to, and cross-referenced terms (see_also).

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `slug` | string | Yes | The entry slug (e.g., 'contract', 'habeas_corpus', 'first_amendment'). Spaces are converted to underscores automatically. |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/law-cornell/get-entry \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"slug":"<string>"}'
```

### List entries

List Wex legal encyclopedia entries for a specific letter or all letters. Returns term names, slugs, and URLs. Each letter page contains all entries starting with that letter. Use 'all' to fetch every letter sequentially. No server-side pagination; use limit to cap the result count client-side.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `letter` | string | No | Letter to browse (a-z, or numbers 1, 3, 4, 7, 9). Use 'all' to get entries for all letters. |
| `limit` | integer | No | Maximum number of entries to return. 0 returns all entries. |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/law-cornell/list-entries \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"letter":"<string>","limit":"<integer>"}'
```

### Search entries

Search Wex entries by keyword in the term name. Performs a case-insensitive substring match against entry names in the alphabetical index. By default searches the letter matching the first character of the query; specify a letter to search within a different letter page. Returns matching terms with their slugs and URLs.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `letter` | string | No | Specific letter to search within (a-z, or numbers 1, 3, 4, 7, 9). If omitted, searches the letter matching the first character of the query. |
| `limit` | integer | No | Maximum results to return. |
| `query` | string | Yes | Search keyword to match against term names (case-insensitive substring match). |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/law-cornell/search-entries \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"letter":"<string>","limit":"<integer>","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.