<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: APIVAI</title>
    <description>The latest articles on DEV Community by APIVAI (@mupromax).</description>
    <link>https://dev.to/mupromax</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3978088%2F58e79879-33b7-405b-9773-fbeb3b4bb54a.png</url>
      <title>DEV Community: APIVAI</title>
      <link>https://dev.to/mupromax</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mupromax"/>
    <language>en</language>
    <item>
      <title>How to check whether your Claude API relay is serving the real model (what works, what doesn't)</title>
      <dc:creator>APIVAI</dc:creator>
      <pubDate>Mon, 19 Oct 2026 12:14:42 +0000</pubDate>
      <link>https://dev.to/mupromax/how-to-check-whether-your-claude-api-relay-is-serving-the-real-model-what-works-what-doesnt-ke1</link>
      <guid>https://dev.to/mupromax/how-to-check-whether-your-claude-api-relay-is-serving-the-real-model-what-works-what-doesnt-ke1</guid>
      <description>&lt;p&gt;&lt;em&gt;Disclosure: I run APIVAI, a pay-as-you-go gateway for Claude and GPT. I ran the tests below against my own service too, and the results are at the end. The method works on any relay that speaks the native Anthropic format, so use it on mine, on others, or on the one you already pay for.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;If you buy Claude through a reseller, a relay or a gateway, you are trusting that a request for &lt;code&gt;claude-sonnet-4-6&lt;/code&gt; actually reaches Claude Sonnet 4.6. That trust is not always deserved:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A CISPA paper accepted to ACM CCS 2026 ("Real Money, Fake Models", arXiv 2603.01919) audited "shadow APIs" used in 187 research papers. On the three it tested in depth, performance diverged by up to 47% and 45.83% of fingerprint checks failed identity verification.&lt;/li&gt;
&lt;li&gt;In Chinese developer forums the complaint has its own vocabulary: 以次充好 (passing off a cheaper product), 掺水 (watering down), 降智 (the model "got dumber"). Typical posts: "how do they guarantee it isn't another model?" Reply: "they don't, and they mix them."&lt;/li&gt;
&lt;li&gt;On Hacker News, people report being routed to poor quantizations on marketplaces "while paying maybe 15% less".&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So how do you check? Most of the advice you will find doesn't work.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tests that don't work
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;"Ask it who it is."&lt;/strong&gt; A relay can inject a system prompt, and real models get their own identity wrong anyway. One survey of 190 models found about 60% misnamed themselves at least once.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"Ask for its knowledge cutoff."&lt;/strong&gt; A backend serving genuine Claude gave 12 different cutoff dates across 34 asks in one published test. The answer is noise.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"Check the &lt;code&gt;model&lt;/code&gt; field in the response."&lt;/strong&gt; The relay writes that field. It can say anything.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"It feels slower/dumber today."&lt;/strong&gt; Real regressions exist (Anthropic published a postmortem in 2025 about infrastructure bugs that degraded some Sonnet responses), and so do prompt and context differences. A feeling is not evidence.&lt;/p&gt;

&lt;h2&gt;
  
  
  The test that does work: the thinking signature
&lt;/h2&gt;

&lt;p&gt;When extended thinking is on, Anthropic returns each &lt;code&gt;thinking&lt;/code&gt; block with an opaque &lt;code&gt;signature&lt;/code&gt;. In a tool-use conversation you must send the previous assistant turn back, thinking blocks included, and &lt;strong&gt;Anthropic verifies that signature&lt;/strong&gt;. A fake or modified signature is rejected with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;400 invalid_request_error: messages.1.content.0: Invalid `signature` in `thinking` block
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That gives you a clean experiment:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Ask a question that makes the model call a tool, with thinking enabled. You get back a &lt;code&gt;thinking&lt;/code&gt; block (with a signature) and a &lt;code&gt;tool_use&lt;/code&gt; block.&lt;/li&gt;
&lt;li&gt;Send the turn back unchanged with a tool result. &lt;strong&gt;A genuine backend accepts it.&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Send it back again with the last few characters of the signature changed. &lt;strong&gt;A genuine backend rejects it&lt;/strong&gt; with the error above.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Step 3 is the important one. A relay that serves another model can invent a signature string, but it cannot make Anthropic's verifier reject a tampered one and accept the real one, unless the requests really are going to Anthropic.&lt;/p&gt;

&lt;p&gt;Supporting signals in the same responses (useful, but forgeable on their own):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Message IDs look like &lt;code&gt;msg_011…&lt;/code&gt;, tool-call IDs like &lt;code&gt;toolu_…&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;usage&lt;/code&gt; contains the newer fields: &lt;code&gt;service_tier&lt;/code&gt;, &lt;code&gt;inference_geo&lt;/code&gt;, and a nested &lt;code&gt;cache_creation&lt;/code&gt; object.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The script
&lt;/h2&gt;

&lt;p&gt;Python, standard &lt;code&gt;requests&lt;/code&gt;, native Anthropic format. It costs well under a cent on Haiku and about a cent on Sonnet.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;

&lt;span class="n"&gt;BASE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;RELAY_BASE_URL&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;      &lt;span class="c1"&gt;# e.g. https://your-relay.example (no /v1)
&lt;/span&gt;&lt;span class="n"&gt;KEY&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;RELAY_API_KEY&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;MODEL&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;MODEL&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;claude-sonnet-4-6&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;H&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;x-api-key&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;anthropic-version&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;2023-06-01&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;content-type&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;application/json&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="n"&gt;TOOLS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;name&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;get_weather&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;description&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Get the weather for a city&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;input_schema&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;type&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;object&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;properties&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;city&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;type&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;string&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}},&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;required&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;city&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]}}]&lt;/span&gt;
&lt;span class="n"&gt;THINK&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;type&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;enabled&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;budget_tokens&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1024&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="n"&gt;Q&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;role&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;user&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;content&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;What is the weather in Paris? Use the tool.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;call&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;BASE&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;/v1/messages&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;H&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;120&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;model&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;MODEL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;max_tokens&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1600&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;thinking&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;THINK&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;tools&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;TOOLS&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;messages&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;status_code&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;call&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;Q&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;span class="n"&gt;blocks&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;content&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[])&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;1st:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;type&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;blocks&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;usage fields:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;sorted&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;usage&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{}).&lt;/span&gt;&lt;span class="nf"&gt;keys&lt;/span&gt;&lt;span class="p"&gt;()))&lt;/span&gt;
&lt;span class="n"&gt;tool&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;next&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;blocks&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;type&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;tool_use&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;think&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;next&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;blocks&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;type&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;thinking&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tool&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;think&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;think&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;signature&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)):&lt;/span&gt;
    &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;SystemExit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;No thinking block with a signature: cannot run the test (try another model or prompt).&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;second&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;call&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;Q&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;role&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;assistant&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;content&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
                 &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;role&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;user&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;content&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;type&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;tool_result&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;tool_use_id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;tool&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;content&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Sunny, 18C&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}]}])&lt;/span&gt;

&lt;span class="n"&gt;s2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;second&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;blocks&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;2nd, signature unchanged:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;s2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;(expect 200)&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;bad&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;signature&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;signature&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;][:&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;AAAAAAAA&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;type&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;thinking&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;blocks&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;s3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b3&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;second&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bad&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;3rd, signature tampered:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;s3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;error&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{}).&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;message&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;""&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;(expect 400 Invalid `signature`)&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Read the result like this:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;2nd call&lt;/th&gt;
&lt;th&gt;3rd call&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;200&lt;/td&gt;
&lt;td&gt;400 "Invalid &lt;code&gt;signature&lt;/code&gt;"&lt;/td&gt;
&lt;td&gt;Requests reach Anthropic's Claude and the relay passes thinking blocks through intact&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;200&lt;/td&gt;
&lt;td&gt;200&lt;/td&gt;
&lt;td&gt;Nobody is checking signatures: not a genuine Anthropic backend&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;400&lt;/td&gt;
&lt;td&gt;400&lt;/td&gt;
&lt;td&gt;The relay breaks thinking blocks (common when it converts to OpenAI format); Claude Code multi-turn sessions will hit this too&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  What this test cannot tell you
&lt;/h2&gt;

&lt;p&gt;Be clear about the limits, because nobody can prove more than this from the outside:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;It proves "Anthropic's Claude", not "which Claude".&lt;/strong&gt; A relay that quietly sends your Opus requests to Sonnet, both on Anthropic, passes. To catch tier swaps, compare cost and latency against the official API on the same prompts, or run a small fixed set of hard questions from time to time.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It's a point in time.&lt;/strong&gt; Relays change backends. Run it again now and then, and on the models you actually use.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It needs the native Anthropic format.&lt;/strong&gt; OpenAI-format endpoints drop thinking signatures, so you can't run it there.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Passing is "no evidence of substitution", not proof.&lt;/strong&gt; That's also the conclusion of the academic audits; only hardware attestation would be real proof, and no reseller channel offers it.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Other things worth checking before you prepay anyone
&lt;/h2&gt;

&lt;p&gt;These come from complaints that keep recurring in forums:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Billing you can reconcile:&lt;/strong&gt; per-request logs with input, output, cache-read and cache-write tokens and the cost of each request. Cache hit rates that never change from request to request are a red flag.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Prices next to the official price&lt;/strong&gt;, and notice before any change. "They silently changed my group/multiplier and burned my balance" is a common story.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Small top-ups and a written refund policy&lt;/strong&gt; for unused balance. Relays that vanish with prepaid balances are not rare.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A clear statement of what is logged.&lt;/strong&gt; Metadata (tokens, model, cost) is normal; request and response content should not be stored.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Honest limits:&lt;/strong&gt; rate limits and concurrency stated up front, not "upstream fluctuation" after the fact.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  My own results
&lt;/h2&gt;

