LLegiScoreSearch API
Get an API key
Get started
IntroductionAuthenticationQuickstartSearch lifecycleErrorsWebhooksCreditsGet an API key
API reference
Credit balancegetCataloggetLookupsgetSearchespost
States
All states
View as Markdownllms-full.txt

Get started

Authentication

Send your API key on every request, either as a Bearer token or in an X-API-Key header. The key decides which workspace wallet pays.

Send the key

Keys start with lsk_. Use whichever header suits your client:

http
Authorization: Bearer lsk_your_api_key
# or
X-API-Key: lsk_your_api_key

What a key controls

PropertyBehaviour
WorkspaceA key belongs to one workspace. Searches it submits are charged to that workspace’s search wallet.
OwnerA key is tied to the workspace it was created in. It stops working when the person who holds it leaves the workspace.
Embed keysA key made for embedding can read results but cannot spend credits. Use a server key to submit searches.
RevocationA deactivated key is refused immediately with 401.
Rate limitsPer key. See Errors for the 429 response and Retry-After.
Domain-restricted keysIf the key has an allowed-domain list, requests must carry an Origin or Referer header from that domain. Use a key with no restriction for server-to-server calls.

When authentication fails

You get 401 and an error body:

json
{
  "error": {
    "code": "unauthorized",
    "message": "API key not found"
  }
}
messageMeaning
Invalid API key formatThe value does not look like an lsk_ key.
API key not foundNo such key. Check for a stray space or a revoked key.
API key is deactivatedThe key was switched off in the workspace.
Domain not allowedThe Origin does not match the key’s allowed domains.
Origin header required for domain-restricted keysAdd the header, or use an unrestricted key from your server.
Keep keys on your server
Never ship an lsk_ key in a browser or mobile app. Anyone holding it can spend your credits.

Need a key? See Get an API key. The only unauthenticated endpoint is the public catalog.

PreviousIntroductionNextQuickstart