<?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: Travis</title>
    <description>The latest articles on DEV Community by Travis (@travis-stableapi).</description>
    <link>https://dev.to/travis-stableapi</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%2F4280489%2F3588e11e-51fc-4b21-a320-b3f7fd60430b.png</url>
      <title>DEV Community: Travis</title>
      <link>https://dev.to/travis-stableapi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/travis-stableapi"/>
    <language>en</language>
    <item>
      <title>Switching an OpenAI-compatible SDK to Stable API</title>
      <dc:creator>Travis</dc:creator>
      <pubDate>Thu, 03 Dec 2026 11:33:59 +0000</pubDate>
      <link>https://dev.to/travis-stableapi/switching-an-openai-compatible-sdk-to-stable-api-33c1</link>
      <guid>https://dev.to/travis-stableapi/switching-an-openai-compatible-sdk-to-stable-api-33c1</guid>
      <description>&lt;p&gt;I am writing on behalf of Stable API (&lt;a href="https://apiniuma.com" rel="noopener noreferrer"&gt;https://apiniuma.com&lt;/a&gt;). My display name is Travis. This is a setup note, not an independent benchmark and not a paid placement. Please verify everything against the live site. Pricing and model IDs are on &lt;a href="https://apiniuma.com/pricing" rel="noopener noreferrer"&gt;https://apiniuma.com/pricing&lt;/a&gt; and can change.&lt;/p&gt;

&lt;p&gt;When I move an existing OpenAI SDK integration to another OpenAI-compatible gateway, I check three values first: the base URL, the API key, and the model ID. This note uses Stable API as a concrete example. The same checklist applies to other compatible gateways; only the URL, key, and model slugs change.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. What the official site says about migration
&lt;/h2&gt;

&lt;p&gt;The public FAQ on &lt;a href="https://apiniuma.com" rel="noopener noreferrer"&gt;https://apiniuma.com&lt;/a&gt; says you replace the original API endpoint with the platform endpoint and leave other parameters unchanged. It also says that for most client libraries you only need to change the base URL and the API key. The FAQ example replaces &lt;code&gt;https://api.openai.com/v1/chat/completions&lt;/code&gt; with the same path on the platform host.&lt;/p&gt;

&lt;p&gt;The public status API (&lt;code&gt;GET https://apiniuma.com/api/status&lt;/code&gt;, 2026-12-03) reports &lt;code&gt;server_address&lt;/code&gt; as &lt;code&gt;https://apiniuma.com&lt;/code&gt; and describes the service as usage-based (&lt;code&gt;按量计费&lt;/code&gt; in the Chinese description; the keywords also include “OpenAI 兼容”). I therefore use:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Base URL: &lt;code&gt;https://apiniuma.com/v1&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;API key: created in the Stable API console, stored in an environment variable such as &lt;code&gt;STABLE_API_KEY&lt;/code&gt; (never committed)&lt;/li&gt;
&lt;li&gt;Model ID: copied from &lt;a href="https://apiniuma.com/pricing" rel="noopener noreferrer"&gt;https://apiniuma.com/pricing&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The same status API showed &lt;code&gt;currency_type&lt;/code&gt; USD, &lt;code&gt;new_user_welcome_credit&lt;/code&gt; 0, and &lt;code&gt;min_topup&lt;/code&gt; 1 on that day. This is a paid, pay-as-you-go service, not a free tier. Treat those fields as a snapshot and re-check the billing page before you rely on them.&lt;/p&gt;

&lt;p&gt;On 2026-12-03, &lt;code&gt;GET https://apiniuma.com/api/pricing_new&lt;/code&gt; returned 279 on-shelf models in &lt;code&gt;data&lt;/code&gt;. That count will change. I am not going to advertise a rounded “300+” figure.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. A minimal connectivity check
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;
&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;openai&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nc"&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="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="s2"&gt;"STABLE_API_KEY"&lt;/span&gt;&lt;span class="p"&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="s2"&gt;"https://apiniuma.com/v1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;item&lt;/span&gt; &lt;span class="k"&gt;in&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;models&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kt"&gt;list&lt;/span&gt;&lt;span class="p"&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;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;]&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;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl https://apiniuma.com/v1/models \
  -H &lt;span class="s2"&gt;"Authorization: Bearer $STABLE_API_KEY"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Only after that succeeds do I send a one-line &lt;code&gt;chat.completions&lt;/code&gt; request with a model ID from the pricing page, then inspect the usage log. The FAQ says the “Usage Logs” page shows time, model, token usage, and cost after login.&lt;/p&gt;

&lt;p&gt;If you are coming from OpenRouter, the OpenRouter compatibility doc (&lt;a href="https://openrouter.ai/docs/guides/features/compatibility" rel="noopener noreferrer"&gt;https://openrouter.ai/docs/guides/features/compatibility&lt;/a&gt; , title “OpenAI Compatibility - Drop-in OpenAI SDK Replacement on OpenRouter”, fetched 2026-12-03) uses &lt;code&gt;https://openrouter.ai/api/v1&lt;/code&gt; and often requires author-prefixed model IDs such as &lt;code&gt;openai/gpt-4o&lt;/code&gt;. Do not assume those prefixed IDs are valid on Stable API. Use the IDs on the Stable API pricing page.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. The same base URL in common clients
&lt;/h2&gt;

&lt;p&gt;I checked the following official client docs on 2026-12-03:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;LiteLLM, “OpenAI-Compatible Endpoints”: &lt;a href="https://docs.litellm.ai/docs/providers/openai_compatible" rel="noopener noreferrer"&gt;https://docs.litellm.ai/docs/providers/openai_compatible&lt;/a&gt; — prefix the model with &lt;code&gt;openai/&lt;/code&gt;, set &lt;code&gt;api_base&lt;/code&gt; to &lt;code&gt;https://apiniuma.com/v1&lt;/code&gt;, and use your key. The doc says a missing &lt;code&gt;/v1&lt;/code&gt; suffix is a common cause of Not Found.&lt;/li&gt;
&lt;li&gt;Continue, “How to Configure OpenAI Models with Continue”: &lt;a href="https://docs.continue.dev/customize/model-providers/top-level/openai" rel="noopener noreferrer"&gt;https://docs.continue.dev/customize/model-providers/top-level/openai&lt;/a&gt; — use &lt;code&gt;provider: openai&lt;/code&gt; and set &lt;code&gt;apiBase&lt;/code&gt; (the older &lt;code&gt;/customize/model-providers/openai&lt;/code&gt; path returned 404).&lt;/li&gt;
&lt;li&gt;Open WebUI, “OpenAI-Compatible”: &lt;a href="https://docs.openwebui.com/getting-started/quick-start/connect-a-provider/starting-with-openai-compatible/" rel="noopener noreferrer"&gt;https://docs.openwebui.com/getting-started/quick-start/connect-a-provider/starting-with-openai-compatible/&lt;/a&gt; — add an OpenAI-compatible connection with the base URL and key.&lt;/li&gt;
&lt;li&gt;Cherry Studio’s custom-provider doc is in Chinese: &lt;a href="https://cherryai.com.cn/docs/zh-cn/pre-basic/providers/zi-ding-yi-fu-wu-shang/" rel="noopener noreferrer"&gt;https://cherryai.com.cn/docs/zh-cn/pre-basic/providers/zi-ding-yi-fu-wu-shang/&lt;/a&gt; — Settings → model providers → add a custom provider, then enable it and add model IDs.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I could not reliably load Cursor’s official documentation in this environment (requests to cursor.com/docs were rewritten to another site), so I am not quoting Cursor’s help text. In principle, if your Cursor build exposes an OpenAI key field and an “Override OpenAI Base URL” (or similarly named) option, use &lt;code&gt;https://apiniuma.com/v1&lt;/code&gt; and a console key, then confirm in your installed UI.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. What this article does not claim
&lt;/h2&gt;

&lt;p&gt;I did not benchmark latency or uptime, and I did not compare prices with OpenRouter or official vendor APIs. The Stable API FAQ includes a platform statement about availability; I have not independently verified it, so I am not repeating it here as a measurement.&lt;/p&gt;

&lt;p&gt;If you want to try the service, the site is &lt;a href="https://apiniuma.com" rel="noopener noreferrer"&gt;https://apiniuma.com&lt;/a&gt; and the docs are &lt;a href="https://docs.apiniuma.com/" rel="noopener noreferrer"&gt;https://docs.apiniuma.com/&lt;/a&gt; . Because I am affiliated with the product, please rely on the live pricing page and your own test calls.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>api</category>
      <category>openai</category>
      <category>documentation</category>
    </item>
  </channel>
</rss>
