<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[APIVAI Blog]]></title><description><![CDATA[APIVAI Blog]]></description><link>https://apivai.hashnode.dev</link><image><url>https://cdn.hashnode.com/uploads/logos/6a29984197231e7520846d01/51c42d6f-556b-49d4-85aa-cb115549300b.png</url><title>APIVAI Blog</title><link>https://apivai.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Tue, 13 Oct 2026 20:06:15 GMT</lastBuildDate><atom:link href="https://apivai.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Running Claude Code, Cursor and Codex CLI through one API key]]></title><description><![CDATA[Disclosure: I run APIVAI, the gateway used in the examples below. The setup steps work the same way with any endpoint that speaks the Anthropic and OpenAI formats. This post was first published on dev]]></description><link>https://apivai.hashnode.dev/running-claude-code-cursor-and-codex-cli-through-one-api-key</link><guid isPermaLink="true">https://apivai.hashnode.dev/running-claude-code-cursor-and-codex-cli-through-one-api-key</guid><category><![CDATA[claude]]></category><category><![CDATA[claude-code]]></category><category><![CDATA[cursor]]></category><category><![CDATA[AI]]></category><category><![CDATA[API Gateway]]></category><dc:creator><![CDATA[APIVAI]]></dc:creator><pubDate>Thu, 08 Oct 2026 08:59:05 GMT</pubDate><content:encoded><![CDATA[<p><em>Disclosure: I run APIVAI, the gateway used in the examples below. The setup steps work the same way with any endpoint that speaks the Anthropic and OpenAI formats. This post was first published on <a href="https://dev.to/mupromax/running-claude-code-cursor-and-codex-cli-through-one-api-key-3hjd">dev.to</a>.</em></p>
<p>Most AI coding tools let you change the API base URL. That means you can point Claude Code, Cursor, Codex CLI, Cline and the official SDKs at a single gateway and manage one key and one balance instead of several.</p>
<h2>Claude Code</h2>
<p>Claude Code speaks the Anthropic Messages format. Set two environment variables:</p>
<pre><code class="language-bash">export ANTHROPIC_BASE_URL="https://api.apivai.com"
export ANTHROPIC_AUTH_TOKEN="your-key"
claude
</code></pre>
<p>On Windows PowerShell:</p>
<pre><code class="language-powershell">$env:ANTHROPIC_BASE_URL = "https://api.apivai.com"
$env:ANTHROPIC_AUTH_TOKEN = "your-key"
claude
</code></pre>
<h2>Cursor</h2>
<p>Settings → Models → API Keys: turn on <strong>Override OpenAI Base URL</strong>, enter <code>https://api.apivai.com/v1</code>, paste your key, then add the model IDs you want (for example <code>claude-sonnet-4-6</code>).</p>
<h2>OpenAI SDK (Python)</h2>
<pre><code class="language-python">from openai import OpenAI

client = OpenAI(api_key="your-key", base_url="https://api.apivai.com/v1")
r = client.chat.completions.create(
    model="claude-sonnet-4-6",
    messages=[{"role": "user", "content": "Hello"}],
)
print(r.choices[0].message.content)
</code></pre>
<h2>Common errors</h2>
<ul>
<li><strong>401</strong>: the key is wrong, or it was sent in the wrong header. Use <code>x-api-key</code> or <code>Authorization: Bearer</code>.</li>
<li><strong>404</strong>: usually a <code>/v1</code> mismatch. Anthropic-format tools use the root URL, OpenAI-format tools need <code>/v1</code>.</li>
<li><strong>429</strong>: the default limit is 60 requests per minute per key.</li>
</ul>
<h2>What it costs</h2>
<p>At the time of writing, Claude models on APIVAI are 56–62% below Anthropic's list prices and GPT models up to 86% below OpenAI's. For example, Claude Sonnet 4.6 is \(1.15 / \)5.74 per million input / output tokens against the official \(3 / \)15. It's prepaid and pay-per-token, with no subscription. The full table is at <a href="https://apivai.com/pricing">https://apivai.com/pricing</a>.</p>
<p>Setup guides for Cline, Roo Code, Aider, Continue, Open WebUI and others are on the blog: <a href="https://apivai.com/blog">https://apivai.com/blog</a></p>
<p>Questions are welcome in the comments.</p>
]]></content:encoded></item></channel></rss>