Get an API key

Mint a paper key on staging, run a real call from this site, then run the same call from the SDK.

This is the shortest path from nothing to a 200. It uses staging and a paper key throughout, so every step is safe to run while you read.

Step 0 — call the API before you have a key

GET /api/v1/markets needs no authentication. Open it in the reference and press send:

Or from a terminal:

$curl "https://staging.drazill.com/api/v1/markets?limit=3"

If that returns markets, your network path is fine and everything below is about authentication, not connectivity.

Step 1 — mint a drzl_test_ key

Sign in to the developer dashboard on staging and create a key with environment: "test":

The same thing over HTTP:

POST /api/v1/api-keys
1{ "name": "My integration (sandbox)", "environment": "test" }

Three things to know before you click:

  • The secret is shown once. Store it immediately; it is never retrievable again. If you lose it, rotate the key rather than creating a new one.
  • New keys are read-only by default. Write scopes (orders:write, wallet:write, …) must be requested explicitly and acknowledged with acknowledge_write_scopes: true, and they require a verified email on the account.
  • The sandbox is on for staging. Test keys are mintable there today (DEVELOPER_SANDBOX_ENABLED defaults on for staging and development). On production it is off, so production mints live-class keys only. See Sandbox.

A drzl_live_ key trades real money. Never paste one into this site, a browser, a shared notebook, or any client you do not control. Everything on this page uses a drzl_test_ paper key against staging.

Step 2 — authenticate the Explorer

On any operation page, open the Explorer’s auth panel and paste the key as X-API-Key. Fern stores it client-side for your session only. Confirm the environment dropdown reads Staging — it is the only environment offered, so a real-money call cannot be issued from this site at all.

Now run an authenticated read:

$curl -H "X-API-Key: $DRAZILL_API_KEY" \
> https://staging.drazill.com/api/v1/auth/me

That is the smallest possible proof your key works. If it returns 401, the key is wrong or revoked; if it returns 403, the key is valid but lacks the scope.

Point a test key at a real-money endpoint and you get 403 TEST_KEY_LIVE_ENDPOINT. That is the guardrail working, not a misconfiguration — a paper key can never move real funds.

Step 3 — the same call from the SDK

Install the official client for your language. Both packages are named drazill:

$pip install drazill # PyPI
$npm install drazill # npm

Then list markets — this is the exact code from the SDK’s tested quickstart:

1client = DrazillClient(api_key=API_KEY, base_url=BASE_URL)
2print(f"→ Drazill API @ {BASE_URL}\n")
3
4# 1) List a page of open markets.
5page = client.markets.list_markets(status="ACTIVE", limit=5, sort_by="volume")
6print(f"Open markets ({page.total} total, showing {len(page.items)}):")
7for m in page.items:
8 print(f" • {m.title}")
9 print(f" id={m.id} slug={m.slug} volume={m.total_volume}")

An unconfigured client already points at staging, so there is no base URL to set while you are testing. Set DRAZILL_BASE_URL (or pass base_url= / baseUrl) when you move to another environment.

Step 4 — place a paper trade

With a drzl_test_ key, the ordinary trading endpoints route onto the paper engine — your production code path is unchanged, only the key differs. Paper orders run on the real LMSR pricing engine against isolated virtual balances, so what you observe is what you get live.

Walk that path on Quickstart, and read Paper vs live for exactly what is and isn’t shared between the two.

Where to go next