# Moonshot (https://www.librechat.ai/docs/configuration/librechat_yaml/ai_endpoints/moonshot)

Moonshot AI serves its Kimi 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 [Moonshot platform](https://platform.moonshot.ai). Add it to your `.env` file:

```bash filename=".env"
MOONSHOT_API_KEY=your-api-key
```

## Configuration

Add the endpoint under `endpoints.custom` in your `librechat.yaml`:

```yaml filename="librechat.yaml"
    - name: "Moonshot"
      apiKey: "${MOONSHOT_API_KEY}"
      baseURL: "https://api.moonshot.ai/v1"
      models:
        default: ["kimi-k2.5"]
        fetch: true
      titleConvo: true
      titleModel: "current_model"
      modelDisplayLabel: "Moonshot"
```

## Notes

- For models with reasoning capabilities such as `kimi-k2.5` and `kimi-k2-thinking`, the endpoint `name` must be set to `"Moonshot"` (case-insensitive) for interleaved reasoning to work with tool calls. A different name causes errors like `thinking is enabled but reasoning_content is missing in assistant tool call message`. See [Moonshot's documentation](https://platform.moonshot.ai/docs/guide/use-kimi-k2-thinking-model#frequently-asked-questions) for details.
