EN ▾

OpenAI Alternative to Claude Code: Coding Agent Setup

Claude Code talks to Anthropic's own API, so it cannot simply be repointed at an OpenAI-style endpoint. Here is what works instead: coding agents that accept a custom OpenAI base URL, and how to wire them to this API.

Updated

Terminal window linked by a glowing cable to an API server cube, illustrating a coding agent using a custom endpoint

Key points

  • Claude Code is built around Anthropic's API format, while this service speaks the OpenAI chat completions format.
  • Aider, Continue, Cline and Cursor-style tools accept a custom OpenAI-compatible base URL and a model name.
  • Use base URL https://api.minimaxapikey.com/v1 with the model ID uncensored and a Bearer key.
  • Test with curl first, then keep concurrency at or below 8 requests, because agents fire many calls at once.

The short answer

If you searched for an openai alternative to claude code, the first thing to settle is what you want to replace. Claude Code is Anthropic's terminal coding agent. It is designed to talk to Anthropic's own API, which uses a different request format from the OpenAI one. This service implements the OpenAI chat completions format, so the two do not plug into each other by changing a URL.

What does work is the large family of coding agents and editor plugins that accept any OpenAI-compatible endpoint. You give them a base URL, a key and a model name, and they send ordinary POST /v1/chat/completions requests. Aider, Continue and Cline all fall into this group, and several editors have a base URL override for OpenAI models. For this API the three values are the base URL https://api.minimaxapikey.com/v1, the model ID uncensored, and your key as a Bearer token.

Keep your expectations grounded. The model behind the endpoint is one open-weight model run by an independent provider, tuned to answer without content refusals for lawful adult use. It is not Claude, and it is not an official API from any model vendor. Whether it suits your repository is something you find out on your own tasks, and this article shows how to run that test cheaply.

Why you cannot just change a URL in Claude Code

An API format is more than an address. Anthropic's API has its own message structure, its own way of expressing system prompts, its own tool-use blocks and its own streaming events. An OpenAI-style server expects messages with roles, a tools array of function definitions, and server-sent events carrying choices[0].delta. A client built for one format will fail or misbehave against a server for the other, even if the URL is reachable.

Some people place a translation layer between the two, a small proxy that rewrites requests and responses. That can work, but it is a separate piece of software you would run and debug yourself, and behaviour around tool calls and streaming tends to be where such layers break. Whether Claude Code offers an official setting for third-party endpoints is something to check in Anthropic's current documentation, because those options change.

The simpler path is to choose an agent that already speaks the OpenAI format. You lose nothing in terms of the basic loop: the agent reads your files, builds a prompt, asks the model for an edit, and applies it. The model is the part you are swapping, and that part only needs a compatible endpoint.

Test the endpoint with curl before touching any tool

Every integration problem is easier to diagnose if you already know the raw API works. Create a key on the API key page, export it, and run one request. If this succeeds, any failure later is in the tool settings, not in the key or the network.

export UNCENSORED_KEY="paste-your-key-here"

curl -s https://api.minimaxapikey.com/v1/chat/completions \
  -H "Authorization: Bearer $UNCENSORED_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [
      {"role": "system", "content": "You are a concise coding assistant."},
      {"role": "user", "content": "Write a Python function that parses an ISO date string."}
    ]
  }'

You can also list models with GET /v1/models. Many tools call that endpoint when you save a provider, to confirm the key is valid, so it is worth seeing it return before you configure anything. The documentation page has the full request reference.

Where each tool takes the base URL

The names of the settings differ, but the idea is the same everywhere. The table lists the common coding tools and the field you fill in. Menus move between versions, so treat it as a map and check each tool's own docs for the current layout.

ToolWhere to enter the endpointModel name to use
AiderEnvironment variables or command-line flags for the OpenAI base URL and keyopenai/uncensored
ContinueA model entry in its config file, with provider openai and an apiBaseuncensored
ClineProvider list, choose the OpenAI-compatible optionuncensored
CursorModels settings, OpenAI API key section with a base URL overrideuncensored as a custom model
Your own scriptThe base_url argument of any OpenAI SDKuncensored

Because this service exposes exactly one model, there is no model picker to configure. Wherever a tool wants a model name, type uncensored. If the tool insists on a list of known models and rejects unknown names, look for a "custom model" or "add model" option.

Aider example

Aider runs in your terminal, edits files in a git repository and commits the result, which makes it the closest in spirit to Claude Code. It uses LiteLLM underneath, so the model name carries a provider prefix. For an OpenAI-compatible server that prefix is openai/.

pip install aider-chat

export OPENAI_API_BASE="https://api.minimaxapikey.com/v1"
export OPENAI_API_KEY="paste-your-key-here"

cd your-repo
aider --model openai/uncensored

