How do I create and use a Leiolai API key?
In the Leiolai web app, open Account, More, Leiolai API, Manage keys. Choose Unrestricted, Private only, or Research only access. A new key is shown once. Keep the key secret and send the authentication header required by your chosen API format.
Read the Leiolai API reference
Where do I create a key?
In the Leiolai web app, open Account, More, Leiolai API, Manage keys. Create the key for the application you are connecting. A newly created key is shown once, so save the value securely when creating the key.
Which key restriction should I choose?
When creating a Leiolai API key, choose Private only for confidential work, Research only for non-sensitive Research requests, or Unrestricted when your application selects the mode on every request. A restricted key can omit mode because the key already specifies the permitted mode.
How mode restrictions workHow do I use the key in OpenAI-compatible requests?
Send Authorization: Bearer followed by your Leiolai sb_ key. For an OpenAI-style SDK, set base_url to https://api.leiolai.com/v1 and model to leiolai-1.
Start with Chat CompletionsHow do I use the key in an Anthropic SDK?
Set the SDK’s base URL to https://api.leiolai.com and provide your Leiolai key. Direct Messages requests use x-api-key plus anthropic-version: 2023-06-01. Keep the base URL appropriate to the SDK so the SDK adds the endpoint path correctly.
Use the Messages formatWhere should an application keep the API key?
Keep the key on a backend you control. A frontend can call your backend, which sends the authenticated request to Leiolai. Use your deployment’s secret settings or environment variables, and leave real keys out of source code, screenshots, shared configuration examples, and browser JavaScript.
Why does a valid key return a mode error?
An unrestricted Leiolai key needs mode on every request. A restricted key rejects a conflicting mode with HTTP 403. For example, a Leiolai Private-only key cannot request non-private. Correct the request’s mode or use a key with the appropriate permission.
Why does a key return a balance or budget error?
HTTP 402 can mean the Leiolai account has insufficient balance, an API budget has been reached, or an account with auto reload enabled needs a budget. Read the specific error code, then update the balance or budget in your Leiolai account.
Match API errors to the right actionCan I use the same setup in a third-party chat client?
Clients that accept an OpenAI-compatible provider generally need the /v1 base URL, API key, and leiolai-1 model ID. A Leiolai Private-only key can omit the mode field. Follow the guide for that client’s own settings and request format.
Set up Open WebUI Set up Continue