Claude Code
Prepare a Claude Code environment for Inferway.
Claude Code speaks the Anthropic Messages API, which Inferway serves at /v1/messages. Redirect it with the environment variables below, or put the same variables in the env block of ~/.claude/settings.json.
Current Inferway catalog
No verification record exists for openai/gpt-6.2-astra in this client; the configuration below is a reference.
Before you start
Install the named client using its official instructions. Pi here means the pi-mono coding agent; Hermes means Nous Research's Hermes Agent.
Once your Inferway account is activated, create a key under Console → API Keys. Use a dedicated key for this client; a project's monthly budget caps what it can spend. Both live and test prefixes use the same inference and billing path; test is an environment label, not a free or simulated inference mode.
Use an Inferway key for Inferway's endpoint. A key from another service belongs to that service and cannot authenticate to this address.
Keep the key in the client's credential store or your local environment. Do not paste it into a prompt, screenshot, or committed configuration. These examples use bash/zsh on macOS or Linux.
Make the key available to this terminal
The prompt below hides your input and keeps the key out of shell history. Start the client from this same terminal; a separately opened app may not inherit this variable.
printf 'Inferway API key: ' IFS= read -r -s INFERWAY_API_KEY printf '\n' export INFERWAY_API_KEY
Point Claude Code at Inferway
Export these variables in the terminal you start Claude Code from. ANTHROPIC_BASE_URL is the origin without /v1: the client appends /v1/messages itself. ANTHROPIC_AUTH_TOKEN sends the Inferway key as a bearer token; the key stays in the environment and never enters a file.
The first line clears any ANTHROPIC_API_KEY left in this terminal, for example a key from Anthropic or another provider. Claude Code would otherwise send that key along with your Inferway key. Inferway authenticates with the Inferway key only and does not use or store the other one, but there is no reason for it to leave your machine. A new terminal gets your original variables back.
The same variables also work in the env block of ~/.claude/settings.json (tested with Claude Code 2.1.309); that is what CC Switch writes. A settings file stores the key in plain text, so keep it out of sync folders and repositories. If you configure Claude Code through settings.json, add "ANTHROPIC_API_KEY": "" to its env block. This stops a key exported in your shell profile from being sent.
This model ID is not in Claude Code's built-in catalog, so the client warns and assumes a smaller context window. CLAUDE_CODE_MAX_CONTEXT_TOKENS states the published window for this model.
Claude Code switches to its Haiku tier for background tasks and some sub-agents. ANTHROPIC_DEFAULT_HAIKU_MODEL, ANTHROPIC_DEFAULT_SONNET_MODEL and ANTHROPIC_DEFAULT_OPUS_MODEL point all three tiers at the model above, and CLAUDE_CODE_SUBAGENT_MODEL does the same for sub-agents. If you leave them out, Claude Code asks Inferway for a Claude model name and those requests fail.
unset ANTHROPIC_API_KEY export ANTHROPIC_BASE_URL='https://api.inferway.ai' export ANTHROPIC_AUTH_TOKEN="$INFERWAY_API_KEY" export ANTHROPIC_MODEL='openai/gpt-6.2-astra' export ANTHROPIC_DEFAULT_HAIKU_MODEL='openai/gpt-6.2-astra' export ANTHROPIC_DEFAULT_SONNET_MODEL='openai/gpt-6.2-astra' export ANTHROPIC_DEFAULT_OPUS_MODEL='openai/gpt-6.2-astra' export CLAUDE_CODE_SUBAGENT_MODEL='openai/gpt-6.2-astra' export CLAUDE_CODE_MAX_CONTEXT_TOKENS=1050000 claude
Thinking
Claude Code asks for thinking by default, and Inferway turns the model's thinking on for those requests: answers take longer and reasoning tokens are billed. To keep thinking off, also export CLAUDE_CODE_DISABLE_THINKING=1 before starting claude.
Verify the connection
Send a short message, then test one read-only tool. Console → Requests shows whether the request was recorded.
Frequently asked questions
Can I use a settings file instead of exporting variables? Yes. Put the same variables in the env block of ~/.claude/settings.json and restart claude; Claude Code 2.1.309 applies them (tested 2026-11-15). The file stores the key in plain text. CC Switch can write this file for you; see the CC Switch guide.
How do I switch back to the default provider? In the terminal where you set the variables, run unset ANTHROPIC_BASE_URL ANTHROPIC_AUTH_TOKEN ANTHROPIC_MODEL ANTHROPIC_DEFAULT_HAIKU_MODEL ANTHROPIC_DEFAULT_SONNET_MODEL ANTHROPIC_DEFAULT_OPUS_MODEL CLAUDE_CODE_SUBAGENT_MODEL CLAUDE_CODE_MAX_CONTEXT_TOKENS (and unset CLAUDE_CODE_DISABLE_THINKING if you exported it), or open a new terminal window to restore standard settings. A leftover ANTHROPIC_MODEL makes Claude Code ask the default provider for an Inferway model ID, and a leftover CLAUDE_CODE_MAX_CONTEXT_TOKENS makes it size the context window for the wrong model. Leftover tier or sub-agent variables do the same for background and sub-agent requests.
What is the status of tool calling and streaming? Inferway's /v1/messages endpoint supports SSE streaming and client-defined tool calls. The one recorded end-to-end run of Claude Code is the CC Switch run of 2026-11-15 (Claude Code 2.1.309): a basic reply and a file-read tool round trip. The CC Switch guide names the model and has the record. Other models, file editing and shell commands have no recorded run, so treat them as unverified.
Cost and usage
Actual consumption is recorded by Inferway: open Console → Requests to see each request's status and token usage, and Console → Usage for totals. Numbers a client shows locally are its own estimates, not billing amounts; rely on the Console.
If a request fails
Authentication: check that an API key is present, active, and allowed to use the model. Reopen the client from the terminal containing the variable. Never print the full key when debugging.
Wrong endpoint or model: check for a duplicate /v1, use the exact published model ID, and confirm the client is using Chat Completions. A request to /responses or /completions cannot be repaired by changing the key.
Limits or timeout: check wallet balance and key limits, respect Retry-After, and reduce the prompt or output budget. Keep streaming enabled for long outputs. Avoid repeated agent retries while diagnosing.
When contacting support, share the client version, model ID, timestamp, and request ID if available. Redact credentials and source code.
Available Text Models & Pricing
All models below can be called directly in your client by specifying the model ID. Rates are the prices published for your market; data retention differs by model, see the Data Retention column.
Loading prices
| Model Name | Model ID | Context Window | Data Retention | Input Price | Output Price | Typical Session Cost |
|---|---|---|---|---|---|---|
| Qwen3.8 27B Uncensored | inferway/qwen3.8-27b-uncensored | 262,144 | Zero data retention (self-hosted) | — | — | — |
| Claude Fable 5.2 | anthropic/claude-fable-5.2 | 1M | Third-party model; its retention terms apply | — | — | — |
| Claude Haiku 5.5 | anthropic/claude-haiku-5.5 | 1M | Third-party model; its retention terms apply | — | — | — |
| Claude Opus 5.5 | anthropic/claude-opus-5.5 | 1M | Third-party model; its retention terms apply | — | — | — |
| Claude Sonnet 5.5 | anthropic/claude-sonnet-5.5 | 1M | Third-party model; its retention terms apply | — | — | — |
| DeepSeek V4.1 Flash 1017 | deepseek/deepseek-v4.1-flash-1017 | 1M | Third-party model; its retention terms apply | — | — | — |
| DeepSeek V4.1 Flash 1017 ZDR | deepseek/deepseek-v4.1-flash-1017-zdr | 1M | Provider states zero data retention | — | — | — |
| DeepSeek V4.1 Flash Uncensored | deepseek/deepseek-v4.1-uncensored | 1M | Provider states zero data retention | — | — | — |
| MiniMax M3.1 Flash | minimax/minimax-m3.1-flash | 1M | Third-party model; its retention terms apply | — | — | — |
| Kimi K3.1 Pro | moonshotai/kimi-k3.1-pro | 1M | Third-party model; its retention terms apply | — | — | — |
| GPT-6 Luna | openai/gpt-6-luna | 1M | Third-party model; its retention terms apply | — | — | — |
| GPT-6.1 Terra | openai/gpt-6.1-terra | 1M | Third-party model; its retention terms apply | — | — | — |
| GPT-6.2 Astra | openai/gpt-6.2-astra | 1M | Third-party model; its retention terms apply | — | — | — |
| GPT-6.2 Sol | openai/gpt-6.2-sol | 1M | Third-party model; its retention terms apply | — | — | — |
| Qwen4 35B-A3B | qwen/qwen4-35b-a3b | 524,288 | Provider states zero data retention | — | — | — |
| MiMo-V2.6 Flash | xiaomi/mimo-v2.6-flash | 1M | Third-party model; its retention terms apply | — | — | — |
| GLM-5.3 | z-ai/glm-5.3 | 1M | Provider states zero data retention | — | — | — |
| GLM-5.3 Flash | z-ai/glm-5.3-flash | 1M | Provider states zero data retention | — | — | — |
| GLM-5.3 Flash Uncensored | z-ai/glm-5.3-flash-uncensored | 1M | Provider states zero data retention | — | — | — |
| GLM-5.3 Uncensored | z-ai/glm-5.3-uncensored | 1M | Provider states zero data retention | — | — | — |
Typical Coding Session Cost Example
Note: This example assumes a typical multi-turn coding session with 50,000 input tokens and 2,000 output tokens (input covers codebase context and turn history; output covers generated code edits and replies). Token counts are illustrative constants; unit prices are the rates published for your market (in that market's currency), and the total cost is calculated dynamically at render time. Actual charges depend on verified usage recorded in the console.