> ## 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.

# Grok CLI 自定义模型接入 LLMEasy 指南

> 在 Grok CLI 中使用 LLMEasy，接入 GPT 分组模型。

Grok CLI 通过环境变量配置 API 地址和 Key。接入 LLMEasy 时，请使用 `https://www.llmeasy.ru/v1`，并指定 GPT 分组模型 ID。

<Warning>
  Grok CLI 更适合轻量场景。如需完整 Agent 工作流，优先使用 Claude Code、Codex 或 OpenClaw。
</Warning>

## 前置条件

* 已安装 Node.js
* 已获取 LLMEasy API Key（<a href={"https://www.llmeasy.ru/register"}>注册并获取</a>）

## 安装 Grok CLI

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

## 配置步骤

<Steps>
  <Step title="清除冲突的环境变量">
    ```bash theme={null}
    unset OPENAI_API_KEY
    unset OPENAI_BASE_URL
    ```
  </Step>

  <Step title="设置 LLMEasy 环境变量">
    ```bash theme={null}
    export GROK_BASE_URL="https://www.llmeasy.ru/v1"
    export GROK_API_KEY="YOUR_API_KEY"
    ```
  </Step>

  <Step title="启动 Grok CLI 并指定模型">
    ```bash theme={null}
    grok --model YOUR_GPT_MODEL_ID
    ```

    将 `YOUR_GPT_MODEL_ID` 替换为从<a href={"https://www.llmeasy.ru/pricing"}>模型广场</a>复制的 **GPT 分组模型 ID**。
  </Step>

  <Step title="重启 Grok CLI">
    修改环境变量后，请关闭当前 Grok CLI 会话，并重新启动命令行工具。
  </Step>
</Steps>

<Note>
  目前我们没有查到 Grok CLI 官方接入说明要求 LLMEasy 额外配置 `User-Agent`。优先检查环境变量、模型 ID 和工具版本；只有当你额外接入的上游网关明确要求 headers 时，再按其文档补充。
</Note>

## 相关 FAQ

* [OpenAI-compatible API 和 Anthropic-compatible API 有什么区别？](/zh/faq/concepts/openai-compatible-vs-anthropic-compatible)
* [MCP 和 API Key / Base URL 有什么区别？](/zh/faq/concepts/mcp-vs-api-key-base-url)
* [Codex CLI 中 model\_provider、base\_url 和 wire\_api 是什么？](/zh/faq/codex/model-provider-base-url-wire-api)
* [Cline 如何配置 OpenAI-compatible API？](/zh/faq/cline/openai-compatible-api)
