<?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: Xu Kaichao</title>
    <description>The latest articles on DEV Community by Xu Kaichao (@kaichao_xu).</description>
    <link>https://dev.to/kaichao_xu</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3905671%2F2baf200b-43b3-4aaf-b451-191ddb3f2089.png</url>
      <title>DEV Community: Xu Kaichao</title>
      <link>https://dev.to/kaichao_xu</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kaichao_xu"/>
    <language>en</language>
    <item>
      <title>How I Built an AI API Wrapper Backend in 30 Minutes - Would You Pay USD 79 for This?</title>
      <dc:creator>Xu Kaichao</dc:creator>
      <pubDate>Thu, 30 Apr 2026 14:34:16 +0000</pubDate>
      <link>https://dev.to/kaichao_xu/how-i-built-an-ai-api-wrapper-backend-in-30-minutes-would-you-pay-9-for-this-3l03</link>
      <guid>https://dev.to/kaichao_xu/how-i-built-an-ai-api-wrapper-backend-in-30-minutes-would-you-pay-9-for-this-3l03</guid>
      <description>&lt;h2&gt;
  
  
  The 2-Day Problem I Solved in 30 Minutes
&lt;/h2&gt;

&lt;p&gt;Every time I start a new AI project, I spend 2-3 days on the same stuff: API key management, token counting, user rate limiting, and switching between models.&lt;/p&gt;

&lt;p&gt;Last week I said "enough" and built a reusable backend template.&lt;/p&gt;

&lt;h2&gt;
  
  
  What It Does
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;One endpoint, any model&lt;/strong&gt; — Swap between DeepSeek, OpenAI, Claude by changing one config line&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;API key encryption&lt;/strong&gt; — Keys never touch your frontend code&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Token billing built-in&lt;/strong&gt; — Per-user usage tracking with quota system&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Docker deploy&lt;/strong&gt; — One command to production&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Code (Core)
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# api_router.py — the heart of it
&lt;/span&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;fastapi&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;FastAPI&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Depends&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;core.auth&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;get_current_user&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;core.billing&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;check_quota&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;deduct_tokens&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;core.gateway&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;AIProvider&lt;/span&gt;

&lt;span class="n"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;FastAPI&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="nd"&gt;@app.post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/api/generate&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;generate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;prompt&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;model&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;deepseek-v4-pro&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Depends&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;get_current_user&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="nf"&gt;check_quota&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;estimated_tokens&lt;/span&gt;&lt;span class="o"&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;raise&lt;/span&gt; &lt;span class="nc"&gt;HTTPException&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;402&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Quota exceeded&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="n"&gt;provider&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;AIProvider&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;provider&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;complete&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;prompt&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="n"&gt;token_cost&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;usage&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;total_tokens&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
    &lt;span class="nf"&gt;deduct_tokens&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;token_cost&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="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;text&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;result&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;tokens_used&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;token_cost&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Why I'm Posting This
&lt;/h2&gt;

&lt;p&gt;I'm thinking of packaging this as a product. Full template with auth, billing, admin dashboard, Docker deployment — ready to clone and ship your AI app in 30 minutes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Question to the community: Would you pay $79 for this? Or is it something you'd rather build yourself?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Be honest. If 10 people say they'd buy it, I'll launch it next week.&lt;/p&gt;




&lt;p&gt;Tags: #saas #ai #webdev #startup #discuss&lt;/p&gt;

</description>
      <category>saas</category>
      <category>ai</category>
      <category>webdev</category>
      <category>startup</category>
    </item>
    <item>
      <title>5 AI Prompts That Save Me 10 Hours of Content Creation Every Week</title>
      <dc:creator>Xu Kaichao</dc:creator>
      <pubDate>Thu, 30 Apr 2026 08:40:49 +0000</pubDate>
      <link>https://dev.to/kaichao_xu/5-ai-prompts-that-save-me-10-hours-of-content-creation-every-week-4elb</link>
      <guid>https://dev.to/kaichao_xu/5-ai-prompts-that-save-me-10-hours-of-content-creation-every-week-4elb</guid>
      <description>&lt;p&gt;I used to stare at a blank screen every morning wondering what to post.&lt;/p&gt;

&lt;p&gt;Not anymore. I built a system using AI prompts that turns ONE idea into a week of content across LinkedIn, Twitter, and email.&lt;/p&gt;

&lt;p&gt;Here are 3 of my favorites (free to use):&lt;/p&gt;




&lt;h2&gt;
  
  
  1. The "One Idea → 5 Posts" Prompt
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Take this topic: "[YOUR TOPIC]"
Create 5 content angles:
1. A contrarian take (go against common advice)
2. A personal story (share a failure or lesson)
3. A how-to (step-by-step, actionable)
4. A question (provocative, invite discussion)
5. A curation (3 resources/tools + why)
Make each angle unique and platform-ready.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Why it works: This prompt kills the "what do I post today" problem. One idea becomes a week of content instantly.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. The "LinkedIn Hook Factory"
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Write 5 LinkedIn opening hooks for this topic: "[TOPIC]"
Rules:
- Hook must fit in one line on mobile
- Use curiosity, numbers, or a bold claim
- No clickbait cliches
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Why it works: If your first line doesn't grab, nothing else matters. This prompt makes sure someone actually reads past line 1.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. The "Repurpose Everything" Prompt
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;I have a [BLOG POST / VIDEO / THREAD] about [TOPIC].
Turn it into:
- 3 tweets (short, punchy)
- 1 LinkedIn post (professional, story-driven)
- 1 email newsletter intro
Keep the core message. Adapt the tone for each platform.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Why it works: Most creators do the hard work once and let it die. This prompt turns one piece of content into a distribution machine.&lt;/p&gt;




&lt;p&gt;I've collected 50 of these prompts covering LinkedIn, Twitter, Instagram, Email, Blog, and more. Each one comes with platform-specific formatting, tone guides, and ready-to-use templates.&lt;/p&gt;

&lt;p&gt;If you're tired of the daily "what do I post" stress, you can grab the full pack here:&lt;br&gt;
&lt;a href="https://content-multiplier.surge.sh" rel="noopener noreferrer"&gt;https://content-multiplier.surge.sh&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;$19, lifetime access, 30-day refund if it doesn't save you time.&lt;/p&gt;




&lt;p&gt;What's your go-to content hack? Drop it in the comments.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>productivity</category>
      <category>contentcreation</category>
      <category>chatgpt</category>
    </item>
  </channel>
</rss>
