aicheap.io

Setup Docs

Two env vars. Same workflow.

Pick your tool below, copy the snippet, paste it. Every endpoint speaks the OpenAI or Anthropic API verbatim — no SDK swaps, no code changes.

If your tool lets you configure an OpenAI base URL and key, it works. Same pattern as Cursor/Cline/aider — for everything else.

  1. 1

    The two values to set

    Base URL / API host:  https://api.aicheap.io/v1
    API key:             sk-...
    Model:               gpt-5.4  # or any id from /models
  2. 2

    Tools known to work this way

    Verified by users in the community: LibreChat, Open WebUI, ChatBox, BoltAI, TypingMind, Jan, BetterChatGPT, Big-AGI, Lobe Chat, NextChat, ChatGPT-Next-Web, AnythingLLM, llm (Simon Willison's CLI). Anything that exposes an "OpenAI base URL" / "OpenAI-compatible endpoint" setting will work — if you find one that doesn't, ping us in the Telegram community.

Claude Code

Anthropic API

Anthropic's official CLI agent. Set two env vars and the CLI talks to aicheap.io instead of api.anthropic.com.

  1. 1

    Get an API key

    Sign in at console.aicheap.io, pick a plan, and copy the key from the Keys page.

  2. 2

    Export the env vars

    export ANTHROPIC_BASE_URL="https://api.aicheap.io/anthropic/v1"
    export ANTHROPIC_API_KEY="sk-..."
    
    # Optional: pin to a specific model
    export ANTHROPIC_MODEL="gpt-5.4"
  3. 3

    Run claude as usual

    claude
    # or with a prompt
    claude "refactor this function"

Codex

OpenAI API

OpenAI's coding agent. Point OPENAI_BASE_URL at the Codex-compatible endpoint.

  1. 1

    Export the env vars

    export OPENAI_BASE_URL="https://api.aicheap.io/openai/v1"
    export OPENAI_API_KEY="sk-..."
  2. 2

    Run codex

    codex

OpenCode

OpenAI API

OpenAI-compatible coding agent. Point OPENAI_BASE_URL at our /v1 endpoint.

  1. 1

    Export the env vars

    export OPENAI_BASE_URL="https://api.aicheap.io/v1"
    export OPENAI_API_KEY="sk-..."
  2. 2

    Run opencode

    opencode

OpenClaw

Config file

Add aicheap as a custom provider in your OpenClaw JSON config.

  1. 1

    Edit ~/.openclaw/openclaw.json

    // ~/.openclaw/openclaw.json
    {
      "models": {
        "providers": {
          "aicheap": {
            "baseUrl": "https://api.aicheap.io/v1",
            "apiKey": "sk-...",
            "api": "openai-completions"
          }
        }
      }
    }
  2. 2

    Restart OpenClaw and pick the aicheap provider

    Models served via aicheap appear under the aicheap provider in the model picker.

Cursor

Config file

Override OpenAI in Cursor settings. Works for both chat and tab completion.

  1. 1

    Open Cursor → Settings → Models

    Toggle on Override OpenAI Base URL.

  2. 2

    Set base URL and key

    Base URL: https://api.aicheap.io/cursor/v1
    OpenAI API Key: sk-...
  3. 3

    Verify and use

    Click Verify in settings. After it confirms, every Cursor request flows through aicheap.io.

Cline supports any OpenAI-compatible endpoint via its provider settings.

  1. 1

    Open the Cline sidebar → ⚙ Settings

    Set API Provider to OpenAI Compatible.

  2. 2

    Configure the endpoint

    Base URL: https://api.aicheap.io/v1
    API Key: sk-...
    Model ID: gpt-5.4  # or any model from /models

aider

Config file

aider speaks OpenAI and Anthropic natively. Both env styles work.

  1. 1

    Anthropic-style (Claude models)

    export ANTHROPIC_BASE_URL="https://api.aicheap.io/anthropic/v1"
    export ANTHROPIC_API_KEY="sk-..."
    aider --model gpt-5.4
  2. 2

    OpenAI-style (GPT, Gemini, Grok, …)

    export OPENAI_API_BASE="https://api.aicheap.io/v1"
    export OPENAI_API_KEY="sk-..."
    aider --model gpt-5.4

Add aicheap as an OpenAI-compatible provider in ~/.continue/config.json.

  1. 1

    Edit ~/.continue/config.json

    {
      "models": [
        {
          "title": "aicheap — Claude Opus",
          "provider": "openai",
          "model": "gpt-5.4",
          "apiBase": "https://api.aicheap.io/v1",
          "apiKey": "sk-..."
        }
      ]
    }

Drop-in replacement. Override base_url when constructing the client.

  1. 1

    Python

    from openai import OpenAI
    
    client = OpenAI(
        base_url="https://api.aicheap.io/v1",
        api_key="sk-...",
    )
    
    resp = client.chat.completions.create(
        model="gpt-5.4",
        messages=[{"role": "user", "content": "hello"}],
    )
    print(resp.choices[0].message.content)
  2. 2

    Node

    import OpenAI from "openai";
    
    const client = new OpenAI({
      baseURL: "https://api.aicheap.io/v1",
      apiKey: "sk-...",
    });
    
    const resp = await client.chat.completions.create({
      model: "gpt-5.4",
      messages: [{ role: "user", content: "hello" }],
    });

Anthropic SDK

Anthropic API

Anthropic's official SDK works unchanged — set the base URL.

  1. 1

    Python

    from anthropic import Anthropic
    
    client = Anthropic(
        base_url="https://api.aicheap.io/anthropic/v1",
        api_key="sk-...",
    )
    
    msg = client.messages.create(
        model="gpt-5.4",
        max_tokens=1024,
        messages=[{"role": "user", "content": "hello"}],
    )
  2. 2

    Node

    import Anthropic from "@anthropic-ai/sdk";
    
    const client = new Anthropic({
      baseURL: "https://api.aicheap.io/anthropic/v1",
      apiKey: "sk-...",
    });

cURL

OpenAI API

Sanity-check a key in 5 seconds before wiring it into your tools.

  1. 1

    OpenAI-compatible request

    curl https://api.aicheap.io/v1/chat/completions \
      -H "Authorization: Bearer sk-..." \
      -H "Content-Type: application/json" \
      -d '{
        "model": "gpt-5.4",
        "messages": [{"role": "user", "content": "ping"}]
      }'
  2. 2

    Anthropic-compatible request

    curl https://api.aicheap.io/anthropic/v1/messages \
      -H "x-api-key: sk-..." \
      -H "anthropic-version: 2023-06-01" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "gpt-5.4",
        "max_tokens": 1024,
        "messages": [{"role": "user", "content": "ping"}]
      }'

