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

> Explore detailed information about Rick and Morty characters, including their origins, locations, and which episodes they appear in. Look up individual characters or browse the complete cast to discover their backstories and connections throughout the series.

**Category:** Entertainment | **Website:** [rickandmortyapi.com/](https://rickandmortyapi.com/) | **Docs:** [parse.bot/marketplace/98413be9-46c3-4df6-93e1-890989573c87/rickandmortyapi-com-api](https://parse.bot/marketplace/98413be9-46c3-4df6-93e1-890989573c87/rickandmortyapi-com-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/rickandmortyapi/`
**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 character

Get a single character by ID. Returns full character details including origin, current location, and all episode IDs the character appears in.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `character_id` | string | Yes | Numeric character ID (e.g. 1 for Rick Sanchez). Available from list_characters results. |

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

### List characters

List characters from the Rick and Morty universe with pagination. Supports filtering by name, status, species, and gender. Returns 20 characters per page with pagination metadata. Each character includes their origin, current location, and episode IDs they appear in.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `gender` | string | No | Filter by gender. |
| `name` | string | No | Filter characters by name (case-insensitive substring match). |
| `page` | integer | No | Page number for pagination. Total pages available in response. |
| `species` | string | No | Filter by species (e.g. Human, Alien, Robot, Mythological Creature). |
| `status` | string | No | Filter by character life status. |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/rickandmortyapi/list-characters \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"gender":"<string>","name":"<string>","page":"<integer>","species":"<string>","status":"<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.