&lt;p&gt;I ran the script against my service (APIVAI) through its public endpoint on Claude Haiku 4.5, and against Claude Sonnet 4.6 on the same backend:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;1st call: &lt;code&gt;msg_011…&lt;/code&gt; ID, &lt;code&gt;toolu_…&lt;/code&gt; tool ID, &lt;code&gt;usage&lt;/code&gt; with &lt;code&gt;service_tier&lt;/code&gt;, &lt;code&gt;inference_geo&lt;/code&gt; and nested &lt;code&gt;cache_creation&lt;/code&gt;, and a thinking block with a signature.&lt;/li&gt;
&lt;li&gt;2nd call (unchanged signature): 200.&lt;/li&gt;
&lt;li&gt;3rd call (tampered signature): 400 &lt;code&gt;Invalid \&lt;/code&gt;signature&lt;code&gt;in \&lt;/code&gt;thinking&lt;code&gt;block&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Not present: &lt;code&gt;anthropic-ratelimit-*&lt;/code&gt; response headers, so I can't offer those as a signal.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is all the test shows, with the limits above. If you run it against any relay, including mine, I'd be glad to see the results in the comments, especially failures.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>claude</category>
      <category>security</category>
      <category>api</category>
    </item>
    <item>
      <title>LobeChat (LobeHub) with Claude and GPT: custom provider, Docker env vars and the /v1 rule</title>
      <dc:creator>APIVAI</dc:creator>
      <pubDate>Mon, 19 Oct 2026 09:19:21 +0000</pubDate>
      <link>https://dev.to/mupromax/lobechat-lobehub-with-claude-and-gpt-custom-provider-docker-env-vars-and-the-v1-rule-3ee7</link>
      <guid>https://dev.to/mupromax/lobechat-lobehub-with-claude-and-gpt-custom-provider-docker-env-vars-and-the-v1-rule-3ee7</guid>
      <description>&lt;p&gt;&lt;em&gt;Disclosure: I run APIVAI, the gateway used in the examples below. The setup is the same for any endpoint that speaks the OpenAI or Anthropic format.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;LobeChat is now called &lt;strong&gt;LobeHub&lt;/strong&gt;: the GitHub repo &lt;code&gt;lobehub/lobe-chat&lt;/code&gt; redirects to &lt;code&gt;lobehub/lobehub&lt;/code&gt;, and the Docker image is &lt;code&gt;lobehub/lobehub&lt;/code&gt;. It's an open-source chat and agent app that runs on the web, as a desktop app, or self-hosted, and every agent can use its own provider and model. This guide follows the &lt;a href="https://lobehub.com/docs/self-hosting/environment-variables/model-provider" rel="noopener noreferrer"&gt;LobeHub docs&lt;/a&gt; and UI labels as of October 2026: how to add a third-party API, where &lt;code&gt;/v1&lt;/code&gt; goes, and the usual pitfalls.&lt;/p&gt;

&lt;h2&gt;
  
  
  Three ways to connect
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Method&lt;/th&gt;
&lt;th&gt;URL&lt;/th&gt;
&lt;th&gt;Models&lt;/th&gt;
&lt;th&gt;Best for&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Custom provider, Request Format = OpenAI&lt;/td&gt;
&lt;td&gt;&lt;code&gt;https://api.apivai.com/v1&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Claude and GPT&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Recommended&lt;/strong&gt;: one provider for every model, built-in OpenAI provider untouched&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Built-in Anthropic provider&lt;/td&gt;
&lt;td&gt;&lt;code&gt;https://api.apivai.com&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Claude only&lt;/td&gt;
&lt;td&gt;Claude in its native Messages format&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Built-in OpenAI provider&lt;/td&gt;
&lt;td&gt;&lt;code&gt;https://api.apivai.com/v1&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Claude and GPT&lt;/td&gt;
&lt;td&gt;Quickest, but replaces the OpenAI provider (breaks file indexing, see below)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The &lt;code&gt;/v1&lt;/code&gt; rule: OpenAI-format URLs end in &lt;code&gt;/v1&lt;/code&gt;; Anthropic-format URLs don't, because the Anthropic SDK appends &lt;code&gt;/v1/messages&lt;/code&gt; itself.&lt;/p&gt;

