> ## Documentation Index
> Fetch the complete documentation index at: https://docs.llmeasy.ru/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect Grok CLI to LLMEasy with a custom model

> Connect LLMEasy to Grok CLI with GPT Key group model IDs.

Grok CLI uses environment variables for API configuration. When connecting LLMEasy, use `https://www.llmeasy.ru/v1` and a model ID from the GPT Key group.

<Warning>
  Grok CLI is better suited to lightweight usage. For full agent workflows, prefer Claude Code, Codex, or OpenClaw.
</Warning>

## Prerequisites

* Node.js installed
* LLMEasy API Key (<a href={"https://www.llmeasy.ru/register"}>register here</a>)

## Install Grok CLI

```bash theme={null}
npm install -g @vibe-kit/grok-cli
```

## Setup

<Steps>
  <Step title="Clear conflicting environment variables">
    ```bash theme={null}
    unset OPENAI_API_KEY
    unset OPENAI_BASE_URL
    ```
  </Step>

  <Step title="Set LLMEasy environment variables">
    ```bash theme={null}
    export GROK_BASE_URL="https://www.llmeasy.ru/v1"
    export GROK_API_KEY="YOUR_API_KEY"
    ```
  </Step>

  <Step title="Start Grok CLI with a model">
    ```bash theme={null}
    grok --model YOUR_GPT_MODEL_ID
    ```

    Replace `YOUR_GPT_MODEL_ID` with a current **GPT Key group** model ID copied from the <a href={"https://www.llmeasy.ru/pricing"}>model plaza</a>.
  </Step>

  <Step title="Restart Grok CLI">
    After changing the environment variables, close the current Grok CLI session and start the tool again.
  </Step>
</Steps>

<Note>
  We did not find an official Grok CLI setup requirement that makes `User-Agent` mandatory for LLMEasy. Check the environment variables, model ID, and tool version first; only add headers when your upstream gateway explicitly requires them.
</Note>

## Related FAQ

* [OpenAI-compatible API vs Anthropic-compatible API](/en/faq/concepts/openai-compatible-vs-anthropic-compatible)
* [MCP vs API Key and Base URL](/en/faq/concepts/mcp-vs-api-key-base-url)
* [What are model\_provider, base\_url, and wire\_api?](/en/faq/codex/model-provider-base-url-wire-api)
* [How to configure an OpenAI-compatible API in Cline](/en/faq/cline/openai-compatible-api)
