<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>NewAPI on Margrop Blog</title>
		<link>https://blog.margrop.net/en/tag/newapi/</link>
		<description>Recent content in NewAPI on Margrop Blog</description>
		<generator>Hugo</generator>
		<language>en-US</language>
		
		
		
		
			<lastBuildDate>Fri, 10 Jul 2026 15:30:00 +0800</lastBuildDate>
		
			<atom:link href="https://blog.margrop.net/en/tag/newapi/index.xml" rel="self" type="application/rss+xml" />
			<item>
				<title>Stop Sprinkling API Keys Everywhere: My Self-Hosted NewAPI Relay Station</title>
				<link>https://blog.margrop.net/en/post/newapi-self-hosted-relay-station/</link>
				<pubDate>Fri, 10 Jul 2026 15:30:00 +0800</pubDate>
				<guid>https://blog.margrop.net/en/post/newapi-self-hosted-relay-station/</guid>
				<description>&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;NewAPI is not a free-model trick and it is not a mysterious proxy. In my setup, it is the front desk for AI usage: every app talks to one endpoint, while the gateway routes requests to authorized upstream providers and handles tokens, quotas, groups, model limits, logs, and usage accounting. For a personal deployment, the big win is not “one more dashboard”; it is no longer scattering upstream keys across every client, script, and agent.&lt;/p&gt;&#xA;&lt;p&gt;This post explains why I wanted a self-hosted model relay, what people usually misunderstand, how to deploy a minimal Docker Compose version, why I add persistent storage, and how to use one-click scripts for Windows 11, Ubuntu 26.04, and macOS 26. It also includes an agent-driven setup prompt with strict boundaries. No private address, complete machine name, private domain, or real secret is included.&lt;/p&gt;&#xA;&lt;/blockquote&gt;</description>
			</item>
			<item>
				<title>One Missing operator.write Took Down the Gateway: The OpenClaw Fallback Failure That Wasn&#39;t a Model Problem</title>
				<link>https://blog.margrop.net/en/post/openclaw-missing-operator-write-scope/</link>
				<pubDate>Fri, 10 Jul 2026 08:00:00 +0800</pubDate>
				<guid>https://blog.margrop.net/en/post/openclaw-missing-operator-write-scope/</guid>
				<description>&lt;p&gt;This incident looked like a model-provider outage at first. OpenClaw had just received three NewAPI-backed fallback models, but gateway-based model calls started failing with a provider authentication error. After peeling back the outer message, the real error was much more specific:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;missing scope: operator.write&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;That string changed the direction of the investigation. The provider key was not the root problem. The NewAPI endpoint was not the root problem. The model names were not the root problem either. The failure lived inside OpenClaw&amp;rsquo;s gateway authorization path: when a model override was used, the gateway call switched into a backend/gateway-client mode, but did not force the request to use the already paired stored device identity. The device had &lt;code&gt;operator.write&lt;/code&gt;; the request simply did not carry the identity that could prove it.&lt;/p&gt;&#xA;&lt;p&gt;The shortest version is this: &lt;strong&gt;the badge existed, but this entrance did not scan it.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://blog.margrop.net/post-images/openclaw-missing-operator-write-scope/cover.png&#34; alt=&#34;AI-generated cover showing a gateway protected by two authorization locks&#34;&gt;&lt;/p&gt;</description>
			</item>
			<item>
				<title>Stop Letting Agents Burn Tokens: Wiring Headroom into NewAPI, OpenClaw, and HermesAgent</title>
				<link>https://blog.margrop.net/en/post/headroom-newapi-openclaw-hermesagent-token-compression-guide/</link>
				<pubDate>Sat, 20 Jun 2026 12:30:00 +0800</pubDate>
				<guid>https://blog.margrop.net/en/post/headroom-newapi-openclaw-hermesagent-token-compression-guide/</guid>
				<description>&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;I did not replace NewAPI, and I did not point OpenClaw or HermesAgent at an unproven gateway. The actual design is simpler: place Headroom in front of NewAPI, then move only the already validated OpenAI-compatible providers to &lt;code&gt;http://&amp;lt;headroom-host&amp;gt;:8787/v1&lt;/code&gt;. The original NewAPI endpoint stays available. Long agent context now goes through Headroom first, gets compressed, then continues to NewAPI for the same routing and model management as before.&lt;/p&gt;&#xA;&lt;p&gt;The rule that kept the rollout boring was: &lt;strong&gt;test first, edit second; migrate only OpenAI-compatible providers that pass; leave non-OpenAI fallbacks alone.&lt;/strong&gt; This post is both a write-up and a runbook you can hand to an Agent or follow manually.&lt;/p&gt;&#xA;&lt;/blockquote&gt;</description>
			</item>
			<item>
				<title>Double-Consumed Streaming: Debugging a NewAPI v1.0.0-rc.10 MiniMax Proxy Bug</title>
				<link>https://blog.margrop.net/en/post/newapi-streaming-duplicate-content-debugging/</link>
				<pubDate>Sun, 31 May 2026 18:00:00 +0800</pubDate>
				<guid>https://blog.margrop.net/en/post/newapi-streaming-duplicate-content-debugging/</guid>
				<description>&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;An AI Agent was producing duplicated replies in DingTalk — not two separate messages, but a single message whose content appeared twice. The root cause traced back to a streaming bug in NewAPI (the QuantumNous fork of OneAPI) v1.0.0-rc.10: when proxying MiniMax through the OpenAI Chat Completions protocol, the finish chunk contained &lt;strong&gt;both &lt;code&gt;delta.content&lt;/code&gt; and &lt;code&gt;message.content&lt;/code&gt;&lt;/strong&gt; with identical values. The Agent&amp;rsquo;s stream handler consumed both as &amp;ldquo;visible text,&amp;rdquo; concatenating the content twice. The fix was straightforward: switch the OpenClaw provider protocol from &lt;code&gt;openai-completions&lt;/code&gt; to &lt;code&gt;anthropic-messages&lt;/code&gt;, which OneAPI natively supports and where streaming behaves correctly.&lt;/p&gt;&#xA;&lt;p&gt;No internal IPs, tokens, model IDs, or private paths appear in this article. All configuration snippets have been sanitized.&lt;/p&gt;&#xA;&lt;/blockquote&gt;</description>
			</item>
			<item>
				<title>Why HermesAgent Would Not Reply in WeChat or WeCom: The Real Culprit Was a Local Relay With a 3-Second Timeout</title>
				<link>https://blog.margrop.net/en/post/hermesagent-wechat-wecom-relay-timeout-debugging/</link>
				<pubDate>Sun, 31 May 2026 08:00:00 +0800</pubDate>
				<guid>https://blog.margrop.net/en/post/hermesagent-wechat-wecom-relay-timeout-debugging/</guid>
				<description>&lt;h2 id=&#34;the-short-version&#34;&gt;The short version&lt;/h2&gt;&#xA;&lt;p&gt;This incident looked like a model problem or a broken messaging channel, but the real failure happened one layer lower: my local &lt;code&gt;relay&lt;/code&gt; cut the upstream request off after 3 seconds. That was fine for quick health checks, but it was wrong for real WeChat and WeCom turns, which often take longer to produce a complete answer from the NewAPI gateway. Once the relay disconnected too early, HermesAgent could only see &lt;code&gt;Connection error&lt;/code&gt;, &lt;code&gt;RemoteProtocolError&lt;/code&gt;, and then exhausted fallback attempts.&lt;/p&gt;</description>
			</item>
	</channel>
</rss>