&lt;h2&gt;
  
  
  Adding a custom provider
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Open &lt;strong&gt;App Settings → AI Providers&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Add Custom Provider&lt;/strong&gt; to open &lt;strong&gt;Create Custom AI Provider&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Fill in the fields below and click &lt;strong&gt;Create&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Provider ID&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;apivai&lt;/code&gt; (lowercase; can't be changed later)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Provider Name&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;APIVAI&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Request Format&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;OpenAI&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Proxy URL&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;https://api.apivai.com/v1&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;API Key&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;your key&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Use Client Request Mode&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;off&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Use Client Request Mode&lt;/strong&gt; sends requests straight from the browser instead of through the LobeHub server. Leave it off unless you have a reason; if you turn it on and get network errors, turn it off again.&lt;/p&gt;

&lt;p&gt;Then, on the provider's page:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Run &lt;strong&gt;Connectivity Check&lt;/strong&gt;: pick a model, click &lt;strong&gt;Check&lt;/strong&gt;, and you should see &lt;strong&gt;Check passed&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Fetch models&lt;/strong&gt; to pull IDs from &lt;code&gt;/v1/models&lt;/code&gt;, and switch on the ones you want. Or click &lt;strong&gt;Add Model&lt;/strong&gt; and type a &lt;strong&gt;Model ID&lt;/strong&gt; such as &lt;code&gt;claude-sonnet-4-6&lt;/code&gt; or &lt;code&gt;gpt-5.5&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;In an agent's settings, choose this provider and a model.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To see which IDs your key can use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl https://api.apivai.com/v1/models &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Authorization: Bearer your-key"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Alternative: the built-in Anthropic provider
&lt;/h2&gt;

&lt;p&gt;In &lt;strong&gt;AI Providers&lt;/strong&gt;, select &lt;strong&gt;Anthropic&lt;/strong&gt; and enable it. Paste the key into &lt;strong&gt;API Key&lt;/strong&gt; and set &lt;strong&gt;API Proxy URL&lt;/strong&gt; to &lt;code&gt;https://api.apivai.com&lt;/code&gt; (&lt;strong&gt;no &lt;code&gt;/v1&lt;/code&gt;&lt;/strong&gt;). Run &lt;strong&gt;Check&lt;/strong&gt;, then enable Claude models. If a built-in model card has a different ID from the gateway's, add the correct one with &lt;strong&gt;Add Model&lt;/strong&gt;; if &lt;strong&gt;Fetch models&lt;/strong&gt; returns nothing here, add models by hand.&lt;/p&gt;

&lt;p&gt;If you use the built-in &lt;strong&gt;OpenAI&lt;/strong&gt; provider instead, set &lt;strong&gt;API Proxy URL&lt;/strong&gt; to &lt;code&gt;https://api.apivai.com/v1&lt;/code&gt; and leave &lt;strong&gt;Use Responses API Specification&lt;/strong&gt; off: LobeHub says it only supports OpenAI models, and you'll be sending Claude requests through it too.&lt;/p&gt;

&lt;h2&gt;
  
  
  Self-hosting: Docker environment variables
&lt;/h2&gt;

&lt;p&gt;A self-hosted LobeHub server reads providers from environment variables. Add these to your &lt;code&gt;lobehub.env&lt;/code&gt;, next to the database and auth variables you already have:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# OpenAI format: Claude and GPT&lt;/span&gt;
&lt;span class="nv"&gt;OPENAI_API_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;your-key
&lt;span class="nv"&gt;OPENAI_PROXY_URL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;https://api.apivai.com/v1
&lt;span class="nv"&gt;OPENAI_MODEL_LIST&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nt"&gt;-all&lt;/span&gt;,+claude-sonnet-4-6,+claude-haiku-4-5,+gpt-5.5

&lt;span class="c"&gt;# Or Anthropic format: Claude only&lt;/span&gt;
&lt;span class="nv"&gt;ANTHROPIC_API_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;your-key
&lt;span class="nv"&gt;ANTHROPIC_PROXY_URL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;https://api.apivai.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Start the container as usual, e.g. &lt;code&gt;docker run -d -p 3210:3210 --env-file lobehub.env --name lobehub lobehub/lobehub&lt;/code&gt;, and restart it after every change to the file.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;OPENAI_MODEL_LIST&lt;/code&gt; syntax: &lt;code&gt;-all&lt;/code&gt; hides the default OpenAI models, &lt;code&gt;+id&lt;/code&gt; adds a model, &lt;code&gt;id=Display Name&lt;/code&gt; renames one. A key set here is a server key shared by every user of your instance, so give it its own budget limit. The LobeHub docs note that empty replies are often caused by &lt;code&gt;OPENAI_PROXY_URL&lt;/code&gt; missing &lt;code&gt;/v1&lt;/code&gt;; keep it there.&lt;/p&gt;

&lt;h2&gt;
  
  
  Do files and the knowledge base work?
&lt;/h2&gt;

&lt;p&gt;Chat works fully. Files and the knowledge base also need an &lt;strong&gt;embedding&lt;/strong&gt; model to index documents, and APIVAI doesn't offer embeddings.&lt;/p&gt;

&lt;p&gt;By default LobeHub creates embeddings with OpenAI's &lt;code&gt;text-embedding-3-small&lt;/code&gt; through the OpenAI provider. If you point &lt;code&gt;OPENAI_PROXY_URL&lt;/code&gt; at the gateway, file indexing fails, which is one more reason to chat through a custom provider. Configure embeddings separately with &lt;code&gt;DEFAULT_FILES_CONFIG&lt;/code&gt;, e.g. &lt;code&gt;DEFAULT_FILES_CONFIG=embedding_model=ollama/&amp;lt;your-embedding-model&amp;gt;&lt;/code&gt;; the supported providers are listed in LobeHub's knowledge-base deployment guide. Answers about your files still come from the Claude or GPT model you picked.&lt;/p&gt;

&lt;h2&gt;
  
  
  Which model for which job
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;General assistant, quick questions: &lt;code&gt;claude-haiku-4-5&lt;/code&gt; or &lt;code&gt;gpt-6-luna&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Writing and coding agents: &lt;code&gt;claude-sonnet-4-6&lt;/code&gt; or &lt;code&gt;claude-sonnet-5-5&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;The hardest analysis and long-form writing: &lt;code&gt;claude-opus-5-5&lt;/code&gt;, only where it's needed&lt;/li&gt;
&lt;li&gt;Current GPT: &lt;code&gt;gpt-6-sol&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Every message re-sends the conversation so far, so long chats get more expensive per message; start a new topic when the subject changes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Common errors
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;401 / API key invalid&lt;/strong&gt;: the key has extra spaces, is incomplete, or has been deleted.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;402 / insufficient_quota&lt;/strong&gt;: the key's budget is used up, or what's left is too little for one request to an expensive model (Opus, Sonnet 4.6 hit this first). Add budget to the key or switch to a cheaper model. A key stops working with a little still on it; that remainder isn't lost, because deleting the key returns it to your account balance.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;404&lt;/strong&gt;: the &lt;code&gt;/v1&lt;/code&gt; is wrong. OpenAI format (custom provider, OpenAI provider, &lt;code&gt;OPENAI_PROXY_URL&lt;/code&gt;) needs &lt;code&gt;https://api.apivai.com/v1&lt;/code&gt;; Anthropic format needs &lt;code&gt;https://api.apivai.com&lt;/code&gt;. Don't add &lt;code&gt;/chat/completions&lt;/code&gt; or &lt;code&gt;/messages&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Model not found&lt;/strong&gt;: the &lt;strong&gt;Model ID&lt;/strong&gt; must match the gateway's ID exactly, such as &lt;code&gt;claude-sonnet-4-6&lt;/code&gt;, not the display name. Check with &lt;strong&gt;Fetch models&lt;/strong&gt; or &lt;code&gt;GET /v1/models&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Empty or cut-off replies&lt;/strong&gt;: thinking is on by default and counts as output tokens. In the agent's model settings, turn on &lt;strong&gt;Enable Max Tokens Limit&lt;/strong&gt; and set &lt;strong&gt;Max Tokens Limit&lt;/strong&gt; to 4096 or more. For empty replies in OpenAI format, also check that the URL ends in &lt;code&gt;/v1&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Environment variables ignored&lt;/strong&gt;: restart the container after editing &lt;code&gt;lobehub.env&lt;/code&gt;, and check the variable names match exactly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;429&lt;/strong&gt;: the default limit is 60 requests per minute per key. A shared instance can hit it; split usage across keys.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What it costs
&lt;/h2&gt;

&lt;p&gt;At the time of writing, most 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.26 / $6.32 per million input / output tokens against the official $3 / $15. It's prepaid and billed per token, with no subscription. The full table is at &lt;a href="https://apivai.com/pricing?utm_source=devto&amp;amp;utm_campaign=lobechat" rel="noopener noreferrer"&gt;https://apivai.com/pricing?utm_source=devto&amp;amp;utm_campaign=lobechat&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Questions are welcome in the comments.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>claude</category>
      <category>selfhosted</category>
      <category>docker</category>
    </item>
    <item>
      <title>Dify with Claude and GPT: every field of the OpenAI-API-compatible plugin, explained</title>
      <dc:creator>APIVAI</dc:creator>
      <pubDate>Fri, 16 Oct 2026 07:33:36 +0000</pubDate>
      <link>https://dev.to/mupromax/dify-with-claude-and-gpt-every-field-of-the-openai-api-compatible-plugin-explained-4995</link>
      <guid>https://dev.to/mupromax/dify-with-claude-and-gpt-every-field-of-the-openai-api-compatible-plugin-explained-4995</guid>
      <description>&lt;p&gt;&lt;em&gt;Disclosure: I run APIVAI, the gateway used in the examples below. The setup is the same for any endpoint that speaks the OpenAI or Anthropic format.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.dify.ai" rel="noopener noreferrer"&gt;Dify&lt;/a&gt; is an open-source platform for building LLM apps: chatbots, agents, workflows and knowledge-base (RAG) apps. It reaches models through model provider plugins, and with a third-party gateway there are enough fields that it's easy to fill one in wrong. This post goes through the actual fields of Dify's official &lt;code&gt;openai_api_compatible&lt;/code&gt; plugin (version 0.0.68) and the &lt;code&gt;anthropic&lt;/code&gt; plugin.&lt;/p&gt;

&lt;h2&gt;
  
  
  Which provider plugin?
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Plugin&lt;/th&gt;
&lt;th&gt;Address field&lt;/th&gt;
&lt;th&gt;Models&lt;/th&gt;
&lt;th&gt;Best for&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;OpenAI-API-compatible&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;API Base URL: &lt;code&gt;https://api.apivai.com/v1&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Claude and GPT&lt;/td&gt;
&lt;td&gt;One provider for every model; you type the model IDs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Anthropic&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;API URL: &lt;code&gt;https://api.apivai.com&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Claude only&lt;/td&gt;
&lt;td&gt;Claude only, in the native format with prompt caching&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Start with &lt;strong&gt;OpenAI-API-compatible&lt;/strong&gt;: you type each model ID yourself, so a new model works as soon as the gateway lists it.&lt;/p&gt;

&lt;p&gt;Providers live on the &lt;strong&gt;Model Provider&lt;/strong&gt; page: under &lt;strong&gt;Integrations&lt;/strong&gt; in current Dify Cloud, under &lt;strong&gt;Settings&lt;/strong&gt; in the account menu in older self-hosted versions. Each provider applies to the whole workspace, and only owners and admins can change it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Install the plugin
&lt;/h2&gt;

&lt;p&gt;Open &lt;strong&gt;Model Provider&lt;/strong&gt;, find &lt;strong&gt;OpenAI-API-compatible&lt;/strong&gt; in the list of providers you can install (or on the &lt;a href="https://marketplace.dify.ai/" rel="noopener noreferrer"&gt;Dify Marketplace&lt;/a&gt;) and click &lt;strong&gt;Install&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Add a model
&lt;/h2&gt;

&lt;p&gt;On the &lt;strong&gt;OpenAI-API-compatible&lt;/strong&gt; card, click &lt;strong&gt;Add Model&lt;/strong&gt; and fill in:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Model Type&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;LLM&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Model Name&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;claude-sonnet-4-6&lt;/code&gt; (the exact model ID)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Model display name&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;optional, e.g. "Claude Sonnet 4.6"&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;API Key&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;your key&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;API Base URL&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;https://api.apivai.com/v1&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;model name for API endpoint&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;leave empty&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Completion mode&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Chat&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Model context size&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;no larger than the model's context window&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Upper bound for max tokens&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;8192 or more&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Function Call Type&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Tool Call&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Stream function calling&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Support&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;API Type&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Chat Completions API (/chat/completions)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Leave the rest at their defaults. Older versions of the plugin call the address field &lt;strong&gt;API endpoint URL&lt;/strong&gt;; the value is the same.&lt;/p&gt;

&lt;p&gt;The fields people most often misread:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Model Name&lt;/strong&gt; is what Dify actually sends to the API, so it must be the exact ID. The display name is only for the interface.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Model context size&lt;/strong&gt; is the limit Dify uses when it fits history and retrieved knowledge into the prompt. A value below the model's real window is fine and keeps long chats cheaper.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Upper bound for max tokens&lt;/strong&gt; only sets how high &lt;strong&gt;Max Tokens&lt;/strong&gt; can go in your apps. Thinking is on by default and counts as output, so leave room above 4096.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Function Call Type: Tool Call&lt;/strong&gt; is what lets Agent apps use native tool calling.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When you click &lt;strong&gt;Save&lt;/strong&gt;, Dify sends a test request and only saves if it passes. Repeat &lt;strong&gt;Add Model&lt;/strong&gt; for each model you want, with the same key and address, for example &lt;code&gt;gpt-5.5&lt;/code&gt; and &lt;code&gt;claude-haiku-4-5&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Take model IDs from the API:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl https://api.apivai.com/v1/models &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Authorization: Bearer your-key"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 3: Use the models
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;In an app's model selector, pick your model under OpenAI-API-compatible and set &lt;strong&gt;Max Tokens&lt;/strong&gt; to 4096 or more.&lt;/li&gt;
&lt;li&gt;In a workflow, each &lt;strong&gt;LLM&lt;/strong&gt; node picks its own model, so cheap and strong models can sit in the same flow.&lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;Default Models&lt;/strong&gt; on the Model Provider page, set the &lt;strong&gt;System Reasoning Model&lt;/strong&gt; as the workspace default.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Alternative: the Anthropic plugin for Claude
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Install the &lt;strong&gt;Anthropic&lt;/strong&gt; plugin and open its setup.&lt;/li&gt;
&lt;li&gt;Set &lt;strong&gt;API Key&lt;/strong&gt; to your key and &lt;strong&gt;API URL&lt;/strong&gt; to &lt;code&gt;https://api.apivai.com&lt;/code&gt;. Do &lt;strong&gt;not&lt;/strong&gt; add &lt;code&gt;/v1&lt;/code&gt;; the plugin's Anthropic client appends &lt;code&gt;/v1/messages&lt;/code&gt; itself. Leave &lt;strong&gt;Enable request metadata&lt;/strong&gt; on Disabled.&lt;/li&gt;
&lt;li&gt;Some IDs in the plugin's built-in model list match the gateway's (such as &lt;code&gt;claude-sonnet-4-6&lt;/code&gt;); others have different or dated names. If a model is missing or returns "model not found", click &lt;strong&gt;Add Model&lt;/strong&gt; on the Anthropic card and type the exact ID.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Which model for which job
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Question Classifier nodes, extraction, high-volume Q&amp;amp;A: &lt;code&gt;claude-haiku-4-5&lt;/code&gt; or &lt;code&gt;gpt-6-luna&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Default for chatbots and agents: &lt;code&gt;claude-sonnet-4-6&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Agents with many tools, long documents: &lt;code&gt;claude-sonnet-5-5&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Only the hardest reasoning nodes: &lt;code&gt;claude-opus-5-5&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A routing workflow (a cheap model classifies first, then hands the hard cases to a strong one) is the most common way to keep Dify costs down.&lt;/p&gt;

&lt;h2&gt;
  
  
  Common errors
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Credentials validation fails on save / 401&lt;/strong&gt;: the key is incomplete or deleted. Also check that &lt;strong&gt;API Base URL&lt;/strong&gt; has &lt;code&gt;/v1&lt;/code&gt; exactly once.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;402 / insufficient_quota&lt;/strong&gt;: the key's budget is used up, or what's left is too little for one request to an expensive model (Opus, Sonnet 4.6 hit this first). Add budget to the key or move that node to a cheaper model. A key stops working with a little still on it; that remainder isn't lost, and deleting the key returns it to your account balance.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;404&lt;/strong&gt;: OpenAI-API-compatible needs &lt;code&gt;https://api.apivai.com/v1&lt;/code&gt;, without &lt;code&gt;/chat/completions&lt;/code&gt;; the Anthropic plugin needs &lt;code&gt;https://api.apivai.com&lt;/code&gt; without &lt;code&gt;/v1&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Model not found&lt;/strong&gt;: &lt;strong&gt;Model Name&lt;/strong&gt; holds a display name instead of the ID, or you used a dated name from the Anthropic plugin's built-in list.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Empty or cut-off answers&lt;/strong&gt;: &lt;strong&gt;Max Tokens&lt;/strong&gt; in the app is too low (thinking uses output tokens); raise it to 4096 or more, and make sure &lt;strong&gt;Upper bound for max tokens&lt;/strong&gt; is high enough.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The agent never calls tools&lt;/strong&gt;: &lt;strong&gt;Function Call Type&lt;/strong&gt; isn't set to &lt;strong&gt;Tool Call&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Knowledge base errors&lt;/strong&gt;: a knowledge base needs an embedding model, and APIVAI doesn't provide embeddings. Set up a separate embedding provider for it; the LLM that writes the answer can still be Claude or GPT.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;429&lt;/strong&gt;: each key allows 60 requests per minute and 5 at once (extra ones wait in a queue for a while). For busy apps, give each app its own key.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What it costs
&lt;/h2&gt;

&lt;p&gt;At the time of writing, most 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.26 / $6.32 per million input / output tokens against the official $3 / $15. It's prepaid and billed per token, with no subscription. The full table is at &lt;a href="https://apivai.com/pricing" rel="noopener noreferrer"&gt;https://apivai.com/pricing&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Questions are welcome in the comments.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>claude</category>
      <category>openai</category>
      <category>dify</category>
    </item>
    <item>
      <title>Roo Code with Claude and GPT: OpenAI Compatible vs Anthropic, and one model per mode</title>
      <dc:creator>APIVAI</dc:creator>
      <pubDate>Mon, 12 Oct 2026 13:57:34 +0000</pubDate>
      <link>https://dev.to/mupromax/roo-code-with-claude-and-gpt-openai-compatible-vs-anthropic-and-one-model-per-mode-idf</link>
      <guid>https://dev.to/mupromax/roo-code-with-claude-and-gpt-openai-compatible-vs-anthropic-and-one-model-per-mode-idf</guid>
      <description>&lt;p&gt;&lt;em&gt;Disclosure: I run APIVAI, the gateway used in the examples below. The setup is the same for any endpoint that speaks both the OpenAI and Anthropic formats.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://roocodeinc.github.io/Roo-Code/providers/openai-compatible" rel="noopener noreferrer"&gt;Roo Code&lt;/a&gt; is an open-source coding agent for VS Code. It shares its roots with Cline but adds modes (Code, Architect, Ask, Debug) and configuration profiles. Used together, they let planning, coding and quick questions each run on a different model. This post covers the two provider types that work with a gateway, how to set up profiles per mode, and the common errors.&lt;/p&gt;

&lt;h2&gt;
  
  
  OpenAI Compatible or Anthropic?
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;OpenAI Compatible&lt;/th&gt;
&lt;th&gt;Anthropic&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Base URL&lt;/td&gt;
&lt;td&gt;&lt;code&gt;https://api.apivai.com/v1&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;https://api.apivai.com&lt;/code&gt; (no &lt;code&gt;/v1&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Models&lt;/td&gt;
&lt;td&gt;Claude and GPT&lt;/td&gt;
&lt;td&gt;Claude only&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Picking a model&lt;/td&gt;
&lt;td&gt;Type the model ID&lt;/td&gt;
&lt;td&gt;Choose from Roo Code's list&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Best for&lt;/td&gt;
&lt;td&gt;Mixing Claude and GPT, newest model IDs&lt;/td&gt;
&lt;td&gt;Long Claude sessions, with prompt caching&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The prompt caching part is worth a note. Roo Code's Anthropic provider adds &lt;code&gt;cache_control&lt;/code&gt; markers to the system prompt and recent messages, so repeated context is billed at the cache-read price, which is much lower than the full input price. An agent resends a lot of context on every step, so &lt;strong&gt;if you only use Claude, the Anthropic provider is usually cheaper&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Set up OpenAI Compatible
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Open the Roo Code panel in VS Code, click the gear icon and go to &lt;strong&gt;Providers&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Set &lt;strong&gt;API Provider&lt;/strong&gt; to &lt;strong&gt;OpenAI Compatible&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Fill in the fields below and save.&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Base URL&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;https://api.apivai.com/v1&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;API Key&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;your key&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Model&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;claude-sonnet-4-6&lt;/code&gt; (or any ID from &lt;code&gt;GET /v1/models&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Max Output Tokens&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;8192 or more (at least 4096)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The base URL ends in &lt;code&gt;/v1&lt;/code&gt; exactly once; Roo Code appends &lt;code&gt;/chat/completions&lt;/code&gt; itself. Leave &lt;strong&gt;Context Window&lt;/strong&gt;, &lt;strong&gt;Image Support&lt;/strong&gt; and &lt;strong&gt;Computer Use&lt;/strong&gt; at their defaults unless you have a reason to change them. The Input/Output Price fields only change the cost estimate Roo Code shows; they don't affect billing.&lt;/p&gt;

&lt;p&gt;Roo Code uses native tool calling only, so the model must support function calling. The main Claude and GPT models do.&lt;/p&gt;

&lt;p&gt;To see which model IDs your key can use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl https://api.apivai.com/v1/models &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Authorization: Bearer your-key"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 2: Add an Anthropic profile (recommended if you only use Claude)
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;In &lt;strong&gt;Providers&lt;/strong&gt;, click the &lt;strong&gt;+&lt;/strong&gt; next to the profile selector and name the profile, for example "APIVAI Claude".&lt;/li&gt;
&lt;li&gt;Set &lt;strong&gt;API Provider&lt;/strong&gt; to &lt;strong&gt;Anthropic&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Paste your key into &lt;strong&gt;Anthropic API Key&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Tick &lt;strong&gt;Use custom base URL&lt;/strong&gt; and enter &lt;code&gt;https://api.apivai.com&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Choose a Claude model from the &lt;strong&gt;Model&lt;/strong&gt; dropdown.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Do &lt;strong&gt;not&lt;/strong&gt; add &lt;code&gt;/v1&lt;/code&gt; here. Roo Code passes this address to the Anthropic SDK, which appends &lt;code&gt;/v1/messages&lt;/code&gt; on its own, so &lt;code&gt;https://api.apivai.com/v1&lt;/code&gt; turns into &lt;code&gt;/v1/v1/messages&lt;/code&gt; and returns 404.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Give each mode its own profile
&lt;/h2&gt;

&lt;p&gt;Roo Code remembers which profile you last used in each mode, and its mode settings let you assign a profile to a mode explicitly. All profiles can share the same key.&lt;/p&gt;

&lt;h2&gt;
  
  
  Which model for which job
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Mode&lt;/th&gt;
&lt;th&gt;Model&lt;/th&gt;
&lt;th&gt;Why&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Architect (planning)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;claude-opus-5-5&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A wrong plan wastes everything after it&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Code / Debug&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;claude-sonnet-4-6&lt;/code&gt; or &lt;code&gt;claude-sonnet-5-5&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;The everyday default&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ask&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;claude-haiku-4-5&lt;/code&gt; or &lt;code&gt;gpt-6-luna&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Just questions; cheap and fast is enough&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;If a task keeps going in circles on Sonnet, switch that task to Opus rather than making Opus your default. GPT models only work through an OpenAI Compatible profile.&lt;/p&gt;

&lt;h2&gt;
  
  
  Common errors
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;401 / invalid key&lt;/strong&gt;: the key is incomplete or deleted. With the Anthropic provider, also check that &lt;strong&gt;Use custom base URL&lt;/strong&gt; is ticked, or Roo Code sends your key to Anthropic directly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;402 / insufficient_quota&lt;/strong&gt;: the key's budget is used up, or what's left is too little for one request to an expensive model (Opus, Sonnet 4.6 hit this first, so Architect on Opus is the usual place to see it). Add budget to the key or switch to a cheaper model. A key stops working with a little still on it; that remainder isn't lost, and deleting the key returns it to your account balance.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;404&lt;/strong&gt;: almost always &lt;code&gt;/v1&lt;/code&gt;. OpenAI Compatible needs &lt;code&gt;https://api.apivai.com/v1&lt;/code&gt; (one &lt;code&gt;/v1&lt;/code&gt;, no &lt;code&gt;/chat/completions&lt;/code&gt;); Anthropic needs &lt;code&gt;https://api.apivai.com&lt;/code&gt; without &lt;code&gt;/v1&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Model not found&lt;/strong&gt;: use the exact ID, such as &lt;code&gt;claude-sonnet-4-6&lt;/code&gt;, not the display name. Check it against &lt;code&gt;GET /v1/models&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tool-calling errors&lt;/strong&gt;: switch to a model that supports function calling.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Empty or cut-off replies&lt;/strong&gt;: thinking is on by default and uses output tokens. Raise &lt;strong&gt;Max Output Tokens&lt;/strong&gt; to 8192 (at least 4096).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;429&lt;/strong&gt;: the default limit is 60 requests per minute per key. Long tasks can hit it; wait a moment or split work across several keys.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What it costs
&lt;/h2&gt;

&lt;p&gt;At the time of writing, most 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 billed per token, with no subscription. The full table is at &lt;a href="https://apivai.com/pricing" rel="noopener noreferrer"&gt;https://apivai.com/pricing&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Questions are welcome in the comments.&lt;/p&gt;

</description>
      <category>vscode</category>
      <category>ai</category>
      <category>claude</category>
      <category>programming</category>
    </item>
    <item>
      <title>Cherry Studio with Claude and GPT: adding a custom provider (and the /v1 question)</title>
      <dc:creator>APIVAI</dc:creator>
      <pubDate>Mon, 12 Oct 2026 13:56:56 +0000</pubDate>
      <link>https://dev.to/mupromax/cherry-studio-with-claude-and-gpt-adding-a-custom-provider-and-the-v1-question-23ob</link>
      <guid>https://dev.to/mupromax/cherry-studio-with-claude-and-gpt-adding-a-custom-provider-and-the-v1-question-23ob</guid>
      <description>&lt;p&gt;&lt;em&gt;Disclosure: I run APIVAI, the gateway used in the examples below. The setup is the same for any endpoint that speaks both the OpenAI and Anthropic formats.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.cherryai.com.cn/docs/en-us/pre-basic/providers/zi-ding-yi-fu-wu-shang" rel="noopener noreferrer"&gt;Cherry Studio&lt;/a&gt; is a free desktop AI client for Windows, macOS and Linux, with assistants, knowledge bases, MCP tools and side-by-side answers from several models. It has no models of its own: you add a provider and a key. This post covers how to add a custom provider, whether the address needs &lt;code&gt;/v1&lt;/code&gt;, and the errors people run into most.&lt;/p&gt;

&lt;h2&gt;
  
  
  Custom provider or the built-in Anthropic provider?
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Custom provider (OpenAI endpoint)&lt;/th&gt;
&lt;th&gt;Built-in Anthropic provider&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Where&lt;/td&gt;
&lt;td&gt;Settings → Model Services → + Add Provider&lt;/td&gt;
&lt;td&gt;Settings → Model Services → Anthropic&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Address&lt;/td&gt;
&lt;td&gt;&lt;code&gt;https://api.apivai.com&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;https://api.apivai.com&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Models&lt;/td&gt;
&lt;td&gt;Claude and GPT&lt;/td&gt;
&lt;td&gt;Claude only&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Best for&lt;/td&gt;
&lt;td&gt;One entry for every model&lt;/td&gt;
&lt;td&gt;Claude in its native Messages format&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;For most people the &lt;strong&gt;custom provider&lt;/strong&gt; is enough: one key, with Claude and GPT in the same model list. You can also set up both with the same key.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Add a custom provider
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Click &lt;strong&gt;Settings&lt;/strong&gt; (the gear icon in the left navigation bar).&lt;/li&gt;
&lt;li&gt;Open &lt;strong&gt;Model Services&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;+ Add Provider&lt;/strong&gt; below the provider list.&lt;/li&gt;
&lt;li&gt;Fill in the dialog as below and click &lt;strong&gt;Add&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Provider Name&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;anything you'll recognise, e.g. &lt;code&gt;APIVAI&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;API Key&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;your key&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;OpenAI endpoint (API Address)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;https://api.apivai.com&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;About &lt;code&gt;/v1&lt;/code&gt;: Cherry Studio wants the base address and appends &lt;code&gt;/v1/chat/completions&lt;/code&gt; itself, so &lt;code&gt;https://api.apivai.com&lt;/code&gt; becomes &lt;code&gt;https://api.apivai.com/v1/chat/completions&lt;/code&gt;. Current versions also accept &lt;code&gt;https://api.apivai.com/v1&lt;/code&gt; without doubling it, but never paste the full &lt;code&gt;/v1/chat/completions&lt;/code&gt; address. A trailing &lt;code&gt;#&lt;/code&gt; means "use this address exactly as typed"; you don't need it here.&lt;/p&gt;

&lt;p&gt;Older versions ask for a &lt;strong&gt;Provider Type&lt;/strong&gt; instead; choose &lt;strong&gt;OpenAI&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Add the models
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Open the provider you just created.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Get model list&lt;/strong&gt; and click the &lt;strong&gt;+&lt;/strong&gt; next to each model you want. Only models you've added with &lt;strong&gt;+&lt;/strong&gt; show up in the chat's model picker.&lt;/li&gt;
&lt;li&gt;Or click &lt;strong&gt;+&lt;/strong&gt; and type a model ID, such as &lt;code&gt;claude-sonnet-4-6&lt;/code&gt;, &lt;code&gt;claude-haiku-4-5&lt;/code&gt; or &lt;code&gt;gpt-5.5&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The list changes over time, so take IDs from &lt;strong&gt;Get model list&lt;/strong&gt; rather than from old screenshots.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Test and switch it on
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Click &lt;strong&gt;Test&lt;/strong&gt; (named &lt;strong&gt;Check&lt;/strong&gt; in some versions) and pick a model. A success message means the key and address are right.&lt;/li&gt;
&lt;li&gt;Turn the provider on with the switch in the upper-right corner of the provider page. An enabled provider shows a green dot in the list.&lt;/li&gt;
&lt;li&gt;Pick the model from the drop-down at the top of a chat and send a message.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Optional: Claude through the built-in Anthropic provider
&lt;/h2&gt;

&lt;p&gt;In &lt;strong&gt;Model Services&lt;/strong&gt;, open &lt;strong&gt;Anthropic&lt;/strong&gt;, paste your key into &lt;strong&gt;API Key&lt;/strong&gt; and change &lt;strong&gt;API Address&lt;/strong&gt; from &lt;code&gt;https://api.anthropic.com&lt;/code&gt; to &lt;code&gt;https://api.apivai.com&lt;/code&gt;. Do &lt;strong&gt;not&lt;/strong&gt; add &lt;code&gt;/v1&lt;/code&gt;; the address has the same shape as Anthropic's own. Then click &lt;strong&gt;Get model list&lt;/strong&gt;, add the Claude models you want and switch the provider on. GPT models won't work here; they go through the custom provider above.&lt;/p&gt;

&lt;h2&gt;
  
  
  Which model for which job
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Default assistant (quick questions, translation, summaries): &lt;code&gt;claude-haiku-4-5&lt;/code&gt; or &lt;code&gt;gpt-6-luna&lt;/code&gt;, cheap and fast&lt;/li&gt;
&lt;li&gt;Main assistant (writing, code): &lt;code&gt;claude-sonnet-4-6&lt;/code&gt; or &lt;code&gt;claude-sonnet-5-5&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;The hardest analysis and reasoning: &lt;code&gt;claude-opus-5-5&lt;/code&gt;, only when you need it&lt;/li&gt;
&lt;li&gt;Comparing models: Cherry Studio can send one question to several models at once, which is the most direct way to compare them on your own tasks&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Every message resends the conversation so far, so long chats cost more per turn. Start a new topic when the subject changes.&lt;/p&gt;

&lt;h2&gt;
  
  
  What about knowledge bases?
&lt;/h2&gt;

&lt;p&gt;Chat works fine, but a knowledge base needs an embedding model to index your files, and APIVAI doesn't provide embeddings. Configure a separate embedding provider for the knowledge base in Cherry Studio; the assistant that answers can still be a Claude or GPT model. Image generation models aren't available either.&lt;/p&gt;

&lt;h2&gt;
  
  
  Common errors
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;401 / invalid API key&lt;/strong&gt;: the key is incomplete or has been deleted.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;402 / insufficient_quota&lt;/strong&gt;: the key's budget is used up, or what's left is too little for one request to an expensive model (Opus, Sonnet 4.6 hit this first). Add budget to the key or switch to a cheaper model. A key stops working with a little still on it; that remainder isn't lost, and deleting the key returns it to your account balance.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;404&lt;/strong&gt;: the address is wrong. The custom provider takes &lt;code&gt;https://api.apivai.com&lt;/code&gt;, without &lt;code&gt;/chat/completions&lt;/code&gt; and without a trailing &lt;code&gt;#&lt;/code&gt;; the Anthropic provider takes &lt;code&gt;https://api.apivai.com&lt;/code&gt; without &lt;code&gt;/v1&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Model not found&lt;/strong&gt;: the ID must match exactly (e.g. &lt;code&gt;claude-sonnet-4-6&lt;/code&gt;), not the display name. GPT models fail on the Anthropic provider.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Model missing from the chat picker&lt;/strong&gt;: the provider switch is off, or you fetched the list but didn't click &lt;strong&gt;+&lt;/strong&gt; next to the model.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Empty or cut-off replies&lt;/strong&gt;: thinking tokens count towards the output limit. In &lt;strong&gt;Edit Assistant&lt;/strong&gt; → &lt;strong&gt;Model&lt;/strong&gt;, turn off &lt;strong&gt;Enable message length limit (MaxToken)&lt;/strong&gt; or set it to 4096 or more.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Replies arrive all at once, or the stream stops&lt;/strong&gt;: check the &lt;strong&gt;Streaming output (Stream)&lt;/strong&gt; switch on the same tab, and any proxy in Cherry Studio's network settings.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;429&lt;/strong&gt;: the default limit is 60 requests per minute per key. Comparing several models at once uses several requests; wait a moment and try again.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What it costs
&lt;/h2&gt;

&lt;p&gt;At the time of writing, most 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 billed per token, with no subscription. The full table is at &lt;a href="https://apivai.com/pricing" rel="noopener noreferrer"&gt;https://apivai.com/pricing&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Questions are welcome in the comments.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>claude</category>
      <category>openai</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Cline with Claude and GPT through your own API gateway: OpenAI Compatible vs Anthropic, and the /v1 trap</title>
      <dc:creator>APIVAI</dc:creator>
      <pubDate>Mon, 12 Oct 2026 12:59:50 +0000</pubDate>
      <link>https://dev.to/mupromax/cline-with-claude-and-gpt-through-your-own-api-gateway-openai-compatible-vs-anthropic-and-the-v1-2c49</link>
      <guid>https://dev.to/mupromax/cline-with-claude-and-gpt-through-your-own-api-gateway-openai-compatible-vs-anthropic-and-the-v1-2c49</guid>
      <description>&lt;p&gt;&lt;em&gt;Disclosure: I run APIVAI, the gateway used in the examples below. The setup is the same for any endpoint that speaks both the OpenAI and Anthropic formats.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.cline.bot/provider-config/openai-compatible" rel="noopener noreferrer"&gt;Cline&lt;/a&gt; is an open-source coding agent for VS Code. It reads your files, proposes edits and runs commands with your approval, but it ships without a model: you bring a provider and a key. Cline offers two provider types that work with a third-party gateway, and most setup errors come from mixing up their base URLs. Here is how they differ and how to fill in each one.&lt;/p&gt;

&lt;h2&gt;
  
  
  OpenAI Compatible or Anthropic?
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;OpenAI Compatible&lt;/th&gt;
&lt;th&gt;Anthropic&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Base URL&lt;/td&gt;
&lt;td&gt;&lt;code&gt;https://api.apivai.com/v1&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;https://api.apivai.com&lt;/code&gt; (no &lt;code&gt;/v1&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Models&lt;/td&gt;
&lt;td&gt;Claude and GPT&lt;/td&gt;
&lt;td&gt;Claude only&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Picking a model&lt;/td&gt;
&lt;td&gt;Type the model ID&lt;/td&gt;
&lt;td&gt;Choose from Cline's list&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Best for&lt;/td&gt;
&lt;td&gt;One setup for every model&lt;/td&gt;
&lt;td&gt;Claude in its native Messages format&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Pick &lt;strong&gt;OpenAI Compatible&lt;/strong&gt; if you want to switch between Claude and GPT, or use a model ID newer than Cline's built-in list. Pick &lt;strong&gt;Anthropic&lt;/strong&gt; if you only use Claude. The same key works in both, and you can switch at any time.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting up OpenAI Compatible
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Open the Cline panel in VS Code and click the gear icon.&lt;/li&gt;
&lt;li&gt;Set &lt;strong&gt;API Provider&lt;/strong&gt; to &lt;strong&gt;OpenAI Compatible&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Fill in the fields below, click &lt;strong&gt;Verify&lt;/strong&gt; if your version has it, and save.&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Base URL&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;https://api.apivai.com/v1&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;API Key&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;your key&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Model&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;claude-sonnet-4-6&lt;/code&gt; (or any ID from &lt;code&gt;GET /v1/models&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Max Output Tokens&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;8192 or more (at least 4096)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The base URL must end in &lt;code&gt;/v1&lt;/code&gt; exactly once, because Cline appends &lt;code&gt;/chat/completions&lt;/code&gt; itself. Leave &lt;strong&gt;Context Window&lt;/strong&gt;, &lt;strong&gt;Image Support&lt;/strong&gt; and &lt;strong&gt;Computer Use&lt;/strong&gt; at their defaults unless you know you need them. The Input/Output Price fields only change the cost estimate Cline shows; they don't affect billing.&lt;/p&gt;

&lt;p&gt;To see which model IDs your key can use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl https://api.apivai.com/v1/models &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Authorization: Bearer your-key"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Copy IDs from that response rather than from old tutorials; the list changes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting up Anthropic (Claude only)
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Set &lt;strong&gt;API Provider&lt;/strong&gt; to &lt;strong&gt;Anthropic&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Paste your key into &lt;strong&gt;Anthropic API Key&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Tick &lt;strong&gt;Use custom base URL&lt;/strong&gt; and enter &lt;code&gt;https://api.apivai.com&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Pick a Claude model from the dropdown.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Do &lt;strong&gt;not&lt;/strong&gt; add &lt;code&gt;/v1&lt;/code&gt; here. Cline's Anthropic client appends &lt;code&gt;/v1/messages&lt;/code&gt; on its own, so &lt;code&gt;https://api.apivai.com/v1&lt;/code&gt; turns into &lt;code&gt;/v1/v1/messages&lt;/code&gt; and returns 404. If the Claude model you want isn't in Cline's list yet, use the OpenAI Compatible provider and type the ID.&lt;/p&gt;

&lt;h2&gt;
  
  
  Which model for which job
&lt;/h2&gt;

&lt;p&gt;Cline re-sends the conversation and every file it has read on each step, so input tokens add up quickly and the price per token matters more than in a chat app. A practical split:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Everyday coding: &lt;code&gt;claude-sonnet-4-6&lt;/code&gt; or &lt;code&gt;claude-sonnet-5-5&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Hard bugs and large refactors, when Sonnet keeps going in circles: &lt;code&gt;claude-opus-5-5&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Renames, comments, small fixes: &lt;code&gt;claude-haiku-4-5&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;A second opinion: &lt;code&gt;gpt-5.5&lt;/code&gt; (OpenAI Compatible only)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Common errors
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;401 / invalid key&lt;/strong&gt;: the key is incomplete or deleted. With the Anthropic provider, also check that &lt;strong&gt;Use custom base URL&lt;/strong&gt; is ticked, or Cline sends your key to Anthropic directly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;402 / insufficient_quota&lt;/strong&gt;: the key's budget is used up, or what's left is too little for one request to an expensive model (Opus, Sonnet 4.6). Add budget to the key or switch to a cheaper model.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;404&lt;/strong&gt;: almost always &lt;code&gt;/v1&lt;/code&gt;. OpenAI Compatible needs &lt;code&gt;https://api.apivai.com/v1&lt;/code&gt; (one &lt;code&gt;/v1&lt;/code&gt;, no &lt;code&gt;/chat/completions&lt;/code&gt;); Anthropic needs &lt;code&gt;https://api.apivai.com&lt;/code&gt; without &lt;code&gt;/v1&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Model not found&lt;/strong&gt;: use the exact ID, such as &lt;code&gt;claude-sonnet-4-6&lt;/code&gt;, not the display name.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Empty or cut-off replies&lt;/strong&gt;: thinking is on by default and uses output tokens. Raise &lt;strong&gt;Max Output Tokens&lt;/strong&gt; to 8192 (at least 4096).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;429&lt;/strong&gt;: the default limit is 60 requests per minute per key. Long agent runs can hit it; wait a moment or split work across keys.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What it costs
&lt;/h2&gt;

&lt;p&gt;At the time of writing, most 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 billed per token, with no subscription. The full table is at &lt;a href="https://apivai.com/pricing" rel="noopener noreferrer"&gt;https://apivai.com/pricing&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Questions are welcome in the comments.&lt;/p&gt;

</description>
      <category>cline</category>
      <category>ai</category>
      <category>vscode</category>
      <category>claude</category>
    </item>
    <item>
      <title>Pointing Codex CLI at your own API gateway: config.toml, keys and common errors</title>
      <dc:creator>APIVAI</dc:creator>
      <pubDate>Thu, 08 Oct 2026 11:06:46 +0000</pubDate>
      <link>https://dev.to/mupromax/pointing-codex-cli-at-your-own-api-gateway-configtoml-keys-and-common-errors-13nd</link>
      <guid>https://dev.to/mupromax/pointing-codex-cli-at-your-own-api-gateway-configtoml-keys-and-common-errors-13nd</guid>
      <description>&lt;p&gt;&lt;em&gt;Disclosure: I run APIVAI, the gateway used in the examples below. The same config works with any endpoint that supports the OpenAI Responses API.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Codex CLI talks to OpenAI by default, but it lets you define your own model provider in its config file. That means you can point it at another gateway with a few lines of TOML. Here is the setup, where the key goes, and the mistakes that cause most of the errors.&lt;/p&gt;

&lt;h2&gt;
  
  
  Codex uses the Responses API
&lt;/h2&gt;

&lt;p&gt;Unlike most tools, Codex CLI does not call &lt;code&gt;/v1/chat/completions&lt;/code&gt;. It uses OpenAI's &lt;strong&gt;Responses API&lt;/strong&gt; (&lt;code&gt;/v1/responses&lt;/code&gt;). Whatever endpoint you point it at has to support that API, or tool calls and streaming will break. The &lt;code&gt;wire_api = "responses"&lt;/code&gt; line in the config tells Codex which API to use.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: the config file
&lt;/h2&gt;

&lt;p&gt;Location:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;macOS / Linux: &lt;code&gt;~/.codex/config.toml&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Windows: &lt;code&gt;%USERPROFILE%\.codex\config.toml&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="py"&gt;model&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"gpt-5.5"&lt;/span&gt;
&lt;span class="py"&gt;model_provider&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"apivai"&lt;/span&gt;

&lt;span class="nn"&gt;[model_providers.apivai]&lt;/span&gt;
&lt;span class="py"&gt;name&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"APIVAI"&lt;/span&gt;
&lt;span class="py"&gt;base_url&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"https://api.apivai.com/v1"&lt;/span&gt;
&lt;span class="py"&gt;env_key&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"OPENAI_API_KEY"&lt;/span&gt;
&lt;span class="py"&gt;wire_api&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"responses"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;What it does&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;model&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Default model ID&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;model_provider&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Which provider to use; must match the &lt;code&gt;[model_providers.xxx]&lt;/code&gt; name&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;base_url&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Endpoint, &lt;strong&gt;with&lt;/strong&gt; &lt;code&gt;/v1&lt;/code&gt;; Codex appends &lt;code&gt;/responses&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;env_key&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Environment variable that holds the key&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;wire_api&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;responses&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Step 2: the key
&lt;/h2&gt;

&lt;p&gt;The key does not go in the config file. Codex reads it from the variable named in &lt;code&gt;env_key&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;OPENAI_API_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"your-key"&lt;/span&gt;
codex &lt;span class="s2"&gt;"explain what this repo does in two sentences"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Windows PowerShell:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$&lt;/span&gt;&lt;span class="nn"&gt;env&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nv"&gt;OPENAI_API_KEY&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"your-key"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="n"&gt;codex&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"explain what this repo does in two sentences"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Start with a small question like this before you let it edit code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: check the model ID
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl https://api.apivai.com/v1/models &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Authorization: Bearer your-key"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To switch models for one run, pass &lt;code&gt;-m&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;codex &lt;span class="nt"&gt;-m&lt;/span&gt; gpt-5.5 &lt;span class="s2"&gt;"add unit tests for utils.py"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Common errors
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;401 Unauthorized&lt;/strong&gt;: Codex can't see the key. Check that the variable name in &lt;code&gt;env_key&lt;/code&gt; matches the one you set, and that it is set in the terminal you're using (&lt;code&gt;echo $OPENAI_API_KEY&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;404 Not Found&lt;/strong&gt;: &lt;code&gt;base_url&lt;/code&gt; must be &lt;code&gt;https://api.apivai.com/v1&lt;/code&gt;. Don't drop &lt;code&gt;/v1&lt;/code&gt;, and don't add &lt;code&gt;/responses&lt;/code&gt; yourself.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;"provider not found", or requests not reaching the gateway&lt;/strong&gt;: the &lt;code&gt;model_provider&lt;/code&gt; value must match the &lt;code&gt;[model_providers.xxx]&lt;/code&gt; name exactly, and you must be editing the right &lt;code&gt;config.toml&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tool calls fail or output hangs&lt;/strong&gt;: &lt;code&gt;wire_api&lt;/code&gt; is missing or set to &lt;code&gt;chat&lt;/code&gt;, or the endpoint doesn't support the Responses API.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Model not found&lt;/strong&gt;: use an exact ID from &lt;code&gt;GET /v1/models&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;429&lt;/strong&gt;: the default limit is 60 requests per minute per key.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What it costs
&lt;/h2&gt;

&lt;p&gt;At the time of writing, GPT models on APIVAI are up to 86% below OpenAI's list prices and Claude models 56–62% below Anthropic's. It's prepaid and billed per token, with no subscription. The full table is at &lt;a href="https://apivai.com/pricing" rel="noopener noreferrer"&gt;https://apivai.com/pricing&lt;/a&gt;, and setup guides for other tools are at &lt;a href="https://apivai.com/blog" rel="noopener noreferrer"&gt;https://apivai.com/blog&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Questions are welcome in the comments.&lt;/p&gt;

</description>
      <category>openai</category>
      <category>ai</category>
      <category>cli</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Running Claude Code, Cursor and Codex CLI through one API key</title>
      <dc:creator>APIVAI</dc:creator>
      <pubDate>Wed, 07 Oct 2026 18:50:56 +0000</pubDate>
      <link>https://dev.to/mupromax/running-claude-code-cursor-and-codex-cli-through-one-api-key-3hjd</link>
      <guid>https://dev.to/mupromax/running-claude-code-cursor-and-codex-cli-through-one-api-key-3hjd</guid>
      <description>&lt;p&gt;&lt;em&gt;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.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h3&gt;
  
  
  Claude Code
&lt;/h3&gt;

&lt;p&gt;Claude Code speaks the Anthropic Messages format. Set two environment variables:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;ANTHROPIC_BASE_URL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"https://api.apivai.com"&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;ANTHROPIC_AUTH_TOKEN&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"your-key"&lt;/span&gt;
claude
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On Windows PowerShell:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$&lt;/span&gt;&lt;span class="nn"&gt;env&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nv"&gt;ANTHROPIC_BASE_URL&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://api.apivai.com"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nv"&gt;$&lt;/span&gt;&lt;span class="nn"&gt;env&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nv"&gt;ANTHROPIC_AUTH_TOKEN&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"your-key"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="n"&gt;claude&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Cursor
&lt;/h3&gt;

&lt;p&gt;Settings → Models → API Keys: turn on &lt;strong&gt;Override OpenAI Base URL&lt;/strong&gt;, enter &lt;code&gt;https://api.apivai.com/v1&lt;/code&gt;, paste your key, then add the model IDs you want (for example &lt;code&gt;claude-sonnet-4-6&lt;/code&gt;).&lt;/p&gt;

&lt;h3&gt;
  
  
  OpenAI SDK (Python)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;openai&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;OpenAI&lt;/span&gt;

&lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;OpenAI&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;api_key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;your-key&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;base_url&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https://api.apivai.com/v1&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;chat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;completions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;claude-sonnet-4-6&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;role&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;user&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;content&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Hello&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}],&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;choices&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Common errors
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;401&lt;/strong&gt;: the key is wrong, or it was sent in the wrong header. Use &lt;code&gt;x-api-key&lt;/code&gt; or &lt;code&gt;Authorization: Bearer&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;404&lt;/strong&gt;: usually a &lt;code&gt;/v1&lt;/code&gt; mismatch. Anthropic-format tools use the root URL, OpenAI-format tools need &lt;code&gt;/v1&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;429&lt;/strong&gt;: the default limit is 60 requests per minute per key.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  What it costs
&lt;/h3&gt;

&lt;p&gt;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 &lt;a href="https://apivai.com/pricing" rel="noopener noreferrer"&gt;https://apivai.com/pricing&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Setup guides for Cline, Roo Code, Aider, Continue, Open WebUI and others are on the blog: &lt;a href="https://apivai.com/blog" rel="noopener noreferrer"&gt;https://apivai.com/blog&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Questions are welcome in the comments.&lt;/p&gt;

</description>
      <category>claude</category>
      <category>ai</category>
      <category>productivity</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How to Connect Roo Code to APIVAI (Cheap API for an AI Coding Agent)</title>
      <dc:creator>APIVAI</dc:creator>
      <pubDate>Sun, 28 Jun 2026 20:07:22 +0000</pubDate>
      <link>https://dev.to/mupromax/how-to-connect-roo-code-to-apivai-cheap-api-for-an-ai-coding-agent-3l06</link>
      <guid>https://dev.to/mupromax/how-to-connect-roo-code-to-apivai-cheap-api-for-an-ai-coding-agent-3l06</guid>
      <description>&lt;h2&gt;
  
  
  Connect Roo Code to APIVAI
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/RooVetGit/Roo-Code" rel="noopener noreferrer"&gt;Roo Code&lt;/a&gt; (formerly Roo Cline) is a popular autonomous&lt;br&gt;
coding agent for VS Code. It supports OpenAI-compatible providers, so you can run it on APIVAI's&lt;br&gt;
Claude and GPT models — agentic edits cost a lot of tokens, so a cheap compatible gateway matters.&lt;/p&gt;
&lt;h2&gt;
  
  
  Configure the provider
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Open Roo Code's settings (the gear icon in the Roo panel).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;API Provider:&lt;/strong&gt; choose &lt;strong&gt;OpenAI Compatible&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Set:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Base URL:&lt;/strong&gt; &lt;code&gt;https://api.apivai.com/v1&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;API Key:&lt;/strong&gt; your APIVAI key&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Model:&lt;/strong&gt; a name APIVAI serves (e.g. &lt;code&gt;claude-sonnet-4-6&lt;/code&gt; or &lt;code&gt;gpt-5.5&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Save.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Roo Code now routes its requests through APIVAI.&lt;/p&gt;
&lt;h2&gt;
  
  
  Pick a model
&lt;/h2&gt;

&lt;p&gt;Confirm valid names:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-s&lt;/span&gt; https://api.apivai.com/v1/models &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Authorization: Bearer &lt;/span&gt;&lt;span class="nv"&gt;$APIVAI_API_KEY&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Claude Sonnet is a strong default for agentic coding; use it for multi-step edits and reasoning.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tips for agent workloads
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Agents send many large requests — a discounted gateway like APIVAI noticeably lowers the bill.&lt;/li&gt;
&lt;li&gt;Prefer a model with a large context window for big files/repos.&lt;/li&gt;
&lt;li&gt;Make sure streaming passes through so you see progress as the agent works.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Troubleshooting
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;401&lt;/strong&gt; — check the key and that the provider is "OpenAI Compatible" with Base URL ending &lt;code&gt;/v1&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;model_not_found&lt;/code&gt;&lt;/strong&gt; — use a name from &lt;code&gt;/v1/models&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Truncated output&lt;/strong&gt; — raise max tokens / pick a larger-context model.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Does Roo Code work with APIVAI?&lt;/strong&gt; Yes — select "OpenAI Compatible", set Base URL&lt;br&gt;
&lt;code&gt;https://api.apivai.com/v1&lt;/code&gt; and your APIVAI key.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Which model for Roo Code?&lt;/strong&gt; Claude Sonnet for agentic coding and reasoning; GPT-5.5 for faster,&lt;br&gt;
cheaper runs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why use a gateway for an agent?&lt;/strong&gt; Coding agents burn tokens; APIVAI's discounted, OpenAI-compatible&lt;br&gt;
access cuts the cost without changing your workflow.&lt;/p&gt;

&lt;h2&gt;
  
  
  Get started
&lt;/h2&gt;

&lt;p&gt;Set the OpenAI-compatible provider in Roo Code with APIVAI's base URL + key and a model from&lt;br&gt;
&lt;code&gt;/v1/models&lt;/code&gt;. Examples: &lt;a href="https://github.com/mupromax/apivai-api-examples" rel="noopener noreferrer"&gt;APIVAI examples repo&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>roocode</category>
      <category>tutorial</category>
      <category>agents</category>
    </item>
    <item>
      <title>How to Build a Telegram AI Bot with APIVAI (Cheap Claude &amp; GPT)</title>
      <dc:creator>APIVAI</dc:creator>
      <pubDate>Sun, 28 Jun 2026 20:07:18 +0000</pubDate>
      <link>https://dev.to/mupromax/how-to-build-a-telegram-ai-bot-with-apivai-cheap-claude-gpt-f66</link>
      <guid>https://dev.to/mupromax/how-to-build-a-telegram-ai-bot-with-apivai-cheap-claude-gpt-f66</guid>
      <description>&lt;h2&gt;
  
  
  Build a Telegram AI bot with APIVAI
&lt;/h2&gt;

&lt;p&gt;A Telegram AI bot is one of the quickest ways to ship an AI assistant: create a bot with BotFather,&lt;br&gt;
run a small script that forwards messages to an OpenAI-compatible model, and reply. APIVAI provides&lt;br&gt;
the model (Claude or GPT) at a fraction of list price, with crypto/USDT/Alipay payment.&lt;/p&gt;

&lt;p&gt;This guide is the full working bot.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Create the bot
&lt;/h2&gt;

&lt;p&gt;Message &lt;strong&gt;&lt;a class="mentioned-user" href="https://dev.to/botfather"&gt;@botfather&lt;/a&gt;&lt;/strong&gt; on Telegram → &lt;code&gt;/newbot&lt;/code&gt; → choose a name → copy the &lt;strong&gt;bot token&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. The bot (Node.js, long polling — no server needed)
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install &lt;/span&gt;node-telegram-bot-api openai
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;TelegramBot&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;node-telegram-bot-api&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;OpenAI&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;openai&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;bot&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;TelegramBot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;TELEGRAM_BOT_TOKEN&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;polling&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;ai&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;OpenAI&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;apiKey&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;APIVAI_API_KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;baseURL&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://api.apivai.com/v1&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;SYSTEM&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;You are a helpful assistant. Answer concisely in the user's language.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;history&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Map&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// chatId -&amp;gt; messages[]&lt;/span&gt;

&lt;span class="nx"&gt;bot&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;on&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;message&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nx"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;startsWith&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;chatId&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;chat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;msgs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;history&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;chatId&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt; &lt;span class="na"&gt;role&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;system&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;SYSTEM&lt;/span&gt; &lt;span class="p"&gt;}];&lt;/span&gt;
  &lt;span class="nx"&gt;msgs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;role&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;user&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;

  &lt;span class="nx"&gt;bot&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sendChatAction&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;chatId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;typing&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;ai&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;chat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;completions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;model&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;gpt-5.5&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;msgs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="na"&gt;max_tokens&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;500&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;reply&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;choices&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;content&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="nx"&gt;msgs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;role&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;assistant&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;reply&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="nx"&gt;history&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;chatId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;msgs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt; &lt;span class="c1"&gt;// keep recent context&lt;/span&gt;
  &lt;span class="nx"&gt;bot&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sendMessage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;chatId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;reply&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Set &lt;code&gt;TELEGRAM_BOT_TOKEN&lt;/code&gt; and &lt;code&gt;APIVAI_API_KEY&lt;/code&gt;, run &lt;code&gt;node bot.js&lt;/code&gt;, and message your bot.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Add commands &amp;amp; polish
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;/start&lt;/code&gt; → a welcome message; &lt;code&gt;/reset&lt;/code&gt; → clear that chat's history.&lt;/li&gt;
&lt;li&gt;Trim history (last ~12 messages) to control token cost.&lt;/li&gt;
&lt;li&gt;Stream long answers by editing the message as chunks arrive (optional).&lt;/li&gt;
&lt;li&gt;For groups, only respond when mentioned or replied to.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Pick the model
&lt;/h2&gt;

&lt;p&gt;GPT-5.5 for fast, natural, multilingual replies; Claude Sonnet for coding/long-reasoning bots.&lt;br&gt;
Switch by changing the &lt;code&gt;model&lt;/code&gt; string — it's OpenAI-compatible.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Can a Telegram bot use APIVAI?&lt;/strong&gt; Yes — it's a normal OpenAI chat call with the base URL set to&lt;br&gt;
&lt;code&gt;https://api.apivai.com/v1&lt;/code&gt;; the bot forwards messages and returns the reply.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Do I need a server?&lt;/strong&gt; No — long polling (above) runs anywhere Node runs. Use webhooks if you want&lt;br&gt;
a serverless deployment.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Which model should the bot use?&lt;/strong&gt; GPT-5.5 for general/multilingual chat; Claude Sonnet for&lt;br&gt;
code-heavy bots.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How do I control cost?&lt;/strong&gt; Trim conversation history and cap &lt;code&gt;max_tokens&lt;/code&gt;; APIVAI's per-token price&lt;br&gt;
is already low.&lt;/p&gt;

&lt;h2&gt;
  
  
  Get started
&lt;/h2&gt;

&lt;p&gt;Create a bot with BotFather, drop in the script with your APIVAI key, and run it. Examples:&lt;br&gt;
&lt;a href="https://github.com/mupromax/apivai-api-examples" rel="noopener noreferrer"&gt;APIVAI examples repo&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>telegram</category>
      <category>aibot</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>The Cheapest Way to Use Claude &amp; GPT APIs in 2026</title>
      <dc:creator>APIVAI</dc:creator>
      <pubDate>Thu, 25 Jun 2026 15:46:00 +0000</pubDate>
      <link>https://dev.to/mupromax/the-cheapest-way-to-use-claude-gpt-apis-in-2026-17kj</link>
      <guid>https://dev.to/mupromax/the-cheapest-way-to-use-claude-gpt-apis-in-2026-17kj</guid>
      <description>&lt;h2&gt;
  
  
  The cheapest way to use Claude &amp;amp; GPT in 2026
&lt;/h2&gt;

&lt;p&gt;If you run AI coding agents or apps all day, the API bill is usually your biggest cost. The good news: you rarely need to pay official list price. Because almost every tool speaks the &lt;strong&gt;OpenAI-compatible&lt;/strong&gt; API format, the model provider is just a configuration value — you can route to a cheaper compatible gateway without changing any code.&lt;/p&gt;

&lt;p&gt;This guide covers the cheapest, most practical way to access Claude and GPT models in 2026.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why it works: OpenAI-compatible everywhere
&lt;/h2&gt;

&lt;p&gt;Claude Code, Cursor, Cline, Codex CLI, and the official OpenAI/Anthropic SDKs all talk to an OpenAI-compatible endpoint. That means switching providers is two environment variables:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;OPENAI_BASE_URL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"https://api.apivai.com/v1"&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;OPENAI_API_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"sk-your-key"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The tool doesn't care who is behind the URL, as long as it speaks the standard format.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to look for in a cheap provider
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Factor&lt;/th&gt;
&lt;th&gt;Why it matters&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Price vs official&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;The whole point — aim for a large discount on input/output tokens&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;OpenAI-compatible&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Drop-in for existing tools, no rewrite&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Streaming passthrough&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Token-by-token output must keep working (real SSE, not buffered)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Model coverage&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Both Claude and GPT families behind one key&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Pay-as-you-go&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;No subscription; top up and spend down&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Payment options&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Cards, plus crypto/USDT/Alipay if you can't use a card&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  How APIVAI fits
&lt;/h2&gt;

&lt;p&gt;APIVAI is an OpenAI- and Anthropic-compatible gateway to Claude and GPT models at a fraction of list price. One key works across models, streaming is proxied as real chunks, and you can pay with crypto, USDT, or Alipay — no VPN, no subscription.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl https://api.apivai.com/v1/chat/completions &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Authorization: Bearer &lt;/span&gt;&lt;span class="nv"&gt;$APIVAI_API_KEY&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;'{"model":"claude-sonnet-4-6","messages":[{"role":"user","content":"Hello"}]}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Cut costs further
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Pick the right model per task — use a smaller/faster model for routine work and reserve the most powerful model for hard problems.&lt;/li&gt;
&lt;li&gt;Cache where you can; reuse context instead of resending it.&lt;/li&gt;
&lt;li&gt;Watch per-model context limits so you aren't paying for tokens you don't need.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Get started
&lt;/h2&gt;

&lt;p&gt;Create a key, call &lt;code&gt;GET /v1/models&lt;/code&gt; to see what's available, set the two environment variables, and send your first request. Your existing tools keep working — just cheaper.&lt;/p&gt;

</description>
      <category>cost</category>
      <category>2026</category>
      <category>cheapapi</category>
    </item>
    <item>
      <title>How to Use Continue.dev with a Cheap OpenAI-Compatible API</title>
      <dc:creator>APIVAI</dc:creator>
      <pubDate>Thu, 25 Jun 2026 15:45:56 +0000</pubDate>
      <link>https://dev.to/mupromax/how-to-use-continuedev-with-a-cheap-openai-compatible-api-3f53</link>
      <guid>https://dev.to/mupromax/how-to-use-continuedev-with-a-cheap-openai-compatible-api-3f53</guid>
      <description>&lt;h2&gt;
  
  
  Use Continue.dev with a cheap OpenAI-compatible API
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://continue.dev" rel="noopener noreferrer"&gt;Continue.dev&lt;/a&gt; is a popular open-source AI assistant for VS Code and JetBrains. Like most modern AI coding tools, it speaks the OpenAI-compatible API format — so you don't have to pay official list price. Point it at a cheaper compatible provider and everything works unchanged.&lt;/p&gt;

&lt;p&gt;This guide shows the exact Continue config to use an OpenAI-compatible gateway like APIVAI.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why it works
&lt;/h2&gt;

&lt;p&gt;Continue lets you define any model with a &lt;code&gt;provider: "openai"&lt;/code&gt; block and a custom &lt;code&gt;apiBase&lt;/code&gt;. That's all it takes to route through a discount gateway — the requests are standard OpenAI chat completions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Configure Continue
&lt;/h2&gt;

&lt;p&gt;Open your Continue config (&lt;code&gt;~/.continue/config.json&lt;/code&gt;, or the YAML config in newer versions) and add a model:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"models"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"APIVAI - Claude Sonnet"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"provider"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"openai"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"model"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"claude-sonnet-4-6"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"apiBase"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://api.apivai.com/v1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"apiKey"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"sk-your-apivai-key"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it. Reload Continue and the model appears in the dropdown. Send a message to confirm it streams.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pick a model that exists
&lt;/h2&gt;

&lt;p&gt;Model availability varies, so list what's available first instead of guessing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-s&lt;/span&gt; https://api.apivai.com/v1/models &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Authorization: Bearer &lt;/span&gt;&lt;span class="nv"&gt;$APIVAI_API_KEY&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use a model name from that response for the &lt;code&gt;model&lt;/code&gt; field.&lt;/p&gt;

&lt;h2&gt;
  
  
  Things to verify
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Streaming&lt;/strong&gt; — Continue streams responses; make sure your provider passes real SSE chunks so output appears token by token.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Model name&lt;/strong&gt; — must match one the provider serves (avoids &lt;code&gt;model_not_found&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Context window&lt;/strong&gt; — pick a model whose context fits your codebase chunks.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why APIVAI
&lt;/h2&gt;

&lt;p&gt;APIVAI is OpenAI- and Anthropic-compatible, covers Claude and GPT models behind one key, and is priced at a fraction of official list. Pay-as-you-go with crypto, USDT, or Alipay, no VPN required — handy if you can't or don't want to use a card.&lt;/p&gt;

&lt;h2&gt;
  
  
  Get started
&lt;/h2&gt;

&lt;p&gt;Grab a key, drop the config block above into Continue with a model from &lt;code&gt;/v1/models&lt;/code&gt;, and start coding at a fraction of the cost — no code changes, same workflow.&lt;/p&gt;

</description>
      <category>continuedev</category>
      <category>tutorial</category>
      <category>ide</category>
    </item>
  </channel>
</rss>
