Licensing and Machine Access
Last updated: August 24, 2026
CortexDJ is DJ software that turns a folder of tracks into a finished set. It finds the beatgrid, the musical key and the energy of every track, works out an order that holds together harmonically and rhythmically across an energy arc, and renders the transitions.
This page is about the other way in. The part that decides what follows what, and how is available as an API, priced per call and paid in stablecoin over x402. It is meant for programs — an agent building a playlist, a music tool that needs a running order, a service that has track metadata and wants a DJ's answer about it.
What is for sale
| Endpoint | Price | What you get |
|---|---|---|
POST /api/agent/setlist |
$0.05 | Up to 120 tracks ordered into a set. You send [{id, bpm, key, energy}]; you get the running order, the cost of every adjacent transition, a recommended transition style and length for each, and the energy arc the ordering was fitted to. |
POST /api/agent/compator GET |
$0.01 | One pair. The harmonic distance on the Camelot wheel, the tempo gap, the target BPM, how far the incoming track must stretch to reach it, and the transition style that fits. |
GET /api/agent/manifest |
free | The catalogue: prices, the engine's weights and cost table, and what it will not do. |
GET /.well-known/x402 |
free | Machine discovery — network, asset, receiving address, offers. |
Discovery is free on purpose. An agent cannot decide to buy something it cannot see the shape of.
What the engine actually does
It is not a sort. Ordering a set is a routing problem: every possible neighbour pair has a cost, and the set is the cheapest walk through all of them. CortexDJ minimises
w_harmonic · camelot_distance(a, b) + w_bpm · tempo_gap(a, b) over adjacent pairs
w_energy · |track_energy − arc(position)| over positions
with harmonic = 1.0, bpm = 0.6, energy = 0.8, searched by greedy nearest-neighbour seeded from every possible opener and then refined by 2-opt. arc is the shape of a set that works: warm up, peak at about 78% of the way through, come down a little rather than all the way. Harmony is weighted highest deliberately — a key clash is the one mistake a listener hears immediately.
The Camelot costs are published in the manifest, so you can reproduce the result or argue with it: same key 0, relative major/minor 0.05, perfect fifth 0.12, diagonal 0.35, whole step 0.5, clash 0.85. An unknown key costs 0.7 — below a clash, because a key we do not know should not be treated as worse than one we know is wrong.
Identical input returns an identical ordering. Ties break on track id, so the order you submit tracks in does not change what comes back.
What it will not do
These need the waveform, and are absent rather than approximated:
- beatgrid and downbeat detection
- key and energy detection from audio — you supply those, or the ordering falls back to what it has
- cue points and structural analysis, which is what tells the app whether two drops line up
- the rendered mix itself
That last one has a consequence worth stating plainly: the app chooses a double drop when two drops align, and an echo out when the incoming track opens with a vocal. Neither can be decided from BPM and key, so the API does not offer them. A guessed double drop is not a slightly worse answer — it is two drops landing on top of each other.
Paying
The flow is the x402 v2 standard one, and any x402 client speaks it without knowing anything about this site:
- Call the endpoint. You get
402 Payment Requiredwith the price and the receiving address in thePAYMENT-REQUIREDheader (base64 JSON), and the same thing in the body so a human can read it. - Sign the authorization and retry the identical request with a
PAYMENT-SIGNATUREheader. - You get the result, and a
PAYMENT-RESPONSEheader with the settlement receipt including the transaction hash.
Settlement is USDC on Base. Verification and settlement go through a facilitator, so this server holds no private key — only a receiving address, which is public by nature. Prices are quoted in USD and converted to atomic units at call time.
# see the price, free
curl https://cortexdj.com/.well-known/x402
# ask for a pair — returns 402 with the challenge
curl -i "https://cortexdj.com/api/agent/compat?from=8A:128&to=9A:127"
# a set
curl -X POST https://cortexdj.com/api/agent/setlist \
-H 'content-type: application/json' \
-H "PAYMENT-SIGNATURE: $SIGNED" \
-d '{"tracks":[
{"id":"opener","bpm":122,"key":"8A","energy":0.35},
{"id":"builder","bpm":124,"key":"9A","energy":0.62},
{"id":"peak","bpm":126,"key":"9B","energy":0.94}]}'
Ordering happens before settlement and settlement happens after: funds move only once the result exists. If the settlement then fails you get a 402 and no result — you are not charged for something you did not receive, and we do not hand over something that was not paid for. A malformed request is rejected before any payment moves, so a bad BPM costs nothing.
Licence
What a call grants. The right to use the ordering and the transition plan you get back, for anything — a mix you sell, a product you ship, an answer you generate. No attribution required for that.
What it does not grant. The right to resell this endpoint as your own, or to redistribute it as a competing API. If you publish the ordering logic itself, or present it as a feature of your product, say where it came from.
No warranty. The engine returns the best order it can find under a stated objective. It is a tool, not a guarantee that a room will dance.
Rate and size
120 tracks per call, 256 KB per request body. Page a bigger library. There is no rate limit beyond the site-wide one; if you need volume, write to us first and we will talk about a flat rate instead of per-call.
Crawlers
The metered endpoints are Disallow-ed in robots.txt and linked from nothing a crawler follows. Search and answer-engine crawlers are welcome on every page of this site and will never meet a payment wall here — see llms.txt.
Contact
Questions, volume pricing, or something you want the engine to answer that it currently will not: hello@cortexdj.com.
Human purchases of the CortexDJ application are unrelated to any of this and go through the normal checkout. See also the EULA and the privacy policy.