Skip to content

Connect Claude#

Connect Claude Code or Claude Desktop to OptScale AI so Claude workflows use models available through your OptScale AI organization.

The integration is supported on Windows, Linux, and macOS.

Before configuring Claude, open Connect this model to external tools → OPENAI-COMPATIBLE in Chat and retrieve the required connection values. For Claude integrations, replace the /v1 suffix in the copied Base URL with /anthropic.

For details, see Get connection values from Chat.

For shared requirements and limitations, see External Tools.

Prerequisites#

Before configuring Claude, confirm that:

  • An organization exists and at least one Active provider is configured.
  • The user has access to the required providers.
  • The OptScale AI deployment is accessible over HTTPS with a valid TLS certificate.
  • For workflows that use tools, the selected model supports tool execution.

Connect Claude Code#

1. Open or create the Claude Code user settings file:

  • For Windows: %USERPROFILE%\.claude\settings.json
  • For macOS and Linux: ~/.claude/settings.json

Claude Code settings.json before configuration

2. In Chat, open Connect this model to external tools → CLAUDE.

In the Claude Code section, copy the contents of the generated env block.

Claude Code configuration values in the Connect this model to external tools dialog

Add the copied values to the env section of your Claude Code settings.json file.

The selected OptScale AI provider and model are added to all three Claude Code model tiers:

  • ANTHROPIC_DEFAULT_HAIKU_MODEL
  • ANTHROPIC_DEFAULT_SONNET_MODEL
  • ANTHROPIC_DEFAULT_OPUS_MODEL

We recommend keeping only the model variable for the Claude Code tier you want to use and removing the other model variables.

For example, to use the selected OptScale AI model as Haiku, keep ANTHROPIC_DEFAULT_HAIKU_MODELand remove ANTHROPIC_DEFAULT_SONNET_MODEL and ANTHROPIC_DEFAULT_OPUS_MODEL.

At least one model variable must remain configured.

3. To update an existing env configuration, use the values from the Claude Desktop section of the same dialog:

Claude Desktop values used to update Claude Code settings

  • Gateway base URL → ANTHROPIC_BASE_URL
  • API key → ANTHROPIC_AUTH_TOKEN
  • Model name → ANTHROPIC_DEFAULT_HAIKU_MODEL, ANTHROPIC_DEFAULT_SONNET_MODEL, or ANTHROPIC_DEFAULT_OPUS_MODEL, depending on the Claude Code tier you want to configure.

If multiple model variables are configured, Claude Code uses the corresponding model for each tier.

4. Save the file.

5. Run claude /logout, restart Claude Code, and then run /models. Confirm that the configured models appear in the list.

6. Send the test prompt described in Verify the connection.

Connect Claude Desktop#

1. Open Claude Desktop and enable Developer Mode: Help → Troubleshooting → Enable Developer Mode.

2. Open the third-party inference settings: Developer → Configure Third-Party Inference.

Claude Desktop Developer menu with Configure Third-Party Inference highlighted

3. In Connection, select Gateway from the provider dropdown.

Claude Desktop Configure third-party inference with Gateway selected

4. Enter the gateway connection values:

Claude Desktop Connection settings with Gateway base URL and API key filled

  • Gateway base URL — Copy the Gateway base URL from Connect this model to external tools → CLAUDE (Claude Desktop section) and paste it into this field.

    OptScale AI Chat Connect dialog with Base URL copy control highlighted

  • Gateway API key — Copy API key from the same Chat dialog and paste it into Gateway API key.

    OptScale AI Chat Connect dialog with API key copy control highlighted

5. Configure models in Connection → Models:

  • Model discovery — Enable to populate the model picker automatically from the gateway.

    Claude Desktop Connection settings with Model discovery enabled

  • Model list — Add models manually by specifying Model ID and Display name.

    Claude Desktop Model list with Model ID and Display name filled

    • Model ID — Copy Model name from OptScale AI Chat.

      OptScale AI Chat Connect dialog with Model name copy control highlighted

    • Display name — Enter a descriptive label for the model.

6. Click Apply Changes. When prompted, click Save & Restart to relaunch Claude Desktop with the new configuration.

Claude Desktop Save and Restart confirmation dialog

7. Confirm that the gateway connection is active and the configured models appear in the model selector.

Verify the connection#

In Claude Code or Claude Desktop, send the following prompt:

Reply with exactly: OptScale AI connection works.

The expected response is:

OptScale AI connection works.

In the Admin Console, open Analytics → Traces and confirm that a row appears for the selected Provider and Model. Requester is the user for whom the connection was configured.

See also#