$EDEL_API_URL and the key from
$EDEL_API_KEY. Set EDEL_API_URL to the REST base URL the introduction lists.
1. Get a key with the device grant
An API key is issued through the agent-connect device grant (the RFC 8628 shape). The program starts the grant, a human approves it once in the browser, and the program collects the key. All three routes are public; the key is the credential every step after this uses.1
Start the grant
Call The response carries the codes and the poll schedule:
POST /v1/agent-connect/start with a client name and the scopes you need. No
credential is required yet.2
Have the owner approve it
Show the owner
verificationUrl and userCode. The owner opens the page (the Demo
/connect-agent page), signs in with a passkey, checks that the code and scopes match
what you asked for, and approves. Approval is a passkey call to
POST /v1/accounts/:accountId/agent-connect/approve; the owner makes it in the browser,
not you. An approval can never grant more than the page showed.3
Collect the key
Poll The poll answers one of four states:Store
POST /v1/agent-connect/complete with your connectCode every intervalSeconds.
Start polling right after step 1, because the owner may approve before you show the code
again.The
approved answer returns the key exactly once:apiKey in a private file only your process can read. It is never returned again.
Never put it in a command-line argument, a log line or a chat message.2. Authenticate every request
Send the key as a bearer on every private request:GET /v1/api-keys/current:
Protect the key: it can trade this account. It can never deposit, withdraw or change the
Canton Party; those stay behind the owner’s passkey session. See
Authentication models for the guarantee that bounds a key.
3. Place and cancel orders
Placing and cancelling both need thetrade scope, and both take an Idempotency-Key header:
reuse the same value on every retry of one call, so a lost response never places or cancels
twice. A placed order also carries a clientOrderId in its body; choose it once for the logical
order and keep it stable across retries. A cancel body names only the owned account and market.
Place an order with POST /v1/orders. A limit order carries orderType limit, a price
and a quantity as decimal strings; side is buy or sell:
POST /v1/orders/:orderId/cancel. The
body names the owned account and market. An exact replay with the same Idempotency-Key
returns the original decision; a later cancel with a new key returns not_found:
reduceOnly, and attached take-profit and
stop-loss (autoClose).
4. Stream the book and your fills over WebSockets
Live data is pushed over the WebSocket at/streams/v1/ws. Edel has no webhooks, and REST
polling does not scale, so a market maker reads state from the socket.
- Market channels are open. Connect and subscribe to
market.bookandmarket.trades(andmarket.ticker,market.funding, and the rest) with no credential. - Account channels need a ticket. Your own events arrive on
account.orders,account.fills,account.positionsandaccount.balance. Mint a short-lived, account-scoped ticket with your key (POST /v1/realtime/ticket,readscope), present it on the socket, then subscribe. The ticket, not the key, travels on the connection, so a long-lived socket never parks your key.
Optional: the MCP server
An AI agent can reach the venue through the Edel Model Context Protocol server, which authenticates with an API key from the same device grant and exposes trading tools. It is optional. A market maker does not need it: the REST and WebSocket path above is the complete integration. Reach for the MCP server only when you want an LLM-driven agent to hold the tools directly.Renew and revoke
An agent key expires (24 hours by default). To renew, run the device grant again and have the owner approve a fresh key; there is no self-service rotation for an agent key. The owner can revoke a key at any time with their passkey session. A refused key answers401; connect
again. See Authentication models for the full lifecycle and the
security guardrail that bounds a key to reading and trading.