# Chosic — 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 for songs on Chosic and discover similar tracks filtered by audio attributes like energy, happiness, danceability, and more. Returns song titles, artists, Spotify IDs, and thumbnail images.

**Category:** Music | **Website:** [chosic.com/](https://chosic.com/) | **Docs:** [parse.bot/marketplace/806b324e-026c-458f-a914-ea4f16830a62/chosic-com-api](https://parse.bot/marketplace/806b324e-026c-458f-a914-ea4f16830a62/chosic-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/chosic/`
**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 similar songs

Find similar songs for a given seed track. Provide either a Spotify track ID directly via `track_id`, or a `song_title` (optionally with `artist_name`) to resolve the seed track via search first. Supports mood-based filtering through optional audio feature parameters (energy, happiness, danceability, acousticness, instrumentalness, popularity) each on a 0-100 scale. Returns up to `limit` recommendations. Each result includes Spotify track ID, title, artist, album name, and image URL (image may be null).

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `acousticness` | integer | No | Target acousticness (0-100) |
| `artist_name` | string | No | Artist name combined with song_title to improve seed track search accuracy |
| `danceability` | integer | No | Target danceability (0-100) |
| `energy` | integer | No | Target energy level (0-100) |
| `happiness` | integer | No | Target happiness/valence (0-100) |
| `instrumentalness` | integer | No | Target instrumentalness (0-100) |
| `limit` | integer | No | Maximum number of similar songs to return |
| `popularity` | integer | No | Target popularity (0-100) |
| `song_title` | string | No | Song title used to search for the seed track when track_id is not provided |
| `track_id` | string | No | Spotify Track ID to find similar songs for. If not provided, song_title is used to search for the seed track. |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/chosic/get-similar-songs \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"acousticness":"<integer>","artist_name":"<string>","danceability":"<integer>","energy":"<integer>","happiness":"<integer>","instrumentalness":"<integer>","limit":"<integer>","popularity":"<integer>","song_title":"<string>","track_id":"<string>"}'
```

### Search songs

Full-text search for songs on Chosic. Matches against song titles and artist names. Returns up to `limit` results, each with a Spotify track ID, title, primary artist name, and thumbnail image URL. No pagination beyond the limit parameter.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `limit` | integer | No | Maximum number of results to return |
| `query` | string | Yes | Search keyword (song title, artist name, or both) |

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