Skip to main content
Every request carries one credential: your API key, sent as an Authorization: Bearer header. The same key works across every surface of the API.

Get an API key

Create a key on the Projects page in the dashboard. How to set up walks through it: start a new project, then choose Generate key. Copy the key while the dialog shows it, because it appears only once.

Send the key

Set the key in your environment, then send it as a bearer token on every request:
Over WebSocket, send the same header in the connection upgrade request. WebSockets vs HTTP covers when to use each. Regional hosts take the same key. Swap api.slng.ai for a regional base URL such as eu-west.api.slng.ai to run the request in that region.

Where the key works

The API key authenticates every SLNG surface: The Batch API also accepts the key in an X-API-Key header, which is equivalent to the bearer header. Keys start with slng_cu_ for consumer keys or slng_bt_ for batch keys.

Keep keys safe

  • Store the key in a secret manager or an environment variable. Keep it out of source control and browser code.
  • Set an expiration when you create a key, and rotate by generating a new one.
  • To revoke a leaked key, delete it in the dashboard and issue a replacement.
Provider keys for bring your own key are separate. You manage those in the dashboard and still authenticate to SLNG with your SLNG API key.

When authentication fails

A request without a valid key returns 401 with the standard error body. See Error codes for the shape and the full list.