> ## 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 CLIProxyAPI with abliteration.ai

> Route CLIProxyAPI to abliteration.ai's OpenAI-compatible and Anthropic APIs with a copy-paste config.yaml, then point Claude Code or Codex at the local proxy.

**To use abliteration.ai with [CLIProxyAPI](https://github.com/router-for-me/CLIProxyAPI)**, add abliteration as an upstream in `config.yaml`, then point your OpenAI- or Anthropic-compatible clients at the local proxy. CLIProxyAPI is a self-hosted proxy that exposes OpenAI-, Anthropic-, and Gemini-compatible endpoints and fans requests out to configured backends.

## Install

Download a binary from the [releases page](https://github.com/router-for-me/CLIProxyAPI/releases), or run the [Docker image](https://github.com/router-for-me/CLIProxyAPI). See the [guides](https://help.router-for.me/) for platform specifics.

## Get an API key

Create an `ak_...` key in the [console](https://abliteration.ai/console).

## Configure

Add abliteration to `config.yaml`. The `openai-compatibility` block is the most portable; add `claude-api-key` too if you want to reach abliteration through Anthropic-protocol clients.

```yaml theme={"system"}
# Keys your local tools use to talk to the proxy (not your abliteration key)
api-keys:
  - "local-dev-key"

# abliteration.ai on the OpenAI-compatible surface
openai-compatibility:
  - name: "abliteration"
    base-url: "https://api.abliteration.ai/v1"
    api-key-entries:
      - api-key: "ak_YOUR_API_KEY"
    models:
      - name: "abliterated-model"
        alias: "abliterated-model"
        display-name: "Abliterated Model"

# Optional: abliteration.ai on the Anthropic Messages surface
claude-api-key:
  - api-key: "ak_YOUR_API_KEY"
    base-url: "https://api.abliteration.ai"
    models:
      - name: "abliterated-model"
        alias: "abliterated-model"
```

<Note>
  `api-keys` are the credentials your local clients present to the proxy. Your abliteration `ak_...` key stays server-side in the `api-key-entries` / `claude-api-key` blocks and is never exposed to clients.
</Note>

## Run

```sh theme={"system"}
./cli-proxy-api --config config.yaml
```

The proxy listens on `http://localhost:8317` by default.

## Point your tools at the proxy

<Tabs>
  <Tab title="OpenAI SDK / Codex">
    Set the base URL to the local proxy and use one of your `api-keys`:

    ```sh theme={"system"}
    export OPENAI_BASE_URL="http://localhost:8317/v1"
    export OPENAI_API_KEY="local-dev-key"
    ```

    Request the model by its alias, `abliterated-model`.
  </Tab>

  <Tab title="Claude Code">
    Point Claude Code at the proxy's Anthropic surface:

    ```sh theme={"system"}
    export ANTHROPIC_BASE_URL="http://localhost:8317"
    export ANTHROPIC_AUTH_TOKEN="local-dev-key"
    export ANTHROPIC_MODEL="abliterated-model"
    ```
  </Tab>
</Tabs>

## Verify

```sh theme={"system"}
curl http://localhost:8317/v1/chat/completions \
  -H "Authorization: Bearer local-dev-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "abliterated-model",
    "messages": [{ "role": "user", "content": "say hello in one word" }]
  }'
```

A normal completion confirms the proxy is routing to abliteration.ai. For the request/response shapes on each surface, see [OpenAI compatibility](/api/openai-compatibility) and [Anthropic compatibility](/api/anthropic-compatibility).

## Notes

* Only `abliterated-model` is available upstream; alias it to whatever name your clients expect.
* Policy rules attached to your `ak_...` key apply to every request the proxy forwards.
* CLIProxyAPI can load-balance multiple `api-key-entries` — add more keys to spread load.
