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

# Troubleshooting

> Reference and fixes for coding-agent gateway routing, drift, keys, and logout.

Use this page to fix routing, key, and config conflicts. See [Model mapping](/cli/coding-agents#model-mapping) for aliases, limits, and defaults.

## Gateway key resolution

`inf <agent> on` resolves a gateway key in this order:

1. `INFERENCE_API_KEY` environment variable (never persisted).
2. The project key stored by `inf auth set-key`.
3. A coding-agent key minted on a previous run (stored in `~/.inf/config.json`).
4. If none of the above, an authenticated session mints one project-scoped key.

One key is shared by all five agents.

If you have no session or key, the command exits with code 1. Use one of these options:

* `inf auth login`
* `inf auth set-key <key>`
* export `INFERENCE_API_KEY`

See [Authentication](/cli/authentication) for the base credential model.

## Drift and conflict scenarios

| Scenario                            | `status`             | `off`                                         |
| ----------------------------------- | -------------------- | --------------------------------------------- |
| Untouched since `on`                | `active`             | restore original (or delete the key)          |
| You edited an owned field           | `modified`           | leave your value, report it                   |
| You deleted an owned field          | `missing`            | nothing to do, report it                      |
| You added unrelated keys            | not reported         | untouched                                     |
| Target file deleted                 | `missing file`       | skip automatic restore, keep state and backup |
| `on` run twice with different flags | `active` (new value) | restores the pre-first-`on` original          |
| Never connected                     | `connected: false`   | "not connected", exit 0                       |

## `inf auth logout` and your agents

Logout disconnects every connected agent before it clears credentials.

| Flag                        | Effect                                                                         |
| --------------------------- | ------------------------------------------------------------------------------ |
| `--keep-coding-agents`      | leave all agent gateway config in place; print the files that still hold a key |
| `--revoke-coding-agent-key` | revoke the minted coding-agent key before logout                               |

The two flags are mutually exclusive.

<Metadata text="cli/coding-agents/troubleshooting/logout[series=coding_agents_troubleshooting]" />

```bash theme={"system"}
inf auth logout
```

<Metadata text="cli/coding-agents/troubleshooting/logout-keep[series=coding_agents_troubleshooting]" />

```bash theme={"system"}
inf auth logout --keep-coding-agents
```

<Metadata text="cli/coding-agents/troubleshooting/logout-revoke[series=coding_agents_troubleshooting]" />

```bash theme={"system"}
inf auth logout --revoke-coding-agent-key
```

If a harness could not be fully disconnected, logout warns and names the files.

## Revoke a coding-agent key

Minted keys are named `inf-coding-agents-<timestamp>`. Use [`inf api-key list`](/cli/api-key) to find the id, then revoke it.

<Metadata text="cli/coding-agents/troubleshooting/revoke[series=coding_agents_troubleshooting]" />

```bash theme={"system"}
inf api-key list
inf api-key revoke <id>
```

## Recover from an interrupted `on`

Each file is written atomically. A multi-file update can still stop between files. Re-run `inf <agent> on`. It reuses the stored key and finishes the update.

<Metadata text="cli/coding-agents/troubleshooting/rerun-on[series=coding_agents_troubleshooting]" />

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

## Config directory moved

If `CLAUDE_CONFIG_DIR`, `CODEX_HOME`, or `XDG_CONFIG_HOME` changes the target between runs, `status`, `on`, and `off` stop and show both paths.

Restore the original root setting. Run `inf <agent> off`. Then change the root and run `inf <agent> on` again.

There is no force flag for this case.

## `--json` reference

`status --json` returns `harness`, `connected`, `models`, and `targets`. Every target has `path`, `missingFile`, and per-field `id` and `state`.

`on --json` adds `keySource` and a masked `keyPreview`. `off --json` adds conflict and retained-state fields. No JSON output contains a raw key.

<Metadata text="cli/coding-agents/troubleshooting/status-json[series=coding_agents_troubleshooting]" />

```bash theme={"system"}
inf claude status --json
```

<Metadata text="cli/coding-agents/troubleshooting/status-json-shape" />

```json theme={"system"}
{
  "harness": "claude",
  "connected": true,
  "models": {
    "main": "kimi-k3-fast",
    "opus": "glm-5.2-fast",
    "sonnet": "glm-5.2-fast",
    "haiku": "deepseek-v4-flash-0731",
    "fable": "kimi-k3-fast",
    "subagents": "deepseek-v4-flash-0731"
  },
  "targets": [
    {
      "path": "/Users/you/.claude/settings.json",
      "missingFile": false,
      "fields": [
        { "id": "model", "state": "active" }
      ]
    }
  ]
}
```

## Upgraded from an older CLI that wrote `glm-5.2`

The default for Claude Opus and Sonnet is now `glm-5.2-fast`. An older connection can still show `glm-5.2` in those slots. The gateway continues to serve that model, so the connection still works.

An upgrade does not change existing connections. Re-run `inf claude on`, or pass `--opus` and `--sonnet`, to use the new Fast default. `off` can still restore the values from before your first `on`.

`glm-5.2` is no longer accepted as a `--model` or slot value on `on`. Use `glm-5.2-fast`, `kimi-k3-fast`, or `deepseek-v4-flash-0731`.
