# Air Premia — 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.

> Search for the lowest available fares across Air Premia flight routes and discover current promotions to find the best deals on your next flight. Browse real-time pricing for specific sectors and stay updated on limited-time offers to maximize your savings.

**Category:** Travel | **Website:** [www.airpremia.com/](https://www.airpremia.com/) | **Docs:** [parse.bot/marketplace/a5b6f46c-ed6e-4920-82f9-2819898afe97/airpremia-com-api](https://parse.bot/marketplace/a5b6f46c-ed6e-4920-82f9-2819898afe97/airpremia-com-api)

Pay-per-use API proxy for Locus Pro. Each call burns credits from your workspace balance.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/credits/air-premia/`
**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 sector fares

Retrieve the lowest daily fare calendar for a given Air Premia route (origin-destination pair) over a date range. Returns per-day availability with fares broken down by cabin class (Economy and Premium Economy), including base fare, taxes, and total. Dates with no availability are marked as sold out. The API requires end_date to align to the last day of its month; any provided end_date is automatically snapped to the month's end. Supports a maximum date span of approximately two months from today.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `adults` | string | No | Number of adult passengers. |
| `begin_date` | string | No | Start date for fare search in YYYY-MM-DD format. Must be today or later; dates in the past are automatically adjusted to today. Defaults to today. |
| `children` | string | No | Number of child passengers. |
| `destination` | string | No | 3-letter IATA airport code for arrival (e.g. LAX, NRT, HKG, SFO, EWR, HNL, BKK, IAD). |
| `end_date` | string | No | End date for fare search in YYYY-MM-DD format. Automatically snapped to the last day of the given month. Defaults to end of next month. |
| `infants` | string | No | Number of infant passengers. |
| `origin` | string | No | 3-letter IATA airport code for departure (e.g. ICN, LAX, NRT). |
| `trip_type` | string | No | Trip type for fare lookup. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/air-premia/get-sector-fares \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"adults":"<string>","begin_date":"<string>","children":"<string>","destination":"<string>","end_date":"<string>","infants":"<string>","origin":"<string>","trip_type":"<string>"}'
```

### List promotions

List Air Premia promotional events and deals with pagination. Returns active and past promotions including discount campaigns, credit card partnerships, and route-specific fare sales. Results are auto-iterated across pages.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `page` | integer | No | Page number for pagination (1-based). |
| `size` | integer | No | Number of promotions per page. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/air-premia/list-promotions \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"page":"<integer>","size":"<integer>"}'
```

## Next steps

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