<?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 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>
    <item>
      <title>How to Run Whisper Locally for Real-Time Speech-to-Text (faster-whisper)</title>
      <dc:creator>APIVAI</dc:creator>
      <pubDate>Thu, 25 Jun 2026 15:45:29 +0000</pubDate>
      <link>https://dev.to/mupromax/how-to-run-whisper-locally-for-real-time-speech-to-text-faster-whisper-35df</link>
      <guid>https://dev.to/mupromax/how-to-run-whisper-locally-for-real-time-speech-to-text-faster-whisper-35df</guid>
      <description>&lt;h2&gt;
  
  
  Run Whisper locally for real-time speech-to-text
&lt;/h2&gt;

&lt;p&gt;For live translation and voice apps, you want speech-to-text that's fast and free per use — which&lt;br&gt;
means running Whisper &lt;strong&gt;locally&lt;/strong&gt; with &lt;code&gt;faster-whisper&lt;/code&gt;. It pairs perfectly with APIVAI for the&lt;br&gt;
translation step: Whisper turns audio into text locally, APIVAI (GPT-5.5) translates it cheaply over&lt;br&gt;
an OpenAI-compatible call, and you keep latency low and per-second cost at zero for the audio part.&lt;/p&gt;

&lt;p&gt;This guide gets local Whisper running for real-time use.&lt;/p&gt;

&lt;h2&gt;
  
  
  Install
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;faster-whisper
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;faster-whisper&lt;/code&gt; is a fast reimplementation of OpenAI's Whisper using CTranslate2. It runs on GPU&lt;br&gt;
(CUDA) or CPU.&lt;/p&gt;

&lt;h2&gt;
  
  
  Choose a model size
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Model&lt;/th&gt;
&lt;th&gt;Speed&lt;/th&gt;
&lt;th&gt;Accuracy&lt;/th&gt;
&lt;th&gt;Use&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;tiny&lt;/code&gt; / &lt;code&gt;base&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;fastest&lt;/td&gt;
&lt;td&gt;lower&lt;/td&gt;
&lt;td&gt;quick captions, weak hardware&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;small&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;fast&lt;/td&gt;
&lt;td&gt;good&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;recommended for live&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;medium&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;slower&lt;/td&gt;
&lt;td&gt;better&lt;/td&gt;
&lt;td&gt;accuracy over speed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;large-v3&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;slowest&lt;/td&gt;
&lt;td&gt;best&lt;/td&gt;
&lt;td&gt;offline/high-accuracy jobs&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;For live captioning, &lt;code&gt;small&lt;/code&gt; on a GPU is the sweet spot.&lt;/p&gt;

&lt;h2&gt;
  
  
  Transcribe in near real time
&lt;/h2&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;faster_whisper&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;WhisperModel&lt;/span&gt;

&lt;span class="n"&gt;model&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;WhisperModel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;small&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;device&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;cuda&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;compute_type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;float16&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# device="cpu", compute_type="int8" for CPU
&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;transcribe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;audio_path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;lang&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;zh&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;segments&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;transcribe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;audio_path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;language&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;lang&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;vad_filter&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;beam_size&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="sh"&gt;""&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&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;text&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;segments&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;strip&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Capture short audio chunks (1–3s) from the mic/OBS monitor and feed them in.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;vad_filter=True&lt;/code&gt; skips silence so you don't transcribe noise.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;beam_size=1&lt;/code&gt; favors speed for live use.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Hook it to translation (APIVAI)
&lt;/h2&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;ai&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_APIVAI_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;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="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;translate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Spanish&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;ai&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;gpt-5.5&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="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;system&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="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Translate to natural &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;. Output only the translation.&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;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="n"&gt;text&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;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;span class="nf"&gt;strip&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="nf"&gt;translate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;transcribe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;chunk.wav&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;h2&gt;
  
  
  Performance tips
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;GPU (&lt;code&gt;float16&lt;/code&gt;) is much faster than CPU; on CPU use &lt;code&gt;int8&lt;/code&gt; and a smaller model.&lt;/li&gt;
&lt;li&gt;Pre-load the model once and reuse it; don't reload per chunk.&lt;/li&gt;
&lt;li&gt;Keep chunks short; longer audio adds latency.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;&lt;strong&gt;Is local Whisper free?&lt;/strong&gt; Yes — &lt;code&gt;faster-whisper&lt;/code&gt; runs on your own hardware; there's no per-call&lt;br&gt;
cost. You only pay for the translation step (e.g. GPT-5.5 via APIVAI), which is cheap.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Does APIVAI provide Whisper?&lt;/strong&gt; No — APIVAI provides the OpenAI/Anthropic-compatible chat models&lt;br&gt;
(the translation step). Run Whisper locally for speech-to-text.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Which model size for live captions?&lt;/strong&gt; &lt;code&gt;small&lt;/code&gt; on a GPU — a good balance of speed and accuracy.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What latency can I expect?&lt;/strong&gt; With &lt;code&gt;small&lt;/code&gt; + short chunks, transcription is sub-second; end-to-end&lt;br&gt;
(STT → translate → caption) is typically ~1–2s.&lt;/p&gt;

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

