← Blog
Open InterpreterIntegrationCoding agents

How to Use Open Interpreter with Claude and GPT via API

(prices in the text follow the live price list)

Short answer

To use Open Interpreter with APIVAI, add a custom provider to ~/.openinterpreter/config.toml with base_url = "https://api.apivai.com/v1", wire_api = "chat" and env_key = "APIVAI_API_KEY", set model_provider to that provider and add harness = "" so Claude models stay on the generic chat mode, put your APIVAI key in the APIVAI_API_KEY environment variable and start interpreter. Open Interpreter appends chat/completions to the base URL itself, so the URL ends with /v1, and this one provider runs both Claude and GPT models, such as claude-sonnet-4-6 or gpt-5.5. The classic Python version uses --api_base https://api.apivai.com/v1 and a model name with the openai/ prefix instead. As of 2026-10-10, Claude Sonnet 4.6 costs $1.15 / $5.74 per million input / output tokens through APIVAI, against the official $3.00 / $15.00, paid per token from a prepaid balance.

What is Open Interpreter in 2026?

Open Interpreter is an open-source agent that runs on your computer: it reads your project, edits files and runs commands. The project changed a lot in 2026. The current release is a Rust terminal agent forked from OpenAI's Codex CLI, started with interpreter (or i) and configured in TOML. It no longer uses LiteLLM, so the old --api_base flags do not exist in it. The original Python version (LiteLLM-based, with --api_base and YAML profiles) lives on as the open-interpreter package on PyPI (last release 0.4.3) and as a community fork.

This guide was checked against the documentation and source code of Open Interpreter 0.0.56 (released October 7, 2026) and tested live with an APIVAI key on that version in October 2026. Open Interpreter ships without a model; APIVAI gives you one key for Claude and GPT, billed per token from a prepaid balance.

Which provider setting should you use?

Routebase_urlwire_apiModels
OpenAI-compatible Chat Completions (recommended), with harness = ""https://api.apivai.com/v1chatClaude and GPT
Anthropic Messages (optional)https://api.apivai.commessagesClaude only
Classic Python version--api_base https://api.apivai.com/v1model prefix openai/Claude and GPT

Open Interpreter joins base_url with a request path. In the source code, the chat transport appends chat/completions and the Messages transport appends v1/messages. That is why the chat base_url ends with /v1 and the Messages one does not. A wrong /v1 gives a 404.

Pick the chat route for one provider that covers every model, and set harness = "" (explained in Step 3) so Claude models do not switch to the claude-code harness, which fails on this route. If you want that harness for Claude, use the Messages route below. More on the format is on the OpenAI-compatible API page.

How do you set up Open Interpreter with APIVAI step by step?

Step 1: Create an APIVAI key

  1. Sign up at apivai.com with your email.
  2. Top up from $10 by card or crypto, or from ¥20 with Alipay / WeChat Pay. There is no free trial or subscription.
  3. In the Dashboard, create a key and copy it. Give it a budget limit if you want a hard cap on what the agent can spend.

Step 2: Install Open Interpreter

On macOS or Linux:

curl -fsSL https://www.openinterpreter.com/install | sh

On Windows PowerShell:

irm https://www.openinterpreter.com/install.ps1 | iex

Restart the terminal and check the install with interpreter --version. No Python is needed for this version.

Step 3: Add APIVAI as a provider

Create or edit ~/.openinterpreter/config.toml (on Windows, %USERPROFILE%\.openinterpreter\config.toml):

model_provider = "apivai"
model = "claude-sonnet-4-6"
model_context_window = 200000
harness = ""

[model_providers.apivai]
name = "APIVAI"
base_url = "https://api.apivai.com/v1"
env_key = "APIVAI_API_KEY"
wire_api = "chat"
KeyValue
model_providerapivai (the id of the provider table)
env_keyName of the environment variable that holds your key
model_context_windowOptional; 200000 is a conservative value
harness"" (no harness: generic chat mode for every model)

