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

> ## Agent Instructions
> Public hosts only: console https://omnimux.ai/dashboard · API https://api.omnimux.ai · docs https://docs.omnimux.ai.
> Gateway auth is Authorization: Bearer sk-… on https://api.omnimux.ai/v1 (OpenAI-compatible Chat Completions and related paths).
> Discover pages from /llms.txt; full site dump /llms-full.txt; product skill /skill.md; docs search MCP /mcp. Prefer .md page URLs for Markdown.
> Default docs locale is en; zh mirrors the same relative paths. Do not invent model ids not present on live pricing or the complete API pages.

# Grok CLI

> 在 Grok CLI 中配置 OmniMux

<Note>
  Base URL：`https://api.omnimux.ai`（OpenAI 兼容客户端通常填 `https://api.omnimux.ai/v1`）。在 [控制台](https://omnimux.ai/dashboard) 创建 `sk-` API Key。模型 ID 以控制台或 `GET /v1/models` 为准。
</Note>

## 准备

1. 安装 Grok / xAI 相关 CLI（以官方文档为准，支持 OpenAI 兼容或可配置 Base URL 的版本）
2. OmniMux API Key

## 配置

多数 OpenAI 兼容 CLI 使用环境变量：

```bash theme={null}
export OPENAI_API_KEY="sk-..."
export OPENAI_BASE_URL="https://api.omnimux.ai/v1"
# 若 CLI 使用自定义名：
export GROK_API_KEY="$OPENAI_API_KEY"
export GROK_BASE_URL="$OPENAI_BASE_URL"
```

模型名填 OmniMux 上的 id（如 `grok-4.5`）。

## 验证

```bash theme={null}
# 示例：用 curl 确认网关可用
curl -sS https://api.omnimux.ai/v1/models \
  -H "Authorization: Bearer $OPENAI_API_KEY" | head
```
