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

# Claude Code Max Gateway

> Use Costa with your Claude Code Subscription -  setup in seconds.

## Prerequisites

* A Costa API key (get one from [https://ai.costa.app](https://ai.costa.app))
* Claude Code installed

## Setup

<Tabs>
  <Tab title="CLI">
    The fastest way to set up Claude Code with Costa is using the [Costa CLI ](/cli):

    ```bash theme={null}
    costa setup claude
    ```

    That's it! Your Claude Code is now configured to use Costa.
  </Tab>

  <Tab title="Manual">
    If you prefer to configure manually, open your Claude Code settings file:

    ```bash theme={null}
    vim ~/.claude/settings.json
    ```

    Add the following configuration:

    ```json theme={null}
    {
      "env": {
        "ANTHROPIC_BASE_URL": "https://ai.costa.app/api",
        "ANTHROPIC_CUSTOM_HEADERS": "costa-api-key: YOUR_COSTA_KEY_HERE"
      },
      "statusLine": {
        "command": "costa status --format claude-code",
        "padding": 0,
        "type": "command"
      }
    }
    ```

    Replace `YOUR_COSTA_KEY_HERE` with your actual Costa API key.

    Save the file and restart Claude Code.
  </Tab>
</Tabs>

## Verification

After saving the settings file, restart Claude Code. You can verify the configuration is working by checking the status line (if configured) or by running a Claude Code command - it should now route through Costa.

## Troubleshooting

* **Configuration not applied**: Make sure you saved `~/.claude/settings.json` and restarted Claude Code
* **JSON syntax errors**: Verify your JSON is valid (no trailing commas, proper quotes)
* **Authentication errors**: Verify your Costa API key is correct and active
* **Connection errors**: Check that you can reach `https://ai.costa.app/api`
* **Settings file doesn't exist**: Create the `~/.claude` directory first with `mkdir -p ~/.claude`
