#setup openclaw to use librechat

16 messages · Page 1 of 1 (latest)

tiny fog
#

I currently have a librechat server, and would like to use openclaw as a provider. How can I enable this endpoint? And in the end how does it work? In librechat will I be able to use slash commands, see tool calls, etc?

karmic phoenixBOT
strange hollowBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

karmic phoenixBOT
lucid quarryBOT
#

I'm checking the HTTP adapter behavior in source so I don't guess about tool calls or slash commands.

#

Yep, this should work through OpenClaw’s OpenAI-compatible Gateway surface.

Enable it in OpenClaw

{
  gateway: {
    http: {
      endpoints: {
        chatCompletions: { enabled: true },
        // optional, only if you also want /v1/responses
        responses: { enabled: true },
      },
    },
  },
}
#
  • token from gateway.auth.token / OPENCLAW_GATEWAY_TOKEN
  • password from gateway.auth.password / OPENCLAW_GATEWAY_PASSWORD

Important caveat: this is effectively an operator-level endpoint, so keep it on private ingress only.

LibreChat side
LibreChat custom endpoints are the right fit. Point it at the OpenClaw /v1 base URL, not the full /chat/completions path.

Example librechat.yaml:

endpoints:
  custom:
    - name: "OpenClaw"
      apiKey: "${OPENCLAW_GATEWAY_TOKEN}"
      baseURL: "http://<gateway-host>:<port>/v1"
      models:
#
        default: ["openclaw/default"]
        fetch: true
      modelDisplayLabel: "OpenClaw"

Notes:

  • LibreChat custom endpoint docs say it appends /chat/completions by default, so /v1 is the right base.
  • GET /v1/models should return openclaw, openclaw/default, and openclaw/<agentId>.
  • In OpenClaw, the OpenAI model field is agent selection, not backend provider model selection.

So use:

  • openclaw/default, or
  • openclaw/<agentId>

How it behaves in practice

  • LibreChat will most likely use GET /v1/models plus POST /v1/chat/completions.
#
  • OpenClaw executes that as a normal agent run internally.
  • So the selected agent can still use its own tools, policies, and routing.

But for your specific questions:

  • Slash commands?
    Probably no, not as OpenClaw slash commands. Those are native OpenClaw/chat-surface features, not part of the OpenAI-compatible HTTP API.

  • See tool calls?
    For POST /v1/chat/completions, also probably no. The compat endpoint returns normal assistant text, not OpenClaw’s internal tool trace. So LibreChat should behave more like a standard chat frontend than an OpenClaw-native UI.

  • What about /v1/responses?
    OpenClaw does support it, and that endpoint does support client-side function tools / function_call items. But I did not find evidence that LibreChat custom endpoints use /v1/responses by default. Their custom endpoint docs describe the /chat/completions flow.

So my recommendation is:

  1. Enable gateway.http.endpoints.chatCompletions.enabled: true
#
  1. Point LibreChat custom endpoint to http://<gateway-host>:<port>/v1
  2. Use openclaw/default as the model
  3. Expect working chat through OpenClaw agents, but not native OpenClaw slash-command UX or full internal tool-call visibility

If you want, I can also sketch a complete OpenClaw + LibreChat config example for Docker or bare metal.

tiny fog
#

How about librechat params titleModel, if I have openrouter setup as another provider in librechat, can I use that instead of openclaw for titleModel?

lucid quarryBOT
#

I'll verify the titleModel / titleEndpoint behavior in LibreChat docs so I can give you the exact answer.

#

Yes, but not with titleModel alone.

If your OpenClaw custom endpoint is the chat endpoint, then:

  • titleModel by itself uses the same endpoint
  • so if you want titles generated by OpenRouter instead of OpenClaw, set titleEndpoint to your OpenRouter custom endpoint name, then set titleModel to an OpenRouter model

Example:

endpoints:
  custom:
    - name: "OpenClaw"
      apiKey: "${OPENCLAW_GATEWAY_TOKEN}"
      baseURL: "http://<gateway-host>:<port>/v1"
      models:
#
        default: ["openclaw/default"]
        fetch: true
      titleConvo: true
      titleEndpoint: "OpenRouter"
      titleModel: "openai/gpt-4o-mini"

    - name: "OpenRouter"
      apiKey: "${OPENROUTER_KEY}"
      baseURL: "https://openrouter.ai/api/v1"
      models:
        fetch: true
        default: ["openai/gpt-4o-mini"]

So the rule is:

#
  • same endpoint for titles → just set titleModel
  • different provider/endpoint for titles → set both titleEndpoint + titleModel

LibreChat docs mention exactly this “use a different custom endpoint for titles” pattern:
https://www.librechat.ai/docs/configuration/librechat_yaml/object_structure/custom_endpoint

If you want, I can write the full LibreChat config block for:

  • OpenClaw for chats
  • OpenRouter for titles
  • and optionally OpenRouter for summaries too