# SX.bet — 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 data from sx.bet.

**Category:** Sports | **Website:** [sx.bet/](https://sx.bet/) | **Docs:** [parse.bot/marketplace/907348e1-f4fe-4e0e-bfd4-07e6ef8bffbd/sx-bet-api](https://parse.bot/marketplace/907348e1-f4fe-4e0e-bfd4-07e6ef8bffbd/sx-bet-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/sx-bet/`
**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 active markets

Returns active betting fixtures with match details, teams, odds, and available market types. When league_id is provided, returns all fixtures for that league. Without it, returns upcoming fixtures across all sports optionally filtered by sport name. Each fixture includes market hashes needed for order book and consensus queries.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `bet_group` | string | No | Bet group filter (e.g. 'game-lines', '1X2', 'set-betting'). |
| `league_id` | string | No | Numeric league ID from get_sports_leagues (e.g. '1308' for ATP Washington). Omitting returns upcoming fixtures across all sports. |
| `sport` | string | No | Sport name to filter upcoming fixtures (e.g. 'Tennis', 'Basketball', 'Soccer'). Only used when league_id is not provided. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/sx-bet/get-active-markets \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"bet_group":"<string>","league_id":"<string>","sport":"<string>"}'
```

### Get market consensus

Returns betting consensus data for a fixture derived from the live order book: best decimal odds on each outcome, implied probabilities, total available liquidity on each side, and percentage distribution. Consensus reflects current market maker positions.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `bet_group` | string | No | Bet group filter. |
| `fixture_id` | string | Yes | Fixture ID from get_active_markets (e.g. 'L19606444'). |
| `market_hash` | string | No | Market hash to filter to a specific market. Omitting returns consensus for all markets. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/sx-bet/get-market-consensus \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"bet_group":"<string>","fixture_id":"<string>","market_hash":"<string>"}'
```

### Get match trades

Returns paginated trade history for a specific fixture showing all executed bets: bettor username, stake amount, decimal odds, implied probability, which outcome was bet on, and settlement status. Serves as the match activity/history for an individual fixture.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `fixture_id` | string | Yes | Fixture ID from get_active_markets (e.g. 'L19606444'). |
| `page` | integer | No | Zero-based page number for pagination. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/sx-bet/get-match-trades \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"fixture_id":"<string>","page":"<integer>"}'
```

### Get order book

Returns the full open order book for a fixture showing all active limit orders, their odds (as implied probability 0-1), stake sizes, and maker addresses. Orders are grouped by market type (MONEY_LINE, SPREAD, OVER_UNDER) and split into outcome one/two sides.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `bet_group` | string | No | Bet group filter. |
| `fixture_id` | string | Yes | Fixture ID from get_active_markets (e.g. 'L19606444'). |
| `market_hash` | string | No | Market hash to filter to a specific market within the fixture. Omitting returns all markets. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/sx-bet/get-order-book \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"bet_group":"<string>","fixture_id":"<string>","market_hash":"<string>"}'
```

### Get sports leagues

Returns all available sports and their active leagues on the SX Bet platform, including event counts per league. Use to discover league IDs for filtering active markets.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/sx-bet/get-sports-leagues \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
```

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