Apps and SDKs
LibreChat
In short: LibreChat supports the gateway as a custom endpoint in librechat.yaml, with the key in .env and the model list fetched from the API.
On this page
LibreChat is an open-source, self-hosted chat interface for teams, configured with a librechat.yaml file next to its .env. The gateway goes in as a custom endpoint, so everyone on your LibreChat instance can use every model your key allows, without each person holding a provider key. Checked against LibreChat v0.8.x and its custom endpoint reference (October 2026).
You need an API key from API keys and this base URL:
Base URLhttps://api.oneaiapikey.com/v1
How do I add the endpoint to LibreChat?
Four steps add the gateway as a custom endpoint in LibreChat.
-
Put the key in LibreChat’s
.envfile:ONEAIAPIKEY_API_KEY=<your One AI API Key key> -
Add the endpoint under
endpoints.custominlibrechat.yaml. Keep the rest of your file as it is.endpoints: custom: - name: "One AI API Key" apiKey: "${ONEAIAPIKEY_API_KEY}" baseURL: "https://api.oneaiapikey.com/v1" models: default: ["z-ai-glm-5.3-flash:free", "qwen-qwen3.8-27b:free"] fetch: true titleConvo: true titleModel: "z-ai-glm-5.3-flash:free" modelDisplayLabel: "One AI API Key" -
Restart LibreChat. With Docker, make sure
librechat.yamlis mounted into the container (LibreChat’s docs use adocker-compose.override.ymlfor this). Changes to the YAML file only apply after a restart. -
Choose One AI API Key in the endpoint menu, pick a model and send a message. The request shows up on your usage page.
What do the endpoint settings do?
Each setting in the YAML entry controls one part of how LibreChat uses the gateway.
nameis the label in LibreChat’s endpoint selector. It must be unique and must not be a built-in endpoint name such asopenAIoranthropic.apiKey: “${ONEAIAPIKEY_API_KEY}”reads the key from.env, so it never sits in the YAML file. Set it to"user_provided"instead if each LibreChat user should paste their own One AI API Key key.baseURLmust end in/v1. LibreChat adds/chat/completionsitself.fetch: trueloads the model list fromGET /v1/models, so it shows exactly the models the key can use.defaultis the list shown if fetching fails.titleModelis the model that names each conversation. A fast, cheap model is enough, and it saves money on every new chat because the title request runs once per conversation.modelDisplayLabelis the name shown next to replies.
Can LibreChat use Claude through the Anthropic format?
Yes, as an optional second endpoint. LibreChat can also call a custom endpoint with Anthropic’s own Messages format by setting provider: "anthropic". The gateway accepts that format for Claude models at the base URL without /v1, because the client adds /v1/messages itself. Add it as a second entry under endpoints.custom:
- name: "One AI API Key Claude"
provider: "anthropic"
apiKey: "${ONEAIAPIKEY_API_KEY}"
baseURL: "https://api.oneaiapikey.com"
headers:
anthropic-version: "2023-06-01"
models:
default: ["qwen-qwen3.8-27b:free", "z-ai-glm-5.3-flash:free"]
fetch: false
titleConvo: true
titleModel: "z-ai-glm-5.3-flash:free"
modelDisplayLabel: "One AI API Key Claude"- Only Claude model ids work on this endpoint. List them under
default; LibreChat does not fetch the model list for Anthropic-format endpoints. - This is the only format in which Claude prompt caching can apply. Through chat completions the gateway translates the request and caching markers are not carried over (see Prompt caching).
How do I fix common LibreChat errors?
Most LibreChat errors come from the YAML file, the key or the base URL.
- The endpoint does not appear: LibreChat did not load the file. Check its startup log for YAML errors (indentation is the usual cause) and that the file is mounted.
- The model list is empty: the key is not valid, or it has a model list that limits what it can see. Check the key with the request on Authentication. Paid models are listed before a top-up, but return
402with codepaid_needs_deposituntil you add $1 or more (see Errors). - 401 errors: the variable name in
apiKeydoes not match the one in.env, or the key was revoked or has expired. - A model fails with 403: the key’s model list does not include it, or your balance is empty. See Errors.
- 404 on every request:
baseURLends in/chat/completionsor lacks/v1. On the Anthropic entry it is the other way round: no/v1.