Without harness = "", Open Interpreter switches Claude model IDs to its claude-code harness, which in 0.0.56 does not run over the chat route and stops with a "compatibility transport" error. The empty value keeps the generic chat mode for every model.

Open Interpreter may lack metadata for models from a custom provider, so model_context_window tells it how much context to use before compacting the conversation; a smaller window keeps requests cheaper.

Step 4: Set the key

export APIVAI_API_KEY="YOUR_APIVAI_KEY"

On Windows, run setx APIVAI_API_KEY "YOUR_APIVAI_KEY" and open a new terminal, or use $env:APIVAI_API_KEY = "YOUR_APIVAI_KEY" for the current PowerShell session. Keep the key out of config.toml.

Step 5: Start a session and switch models

Run interpreter in your project; /debug-config shows the active provider and model. To switch models, use interpreter -m gpt-5.5 for one run, /model in the session (the picker reads APIVAI's GET /v1/models), or profiles. A profile is a separate file next to config.toml, named <name>.config.toml, and its keys are layered on top of config.toml:

# ~/.openinterpreter/gpt.config.toml
model = "gpt-5.5"
# ~/.openinterpreter/cheap.config.toml
model = "claude-haiku-4-5"

Start one with interpreter --profile gpt (or -p gpt). Do not put profiles.* tables inside config.toml: that is the old format, and in 0.0.56 it makes --profile fail. Models are added and retired over time, so copy IDs from GET /v1/models or the pricing page.

Open Interpreter runs real commands on your machine. By default it works inside a sandbox (sandbox_mode = "workspace-write") and asks before actions that need more access (approval_policy = "on-request"). --yolo removes both; use it only in a throwaway VM or container.

How do you use the Anthropic Messages route for Claude?

If you only use Claude, prefer its native format or want the Claude Code harness, add a second provider. We tested this route with an APIVAI key and it works; Open Interpreter picks the claude-code harness for it automatically.

[model_providers.apivai-claude]
name = "APIVAI Claude"
base_url = "https://api.apivai.com"
env_key = "APIVAI_API_KEY"
wire_api = "messages"
http_headers = { "anthropic-version" = "2023-06-01" }

Then set model_provider = "apivai-claude" and remove harness = "" (or set harness = "claude-code"): the Messages route requires a Claude Code harness and rejects the generic mode. Do not add /v1: Open Interpreter sends Messages requests to base_url plus v1/messages. It adds the anthropic-version header automatically only for its built-in Anthropic provider, so set it in http_headers. This route does not work for GPT models. More on the format is on the Claude API proxy page.

How do you configure the classic Python Open Interpreter?

The classic version installs with pip install open-interpreter (Python 3.9 or newer); the community fork installs with pip install git+https://github.com/endolith/open-interpreter.git (Python 3.10 or newer). It talks to models through LiteLLM:

interpreter --api_base https://api.apivai.com/v1 --api_key YOUR_APIVAI_KEY --model openai/claude-sonnet-4-6 --context_window 200000 --max_tokens 8192

The openai/ prefix tells LiteLLM to use the OpenAI-compatible route for any model ID. In Python:

from interpreter import interpreter

interpreter.llm.model = "openai/gpt-5.5"
interpreter.llm.api_base = "https://api.apivai.com/v1"
interpreter.llm.api_key = "YOUR_APIVAI_KEY"
interpreter.llm.context_window = 200000
interpreter.llm.max_tokens = 8192
interpreter.chat()

To make it permanent, run interpreter --profiles, open default.yaml and put model, api_base, api_key, context_window and max_tokens under its llm: section. The classic version asks before running each piece of code; -y (or auto_run: True) skips that, so use it with care.

Which model should you choose?

Prices per 1M input / output tokens as of 2026-10-10:

Model IDPrice (in / out)Good for
claude-sonnet-5-5$0.77 / $3.82Strong default for coding sessions
claude-sonnet-4-6$1.15 / $5.74Most popular, widely supported
claude-opus-5-5$1.54 / $7.65Hardest tasks
claude-haiku-4-5$0.38 / $1.92Fast, cheap scripts and questions
gpt-5.5$0.77 / $4.56GPT alternative
gpt-6-sol$0.30 / $1.52Newer GPT model
gpt-6-luna$0.0144 / $0.0768Very cheap runs

Open Interpreter relies on tool calling to edit files and run commands; all models above support it through APIVAI.

How much does Open Interpreter cost with APIVAI?

Every turn resends the conversation, tool output and the harness prompt, so input tokens make up most of the bill. Two worked examples:

  • One working session on Claude Sonnet 4.6: about 30 requests of 30,000 input and 1,500 output tokens each. Cost: $1.29 with APIVAI, $3.38 at official prices.
  • A month of two such sessions a day for 22 days (1,320 requests): $56.91 with APIVAI, $149 at official prices. The same session on GPT-6 Luna costs $0.0164.

Thinking tokens count as output tokens. Your real numbers per request are on the Dashboard. For a wider comparison, read Claude API pricing in 2026.

How do you fix common errors?

  • "non-Responses wire APIs require the compatibility transport": Open Interpreter picked the claude-code harness for a Claude model on the chat route. Add harness = "" to config.toml, or use the Messages provider for Claude. --chat-completions does not fix it.
  • "--profile gpt cannot be used while config.toml contains legacy ...": move that table's keys into ~/.openinterpreter/gpt.config.toml and delete the table from config.toml.
  • 401 Unauthorized: the key is wrong or deleted, or APIVAI_API_KEY is not set in the terminal that started interpreter (after setx, open a new window).
  • 402 insufficient_quota: the key's budget is used up or too low for the selected model. Add budget to the key in the Dashboard (leave a few dollars of headroom for Opus-class models) or pick a cheaper model. What is left on the key isn't lost: deleting the key returns it to your account balance.
  • 404 Not Found: wrong /v1. With wire_api = "chat" the base_url is https://api.apivai.com/v1; with wire_api = "messages" it is https://api.apivai.com. Do not put /chat/completions in the URL.
  • Model not found: use the exact ID, such as claude-sonnet-4-6, and compare with GET /v1/models. The current version needs no openai/ prefix. In the classic version, a missing openai/ prefix makes LiteLLM fail with "LLM Provider NOT provided" or send the request to the wrong API.
  • Context window warnings or early compaction: set model_context_window (current version) or --context_window and --max_tokens (classic version).
  • Empty or cut-off replies: thinking is on by default and uses output tokens. In the classic version, raise --max_tokens to 8192 (at least 4096). The current version sets output limits itself and has no max-tokens option; a lower model_reasoning_effort (for example "medium") leaves more room for the answer on models that support it.
  • 429 Too Many Requests: the default limit is 60 requests per minute per key. Wait briefly or ask support to raise it.

More on request formats is in the docs. All API error codes and their fixes are collected in Claude API error codes.

FAQ

Does Open Interpreter still have the --api_base flag?

Only the classic Python version does. The current Rust version configures providers in config.toml with base_url and wire_api.

Can I use Claude and GPT in Open Interpreter with one key?

Yes. One APIVAI key works for every model, and the chat provider covers both families. Switch with -m, /model or a profile.

Why does Open Interpreter say "non-Responses wire APIs require the compatibility transport"?

It switched a Claude model to the claude-code harness, which in 0.0.56 does not run over the chat route. Add harness = "" to config.toml, or use the Anthropic Messages provider for Claude.

Does APIVAI store my data?

No. Request and response content is not logged; only usage data such as model, tokens and cost is kept for billing.

Is there a similar terminal agent guide?

Yes. See the Goose guide and the Aider guide.

Create an account, top up from $10 and paste your key into Open Interpreter.

Ready to start?

Get your API key in 30 seconds. Pay as you go for Claude and GPT.

Get Started