# NEAR AI Cloud (https://www.librechat.ai/docs/configuration/librechat_yaml/ai_endpoints/nearai)

NEAR AI Cloud provides an OpenAI-compatible endpoint that you can add to LibreChat through `endpoints.custom`.

## Get an API key

Create an API key from [NEAR AI Cloud](https://cloud.near.ai/). Add it to your `.env` file:

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

## Configuration

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

```yaml filename="librechat.yaml"
    - name: "nearai"
      apiKey: "${NEARAI_API_KEY}"
      baseURL: "https://cloud-api.near.ai/v1"
      models:
        default:
          - "z-ai/glm-5.2"
          - "deepseek-ai/DeepSeek-V4-Flash"
        fetch: true
      titleConvo: true
      titleModel: "z-ai/glm-5.2"
      modelDisplayLabel: "NEAR AI Cloud"
```

To let each user supply their own key through the LibreChat UI instead of reading one from `.env`, set `apiKey: "user_provided"`.

## Notes

- With `fetch: true`, LibreChat loads the model list from NEAR AI Cloud's OpenAI-compatible `/v1/models` endpoint. The `default` array is only the initial selection.
- Use model IDs exactly as they appear in the [NEAR AI Cloud model catalog](https://cloud-api.near.ai/v1/model/list).
- Model availability can change over time. If a selected model is unavailable, choose another chat-capable model from the catalog.
