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

# AI models and keys

> Create your own key for the AI Gateway, connect your coding tools in one step, and see the models you may call.

[AI models & keys](https://chat.xpander.ai/?settings=my-gateway) (**Settings > AI models & keys**) lets your own coding tools and scripts use your company's models, as you, within your budgets.

![Diagram](https://docs.xpander.ai/images/diagrams/use-ai-models-and-keys-79dcd7fb.svg)

The key covers model calls only. File edits, shell commands and local skills stay on your computer and are not recorded.

## Connect a coding tool

**1. Pick your client**

Under **Connect a client**, pick **Claude Code**, **Codex CLI**, **OpenCode** or **Your own code**.

**2. Copy and run the setup**

* **Claude Code, Codex CLI or OpenCode:** pick **macOS**, **Linux** or **Windows**, select **Copy** (it creates a key for that client and computer), and run it in your terminal (PowerShell on Windows). The coding tool stays connected in every new terminal.
* **Your own code:** select **Copy** and paste it into your project's coding agent. It wires your OpenAI or Anthropic SDK calls to the gateway, reading the key from `XPANDER_GATEWAY_KEY`. The prompt never contains your key.

![Connect a client with Claude Code, Codex CLI, OpenCode and Your own code, Claude Code selected, and Linux picked in the line Copy creates your API key automatically](https://mintcdn.com/xpanderai-099931d1/bt8i0GPVb90-qbuD/images/llm-gateway/01-ai-models-and-keys.png?fit=max\&auto=format\&n=bt8i0GPVb90-qbuD\&q=85\&s=be74e0d3ebb483701bb52d8bae124185)

Connect a client, with Claude Code and Linux picked. The setup command and Copy are below it.

**Set up manually** shows the files instead, with your address, a new key and a **Model** filled in.

## Create a key yourself

Under **Gateway keys**, choose **Create key**, give it a name such as `My desktop`, and pick when it expires (7 days to **Never**). Copy it: it is **Shown only once**. Use one key per computer and coding tool. **Revoke** stops a key at once.

## Available models

**Available models** lists what you may call. Copy a model ID and use it as `model` in your coding tool. **Shortcuts your admin set up** work the same way. A missing model is turned off for you: ask an admin.

If you use your own Claude plan here, set **When my Claude plan hits its limit** to **Continue on company models** or **Pause**, unless your admin set calls to pause. Your spend is in [Usage](https://chat.xpander.ai/?settings=my-usage) (**Settings > Usage**).

## Next steps

> [card] [AI Gateway](https://docs.xpander.ai/run/llm-gateway.md)
>
> What your admins control.

> [card] [Gateway errors](https://docs.xpander.ai/run/llm-gateway/errors.md)
>
> What a refused call means.


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