&lt;p&gt;Install faster-whisper, run the transcribe loop, and send the text to APIVAI for translation.&lt;br&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>whisper</category>
      <category>speechtotext</category>
      <category>realtimetranslation</category>
    </item>
    <item>
      <title>How to Build a Discord AI Bot with APIVAI (Cheap Claude &amp; GPT)</title>
      <dc:creator>APIVAI</dc:creator>
      <pubDate>Thu, 25 Jun 2026 15:45:26 +0000</pubDate>
      <link>https://dev.to/mupromax/how-to-build-a-discord-ai-bot-with-apivai-cheap-claude-gpt-149e</link>
      <guid>https://dev.to/mupromax/how-to-build-a-discord-ai-bot-with-apivai-cheap-claude-gpt-149e</guid>
      <description>&lt;h2&gt;
  
  
  Build a Discord AI bot with APIVAI
&lt;/h2&gt;

&lt;p&gt;A Discord AI bot lets your server chat with Claude or GPT. Create a bot application, run a small&lt;br&gt;
discord.js script that forwards messages to an OpenAI-compatible model, and reply. APIVAI provides&lt;br&gt;
the model at a fraction of list price, with crypto/USDT/Alipay payment.&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;Go to the &lt;strong&gt;Discord Developer Portal&lt;/strong&gt; → New Application → &lt;strong&gt;Bot&lt;/strong&gt; → copy the &lt;strong&gt;bot token&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Enable the &lt;strong&gt;Message Content Intent&lt;/strong&gt; (Bot settings) so the bot can read messages.&lt;/li&gt;
&lt;li&gt;Invite the bot to your server (OAuth2 URL with the &lt;code&gt;bot&lt;/code&gt; scope and Send Messages permission).&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  2. The bot (discord.js)
&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;discord.js 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="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Client&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;GatewayIntentBits&lt;/span&gt; &lt;span class="p"&gt;}&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;discord.js&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;client&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;Client&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;intents&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;GatewayIntentBits&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Guilds&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;GatewayIntentBits&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;GuildMessages&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;GatewayIntentBits&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;MessageContent&lt;/span&gt;&lt;span class="p"&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;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 in a Discord server. Be concise.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nx"&gt;client&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;messageCreate&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="nx"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;author&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="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="c1"&gt;// respond when mentioned (so the bot isn't noisy)&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;mentions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;has&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;user&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;prompt&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;content&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/&amp;lt;@!&lt;/span&gt;&lt;span class="se"&gt;?\d&lt;/span&gt;&lt;span class="sr"&gt;+&amp;gt;/g&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;trim&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="k"&gt;await&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;channel&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sendTyping&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="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="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;prompt&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="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="nf"&gt;reply&lt;/span&gt;&lt;span class="p"&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="nf"&gt;slice&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="mi"&gt;1900&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt; &lt;span class="c1"&gt;// Discord 2000-char limit&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;login&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;DISCORD_BOT_TOKEN&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;DISCORD_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 mention the bot in your server.&lt;/p&gt;

&lt;h2&gt;
  
  
  Polish
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Add slash commands (&lt;code&gt;/ask&lt;/code&gt;) for a cleaner UX.&lt;/li&gt;
&lt;li&gt;Keep short per-channel history for context; trim to control token cost.&lt;/li&gt;
&lt;li&gt;Split replies over 2000 chars into multiple messages.&lt;/li&gt;
&lt;li&gt;Pick GPT-5.5 for general chat, Claude Sonnet for coding help.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;&lt;strong&gt;Can a Discord bot use APIVAI?&lt;/strong&gt; Yes — it's a standard OpenAI chat call with base URL&lt;br&gt;
&lt;code&gt;https://api.apivai.com/v1&lt;/code&gt;; the bot forwards the message and posts the reply.&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 code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How do I keep it from being spammy?&lt;/strong&gt; Only respond when mentioned or via a slash command.&lt;/p&gt;

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

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

