// documentation
Setup guide
Everything you need to point a client at TheClaudeAPI: install, configure your IDE, and call the API. If you already have a key, it takes about a minute.
Drop-in compatible
No SDK changes
Per-key limits
5-hour, 7-day and monthly
Two formats
Anthropic + OpenAI
One base URL
aisoftdeal.com
Prerequisites
- Node.js 18 or newer — for Claude Code (nodejs.org)
- A TheClaudeAPI key (
sk-…) — issued by your admin or reseller - A supported client — Claude Code, VS Code, Cursor, Windsurf, Cline, Roo Code or Continue
npm install -g @anthropic-ai/claude-codeBase URLs
https://aisoftdeal.com/api/publichttps://aisoftdeal.com/api/public/v1Claude Desktop "third-party inference" (Gateway): paste exactly https://aisoftdeal.com/api/public — no trailing /v1 or /model.
Quick install
Windows — PowerShell
Open PowerShell and run:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
irm https://aisoftdeal.com/setup.ps1 | iex$env:THECLAUDEAPI_KEY = "YOUR_API_KEY"; irm https://aisoftdeal.com/setup.ps1 | iexmacOS and Linux
curl -fsSL https://aisoftdeal.com/setup.sh | bashcurl -fsSL https://aisoftdeal.com/setup.sh | THECLAUDEAPI_KEY=YOUR_API_KEY bashClaude Code CLI
Run the quick installer, or create / edit ~/.claude/settings.json (Windows: %USERPROFILE%\.claude\settings.json):
{
"env": {
"ANTHROPIC_AUTH_TOKEN": "YOUR_API_KEY",
"ANTHROPIC_BASE_URL": "https://aisoftdeal.com/api/public",
"ANTHROPIC_MODEL": "anthropic/claude-sonnet-5.5",
"ANTHROPIC_SMALL_FAST_MODEL": "anthropic/claude-haiku-5.5",
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
},
"hasCompletedOnboarding": true
}Replace YOUR_API_KEY with your key. Or set it just for one session:
export ANTHROPIC_BASE_URL=https://aisoftdeal.com/api/public
export ANTHROPIC_AUTH_TOKEN=YOUR_API_KEY
claude$env:ANTHROPIC_BASE_URL = "https://aisoftdeal.com/api/public"
$env:ANTHROPIC_AUTH_TOKEN = "YOUR_API_KEY"
claudeEffort (Low · Medium · High · Extra · Max)
Choose Effort inside Claude Code (/model menu) — its menu shows exactly these five options, in this order: Low, Medium, High, Extra, Max. That menu is drawn by the Claude Code client itself, not by us. Claude Code sends your choice as output_config.effort; we pass it to the model as reasoning effort:
Low -> low
Medium -> low (clamped: model has no "medium")
High -> high
Extra -> max (clamped: model has no "xhigh"; OpenRouter treats xhigh = max)
Max -> max
none -> low (default)Every response shows what happened in headers X-Effort-Requested, X-Effort-Applied and X-Effort-Status (honored / clamped / default / unsupported). The menu itself is drawn by Claude Code, not by us — if your Claude Code version hides it for a custom base URL, send the field yourself:
curl https://aisoftdeal.com/api/public/v1/messages \
-H "x-api-key: YOUR_API_KEY" -H "content-type: application/json" \
-d '{"model":"anthropic/claude-sonnet-5.5","max_tokens":1024,"output_config":{"effort":"medium"},"messages":[{"role":"user","content":"Hi"}]}'VS Code
The Claude Code extension for VS Code reads the same ~/.claude/settings.json as the CLI. Save it, then restart VS Code.
Cursor
Settings → Models → add an OpenAI-compatible model:
Base URL: https://aisoftdeal.com/api/public/v1
API key: YOUR_API_KEY
Model: anthropic/claude-sonnet-5.5Windsurf
Settings → AI Provider → OpenAI-compatible:
Base URL: https://aisoftdeal.com/api/public/v1
API key: YOUR_API_KEY
Model: anthropic/claude-sonnet-5.5Cline
{
"cline.apiProvider": "anthropic",
"cline.anthropicBaseUrl": "https://aisoftdeal.com/api/public",
"cline.apiKey": "YOUR_API_KEY"
}Or pick the "OpenAI Compatible" provider with base URL https://aisoftdeal.com/api/public/v1.
Roo Code
{
"roo-cline.apiProvider": "anthropic",
"roo-cline.anthropicBaseUrl": "https://aisoftdeal.com/api/public",
"roo-cline.apiKey": "YOUR_API_KEY"
}Continue
models:
- name: TheClaudeAPI Sonnet
provider: openai
model: anthropic/claude-sonnet-5.5
apiBase: https://aisoftdeal.com/api/public/v1
apiKey: YOUR_API_KEYAll endpoints
POST https://aisoftdeal.com/api/public/v1/messages API key Anthropic / Claude format
POST https://aisoftdeal.com/api/public/v1/chat/completions API key OpenAI format
GET https://aisoftdeal.com/api/public/v1/models none list of models
GET https://aisoftdeal.com/api/public/v1/key-status API key plan, usage %, expiry
GET https://aisoftdeal.com/setup.ps1 none Windows installer
GET https://aisoftdeal.com/setup.sh none macOS / Linux installer
WEB https://aisoftdeal.com/check-key - check a key in the browserAuthentication
Every API endpoint accepts your key in either header:
x-api-key: YOUR_API_KEY
# or
Authorization: Bearer YOUR_API_KEYMessages
Create a message. Anthropic-compatible request and response. Set stream: true for SSE.
{
"model": "anthropic/claude-sonnet-5.5",
"max_tokens": 1024,
"messages": [
{ "role": "user", "content": "Hello, Claude!" }
],
"stream": false
}{
"id": "msg_...",
"type": "message",
"role": "assistant",
"model": "anthropic/claude-sonnet-5.5",
"content": [
{ "type": "text", "text": "Hello! How can I help you today?" }
],
"stop_reason": "end_turn",
"usage": { "input_tokens": 12, "output_tokens": 15 }
}curl https://aisoftdeal.com/api/public/v1/messages \
-H "x-api-key: YOUR_API_KEY" \
-H "content-type: application/json" \
-d '{"model":"anthropic/claude-sonnet-5.5","max_tokens":1024,"messages":[{"role":"user","content":"Hello"}]}'$body = @{ model = "anthropic/claude-sonnet-5.5"; max_tokens = 1024; messages = @(@{ role = "user"; content = "Hello" }) } | ConvertTo-Json -Depth 5
Invoke-RestMethod -Method Post -Uri "https://aisoftdeal.com/api/public/v1/messages" -Headers @{ "x-api-key" = "YOUR_API_KEY" } -ContentType "application/json" -Body $bodyimport anthropic
client = anthropic.Anthropic(base_url="https://aisoftdeal.com/api/public", api_key="YOUR_API_KEY")
r = client.messages.create(model="anthropic/claude-sonnet-5.5", max_tokens=1024, messages=[{"role":"user","content":"Hi"}])
print(r.content[0].text)With "stream": true you get server-sent events — message_start, content_block_delta, message_stop.
Chat completions (OpenAI format)
OpenAI-compatible chat completions. Supports stream: true.
curl https://aisoftdeal.com/api/public/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"anthropic/claude-sonnet-5.5","messages":[{"role":"user","content":"Write a Python hello world"}]}'$body = @{ model = "anthropic/claude-sonnet-5.5"; messages = @(@{ role = "user"; content = "Write a Python hello world" }) } | ConvertTo-Json -Depth 5
Invoke-RestMethod -Method Post -Uri "https://aisoftdeal.com/api/public/v1/chat/completions" -Headers @{ Authorization = "Bearer YOUR_API_KEY" } -ContentType "application/json" -Body $bodyfrom openai import OpenAI
client = OpenAI(base_url="https://aisoftdeal.com/api/public/v1", api_key="YOUR_API_KEY")
r = client.chat.completions.create(model="anthropic/claude-sonnet-5.5", messages=[{"role":"user","content":"Hi"}])
print(r.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://aisoftdeal.com/api/public/v1", apiKey: "YOUR_API_KEY" });
const r = await client.chat.completions.create({ model: "anthropic/claude-sonnet-5.5", messages: [{ role: "user", content: "Hi" }] });
console.log(r.choices[0].message.content);Models
List available models. Public — no key required.
curl https://aisoftdeal.com/api/public/v1/modelsKey status
Your key's status, plan, usage percentage and expiry. The installers use this to verify your key.
curl https://aisoftdeal.com/api/public/v1/key-status -H "x-api-key: YOUR_API_KEY"Invoke-RestMethod -Uri "https://aisoftdeal.com/api/public/v1/key-status" -Headers @{ "x-api-key" = "YOUR_API_KEY" }{
"status": "active",
"name": "My Key",
"plan": "Pro",
"window_used_percent": 12,
"month_used_percent": 3,
"window_resets_at": "2026-10-11T08:00:00.000Z",
"expires_at": "2026-11-10T00:00:00.000Z"
}Available models
Errors & limits
400 invalid request body
401 missing, invalid, expired or revoked API key
403 API key is paused
429 rate limit / 5-hour / 7-day / monthly limit reached
502 upstream model temporarily unavailable — retry
503 service temporarily unavailable — retryOn paid plans the 5-hour window starts with your first request and resets exactly 5 hours later. The 7-day limit is rolling, and the monthly limit resets on the 1st of each month (UTC). Check your usage and reset times anytime at https://aisoftdeal.com/check-key.
Demo keys expire 5 hours after creation, even if unused. Their usage allowance does not reset; once exhausted, the key stops accepting requests.
Troubleshooting
- "running scripts is disabled" on Windows — run the
Set-ExecutionPolicyline first. - Claude Code still asks to log in — open a new terminal and make sure
~/.claude/settings.jsonhas your key. - 401 error — the key is wrong, expired or revoked. Check it on the Check a key page.
- 429 error — you hit a limit; wait for the reset time shown on Check a key.
Full installer scripts
# TheClaudeAPI setup for Windows PowerShell
# Usage: irm https://aisoftdeal.com/setup.ps1 | iex
function Install-TheClaudeAPI {
$ErrorActionPreference = "Stop"
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$Base = "https://aisoftdeal.com/api/public"
$StatusUrl = "https://aisoftdeal.com/api/public/v1/key-status"
Write-Host ""
Write-Host "== TheClaudeAPI setup ==" -ForegroundColor Cyan
$Key = $env:THECLAUDEAPI_KEY
if (-not $Key) { $Key = Read-Host "Enter your API key (sk-...)" }
$Key = ($Key -replace "\s", "")
# Only letters, digits, "-" and "_" are allowed, so the key is safe to write into JSON and env vars.
if ($Key -cnotmatch '^(sk|kx)-[A-Za-z0-9_-]{10,200}$') {
Write-Host "Error: invalid key format. Paste the full key starting with sk-" -ForegroundColor Red; return
}
Write-Host "Checking your key..."
try {
$s = Invoke-RestMethod -Uri $StatusUrl -Headers @{ "x-api-key" = $Key } -UseBasicParsing
} catch {
Write-Host "Key check failed: $($_.Exception.Message)" -ForegroundColor Red; return
}
if ($s.status -ne "active") { Write-Host "Key is not active (status: $($s.status))" -ForegroundColor Red; return }
Write-Host "Key OK. Plan: $($s.plan)" -ForegroundColor Green
$Dir = Join-Path $HOME ".claude"
$File = Join-Path $Dir "settings.json"
New-Item -ItemType Directory -Force -Path $Dir | Out-Null
if (Test-Path $File) { Copy-Item $File "$File.bak" -Force; Write-Host "Backed up old settings.json" }
$Json = @"
{
"env": {
"ANTHROPIC_AUTH_TOKEN": "$Key",
"ANTHROPIC_BASE_URL": "$Base",
"ANTHROPIC_MODEL": "anthropic/claude-sonnet-5.5",
"ANTHROPIC_SMALL_FAST_MODEL": "anthropic/claude-haiku-5.5",
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
},
"hasCompletedOnboarding": true
}
"@
# UTF-8 without BOM (a BOM breaks JSON parsing in Claude Code)
[IO.File]::WriteAllText($File, $Json, (New-Object System.Text.UTF8Encoding($false)))
Write-Host "Wrote $File"
foreach ($pair in @(
@("ANTHROPIC_BASE_URL", $Base), @("ANTHROPIC_AUTH_TOKEN", $Key),
@("OPENAI_BASE_URL", "$Base/v1"), @("OPENAI_API_KEY", $Key))) {
[Environment]::SetEnvironmentVariable($pair[0], $pair[1], "User")
Set-Item -Path ("Env:" + $pair[0]) -Value $pair[1]
}
Write-Host "Saved environment variables."
Write-Host ""
Write-Host "Done. Open a NEW PowerShell window (or restart VS Code) and run: claude" -ForegroundColor Green
}
Install-TheClaudeAPI
#!/usr/bin/env bash
# TheClaudeAPI setup for macOS / Linux
# Usage: curl -fsSL https://aisoftdeal.com/setup.sh | bash
set -eu
BASE="https://aisoftdeal.com/api/public"
STATUS_URL="https://aisoftdeal.com/api/public/v1/key-status"
echo ""
echo "== TheClaudeAPI setup =="
if ! command -v curl >/dev/null 2>&1; then echo "Error: curl is required."; exit 1; fi
KEY="$(printenv THECLAUDEAPI_KEY || true)"
if [ -z "$KEY" ]; then
if [ -r /dev/tty ]; then
printf "Enter your API key (sk-...): " > /dev/tty
read -r KEY < /dev/tty
else
echo "Error: no terminal. Run: THECLAUDEAPI_KEY=sk-... bash setup.sh"; exit 1
fi
fi
KEY="$(printf "%s" "$KEY" | tr -d '[:space:]')"
# Only letters, digits, "-" and "_" are allowed, so the key is safe to write into JSON and shell profiles.
if ! printf "%s" "$KEY" | grep -Eq '^(sk|kx)-[A-Za-z0-9_-]{10,200}$'; then
echo "Error: invalid key format. Paste the full key starting with sk-"; exit 1
fi
echo "Checking your key..."
RESP="$(curl -sL -w "\n%{http_code}" -H "x-api-key: $KEY" "$STATUS_URL" || true)"
CODE="$(printf "%s" "$RESP" | tail -n 1)"
BODY="$(printf "%s" "$RESP" | sed '$d')"
if [ "$CODE" != "200" ]; then echo "Key check failed (HTTP $CODE): $BODY"; exit 1; fi
case "$BODY" in *'"status":"active"'*) ;; *) echo "Key is not active: $BODY"; exit 1;; esac
echo "Key OK."
DIR="$HOME/.claude"
FILE="$DIR/settings.json"
mkdir -p "$DIR"
if [ -f "$FILE" ]; then cp "$FILE" "$FILE.bak.$(date +%s)"; echo "Backed up old settings.json"; fi
cat > "$FILE" <<EOF
{
"env": {
"ANTHROPIC_AUTH_TOKEN": "$KEY",
"ANTHROPIC_BASE_URL": "$BASE",
"ANTHROPIC_MODEL": "anthropic/claude-sonnet-5.5",
"ANTHROPIC_SMALL_FAST_MODEL": "anthropic/claude-haiku-5.5",
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
},
"hasCompletedOnboarding": true
}
EOF
echo "Wrote $FILE"
for RC in "$HOME/.bashrc" "$HOME/.zshrc"; do
[ -f "$RC" ] || continue
# remove an older block, then append a fresh one
sed -i.bak '/# >>> theclaudeapi >>>/,/# <<< theclaudeapi <<</d' "$RC" 2>/dev/null || true
cat >> "$RC" <<EOF
# >>> theclaudeapi >>>
export ANTHROPIC_BASE_URL="$BASE"
export ANTHROPIC_AUTH_TOKEN="$KEY"
export OPENAI_BASE_URL="$BASE/v1"
export OPENAI_API_KEY="$KEY"
# <<< theclaudeapi <<<
EOF
echo "Updated $RC"
done
echo ""
echo "Done. Open a NEW terminal (or restart VS Code) and run: claude"