---
title: "Claude Code with Straitly (2026): Setup, Base URL & Pricing | Straitly"
description: "Connect Claude Code to 117 models at 40% under list on most: 4 copyable steps, base URL, per-model rates and FAQ checked against Claude Code's docs."
url: https://straitly.ai/integrations/claude-code
updated: 2026-11-16
publisher: Straitly (https://straitly.ai)
---

# Use Claude Code with the Straitly API

Use Claude Code with Straitly in 4 steps: set ANTHROPIC\_BASE\_URL to https://api.straitly.ai and ANTHROPIC\_AUTH\_TOKEN to your Straitly key. Claude Opus 5.5 then costs $2.40 in and $12.00 out per 1M tokens, 40% under its list price of $4.00 and $20.00.[\[1\]](#src-1) [\[5\]](#src-5)

Updated 16 November 2026

[Get started](https://straitly.ai/signup) [Jump to the steps ](#setup)

What changes in Claude Code

Setting

\~/.claude/settings.json

Base URL

https://api.straitly.ai Copy

API key

sk-YOUR\_KEY

API format

Anthropic Messages

Connect with

Env vars or settings.json

Your prompts, files and workflow stay as they are. From Claude Code's docs, checked 16 November 2026[\[1\]](#src-1)

## Claude Code in 4 steps.

Replace `sk-YOUR_KEY` with your own key from the [Keys page](https://straitly.ai/app/keys). Setting lives in `~/.claude/settings.json`, base URL `https://api.straitly.ai`.

1. ### Step 1: Get a Straitly key
Sign up with email or Google, add credits from $5 (no subscription, no minimum), then create a key on the Keys page. It starts with sk-. Keep it private.
2. ### Step 2: Point Claude Code at Straitly
Set the gateway address and your key in the terminal that runs Claude Code. Use the root address without /v1: Claude Code adds /v1/messages itself. A gateway key replaces the Claude subscription login for that session.
Terminal · Mac / Linux
Copy
```
export ANTHROPIC_BASE_URL="https://api.straitly.ai"
export ANTHROPIC_AUTH_TOKEN="sk-YOUR_KEY"
```
3. ### Step 3: Keep it for every session
To skip the exports next time, put the same two values in the env block of \~/.claude/settings.json (on Windows, %USERPROFILE%\\.claude\\settings.json). The model line sets the default model.
\~/.claude/settings.json
Copy
```
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.straitly.ai",
    "ANTHROPIC_AUTH_TOKEN": "sk-YOUR_KEY"
  },
  "model": "claude-opus-5-5"
}
```
4. ### Step 4: Start Claude Code and pick a model
Start Claude Code with the model you want. Inside a session, /model switches models and /status shows the model and the base URL in use.
Terminal
Copy
```
claude --model claude-sonnet-5-5
```

Checked against Claude Code's own docs, 16 November 2026

- [Claude Code: connect to an LLM gateway](https://code.claude.com/docs/en/llm-gateway-connect) · [\[1\]](#src-1) (code.claude.com)
- [Claude Code: LLM gateways](https://code.claude.com/docs/en/llm-gateway) · [\[2\]](#src-2) (code.claude.com)
- [Claude Code settings](https://code.claude.com/docs/en/settings) · [\[3\]](#src-3) (code.claude.com)

Config names and menu paths match these pages as of the date shown. If Claude Code changes them, its docs win.

## Or do it in one paste.

Straitly's setup command makes the same change for you and keeps a copy of your old settings. Paste it in a terminal, not inside Claude Code. The full walkthrough with screenshots is in the [Claude Code docs guide](https://straitly.ai/app/docs/claude-code).

**One paste · Mac / Linux (needs Python 3) (16 lines)**

One paste · Mac / Linux (needs Python 3)

Copy

```
STRAITLY_API_KEY="sk-YOUR_KEY" MODELS='[{"model":"claude-opus-5-5","label":"Claude Opus 5.5","description":"Anthropic"}]' python3 - <<'EOF'
import json, os, shutil
key, f = os.environ["STRAITLY_API_KEY"], os.path.expanduser("~/.claude/settings.json")
if not key.startswith("sk-") or key == "sk-YOUR_KEY": raise SystemExit("Put your Straitly key in the first line, then paste again.")
d = {}
if os.path.exists(f):
    if not os.path.exists(f + ".before-straitly"): shutil.copy(f, f + ".before-straitly")
    try: d = json.load(open(f))
    except ValueError: pass
else: os.makedirs(os.path.dirname(f), exist_ok=True)
d.setdefault("env", {}).update({"ANTHROPIC_BASE_URL": "https://api.straitly.ai", "ANTHROPIC_AUTH_TOKEN": key})
d["model"] = "claude-opus-5-5"
d["modelPicker"] = {"replaceBuiltInOptions": True, "options": json.loads(os.environ["MODELS"])}
json.dump(d, open(f, "w"), indent=2)
print("Done - Claude Code now uses Straitly")
EOF
```

One paste · Windows PowerShell

Copy

```
powershell -NoProfile -Command "& ([scriptblock]::Create((irm 'https://straitly.ai/setup/claude-code.ps1'))) 'sk-YOUR_KEY'"
```

## What happens to a Claude Code request?

Two settings change in Claude Code: where requests go and which key pays for them. Everything else, from your prompts to your workflow, stays as it is.

1. Claude Code, as it is
Your prompts, files and workflow stay as they are. The request leaves in the same format as before.
2. One address, one key
It goes to `https://api.straitly.ai` with your Straitly key. That is the whole setup.[\[1\]](#src-1)
3. The same models
The key reaches 117 models. You ask for each one by its model ID.[\[6\]](#src-6)
4. A smaller bill
Claude Opus 5.5 for 10M input tokens and 1M output tokens costs $36.00 against $60.00 at list.[\[5\]](#src-5)

**Claude Code on Straitly in numbers**

4

Steps to connect Claude Code[\[1\]](#src-1)

40%

Straitly under the provider's list price, on most models[\[4\]](#src-4)

$36.00

Claude Opus 5.5 for 10M input tokens and 1M output tokens, against $60.00 at list[\[5\]](#src-5)

117

Models one key reaches from Claude Code[\[6\]](#src-6)

$5

Smallest top-up. No subscription and no minimum[\[6\]](#src-6)

$0

Charged for failed requests[\[4\]](#src-4)

98 of 103

Models with a list price that are at least 40% under it[\[5\]](#src-5)

134 of 145

Models priced under the lowest OpenRouter seller[\[5\]](#src-5)

## What should you know before relying on it?

1. The one-paste setup backs up your current settings.json to settings.json.before-straitly the first time it runs. Copy that file back to undo.
2. Claude Code sends small background requests, like chat titles, to its small model slot. Set ANTHROPIC\_DEFAULT\_HAIKU\_MODEL in the same env block to send them to a lighter model.
3. Signed in to Straitly? The setup page in your console lets you pick several models for the /model menu and fills in your key (it writes the modelPicker setting, which needs Claude Code 2.1.242 or later).
4. Any Straitly model ID works with /model, including non-Claude models such as z-ai/glm-5.3.

## What does Claude Code cost on Straitly?

USD per 1M tokens, input / output

| Model                                                                                                                                         | List price                            | Vs list   | Vs OpenRouter | Straitly                              |
| --------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------- | --------- | ------------- | ------------------------------------- |
| Claude Opus 5.5 claude-opus-5-5 40% lower vs list, 43.1% lower vs OpenRouter. Session $60.00 at list, $36.00 here.                            | $4.00 / $20.00 $60.00 for the session | 40% lower | 43.1% lower   | $2.40 / $12.00 $36.00 for the session |
| Claude Sonnet 5.5 claude-sonnet-5-5 40% lower vs list, 43.1% lower vs OpenRouter. Session $30.00 at list, $18.00 here.                        | $2.00 / $10.00 $30.00 for the session | 40% lower | 43.1% lower   | $1.20 / $6.00 $18.00 for the session  |
| Claude Haiku 5.5 claude-haiku-5-5 40% lower vs list, 43.1% lower vs OpenRouter. Session $1.50 at list, $0.90 here.                            | $0.10 / $0.50 $1.50 for the session   | 40% lower | 43.1% lower   | $0.06 / $0.30 $0.90 for the session   |
| GLM-5.3 z-ai/glm-5.3 68% lower vs list, 55.1% higher vs OpenRouter. Session $18.40 at list, $5.55 here.                                       | $1.40 / $4.40 $18.40 for the session  | 68% lower | 55.1% higher  | $0.416 / $1.39 $5.55 for the session  |
| DeepSeek V4.1 Flash 1017 deepseek/deepseek-v4-1-flash-1017 40% lower vs list, 138.9% higher vs OpenRouter. Session $2.10 at list, $1.26 here. | $0.15 / $0.60 $2.10 for the session   | 40% lower | 138.9% higher | $0.09 / $0.36 $1.26 for the session   |

From the public catalog on 25 November 2026[\[5\]](#src-5). The session is one example workload, 10M input tokens and 1M output tokens. Vs list holds for the input and the output price alike. Vs OpenRouter compares with the lowest OpenRouter seller including its 5.5% credit fee, on a 3:1 input to output mix, as read on 16 November 2026; “higher” means Straitly costs more, and n/a means that read has no figure for the model at this price.

## Claude Code questions.

[Ask a question](https://straitly.ai/contact)

- ### Can Claude Code use an API other than Anthropic's?
Yes. Claude Code's own gateway docs support any gateway that speaks the Anthropic Messages API. Set ANTHROPIC\_BASE\_URL to https://api.straitly.ai and ANTHROPIC\_AUTH\_TOKEN to your Straitly key, in the shell or in \~/.claude/settings.json.
- ### Do I still need a Claude subscription?
No. Claude Code's docs say a gateway credential replaces the subscription login for that session. You pay Straitly per token from prepaid credits instead.
- ### Why is there no /v1 in the base URL?
Claude Code adds /v1/messages to the base URL itself, so use the root, https://api.straitly.ai. Adding /v1 yourself produces a path that does not exist.
- ### What does Claude Opus 5.5 in Claude Code cost?
On 2026-11-25 Straitly charged $2.40 input and $12.00 output per 1M tokens for Claude Opus 5.5, against a list price of $4.00 and $20.00: 40% under list on input and output alike.
- ### Can I use GLM, Kimi or DeepSeek models in Claude Code?
Yes. Type /model followed by any Straitly model ID, for example /model z-ai/glm-5.3\. Every ID is on the models page.
- ### How do I go back to my old setup?
Remove the two env values from settings.json, or, if you used the one-paste setup, copy \~/.claude/settings.json.before-straitly back over settings.json.

## Sources

Setup steps follow Claude Code's own documentation, read on the date shown. Prices come from Straitly's public catalog.

1. \[1\] [Claude Code: connect to an LLM gateway](https://code.claude.com/docs/en/llm-gateway-connect) code.claude.com, 16 November 2026
2. \[2\] [Claude Code: LLM gateways](https://code.claude.com/docs/en/llm-gateway) code.claude.com, 16 November 2026
3. \[3\] [Claude Code settings](https://code.claude.com/docs/en/settings) code.claude.com, 16 November 2026

**All 6 sources**

1. \[4\] [Straitly pricing](https://straitly.ai/pricing) straitly.ai/pricing, 15 November 2026
2. \[5\] [Straitly public catalog](https://straitly.ai/models) straitly.ai/api/catalog, shown on straitly.ai/models, 25 November 2026
3. \[6\] [Straitly home page](https://straitly.ai/) straitly.ai, 16 November 2026

**What each source says**

\[1\] Claude Code: connect to an LLM gateway

Set ANTHROPIC\_BASE\_URL and ANTHROPIC\_AUTH\_TOKEN in the shell or in the env block of \~/.claude/settings.json.

\[2\] Claude Code: LLM gateways

A gateway credential replaces the Claude subscription login for that session.

\[3\] Claude Code settings

settings.json keys, including env, model and modelPicker (modelPicker needs Claude Code 2.1.242 or later).

\[4\] Straitly pricing

Billed per token at the pooled rate, 40% under the provider's published rate on most models, with nothing added on top. Failed requests cost nothing. No subscription, no minimum.

\[5\] Straitly public catalog

Every model ID with Straitly's price, the lab's official list price where one is published, and the lowest OpenRouter seller including its 5.5% credit fee.

\[6\] Straitly home page

One OpenAI-compatible API for 117 models. Sign up with email or Google, top-ups from $5 with no card or platform fee, base URL https://api.straitly.ai/v1, and requests move to another provider serving the same model if one goes down.

Read next: [Use cases](https://straitly.ai/use-cases) , [Compare](https://straitly.ai/compare) , [Claude Code API](https://straitly.ai/claude-code-api) , [Structured outputs docs](https://straitly.ai/docs/structured-outputs) , [Errors & limits docs](https://straitly.ai/docs/errors).

## Which other tools use the same key?

- [Cursor OpenAI-compatible. Settings, no script.](https://straitly.ai/integrations/cursor)
- [Codex OpenAI Responses. config.toml provider.](https://straitly.ai/integrations/codex)
- [OpenCode OpenAI-compatible. opencode.json provider.](https://straitly.ai/integrations/opencode)
- [Cline OpenAI-compatible. Settings, no script.](https://straitly.ai/integrations/cline)
- [Claude app Anthropic Messages. Developer menu gateway.](https://straitly.ai/integrations/claude-app)
- [Hermes OpenAI-compatible. Custom endpoint.](https://straitly.ai/integrations/hermes)
- [OpenClaw OpenAI-compatible. Custom provider.](https://straitly.ai/integrations/openclaw)
- [OpenAI SDK OpenAI-compatible. Python client.](https://straitly.ai/integrations/openai-sdk)
- [Anthropic SDK Anthropic Messages. Python client.](https://straitly.ai/integrations/anthropic-sdk)
- [LangChain OpenAI-compatible. Python client.](https://straitly.ai/integrations/langchain)
- [LlamaIndex OpenAI-compatible. Python client.](https://straitly.ai/integrations/llamaindex)
- [Vercel AI SDK OpenAI-compatible. TypeScript client.](https://straitly.ai/integrations/vercel-ai-sdk)

[All integrations](https://straitly.ai/integrations) [Claude Code in the docs](https://straitly.ai/app/docs/claude-code) [Every model ID](https://straitly.ai/models)

## Start with one request.

Prepaid, no subscription, no minimum. 40% under list on most models you reach from Claude Code.

[Console](https://straitly.ai/app) [Talk to sales ](https://straitly.ai/contact)

---
Markdown version of https://straitly.ai/integrations/claude-code.
