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

# Use Grok CLI with abliteration.ai

> Use Grok CLI (Grok Build) with abliteration.ai by adding a custom model that points at the OpenAI-compatible endpoint.

**To use [Grok CLI](https://github.com/xai-org/grok-build) with abliteration.ai**, add a custom model in `~/.grok/config.toml` with `base_url` set to `https://api.abliteration.ai/v1`, an abliteration.ai model ID, and your `ak_...` key in an environment variable. Grok CLI is xAI's open-source terminal coding agent. When a model's `base_url` is not xAI's endpoint, Grok CLI sends requests through its OpenAI-compatible backend, so no adapter is required.

## Prerequisites

* Grok CLI installed. See the [Grok Build repository](https://github.com/xai-org/grok-build).
* An `ak_...` key from the [console](https://abliteration.ai/console).

## Configure

Add a custom model to `~/.grok/config.toml`:

```toml theme={"system"}
[model.abliterated-large-v2]
model = "abliterated-model-large-v2"
base_url = "https://api.abliteration.ai/v1"
name = "Abliterated Model Large V2"
api_backend = "chat_completions"
env_key = "ABLITERATION_API_KEY"
context_window = 1000000
```

`api_backend` selects the request protocol. Use `chat_completions` for the OpenAI-compatible path; abliteration.ai also serves `responses` and an Anthropic-compatible `messages` backend. `env_key` names the environment variable Grok CLI reads the key from, so the key is not stored in the config file.

Export the key:

```sh theme={"system"}
export ABLITERATION_API_KEY="ak_YOUR_API_KEY"
```

To make it the default model, add:

```toml theme={"system"}
[models]
default = "abliterated-large-v2"
```

## Run

Start Grok CLI and confirm the model is available:

```sh theme={"system"}
grok models
```

Select the model for a single prompt:

```sh theme={"system"}
grok -p "Say hello in one sentence." -m abliterated-large-v2
```

In an interactive session, switch models with `/model abliterated-large-v2` or press `Ctrl+M`.

## Choose a model

| Model | Use it for | `context_window` |
| - | - | - |
| `abliterated-model-large-v2` | Recommended for source code and text-driven agent work | `1000000` |
| `abliterated-model` | Tasks that need image inputs | `262144` |
| `abliterated-model-large` | Compatibility with the previous large model | `1000000` |

`abliterated-model-large-v2` is text-only. Use `abliterated-model` if the agent needs to read images. See [models](/models) for the full capability and context-window comparison.

## Notes

* All abliteration.ai models reason by default. See [thinking and reasoning effort](/capabilities/thinking).
* Published policies scoped to the key's project apply to every Grok CLI request. See [Policies](/policy-gateway/overview).
* The live model list is available from `GET /v1/models`. See [models](/models).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.