<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Lingyi API Notes]]></title><description><![CDATA[Lingyi API Notes]]></description><link>https://lingyi.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Fri, 04 Dec 2026 23:41:59 GMT</lastBuildDate><atom:link href="https://lingyi.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[2:47 AM: Why Your AI Suddenly Refuses to Write the Next Scene]]></title><description><![CDATA[It's 2:47 in the morning. You've been writing for hours. The story is finally at the scene you've been building toward for weeks — the climax, the…]]></description><link>https://lingyi.hashnode.dev/2-47-am-why-your-ai-suddenly-refuses-to-write-the-next-scene</link><guid isPermaLink="true">https://lingyi.hashnode.dev/2-47-am-why-your-ai-suddenly-refuses-to-write-the-next-scene</guid><category><![CDATA[api]]></category><category><![CDATA[llm]]></category><category><![CDATA[AI]]></category><category><![CDATA[writing]]></category><dc:creator><![CDATA[Lingyi]]></dc:creator><pubDate>Mon, 30 Nov 2026 12:43:26 GMT</pubDate><content:encoded><![CDATA[<h1>2:47 AM: Why Your AI Suddenly Refuses to Write the Next Scene</h1>
<p>It's 2:47 in the morning. You've been writing for hours. The story is finally at the scene you've been building toward for weeks — the climax, the confrontation, the moment everything pays off.</p>
<p>You hit send.</p>
<p>And the AI refuses.</p>
<p>Not a crash. Not an error code. Just a polite, firm "I can't continue this." Three months of buildup, stopped cold at the exact moment it mattered most.</p>
<p>If this has happened to you, here is the part nobody tells you: <strong>that refusal is not one thing. It's three different things wearing the same face</strong> — and which one you hit decides what you should do next.</p>
<p><a class="embed-card" href="https://youtube.com/shorts/5sYuX4PnFpg">https://youtube.com/shorts/5sYuX4PnFpg</a></p>