&lt;p&gt;Create a bot app, 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>discord</category>
      <category>aibot</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Build an Enterprise Knowledge Base with Open WebUI + APIVAI (RAG)</title>
      <dc:creator>APIVAI</dc:creator>
      <pubDate>Thu, 25 Jun 2026 15:41:22 +0000</pubDate>
      <link>https://dev.to/mupromax/build-an-enterprise-knowledge-base-with-open-webui-apivai-rag-38hi</link>
      <guid>https://dev.to/mupromax/build-an-enterprise-knowledge-base-with-open-webui-apivai-rag-38hi</guid>
      <description>&lt;h2&gt;
  
  
  Build an enterprise knowledge base with Open WebUI + APIVAI
&lt;/h2&gt;

&lt;p&gt;You can stand up a private, self-hosted "chat with our documents" knowledge base without writing a&lt;br&gt;
RAG pipeline from scratch. &lt;a href="https://openwebui.com" rel="noopener noreferrer"&gt;Open WebUI&lt;/a&gt; has built-in document upload and&lt;br&gt;
retrieval; APIVAI supplies the language model (Claude or GPT) over one OpenAI-compatible&lt;br&gt;
connection, at a fraction of official price. Your documents stay on your own server; only the&lt;br&gt;
model calls go out.&lt;/p&gt;

&lt;p&gt;This guide covers the setup and the design choices that matter.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this stack
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Self-hosted UI + storage&lt;/strong&gt; — documents and chat history live on infrastructure you control.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No custom RAG code&lt;/strong&gt; — Open WebUI handles upload, chunking, embedding, and retrieval.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One model connection&lt;/strong&gt; — APIVAI gives you Claude and GPT models behind a single key.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cost control&lt;/strong&gt; — pay-as-you-go at a fraction of list; crypto/USDT/Alipay accepted.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  1. Run Open WebUI and connect APIVAI
&lt;/h2&gt;

&lt;p&gt;Start Open WebUI (Docker), then add APIVAI as an OpenAI connection (Admin Panel → Settings →&lt;br&gt;
Connections → OpenAI API):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;API 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;/ul&gt;

&lt;p&gt;Confirm models load in the chat model selector. (See the dedicated "Connect Open WebUI to APIVAI"&lt;br&gt;
guide for screenshots and troubleshooting.)&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Add your knowledge base
&lt;/h2&gt;

&lt;p&gt;In Open WebUI:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Go to &lt;strong&gt;Workspace → Knowledge&lt;/strong&gt; (or &lt;strong&gt;Documents&lt;/strong&gt;).&lt;/li&gt;
&lt;li&gt;Create a collection and upload your files (PDF, Markdown, DOCX, TXT).&lt;/li&gt;
&lt;li&gt;Open WebUI chunks and embeds them automatically.&lt;/li&gt;
&lt;li&gt;In a chat, reference the collection with &lt;code&gt;#&lt;/code&gt; (e.g. &lt;code&gt;#company-handbook&lt;/code&gt;) so the model answers
from those documents.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  3. Choose the answering model
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Claude Sonnet&lt;/strong&gt; is a strong default for knowledge-base Q&amp;amp;A: large context, faithful
summarization, careful answers over long source material.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GPT-5.5&lt;/strong&gt; is great when answers should be fast and conversational, or multilingual.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Set the model per chat or as the workspace default. Because it's OpenAI-compatible, switching is&lt;br&gt;
just picking a different model name.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Make answers trustworthy
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cite sources:&lt;/strong&gt; instruct the model (system prompt) to quote or reference the document section
it used, and to say "not in the documents" when it isn't.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scope retrieval:&lt;/strong&gt; keep collections focused (one per domain: HR, product, support) so
retrieval stays relevant.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Access control:&lt;/strong&gt; use Open WebUI's user/group permissions so teams only see their collections.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keep it fresh:&lt;/strong&gt; re-upload documents when they change; remove stale ones.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  5. Embeddings note
&lt;/h2&gt;

