LibreChat - Self-hosted multi-model conversation platform
Connect LibreChat to 58API through librechat.yaml.
The configuration method is different from that of ordinary clients
LibreChat’s custom service providers are mainly through the project root directory .env and librechat.yaml configuration. Docker deployments must also mount the YAML file to the API container.
LibreChat is a self-hosted, open source, multi-model conversation platform that supports connecting to OpenAI-compatible services through custom endpoints.
- Official website:https://www.librechat.ai
- Official documentation:https://www.librechat.ai/docs
- GitHub:https://github.com/LibreChat-AI/LibreChat
Preparation before use
- Installed and able to launch LibreChat.
- exist 58API Create API Key.
- Copy at least one exact model ID from the 58API model list.
- Ability to edit files in the LibreChat project root directory
.env、librechat.yaml;Docker users also need to editdocker-compose.override.yml。
File function
| document | effect |
|---|---|
.env | Save sensitive variables such as API Key |
librechat.yaml | Define 58API endpoint, Base URL and model |
docker-compose.override.yml | Mount YAML to the container during Docker deployment |
Step 1: Save API Key
in the project root directory .env Add in:
EIGHTYEIGHT_API_KEY=<your 58API API Key>Variable names cannot start with a number, so here we use EIGHTYEIGHT_API_KEY. Do not write the real key directly librechat.yaml, also don’t put .env Submit to public repository.
Step 2: Configure librechat.yaml
Create or edit in the project root directory librechat.yaml:
version: 1.3.17
cache: true
endpoints:
custom:
- name: "58API"
apiKey: "${EIGHTYEIGHT_API_KEY}"
baseURL: "https://api.58api.net/v1"
models:
default:
- "<exact model ID copied from the 58API model list>"
fetch: true
titleConvo: true
titleModel: "current_model"
modelDisplayLabel: "58API"Key fields:
| Field | illustrate |
|---|---|
name | The unique name of the endpoint that will be displayed in the selector |
apiKey | Quote .env variables in |
baseURL | https://api.58api.net/v1 |
models.default | Fill in at least one accurate model ID |
models.fetch | Whether to try to get the model list from the server |
modelDisplayLabel | The service provider name displayed next to the message |
Do not add provider: anthropopic
Even if you use the Claude model through 58API, this is still an OpenAI compatible interface and should be omitted provider。 provider: anthropic Only used in the native Anthropic Messages API and will change the request protocol.
If you want to use the native Messages protocol instead, please create another endpoint: Settings provider: anthropic,baseURL fill in https://api.58api.net(without /v1, Anthropic SDK will automatically add /v1/messages), and will models.fetch set to false, manually list the Claude model. Don't use /v1 Add to the baseURL at the end provider: anthropic, otherwise it will request /v1/v1/messages and returns 404.
Step 3: Docker mount configuration
Non-Docker local installations can skip this section. Docker users first copy the official example:
cp docker-compose.override.yml.example docker-compose.override.ymlconfirm docker-compose.override.yml of api Services include:
services:
api:
volumes:
- type: bind
source: ./librechat.yaml
target: /app/librechat.yamlIf the override file already has other services or mount items, please merge this configuration and do not overwrite the original content.
Step 4: Restart and verify
Docker deployment:
docker compose down && docker compose up -dNon-Docker local operation: Stop the current backend process, and then execute:
npm run backendOpen LibreChat, find 58API in the endpoint selector, select the model and send a test message. The request was subsequently confirmed in the 58API console usage logs.
The picture below shows the appearance of 58API in the endpoint selector after the configuration takes effect; the configuration entry is still the above .env、 librechat.yaml and Docker mounts instead of this menu. The screenshot shows the old interface (v0.7.5), and the endpoints of the current version are displayed in the form of an expandable model list.

Each user fills in his or her own Key
When deploying multiple users and do not want the administrator to save the Key uniformly, you can use:
apiKey: "${EIGHTYEIGHT_API_KEY}"Change to:
apiKey: "user_provided"The user then selects 58API in the model selector, clicks the gear icon next to it, and saves his or her 58API Key in the Set API Key/Set API Key dialog box; it can also be viewed or replaced later in Settings → Data & Privacy → API keys → Provider API keys.
Image understanding
Select a vision-capable model (for example deepseek-v4.1-flash) in the model list, upload an image in the input box, and ask—no extra config needed.
FAQ
58API does not appear in the endpoint selector
Check in order:
librechat.yamlIs the YAML indentation correct?.envWhether there is a corresponding variable;- Is Docker mounted?
/app/librechat.yaml; - Whether to restart LibreChat after modification.
Docker users can view:
docker compose logs apiGetting list of models is slow or fails
Will models.fetch Change to false, and in models.default Explicitly list the required models in . Official description fetch The default is false, it may increase the first loading time when enabled.
Should the complete completions address be written in the Base URL?
unnecessary. fill in https://api.58api.net/v1, LibreChat will automatically append /chat/completions. Only used when the service provider requires calling the complete endpoint directly directEndpoint: true, 58API is not required for regular configuration.
YAML validation failed
Do not bypass configuration validation. Check quotes, spaces, and array indentation, make sure endpoint names are unique, and confirm that the current LibreChat version supports the fields in the configuration.