<h2>The three reasons an AI suddenly says no</h2>
<p><strong>1. The model itself declined.</strong> Every model has its own built-in sense of where the line is, and that line moves. A scene that was fine last week can trip it tonight because the wording drifted a little darker, a little more intense. Nothing about your account changed. The model just looked at this particular passage and decided, on its own, to stop.</p>
<p><strong>2. The request never reached the model.</strong> Between you and the model there is usually a checkpoint — a content inspection layer on the route your request travels. When it flags something, your text gets stopped before the model ever sees it. From your side it looks identical to a refusal, but the model was never even asked. This is the one behind those mysterious errors (DataInspectionFailed and friends) that make people think the service is broken.</p>
<p><strong>3. One single word set it off.</strong> Sometimes the whole passage is fine except for one name, one term, one phrase that a filter somewhere is watching for. Change that one word and the exact same scene sails through. Maddening — but also the easiest of the three to fix, once you know it's a possibility.</p>
<h2>The 3-step check I run before I panic</h2>
<p>When a refusal hits mid-scene, don't rewrite everything and don't start switching services at 3 AM. Run this first:</p>
<p><strong>Step 1 — Read the exact words it refused with.</strong> Did it answer like a person declining ("I can't help with this scene")? That's reason #1, the model itself. Did you get a raw error code or a blank failure instead? That points at reason #2, the checkpoint.</p>
<p><strong>Step 2 — Rephrase and retry once.</strong> Trim the passage down, soften the one or two sharpest lines, and send it again. If it goes through, you were dealing with reason #3 — a trigger word or a borderline phrasing — and now you know your scene survives with a lighter touch.</p>
<p><strong>Step 3 — Check the clock.</strong> If refusals and slowdowns cluster at peak hours, part of what you're seeing may be rate limiting wearing a refusal's clothes. Wait ten minutes and retry the unchanged text. If it works, it was never about your content at all.</p>
<p>Ninety percent of "the AI betrayed me" nights are one of these three, and each one has a different fix. Guessing wrong is how people lose a whole evening — or a whole chapter.</p>
<h2>Your turn</h2>
<p>I made a 30-second animated short about exactly this moment — the 2:47 AM refusal — because it has happened to me more times than I'll admit (the video is embedded above).</p>
<p>So tell me: <strong>what's the worst refusal you've ever hit — and what time was it?</strong> The comments on this one are going to be a support group, I can already tell.</p>
<hr />
<p><em>— Lingyi. I write plain-language notes about using AI APIs without the headaches — the errors, the bills, and the 2:47 AM moments — from running an API relay day to day. More notes:</em> <a href="http://dev.to/lingyi_api"><em>dev.to/lingyi_api</em></a></p>
]]></content:encoded></item><item><title><![CDATA[401 Unauthorized: It's Almost Never the Model — It's Your Key]]></title><description><![CDATA[The error looks blunt: 401 Unauthorized Most people read it as "I'm locked out" and start panicking, reinstalling, or blaming the model. In practice a 401…]]></description><link>https://lingyi.hashnode.dev/401-unauthorized-it-s-almost-never-the-model-it-s-your-key</link><guid isPermaLink="true">https://lingyi.hashnode.dev/401-unauthorized-it-s-almost-never-the-model-it-s-your-key</guid><category><![CDATA[api]]></category><category><![CDATA[llm]]></category><category><![CDATA[debugging]]></category><category><![CDATA[AI]]></category><category><![CDATA[Beginner Developers]]></category><dc:creator><![CDATA[Lingyi]]></dc:creator><pubDate>Mon, 30 Nov 2026 12:39:21 GMT</pubDate><content:encoded><![CDATA[<h1>401 Unauthorized: It's Almost Never the Model — It's Your Key</h1>
<p>The error looks blunt:</p>
<p><strong>401 Unauthorized</strong></p>
<p>Most people read it as "I'm locked out" and start panicking, reinstalling, or blaming the model. In practice a 401 is the simplest error of the lot: the service looked at your key and said "I don't know you". The model never even saw your message.</p>
<h2>The four usual causes</h2>
<p><strong>1. The key is copied wrong.</strong> A missing character, a trailing space, or an old key left in the settings while the new one sits in your notes. This is the most common cause by far.</p>
<p><strong>2. The key expired or was revoked.</strong> Some services rotate keys, some let you delete them — and a deleted key fails exactly like a fake one.</p>
<p><strong>3. The balance is empty.</strong> Plenty of services answer an empty wallet with a 401 instead of a clear "top up" message. Annoying, but common.</p>
<p><strong>4. The address and the key don't belong together.</strong> A key from service A pasted into the settings for service B will always get a 401. When you switch providers, the base URL, the key and the model name have to change together — all three.</p>
<h2>A 60-second checklist</h2>
<p>Run it in this order before you change anything else:</p>
<ol>
<li><strong>Address</strong> — is the base URL the one this key was issued for?</li>
<li><strong>Key</strong> — paste it fresh from where it was issued; check for spaces at both ends.</li>
<li><strong>Model name</strong> — does it match what this service calls the model?</li>
<li><strong>Balance</strong> — log in and look. If the balance page shows zero, that was your answer.</li>
</ol>
<h2>How 401 differs from its neighbours</h2>
<ul>
<li><strong>401</strong> = the guard doesn't recognize your card. Key, address, or balance.</li>
<li><strong>403</strong> = the guard recognizes you, but you're not allowed in this room — permissions or region rules.</li>
<li><strong>429</strong> = you're allowed in, but the queue is full. Wait and retry slowly.</li>
</ul>
<p>Learning to tell these three apart saves hours. Most "the API is down" evenings are actually a key that died quietly three days earlier.</p>
<p>On the relay I run, a dead key or an empty balance is visible line by line in the billing log, which is how it should be — when something fails, you deserve an error you can actually diagnose.</p>
<p>Next time a 401 pops up, don't reinstall anything. Check the card first.</p>
]]></content:encoded></item><item><title><![CDATA[429 Too Many Requests: What It Means and How to Stop Hitting It]]></title><description><![CDATA[If you chat or build with an API long enough, you will meet this one: 429 Too Many Requests. It looks scary. It is usually not your fault, and your account…]]></description><link>https://lingyi.hashnode.dev/429-too-many-requests-what-it-means-and-how-to-stop-hitting-it</link><guid isPermaLink="true">https://lingyi.hashnode.dev/429-too-many-requests-what-it-means-and-how-to-stop-hitting-it</guid><category><![CDATA[AI]]></category><category><![CDATA[api]]></category><category><![CDATA[Developer Tools]]></category><category><![CDATA[Productivity]]></category><dc:creator><![CDATA[Lingyi]]></dc:creator><pubDate>Sun, 29 Nov 2026 18:18:51 GMT</pubDate><content:encoded><![CDATA[<p>If you chat or build with an API long enough, you will meet this one: 429 Too Many Requests. It looks scary. It is usually not your fault, and your account is not broken.</p>
<h2>What a 429 actually is</h2>
<p>A 429 means: in the same short window of time, more requests arrived than the service agreed to handle, so the extra ones got turned away at the door. Think of a small shop with one door. Ten people at once is fine. Two hundred at once, and the shopkeeper starts saying "wait outside". You are not banned. The door is just full.</p>
<h2>The three usual causes</h2>
<p><strong>1. A per-minute cap.</strong> Many services limit how many requests you can send per minute. Long chats, auto-retries and batch jobs eat through this faster than people expect.</p>
<p><strong>2. A concurrency cap.</strong> This is how many requests can be in flight at the same moment. Chat apps feel this one a lot: one click can quietly fire several requests behind the scenes.</p>
<p><strong>3. Burst habits.</strong> Retrying instantly after every error, or letting a tool resend the whole long context again and again, creates little traffic jams that trip the limit even when your total usage is small.</p>
<h2>How to tell which one you hit</h2>
<ul>
<li>It happens at busy times of day, then clears on its own → probably a shared per-minute cap.</li>
<li>It happens when your app does several things at once → concurrency cap.</li>
<li>It happens right after an error, in a loop → your own retry pattern is piling requests up.</li>
</ul>
<h2>What actually helps</h2>
<ul>
<li><strong>Back off before retrying.</strong> Wait a few seconds, then longer. Instant retries make the jam worse.</li>
<li><strong>Spread the load.</strong> If a tool lets you set request intervals or max parallel requests, use them.</li>
<li><strong>Ask for the numbers in writing.</strong> Before you top up anywhere, ask: how many requests per minute, and how many concurrent? A service that will not say probably does not have much to give.</li>
</ul>
<p>On the relay I run, the published limits are 12,000 requests per minute and 1,200 concurrent requests. Whatever you end up using, get the numbers first — a 429 problem you can predict is a 429 problem you can plan around.</p>
<p>Hitting 429s all day is rarely bad luck. It is usually just a door that is too small for the crowd trying to use it.</p>
]]></content:encoded></item><item><title><![CDATA[Your Long Chats Are Paying Full Price Every Turn — Check the Cache Line on Your Bill]]></title><description><![CDATA[In a long chat or roleplay session, every new turn makes the model re-read the whole history. Ten thousand words in, you're paying to "read" those ten…]]></description><link>https://lingyi.hashnode.dev/your-long-chats-are-paying-full-price-every-turn-check-the-cache-line-on-your-bill</link><guid isPermaLink="true">https://lingyi.hashnode.dev/your-long-chats-are-paying-full-price-every-turn-check-the-cache-line-on-your-bill</guid><category><![CDATA[api]]></category><category><![CDATA[AI]]></category><category><![CDATA[Deepseek]]></category><category><![CDATA[llm]]></category><dc:creator><![CDATA[Lingyi]]></dc:creator><pubDate>Sun, 29 Nov 2026 17:46:30 GMT</pubDate><content:encoded><![CDATA[<p>In a long chat or roleplay session, every new turn makes the model re-read the whole history. Ten thousand words in, you're paying to "read" those ten thousand words again — every single turn.</p>
<p>That's what prompt caching is for. When the beginning of your conversation stays the same, the provider can bill those repeated tokens at the cache price instead of the full input price. On the flash-class model I use most, that's $0.083 per million input tokens at full price versus $0.005 per million cached — a 16x difference.</p>
<h2>How to check if you're paying full price</h2>
<p>Open your usage bill and compare two numbers: total input tokens and cached input tokens. If your sessions are long but the cached number sits near zero, you're paying full price for words the model has already read dozens of times.</p>
<h2>Why the cache keeps missing</h2>
<ul>
<li><strong>You edited the system prompt or character card mid-chat.</strong> Any change near the start invalidates everything after it.</li>
<li><strong>Long pauses.</strong> Caches expire; come back hours later and the first turn is full price again.</li>
<li><strong>Switching models mid-session.</strong> A new model means a cold cache.</li>
</ul>
<h2>What actually helps</h2>
<ul>
<li>Freeze your system prompt and character card before a long session starts.</li>
<li>If you need to change the setup, change it between sessions, not during one.</li>
<li>Instead of editing the card to fix the story, summarize and start fresh — a cold cache on a short context is cheaper than a broken cache on a huge one.</li>
</ul>
<p>What's your cache hit rate on a long session? Most people I ask have never looked at that line of the bill.</p>
<hr />
<p><em>I run Lingyi, a small API relay (DeepSeek / GLM / Kimi, original and less-restricted versions, per-use billing you can audit line by line): <a href="https://ai.lingapp.io/?aff=vrDV">https://ai.lingapp.io/?aff=vrDV</a> — questions welcome.</em></p>
]]></content:encoded></item><item><title><![CDATA[Your AI Chat Suddenly Refuses to Answer? There Are Three Different Causes]]></title><description><![CDATA[You're in the middle of a long chat or a roleplay session, everything is going fine — and then, out of nowhere, the model refuses to answer. Most people's…]]></description><link>https://lingyi.hashnode.dev/your-ai-chat-suddenly-refuses-to-answer-there-are-three-different-causes</link><guid isPermaLink="true">https://lingyi.hashnode.dev/your-ai-chat-suddenly-refuses-to-answer-there-are-three-different-causes</guid><category><![CDATA[api]]></category><category><![CDATA[AI]]></category><category><![CDATA[Deepseek]]></category><category><![CDATA[llm]]></category><dc:creator><![CDATA[Lingyi]]></dc:creator><pubDate>Sun, 29 Nov 2026 17:24:28 GMT</pubDate><content:encoded><![CDATA[<p>You're in the middle of a long chat or a roleplay session, everything is going fine — and then, out of nowhere, the model refuses to answer.</p>
<p>Most people's first reaction is to switch models. But "refusal" is actually three different problems wearing the same mask, and each one has a different fix.</p>
<h2>1. The model itself won't take it</h2>
<p>Some model versions are simply stricter than others. The same prompt that one version answers happily, another version refuses outright.</p>
<p><strong>Fix:</strong> this is the one case where switching models (or switching to a less restricted version of the same model) actually works.</p>
<h2>2. Your message was blocked before it ever reached the model</h2>
<p>Sometimes your text never arrives at the model at all. A content-inspection layer on the provider's side scans the request first and kills it in transit — if you've ever seen an error like <code>DataInspectionFailed</code>, that's exactly what happened.</p>
<p><strong>Fix:</strong> rewriting your prompt won't help, because the model never saw it. The block is on the line, not in the model. You need a route that doesn't run that inspection.</p>
<h2>3. The conversation got too long</h2>
<p>In a long session, earlier sensitive words stay in the context and get re-read on every turn. The longer you chat, the more chances the filter has to trip — which is why refusals often show up mid-session instead of at the start.</p>
<p><strong>Fix:</strong> trim or summarize the context, or start a fresh thread and carry over only the summary. If refusals vanish in a new thread, this was your cause.</p>
<h2>So before you change anything</h2>
<p>Ask which of the three it is:</p>
<ul>
<li>Refused from the very first message → probably the model.</li>
<li>An error code instead of an answer → probably the line.</li>
<li>Fine at first, refuses later → probably the context.</li>
</ul>
<p>Which one hits you most often?</p>
<hr />
<p><em>I run Lingyi, a small API relay (DeepSeek / GLM / Kimi, original and less-restricted versions, per-use billing you can audit line by line): <a href="https://ai.lingapp.io/?aff=vrDV">https://ai.lingapp.io/?aff=vrDV</a> — questions welcome.</em></p>
]]></content:encoded></item><item><title><![CDATA[What Is DataInspectionFailed? Your Message Was Blocked Before It Ever Reached the Model]]></title><description><![CDATA[If you ever see the error DataInspectionFailed, don't panic — and don't blame yourself. It means this: what you sent never arrived at the AI. It was…]]></description><link>https://lingyi.hashnode.dev/what-is-datainspectionfailed-your-message-was-blocked-before-it-ever-reached-the-model</link><guid isPermaLink="true">https://lingyi.hashnode.dev/what-is-datainspectionfailed-your-message-was-blocked-before-it-ever-reached-the-model</guid><category><![CDATA[api]]></category><category><![CDATA[Deepseek]]></category><category><![CDATA[AI]]></category><category><![CDATA[llm]]></category><dc:creator><![CDATA[Lingyi]]></dc:creator><pubDate>Sun, 29 Nov 2026 15:07:40 GMT</pubDate><content:encoded><![CDATA[<p>If you ever see the error <strong>DataInspectionFailed</strong>, don't panic — and don't blame yourself.</p>
<p>It means this: <strong>what you sent never arrived at the AI. It was stopped on the way there.</strong></p>
<h2>How far does one message travel?</h2>
<p>When you send a message, it passes through four stops:</p>
<ol>
<li><strong>Your client</strong> (the chat app, roleplay front-end, or program you use)</li>
<li><strong>The relay route</strong> (the channel that forwards your request)</li>
<li><strong>The cloud provider's content inspection</strong> (a "security check" at the door of the data center)</li>
<li><strong>The model itself</strong> (the AI that actually answers you)</li>
</ol>
<p>DataInspectionFailed happens at stop 3.</p>
<p>The inspector scans your text, decides it "looks suspicious," and blocks it on the spot. <strong>The model never even saw your message.</strong></p>
<p>So this is not the model refusing you, and it's not a problem with your account. You simply didn't get past the checkpoint.</p>
<h2>Why does it get blocked?</h2>
<p>The inspection is automated and crude. It scans for certain words and combinations, and it would rather block ten innocent messages than let one risky one through.</p>
<p>If your text is a bit intense, or a long passage happens to contain a few flagged words mixed in, it can get stopped — even if the content itself is perfectly fine.</p>
<h2>What to do when it happens</h2>
<p>Try these three steps, in order:</p>
<p><strong>Step 1: Rephrase and resend.</strong>
Swap the most pointed words for milder ones, break up the sentences, and send it again. Very often, that's enough to get through.</p>
<p><strong>Step 2: Split long text into smaller chunks.</strong>
If one spot in a long passage trips the scanner, the whole passage gets blocked. Send it in smaller pieces, one at a time — that also tells you exactly which part caused the problem.</p>
<p><strong>Step 3: If it still fails, it's the route.</strong>
At that point, no edit on your end will help, because what's blocking you isn't the model — it's the inspection on that particular route. You can wait it out, or switch routes or providers. This is exactly where a good route and a bad route part ways.</p>
<h2>One last thing</h2>
<p>Lingyi (the relay service I run) uses dual routing: if one route gets stuck at inspection, your request switches to the other automatically — no settings to change on your side.</p>
<p>But don't take my word for it: <strong>try the three steps above first.</strong> If they work for you, then decide whether it's worth staying.</p>
<p>— Lingyi | An API relay that doesn't dumb models down
Site: <a href="https://ai.lingapp.io/?aff=vrDV">https://ai.lingapp.io/?aff=vrDV</a>
Telegram: <a href="https://t.me/lingyi_apiiii">https://t.me/lingyi_apiiii</a>
X: @lingyi_api</p>
]]></content:encoded></item></channel></rss>