58API Help Center58API Help Center
User GuideAI ApplicationsAPI DocumentationHelp & Support

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.

Preparation before use

  1. Installed and able to launch LibreChat.
  2. exist 58API Create API Key.
  3. Copy at least one exact model ID from the 58API model list.
  4. Ability to edit files in the LibreChat project root directory .env、librechat.yaml;Docker users also need to edit docker-compose.override.yml。

File function

documenteffect
.envSave sensitive variables such as API Key
librechat.yamlDefine 58API endpoint, Base URL and model
docker-compose.override.ymlMount 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:

Fieldillustrate
nameThe unique name of the endpoint that will be displayed in the selector
apiKeyQuote .env variables in
baseURLhttps://api.58api.net/v1
models.defaultFill in at least one accurate model ID
models.fetchWhether to try to get the model list from the server
modelDisplayLabelThe 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.yml

confirm docker-compose.override.yml of api Services include:

services:
  api:
    volumes:
      - type: bind
        source: ./librechat.yaml
        target: /app/librechat.yaml

If 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 -d

Non-Docker local operation: Stop the current backend process, and then execute:

npm run backend

Open 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.

58API appears in endpoint selector after LibreChat restarts

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:

  1. librechat.yaml Is the YAML indentation correct?
  2. .env Whether there is a corresponding variable;
  3. Is Docker mounted? /app/librechat.yaml;
  4. Whether to restart LibreChat after modification.

Docker users can view:

docker compose logs api

Getting 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.

official basis