> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.astropods.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.astropods.com/_mcp/server.

# ast gateway

Route this machine's Claude Code through your organization's [AI Gateway](/ai-gateway), so its usage appears in your organization's Insights.

```bash
ast gateway <subcommand>
```

Claude Code keeps your existing login and billing. `gateway connect` writes two settings to your Claude Code user settings and records exactly what it changed, so `gateway disconnect` can put them back.

## gateway connect

Connect this machine to the AI Gateway for an account.

```bash
ast gateway connect [--account <name>] [--replace-existing]
```

Running `connect` again replaces this machine's key. A machine reports to one account at a time.

Without a terminal, `connect` never replaces another gateway or another account's connection unless you pass `--replace-existing`.

| Flag                 | Description                                                    |
| -------------------- | -------------------------------------------------------------- |
| `--account <name>`   | Account to connect to (default: the active account)            |
| `--replace-existing` | Replace another gateway or account's connection without asking |

## gateway status

Show whether this machine routes through the AI Gateway.

```bash
ast gateway status
```

## gateway devices

List your devices that are connected to the AI Gateway.

```bash
ast gateway devices [--all]
```

`--all` lists every member's devices. It requires permission to manage data sources.

## gateway revoke

Revoke one of your devices' keys, by key prefix or ID.

```bash
ast gateway revoke <key> [--all]
```

`--all` revokes any member's device key. It requires permission to manage data sources.

## gateway disconnect

Restore your Claude Code settings to how they were before `connect`, then revoke this machine's key.

```bash
ast gateway disconnect
```

The command restores the settings first, so `disconnect` works even when the server can't be reached.

## Next steps

* [Claude Code](/monitor-claude-code): stream Claude Code usage telemetry from your team into Astropods
* [AI Gateway](/ai-gateway): use Astropods-provided LLM access without managing your own provider keys