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

# Grok

> Route Grok through the Inference.net gateway with inf grok.

`inf grok` routes Grok through `https://api.inference.net/v1` using the chat completions surface. Grok stores one `[model.*]` section per registered model, with ids prefixed `inference-` so they cannot collide with your own entries.

## Config file

`inf` writes fields in `~/.grok/config.toml` (TOML). `inf` owns fields, not the whole file.

## `inf grok on`

<Metadata text="cli/coding-agents/grok/on-default[series=coding_agents_grok]" />

```bash theme={"system"}
inf grok on
```

| Flag              | Required | Description                  | Default        |
| ----------------- | -------- | ---------------------------- | -------------- |
| `--model <alias>` | No       | Default Grok model selection | `kimi-k3-fast` |

See [Model mapping](/cli/coding-agents#model-mapping) for supported aliases and limits.

## What gets written

`inf` writes one `[model.inference-<alias>]` section per registered model with `model`, `base_url = "https://api.inference.net/v1"`, `api_key`, `api_backend = "chat_completions"`, `context_window`, and `name`. The default selection lives at `[models].default = "inference-<selected alias>"`.

The three registered sections are `inference-glm-5.2-fast`, `inference-kimi-k3-fast`, and `inference-deepseek-v4-flash-0731`.

<Metadata text="cli/coding-agents/grok/model-section" />

```toml theme={"system"}
[model."inference-glm-5.2-fast"]
model = "glm-5.2-fast"
base_url = "https://api.inference.net/v1"
api_key = "<gateway-key>"
api_backend = "chat_completions"
context_window = 262144
name = "Inference.net · glm-5.2-fast"
```

## `inf grok status`

<Metadata text="cli/coding-agents/grok/status[series=coding_agents_grok]" />

```bash theme={"system"}
inf grok status
```

## `inf grok off`

<Metadata text="cli/coding-agents/grok/off[series=coding_agents_grok]" />

```bash theme={"system"}
inf grok off
```

`off` restores unchanged owned fields. It keeps fields that you edited after `on`.

## Examples

Select DeepSeek:

<Metadata text="cli/coding-agents/grok/on-model[series=coding_agents_grok]" />

```bash theme={"system"}
inf grok on --model deepseek-v4-flash-0731
```

Restart Grok after `on` or `off`. See [Troubleshooting](/cli/coding-agents/troubleshooting) for drift, recovery, and key revocation.