Troubleshooting

"401 Unauthorized" or "invalid_api_key"

Your tool may still be holding the old provider's key. Confirm echo $OPENAI_API_KEY (or $ANTHROPIC_API_KEY) prints your aicheap key, then restart the tool. Some shells require unset first if a different key was previously exported.

"model not found" / 404

Check the exact model ID against /models. IDs are case-sensitive and provider-prefixed in some tools (e.g. openai/gpt-5).

Which base URL for which client?

Each agent has a dedicated base URL. Set it exactly as shown:

  • Claude Code & Anthropic SDK: https://api.aicheap.io/anthropic/v1
  • Codex: https://api.aicheap.io/openai/v1
  • Cursor: https://api.aicheap.io/cursor/v1
  • Everything else OpenAI-compatible: https://api.aicheap.io/v1

Streaming hangs or drops

Disable any aggressive HTTP buffering proxy between you and aicheap.io (corp VPN, Charles, etc.). Streaming uses Server-Sent Events and breaks under buffering.

Rate limit / TPM concerns

RPM and TPM are per-plan (Plus 30 RPM / 1.5M TPM, Max 40 RPM / 2M TPM, Pro Max 50 RPM / 2.5M TPM, Ultra 60 RPM / 3M TPM). Spend limits cap total spend, not throughput. Check the dashboard at console.aicheap.io.

Still stuck?

The Telegram community usually answers setup questions in minutes, and we read every email.