Once it starts, ask for a small change in a single file and watch the diff. Begin with something you can verify in seconds, such as adding a docstring or renaming a function, before you hand it a multi-file task. Aider sends the repository map and the files you added to the chat on every turn, so the prompt grows quickly. The 100,000-token window (prompt plus completion) is generous, but a large repository still needs you to add only the files that matter.

If Aider warns that it does not know the context size or price for the model, that is expected: it has no entry for a custom model name. The warning does not stop it from working.

Continue example

Continue is an editor extension that adds chat, edit and autocomplete features inside VS Code and JetBrains. Its configuration lists models, each with a provider and optional overrides. A model entry for this API looks like the following. The exact file name and schema depend on the Continue version you have installed, so compare it with the current docs.

{
  "models": [
    {
      "title": "Uncensored API",
      "provider": "openai",
      "model": "uncensored",
      "apiBase": "https://api.minimaxapikey.com/v1",
      "apiKey": "paste-your-key-here"
    }
  ]
}

Chat and edit requests work well with an endpoint like this. Tab autocomplete is a different workload: it fires on nearly every pause in typing and wants very low latency, which is better served by a small local model. Using a hosted chat model for inline completions will burn requests against your 300 per minute limit with little to show for it.

Build a minimal agent yourself

If no existing tool fits, the tool-calling support makes a small agent easy to write. The API accepts tools and tool_choice, streams tool_calls back, and takes results as messages with role: "tool". The loop below gives the model one function that reads a file, then keeps going until the model answers in plain text.

import json
from openai import OpenAI

client = OpenAI(base_url="https://api.minimaxapikey.com/v1", api_key="paste-your-key-here")

tools = [{
    "type": "function",
    "function": {
        "name": "read_file",
        "description": "Return the text of a file in the current project.",
        "parameters": {
            "type": "object",
            "properties": {"path": {"type": "string"}},
            "required": ["path"],
        },
    },
}]

messages = [{"role": "user", "content": "Summarise what main.py does."}]

while True:
    resp = client.chat.completions.create(model="uncensored", messages=messages, tools=tools)
    msg = resp.choices[0].message
    messages.append(msg)
    if not msg.tool_calls:
        print(msg.content)
        break
    for call in msg.tool_calls:
        args = json.loads(call.function.arguments)
        with open(args["path"], encoding="utf-8") as f:
            result = f.read()
        messages.append({"role": "tool", "tool_call_id": call.id, "content": result})

Add a write function and a confirmation prompt before it runs, and you have the core of a coding agent in about fifty lines. Always validate paths before reading or writing: a model can ask for any path it likes.

Limits and costs to plan around

Agents behave differently from a person chatting. They send bursts of requests, often several in parallel. A full key allows 8 concurrent requests and 300 requests per minute. A trial key allows 2 concurrent and 60 per minute, which can be tight for an agent. When you exceed a limit, the API answers with HTTP 429 and the error code rate_limited or concurrency. Under temporary overload it also returns 429 with Retry-After: 5. Most good clients retry on 429, but if yours does not, lower its parallelism setting. A streamed request holds its concurrency slot until the stream ends, so long streaming edits count against the 8.

On cost, billing is pay as you go from prepaid credit at $0.15 per 1M input tokens and $0.50 per 1M output tokens. Say a session sends 40 requests carrying 30,000 input tokens each, and receives 1,000 output tokens each. That is 1,200,000 input tokens, or $0.18, plus 40,000 output tokens, or $0.02, for $0.20 in total. Failed or refused requests are not charged, and credit never expires. See the pricing page for top-up amounts and bonuses.

New accounts can claim $0.50 of trial credit with one click on the key page, no card needed, valid for 7 days. That is enough to run the curl test and a few small Aider edits. Prompts are not used for training.

Questions and answers

Can I point Claude Code itself at this API?

Not directly. Claude Code is built for Anthropic's API format, while this service implements OpenAI-style chat completions. Check Anthropic's current documentation for what Claude Code supports, and use an OpenAI-compatible agent if you want to use this endpoint.

Which coding tools work with a custom OpenAI base URL?

Aider, Continue and Cline all let you enter an OpenAI-compatible base URL, a key and a model name. Cursor offers a base URL override for OpenAI-style models too, though you should check its current settings and plan limits.

Does the API support tool calling for agents?

Yes. You can send tools and tool_choice, receive streamed tool_calls, and return results with role tool. Whether a given editor plugin uses these fields depends on the plugin.

How much does a coding session cost?

Pricing is $0.15 per 1M input tokens and $0.50 per 1M output tokens. Agents resend a lot of context, so input tokens usually dominate the bill.

Your key is one form away

Create an account, copy the key, change the base URL. That is the whole setup.

Get API key