&lt;p&gt;Open WebUI can compute embeddings locally (default) or via an external embeddings endpoint. APIVAI&lt;br&gt;
focuses on the chat/completions side (Claude and GPT), so keep Open WebUI's built-in/local&lt;br&gt;
embeddings for retrieval and use APIVAI for the answering model — a clean, low-cost split.&lt;/p&gt;

&lt;h2&gt;
  
  
  Example use cases
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Internal HR/IT helpdesk over policy docs.&lt;/li&gt;
&lt;li&gt;Product/support team answering from manuals and past tickets.&lt;/li&gt;
&lt;li&gt;Sales enablement over spec sheets and pricing.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;&lt;strong&gt;Where do my documents live?&lt;/strong&gt; On your Open WebUI server — they are not sent to APIVAI; only the&lt;br&gt;
chat prompt (with retrieved snippets) is.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Which model for a knowledge base?&lt;/strong&gt; Claude Sonnet for faithful long-context answers; GPT-5.5 for&lt;br&gt;
fast multilingual replies.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Do I need to build embeddings/RAG myself?&lt;/strong&gt; No — Open WebUI handles it; APIVAI is just the&lt;br&gt;
answering model.&lt;/p&gt;

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

&lt;p&gt;Run Open WebUI, connect APIVAI (&lt;code&gt;https://api.apivai.com/v1&lt;/code&gt; + key), upload your docs, and pick a&lt;br&gt;
model. 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>openwebui</category>
      <category>rag</category>
    </item>
    <item>
      <title>How to Connect Open WebUI to APIVAI (OpenAI-Compatible)</title>
      <dc:creator>APIVAI</dc:creator>
      <pubDate>Thu, 25 Jun 2026 15:41:19 +0000</pubDate>
      <link>https://dev.to/mupromax/how-to-connect-open-webui-to-apivai-openai-compatible-46h2</link>
      <guid>https://dev.to/mupromax/how-to-connect-open-webui-to-apivai-openai-compatible-46h2</guid>
      <description>&lt;h2&gt;
  
  
  Connect Open WebUI to APIVAI
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://openwebui.com" rel="noopener noreferrer"&gt;Open WebUI&lt;/a&gt; is a popular self-hosted ChatGPT-style interface. It talks to&lt;br&gt;
any OpenAI-compatible endpoint, so you can run it on top of APIVAI's Claude and GPT models by&lt;br&gt;
adding one connection — base URL plus key. No plugins, no code.&lt;/p&gt;

&lt;p&gt;This guide shows the exact steps.&lt;/p&gt;
&lt;h2&gt;
  
  
  1. Run Open WebUI
&lt;/h2&gt;

&lt;p&gt;If you don't have it yet, the quickest start is Docker:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker run &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; 3000:8080 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-v&lt;/span&gt; open-webui:/app/backend/data &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--name&lt;/span&gt; open-webui &lt;span class="se"&gt;\&lt;/span&gt;
  ghcr.io/open-webui/open-webui:main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open &lt;code&gt;http://localhost:3000&lt;/code&gt; and create the admin account.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Add APIVAI as an OpenAI connection
&lt;/h2&gt;

&lt;p&gt;In Open WebUI:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Click your avatar → &lt;strong&gt;Admin Panel → Settings → Connections&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;OpenAI API&lt;/strong&gt;, click &lt;strong&gt;+&lt;/strong&gt; to add a connection.&lt;/li&gt;
&lt;li&gt;Set:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;API 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;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Save, then refresh.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Open WebUI will pull the model list from APIVAI. Claude and GPT models now appear in the model&lt;br&gt;
selector at the top of a new chat.&lt;/p&gt;
&lt;h2&gt;
  
  
  3. Pick a model that exists
&lt;/h2&gt;

&lt;p&gt;If the dropdown is empty or a model errors, confirm the available 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;Use one of the returned names. You can also hide models you don't want from the admin model&lt;br&gt;
settings.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Verify
&lt;/h2&gt;

&lt;p&gt;Start a new chat, pick a Claude or GPT model, and send a message. You should see a streamed&lt;br&gt;
response. If it streams token by token, the OpenAI-compatible connection is working end to end.&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;No models in the dropdown&lt;/strong&gt; — re-check the Base URL ends with &lt;code&gt;/v1&lt;/code&gt; and the key is valid;
refresh the page after saving.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;model_not_found&lt;/code&gt;&lt;/strong&gt; — call &lt;code&gt;GET /v1/models&lt;/code&gt; and use an exact returned name.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No streaming&lt;/strong&gt; — make sure you didn't disable streaming in the chat settings.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;401&lt;/strong&gt; — the key is missing/incorrect or has a leading/trailing space.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why APIVAI for Open WebUI
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;One OpenAI-compatible connection gives Open WebUI access to both Claude and GPT models.&lt;/li&gt;
&lt;li&gt;A fraction of official list price, pay-as-you-go — good for a team sharing one self-hosted UI.&lt;/li&gt;
&lt;li&gt;Crypto / USDT / Alipay payment, no VPN, no subscription.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Next
&lt;/h2&gt;

&lt;p&gt;For a private document Q&amp;amp;A setup, see how to build an enterprise knowledge base with Open WebUI +&lt;br&gt;
APIVAI. Working API examples are in the&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>openwebui</category>
      <category>tutorial</category>
      <category>selfhosted</category>
    </item>
    <item>
      <title>How to Connect Chatbox to APIVAI (Cheap Claude &amp; GPT)</title>
      <dc:creator>APIVAI</dc:creator>
      <pubDate>Thu, 25 Jun 2026 15:40:50 +0000</pubDate>
      <link>https://dev.to/mupromax/how-to-connect-chatbox-to-apivai-cheap-claude-gpt-14co</link>
      <guid>https://dev.to/mupromax/how-to-connect-chatbox-to-apivai-cheap-claude-gpt-14co</guid>
      <description>&lt;h2&gt;
  
  
  Connect Chatbox to APIVAI
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://chatboxai.app" rel="noopener noreferrer"&gt;Chatbox&lt;/a&gt; is a popular desktop and mobile AI client. It supports&lt;br&gt;
OpenAI-compatible providers, so you can use APIVAI's Claude and GPT models by setting the API host&lt;br&gt;
and key — no code.&lt;/p&gt;

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

&lt;ol&gt;
&lt;li&gt;Open Chatbox → &lt;strong&gt;Settings&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Model Provider:&lt;/strong&gt; choose &lt;strong&gt;OpenAI API&lt;/strong&gt; (or "Add Custom Provider" → OpenAI-compatible).&lt;/li&gt;
&lt;li&gt;Set:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;API Host / API Domain:&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;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Model:&lt;/strong&gt; pick or enter a name APIVAI serves (e.g. &lt;code&gt;claude-sonnet-4-6&lt;/code&gt;, &lt;code&gt;gpt-5.5&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Save and start chatting.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Confirm available models
&lt;/h2&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;Enter one of those names if a model errors.&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;401&lt;/strong&gt; — check the API key and that the host is &lt;code&gt;https://api.apivai.com/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 an exact name from &lt;code&gt;/v1/models&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No streaming&lt;/strong&gt; — confirm streaming is on in Chatbox settings.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;A single OpenAI-compatible host gives Chatbox both Claude and GPT models at a fraction of list&lt;br&gt;
price, pay-as-you-go, with crypto/USDT/Alipay and no VPN — great for a personal cross-device client.&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;Does Chatbox work with APIVAI?&lt;/strong&gt; Yes — set the API host to &lt;code&gt;https://api.apivai.com/v1&lt;/code&gt; and your&lt;br&gt;
APIVAI key in the OpenAI provider settings.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Can I use Claude and GPT?&lt;/strong&gt; Yes — one key exposes both families.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Do I need any code?&lt;/strong&gt; No — it's a settings change in the Chatbox app.&lt;/p&gt;

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

&lt;p&gt;Set APIVAI's host + key in Chatbox and pick a model from &lt;code&gt;/v1/models&lt;/code&gt;. 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>chatbox</category>
      <category>tutorial</category>
      <category>desktop</category>
    </item>
    <item>
      <title>How to Build a Slack AI Bot with APIVAI (Cheap Claude &amp; GPT)</title>
      <dc:creator>APIVAI</dc:creator>
      <pubDate>Thu, 25 Jun 2026 15:40:47 +0000</pubDate>
      <link>https://dev.to/mupromax/how-to-build-a-slack-ai-bot-with-apivai-cheap-claude-gpt-2859</link>
      <guid>https://dev.to/mupromax/how-to-build-a-slack-ai-bot-with-apivai-cheap-claude-gpt-2859</guid>
      <description>&lt;h2&gt;
  
  
  Build a Slack AI bot with APIVAI
&lt;/h2&gt;

&lt;p&gt;A Slack AI bot lets your workspace ask Claude or GPT from any channel. Create a Slack app, subscribe&lt;br&gt;
to message events, and forward them to an OpenAI-compatible model. APIVAI provides the model cheaply.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Create the Slack app
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;api.slack.com/apps → &lt;strong&gt;Create New App&lt;/strong&gt; → enable &lt;strong&gt;Bot Token Scopes&lt;/strong&gt; (&lt;code&gt;app_mentions:read&lt;/code&gt;,
&lt;code&gt;chat:write&lt;/code&gt;) → install to your workspace → copy the &lt;strong&gt;Bot Token&lt;/strong&gt; (&lt;code&gt;xoxb-...&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Enable &lt;strong&gt;Event Subscriptions&lt;/strong&gt; and subscribe to &lt;code&gt;app_mention&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  2. The server (Node)
&lt;/h2&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;express&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;express&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;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;express&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;express&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="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="nx"&gt;app&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="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/slack/events&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;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&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="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;type&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;url_verification&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="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;challenge&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Slack handshake&lt;/span&gt;
  &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sendStatus&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&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;e&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;event&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="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;type&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;app_mention&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&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;prompt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;e&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;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/&amp;lt;@&lt;/span&gt;&lt;span class="se"&gt;[^&lt;/span&gt;&lt;span class="sr"&gt;&amp;gt;&lt;/span&gt;&lt;span class="se"&gt;]&lt;/span&gt;&lt;span class="sr"&gt;+&amp;gt;/g&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;trim&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="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;prompt&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="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;fetch&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://slack.com/api/chat.postMessage&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;POST&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;Authorization&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`Bearer &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;SLACK_BOT_TOKEN&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Content-Type&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;application/json&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;channel&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;channel&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;text&lt;/span&gt;&lt;span class="p"&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="p"&gt;});&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;listen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3000&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;SLACK_BOT_TOKEN&lt;/code&gt; + &lt;code&gt;APIVAI_API_KEY&lt;/code&gt;, expose the URL to Slack, and @mention the bot.&lt;/p&gt;

&lt;h2&gt;
  
  
  Polish
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Reply in a thread (&lt;code&gt;thread_ts&lt;/code&gt;) to keep channels tidy.&lt;/li&gt;
&lt;li&gt;Keep short per-thread history for context; trim to control cost.&lt;/li&gt;
&lt;li&gt;GPT-5.5 for general Q&amp;amp;A; Claude Sonnet for code.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;&lt;strong&gt;Can a Slack bot use APIVAI?&lt;/strong&gt; Yes — it's an OpenAI chat call with base URL&lt;br&gt;
&lt;code&gt;https://api.apivai.com/v1&lt;/code&gt;; the bot forwards the mention and posts the reply.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Which model?&lt;/strong&gt; GPT-5.5 for general/multilingual; Claude Sonnet for code-heavy help.&lt;/p&gt;

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

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

&lt;p&gt;Create the Slack app, run the server with your APIVAI key, and @mention the bot. 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>slack</category>
      <category>aibot</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How to Connect Jan to APIVAI (Cloud Claude &amp; GPT Models)</title>
      <dc:creator>APIVAI</dc:creator>
      <pubDate>Wed, 24 Jun 2026 13:47:42 +0000</pubDate>
      <link>https://dev.to/mupromax/how-to-connect-jan-to-apivai-cloud-claude-gpt-models-4bjb</link>
      <guid>https://dev.to/mupromax/how-to-connect-jan-to-apivai-cloud-claude-gpt-models-4bjb</guid>
      <description>&lt;h2&gt;
  
  
  Connect Jan to APIVAI
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://jan.ai" rel="noopener noreferrer"&gt;Jan&lt;/a&gt; is an open-source, offline-first ChatGPT alternative. Besides local models, it&lt;br&gt;
can use remote OpenAI-compatible engines — so you can add APIVAI to chat with cloud Claude and GPT&lt;br&gt;
models at a fraction of list price.&lt;/p&gt;

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

&lt;ol&gt;
&lt;li&gt;In Jan, open &lt;strong&gt;Settings → Model Providers&lt;/strong&gt; (or the engine/remote-API settings).&lt;/li&gt;
&lt;li&gt;Add an &lt;strong&gt;OpenAI-compatible&lt;/strong&gt; remote engine:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Base URL / API 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;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Add the model names you want (e.g. &lt;code&gt;claude-sonnet-4-6&lt;/code&gt;, &lt;code&gt;gpt-5.5&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Select an APIVAI model in a new thread.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Confirm models
&lt;/h2&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="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 returned name.&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;No response / 401&lt;/strong&gt; — recheck the Base URL (&lt;code&gt;/v1&lt;/code&gt;) and key.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;model_not_found&lt;/code&gt;&lt;/strong&gt; — use an exact name from &lt;code&gt;/v1/models&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;Keep local models for offline use and add APIVAI for powerful cloud Claude/GPT models on demand —&lt;br&gt;
one key, a fraction of list price, crypto/USDT/Alipay, no VPN.&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;Can Jan use cloud models via APIVAI?&lt;/strong&gt; Yes — add an OpenAI-compatible remote engine with 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;Does this replace local models?&lt;/strong&gt; No — it's an additional remote engine; use whichever per chat.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Which model?&lt;/strong&gt; Claude Sonnet for depth; GPT-5.5 for fast, cheap replies.&lt;/p&gt;

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

&lt;p&gt;Add APIVAI as a remote engine in Jan and pick a model from &lt;code&gt;/v1/models&lt;/code&gt;. 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>jan</category>
      <category>tutorial</category>
      <category>selfhosted</category>
    </item>
    <item>
      <title>Build an AI Email Assistant with a Cheap OpenAI-Compatible API</title>
      <dc:creator>APIVAI</dc:creator>
      <pubDate>Wed, 24 Jun 2026 09:51:52 +0000</pubDate>
      <link>https://dev.to/mupromax/build-an-ai-email-assistant-with-a-cheap-openai-compatible-api-cm</link>
      <guid>https://dev.to/mupromax/build-an-ai-email-assistant-with-a-cheap-openai-compatible-api-cm</guid>
      <description>&lt;h2&gt;
  
  
  Build an AI email assistant
&lt;/h2&gt;

&lt;p&gt;An AI email assistant can summarize long threads, draft replies in your voice, and triage your&lt;br&gt;
inbox. The model does the language work; APIVAI provides it cheaply over an OpenAI-compatible API&lt;br&gt;
(GPT-5.5 is a great fit for natural, multilingual email).&lt;/p&gt;

&lt;h2&gt;
  
  
  Core actions
&lt;/h2&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;ai&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_APIVAI_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;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="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;summarize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;thread&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;ai&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;gpt-5.5&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="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;system&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;Summarize this email thread in 3 bullets and list any action items.&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;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="n"&gt;thread&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;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="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;draft_reply&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;thread&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;intent&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tone&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;friendly and professional&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;ai&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;gpt-5.5&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="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;system&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="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Write an email reply that is &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;tone&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;. Match the thread&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;s language.&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;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="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Thread:&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;thread&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="se"&gt;\n\n&lt;/span&gt;&lt;span class="s"&gt;My intent: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;intent&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&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;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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Wire it to your inbox
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Gmail/Outlook API&lt;/strong&gt; or &lt;strong&gt;IMAP&lt;/strong&gt;: fetch messages, run &lt;code&gt;summarize&lt;/code&gt;/&lt;code&gt;draft_reply&lt;/code&gt;, save drafts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Triage:&lt;/strong&gt; classify into categories (urgent / FYI / newsletter) and label accordingly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Human in the loop:&lt;/strong&gt; save as a draft for you to review, don't auto-send.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Tips
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Put your signature, common facts, and tone guidelines in the system prompt for consistency.&lt;/li&gt;
&lt;li&gt;Summarize first for long threads, then draft from the summary to save tokens.&lt;/li&gt;
&lt;li&gt;GPT-5.5 handles multilingual email well; a smaller model can do bulk triage cheaply.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;&lt;strong&gt;Which model for email?&lt;/strong&gt; GPT-5.5 — natural, multilingual, cheap via APIVAI; a smaller model for&lt;br&gt;
bulk triage.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Does APIVAI read my email?&lt;/strong&gt; No — your code fetches email; only the text you send in the prompt&lt;br&gt;
reaches the model. Keep secrets out of prompts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Can it auto-send?&lt;/strong&gt; Better to save drafts for review; auto-send only after you trust it.&lt;/p&gt;

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

&lt;p&gt;Get an APIVAI key, wire the functions above to your inbox, and start with summaries + drafts.&lt;br&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>aiemail</category>
      <category>automation</category>
      <category>gpt55</category>
    </item>
  </channel>
</rss>
