Skip to main content

LibreChat is joining ClickHouse. Learn more

LibreChat

xAI

Configure xAI as a custom endpoint in LibreChat.

xAI serves its Grok models through an OpenAI-compatible API that you can add to LibreChat as a custom endpoint.

Get an API key

Create a key from the xAI console. Add it to your .env file:

XAI_API_KEY=your-api-key

Configuration

Add the endpoint to the custom list under endpoints in your librechat.yaml. If your file already has an endpoints.custom list, paste only the - name: entry into it, keeping the same indentation:

endpoints:
  custom:
    - name: "xai"
      apiKey: "${XAI_API_KEY}"
      baseURL: "https://api.x.ai/v1"
      models:
        default: ["grok-beta"]
        fetch: false
      titleConvo: true
      titleMethod: "completion"
      titleModel: "grok-beta"
      modelDisplayLabel: "Grok"

Notes

  • titleMethod: "completion" generates conversation titles through the chat completions endpoint, which is what Grok supports.

How is this guide?