API keys
Create and revoke the keys your integration sends to the Data API, and read their usage, under My organization on the Moonlit platform.
Enable your organization
The Data API is enabled per organization, agreed with our team; see Get access. Once agreed, three steps hand key management to you:
- Sign in at app.moonlit.ai with the account that will manage the keys. Signing in creates the account if you do not have one.
- Tell us which account signed in, at support@moonlit.ai.
- We assign your organization to that account. From then on it manages keys and roles itself.
Who can manage keys
Your organization's Owner, or a member with the Developer role, creates and revokes keys and calls the Data API. Owners and members with the Admin role change a member's role under My organization.
Generate a key
- Open My organization on the Moonlit platform.
- Choose Data API, then Keys.
- Click Generate key.
- Copy the key now; the platform shows it once. Keys start with
mdk_live_.
Each key belongs to one region, Europe or United States. The key list shows its region, who created it, its use, its last use and its limit.
Send the key on every request as a Bearer token:
Authorization: Bearer YOUR_API_KEYThe Data API quickstart takes the key to a first result in two requests.
Regions
Keys in Europe call https://api.moonlit.ai. Keys in the United States call https://us.api.moonlit.ai. The US deployment serves the Data API only, under an enterprise agreement. Where each deployment processes data is listed under Sub-processors and Sub-processors, US deployment.
Revoke a key
Open Keys and click Revoke on the key. Requests that still carry it return 401. To rotate a key without downtime, generate the new key first, switch your service to it, then revoke the old one.
Usage
The Usage tab shows calls and units per key or per endpoint, for a region and a date range. A call is any request. A unit is a call that counts toward your usage and your invoice. Searches and document retrievals are one unit per call.
These endpoints are calls with zero units:
- Every filter endpoint: documenttypes, jurisdictions_portals, trees, sources and semantic_portals.
- articles, the article-level structure of a document.
Your plan's monthly allowance counts units. When it is used up, every request returns 429; see Errors. Calls from the Try it panel on the reference count like any other call.
Where next
- The quickstart runs a first search and reads a document with your key.
- The reference documents every endpoint, parameter and response field.