<?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: XiuAI</title>
    <description>The latest articles on DEV Community by XiuAI (xiuai-lab).</description>
    <link>https://dev.to/xiuai-lab</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%2Forganization%2Fprofile_image%2F14457%2F05a77d4b-586f-4d8e-81be-025936bf9f12.png</url>
      <title>DEV Community: XiuAI</title>
      <link>https://dev.to/xiuai-lab</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/xiuai-lab"/>
    <language>en</language>
    <item>
      <title>How to Compare an AI Subscription Before You Buy</title>
      <dc:creator>Dashu</dc:creator>
      <pubDate>Fri, 04 Sep 2026 12:20:13 +0000</pubDate>
      <link>https://dev.to/xiuai-lab/how-to-compare-an-ai-subscription-before-you-buy-4l48</link>
      <guid>https://dev.to/xiuai-lab/how-to-compare-an-ai-subscription-before-you-buy-4l48</guid>
      <description>&lt;p&gt;One month of ChatGPT Plus currently costs &lt;strong&gt;US$19.99 at XiuStore&lt;/strong&gt; in either of two purchase options. If you want to keep using your existing ChatGPT account, only one of those options fits.&lt;/p&gt;

&lt;p&gt;Here is the actual comparison, using the &lt;a href="https://store.xiu.ai/en/products/chatgpt-plus/?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=plus_options_4574311" rel="noopener noreferrer"&gt;public product page&lt;/a&gt;, checked on &lt;strong&gt;September 19, 2026&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the same price buys
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Activation on your account&lt;/th&gt;
&lt;th&gt;Ready-to-use account&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Listed price&lt;/td&gt;
&lt;td&gt;US$19.99&lt;/td&gt;
&lt;td&gt;US$19.99&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Subscription term&lt;/td&gt;
&lt;td&gt;One month&lt;/td&gt;
&lt;td&gt;One month&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Account you use&lt;/td&gt;
&lt;td&gt;Your existing, eligible ChatGPT account&lt;/td&gt;
&lt;td&gt;A new single-user account supplied with Plus enabled&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;What the order delivers&lt;/td&gt;
&lt;td&gt;A redemption code and instructions&lt;/td&gt;
&lt;td&gt;Account sign-in details and instructions&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Your next step&lt;/td&gt;
&lt;td&gt;Redeem on the account you intend to use&lt;/td&gt;
&lt;td&gt;Follow the order instructions, then sign in to the supplied account&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;OpenAI API credits&lt;/td&gt;
&lt;td&gt;Not included&lt;/td&gt;
&lt;td&gt;Not included&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The practical choice is straightforward. &lt;strong&gt;Want Plus on the account you already use? Choose activation on your account.&lt;/strong&gt; Buying the ready-to-use option will give you a different account; it will not activate your existing one.&lt;/p&gt;

&lt;p&gt;If you want a separate account with Plus already enabled, the ready-to-use option provides that. The order instructions explain where to provide the receiving email and how to retrieve the account details when delivery is complete.&lt;/p&gt;

&lt;h2&gt;
  
  
  Price, currency and support
&lt;/h2&gt;

&lt;p&gt;The catalog also shows &lt;strong&gt;CNY 134.93 as a reference amount&lt;/strong&gt;. XiuStore transactions use USD, so the amount to compare here is US$19.99. The reference conversion and future prices can change. Neither quote establishes a price for a later purchase.&lt;/p&gt;

&lt;p&gt;For activation on your own account, the account must be accessible and eligible for redemption. The listed option does not include a renewal service.&lt;/p&gt;

&lt;p&gt;Both options describe support for the covered subscription term: if the subscription ends early, unused days are refunded, rounded up to a full day. Account bans are excluded. Support starts from the original order, where the buyer can provide the delivery details and error information for that purchase.&lt;/p&gt;

&lt;h2&gt;
  
  
  Applying this comparison to another offer
&lt;/h2&gt;

&lt;p&gt;Compare the account you will use and the subscription term alongside the price. In this example, the product name, price and term all match, but the result after delivery is different. A cheaper offer only helps if it delivers the account arrangement you actually want.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://store.xiu.ai/en/products/chatgpt-plus/?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=plus_options_4574311" rel="noopener noreferrer"&gt;current options and full terms are on the product page&lt;/a&gt;. This walkthrough uses XiuStore's own published offers. XiuStore is operated by XiuLab Inc, a U.S. corporation.&lt;/p&gt;

</description>
      <category>ecommerce</category>
      <category>ai</category>
      <category>product</category>
      <category>saas</category>
    </item>
    <item>
      <title>A Practical Scoping Checklist for Enterprise AI Projects</title>
      <dc:creator>Dashu</dc:creator>
      <pubDate>Tue, 01 Sep 2026 19:07:02 +0000</pubDate>
      <link>https://dev.to/xiuai-lab/a-practical-scoping-checklist-for-enterprise-ai-projects-4lc6</link>
      <guid>https://dev.to/xiuai-lab/a-practical-scoping-checklist-for-enterprise-ai-projects-4lc6</guid>
      <description>&lt;p&gt;A team managing model access for its employees needs a different setup from a business selling AI subscriptions and model APIs under its own brand. Start with that choice, then decide what software, deployment work and ongoing resources you need.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two use cases, with published package prices
&lt;/h2&gt;

&lt;p&gt;XiuAI's &lt;a href="https://xiu.ai/zh/enterprise" rel="noopener noreferrer"&gt;published enterprise offer (Chinese)&lt;/a&gt;, checked on &lt;strong&gt;September 8, 2026&lt;/strong&gt;, lists these annual packages:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Customer goal&lt;/th&gt;
&lt;th&gt;Package&lt;/th&gt;
&lt;th&gt;Published annual price&lt;/th&gt;
&lt;th&gt;Included product scope&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Give a team one place to manage model access, members, quotas and usage&lt;/td&gt;
&lt;td&gt;Standard&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;CNY 9,600/year&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Model management platform, model/API integration, member and usage management, ongoing technical support&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Sell AI subscriptions and provide model APIs using your own brand&lt;/td&gt;
&lt;td&gt;Enhanced&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;CNY 17,600/year&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Standard package plus dedicated XiuStore, XiuRouter and management platform; brand/domain configuration, configuration migration and ongoing upgrades&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The annual fee covers the product and technical delivery package. &lt;strong&gt;Servers, cloud resources and model resources are separate costs.&lt;/strong&gt; The customer purchases and owns the server/cloud environment; model resources are billed by token usage or agreed dedicated capacity. Work outside the standard product scope is quoted separately.&lt;/p&gt;

&lt;p&gt;For the Enhanced scenario, this means starting with existing storefront, order, payment and model-API products under your own brand. You still operate the business and manage your customers. The brand, domain, customer relationships and business data remain on the customer side.&lt;/p&gt;

&lt;p&gt;If you only need model access for an existing app, begin with &lt;a href="https://router.xiu.ai/en/pricing" rel="noopener noreferrer"&gt;XiuRouter's usage-based API service&lt;/a&gt;. The annual deployment package is for teams that want their own platform or product setup.&lt;/p&gt;

&lt;p&gt;These two scenarios make the scoping questions below concrete. Separate four decisions:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;the product and environment the customer owns;&lt;/li&gt;
&lt;li&gt;model resources and usage costs;&lt;/li&gt;
&lt;li&gt;deployment and ongoing technical service;&lt;/li&gt;
&lt;li&gt;procurement, payment, and invoicing.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  1. Start with the customer-owned product
&lt;/h2&gt;

&lt;p&gt;Write down what the customer is actually building and where it will run.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Is the system internal, customer-facing, or both?&lt;/li&gt;
&lt;li&gt;Which cloud account, domain, repository, and data store belong to the
customer?&lt;/li&gt;
&lt;li&gt;Who owns the user relationship and the data-retention decision?&lt;/li&gt;
&lt;li&gt;Which parts must remain portable if the model provider changes?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This prevents a service provider from becoming the accidental owner of the&lt;br&gt;
customer's product boundary. It also makes later security and procurement&lt;br&gt;
questions much easier to answer.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Separate model resources from application cost
&lt;/h2&gt;

&lt;p&gt;“AI cost” is not one number. At minimum, identify:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the model family and exact model ID;&lt;/li&gt;
&lt;li&gt;the protocol and client that will send requests;&lt;/li&gt;
&lt;li&gt;input and output usage;&lt;/li&gt;
&lt;li&gt;cache reads and writes when applicable;&lt;/li&gt;
&lt;li&gt;service tier or route;&lt;/li&gt;
&lt;li&gt;currency, unit, and pricing version;&lt;/li&gt;
&lt;li&gt;the budget owner and the alert threshold.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For a multi-model application, the request path matters as much as the model&lt;br&gt;
name. An OpenAI Responses request, an OpenAI Chat Completions request, an&lt;br&gt;
Anthropic Messages request, and a Gemini GenerateContent request are different&lt;br&gt;
protocol surfaces. A working “hello” response does not prove that the&lt;br&gt;
production client is using the intended route.&lt;/p&gt;

&lt;p&gt;The practical check is to run a small representative request and compare the&lt;br&gt;
client configuration with the provider-side usage record: model, route,&lt;br&gt;
status, token buckets, and recorded cost.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Define deployment and ongoing service separately
&lt;/h2&gt;

&lt;p&gt;Before implementation starts, decide who is responsible for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;integration and environment setup;&lt;/li&gt;
&lt;li&gt;monitoring and incident response;&lt;/li&gt;
&lt;li&gt;version changes and rollback;&lt;/li&gt;
&lt;li&gt;access-key scope and rotation;&lt;/li&gt;
&lt;li&gt;debugging a failed request;&lt;/li&gt;
&lt;li&gt;documentation and handover.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is where a model API service and an engineering service meet, but they&lt;br&gt;
should not be presented as the same thing. A gateway can provide protocol&lt;br&gt;
access, scoped keys, pricing visibility, and request records. It does not&lt;br&gt;
automatically become an SLA, a managed application team, or a provider&lt;br&gt;
fallback system.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Leave procurement until the scope is clear
&lt;/h2&gt;

&lt;p&gt;Procurement questions are easier once the technical boundary is explicit:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What is being purchased: software access, implementation, or ongoing
service?&lt;/li&gt;
&lt;li&gt;Is the charge usage-based, fixed, or a combination?&lt;/li&gt;
&lt;li&gt;Who receives the invoice?&lt;/li&gt;
&lt;li&gt;Which taxes, service fees, or payment constraints apply?&lt;/li&gt;
&lt;li&gt;What does warranty or support cover, and what is outside the boundary?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Do not hide these facts behind a generic “AI package” label. A buyer should be&lt;br&gt;
able to tell what they receive, how the amount is calculated, and where&lt;br&gt;
support starts and ends.&lt;/p&gt;

&lt;h2&gt;
  
  
  A small intake that works
&lt;/h2&gt;

&lt;p&gt;Before choosing a vendor or writing a proposal, collect these six answers:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Question&lt;/th&gt;
&lt;th&gt;Evidence to keep&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;What is the customer building?&lt;/td&gt;
&lt;td&gt;product owner, users, environment&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Which protocol does the client send?&lt;/td&gt;
&lt;td&gt;SDK configuration and request path&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Which model and route are required?&lt;/td&gt;
&lt;td&gt;model ID, service tier, compatibility note&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;How will usage be controlled?&lt;/td&gt;
&lt;td&gt;key scope, quota, budget, expiry&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Who owns deployment and incidents?&lt;/td&gt;
&lt;td&gt;named responsibility and rollback path&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;What is the commercial boundary?&lt;/td&gt;
&lt;td&gt;price method, invoice, support and warranty&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;If an answer is missing, mark it as an open decision. Do not fill the gap with&lt;br&gt;
a default model, a guessed SLA, or a headline discount.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where XiuAI fits
&lt;/h2&gt;

&lt;p&gt;XiuAI provides products and technical services for the two use cases above. XiuRouter is relevant when an&lt;br&gt;
application or agent needs model access through native OpenAI, Anthropic, or&lt;br&gt;
Gemini protocol routes, with scoped API keys and request-level usage and cost&lt;br&gt;
records. XiuStore is a buyer-facing service for AI accounts and subscriptions,&lt;br&gt;
where price, delivery form, warranty, and after-sales support need to be clear&lt;br&gt;
before purchase. Neither surface replaces the customer's own product&lt;br&gt;
ownership or the project responsibility agreement.&lt;/p&gt;

&lt;p&gt;The right order is simple: define the customer's product, validate the&lt;br&gt;
protocol and usage path, assign deployment responsibility, then settle the&lt;br&gt;
commercial terms. That sequence produces a clearer proposal and a more&lt;br&gt;
testable implementation.&lt;/p&gt;

&lt;p&gt;XiuAI and its products are operated by XiuLab Inc, a U.S. corporation.&lt;/p&gt;

&lt;p&gt;For a project-specific discussion, see the &lt;a href="https://xiu.ai/en/contact" rel="noopener noreferrer"&gt;XiuAI contact page&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>productmanagement</category>
      <category>devops</category>
      <category>webdev</category>
    </item>
    <item>
      <title>How to Compare LLM API Gateway Prices Without Mixing Models, Cache, and Routes</title>
      <dc:creator>Dashu</dc:creator>
      <pubDate>Tue, 01 Sep 2026 01:53:16 +0000</pubDate>
      <link>https://dev.to/xiuai-lab/how-to-compare-llm-api-gateway-prices-without-mixing-models-cache-and-routes-3bn1</link>
      <guid>https://dev.to/xiuai-lab/how-to-compare-llm-api-gateway-prices-without-mixing-models-cache-and-routes-3bn1</guid>
      <description>&lt;p&gt;For a developer using GPT-5.5, a price comparison can be concrete: $35 in the displayed provider-reference column versus $2.45 at XiuRouter's current default rate for the same token counts.&lt;/p&gt;

&lt;p&gt;Here is the arithmetic, followed by a method you can apply to your own usage.&lt;/p&gt;

&lt;h2&gt;
  
  
  September 30 deadline for existing benefit-group users
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Update, September 13, 2026:&lt;/strong&gt; XiuRouter's benefit group is closed to new selection. Existing access remains available for now, but the group will stop completely after &lt;strong&gt;September 30, 2026&lt;/strong&gt;. If your key still uses it, migrate to another available group before then. Retaining a key's old settings does not extend the group's availability.&lt;/p&gt;

&lt;p&gt;Recheck the destination model, price and quota before migrating. For Astra, Fast consumes &lt;strong&gt;2.5 times&lt;/strong&gt; the quota of Standard. Verify a small request and its recorded cost before restoring normal traffic.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://changelog.xiu.ai/posts/xiurouter-%E4%BB%8A%E6%97%A5%E6%9B%B4%E6%96%B0%E5%88%86%E7%BB%84%E5%B1%95%E7%A4%BA%E4%BB%B7%E6%A0%BC%E5%8F%82%E8%80%83%E4%B8%8E%E6%95%B0%E6%8D%AE%E9%9A%90%E7%A7%81" rel="noopener noreferrer"&gt;Official retirement notice (Chinese)&lt;/a&gt; · &lt;a href="https://docs.xiu.ai/en/router/models-pricing-usage/#benefit-group-migration-deadline" rel="noopener noreferrer"&gt;Current pricing and migration guide&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  A worked example: $35 versus $2.45
&lt;/h2&gt;

&lt;p&gt;Prices checked on &lt;strong&gt;September 12, 2026&lt;/strong&gt; in &lt;a href="https://router.xiu.ai/en/pricing" rel="noopener noreferrer"&gt;XiuRouter's public pricing catalog&lt;/a&gt;. The model is &lt;code&gt;gpt-5.5&lt;/code&gt;. The public catalog currently exposes one selectable group, &lt;code&gt;max&lt;/code&gt;, so the ordinary price page no longer requires a Value-versus-Managed choice. Historical or account-specific keys may retain other group settings; use the rate available to the key that will make the request.&lt;/p&gt;

&lt;p&gt;Assume your application accumulates one million uncached input tokens and one million output tokens across multiple requests. Each request stays within the &lt;strong&gt;272,000-input-token&lt;/strong&gt; pricing tier.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Token usage&lt;/th&gt;
&lt;th&gt;Displayed provider-reference rate&lt;/th&gt;
&lt;th&gt;XiuRouter rate&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1 million uncached input tokens&lt;/td&gt;
&lt;td&gt;$5.00&lt;/td&gt;
&lt;td&gt;$0.35&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1 million output tokens&lt;/td&gt;
&lt;td&gt;$30.00&lt;/td&gt;
&lt;td&gt;$2.10&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Estimated token cost&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;$35.00&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;$2.45&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Reference estimate = $5.00 + $30.00 = $35.00
XiuRouter estimate = $0.35 + $2.10 = $2.45
Difference         = $32.55, or 93%
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These are USD token-rate estimates using the reference prices displayed by XiuRouter. This example contains no cache reads or writes, and it does not add taxes or other non-token charges. Requests above the input threshold use different rates. No new paid model request was run for this example.&lt;/p&gt;

&lt;p&gt;For your own app, replace the token counts with usage from a representative task. Keep the exact model, service tier and applicable input-length band fixed. The worked example below shows why a different input/output mix can change the winner when two routes have different rate ratios.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why an input discount is not the whole bill
&lt;/h2&gt;

&lt;p&gt;The current &lt;code&gt;gpt-6-astra&lt;/code&gt; standard input-length band illustrates the difference. At no more than 272,000 input tokens per request, the September 12 catalog lists an input rate of $0.875 and an output rate of $5.25 per million tokens, against displayed provider-reference rates of $10 and $50 respectively.&lt;/p&gt;

&lt;p&gt;That is about 91.3% less for input and 89.5% less for output. Accumulating one million uncached input tokens and one million output tokens across requests costs an estimated $6.125, versus a $60 reference estimate: about 89.8% less in total. It would be inaccurate to advertise this workload as saving over 90% on the whole bill.&lt;/p&gt;

&lt;p&gt;The calculation excludes cache usage, tool fees, taxes and other non-token charges. Longer inputs use another pricing band. It is a calculation from the public catalog, not a newly executed or billed model request.&lt;/p&gt;

&lt;h2&gt;
  
  
  A discount percentage is not a price model
&lt;/h2&gt;

&lt;p&gt;Before comparing two offers, define the exact thing being compared.&lt;/p&gt;

&lt;p&gt;A useful comparison tuple is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;model
+ provider or source model
+ service group or route
+ API protocol
+ input price
+ output price
+ cache-read price
+ cache-write price
+ currency and unit
+ pricing version or checked-at time
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If one of these fields changes, you may no longer be comparing the same offer.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A model alias can point to a different upstream model later.&lt;/li&gt;
&lt;li&gt;An OpenAI-compatible route and a native Anthropic Messages route can expose different capabilities.&lt;/li&gt;
&lt;li&gt;A lower-cost service group can have a different availability boundary.&lt;/li&gt;
&lt;li&gt;A cached-input price cannot be compared with an uncached-input price.&lt;/li&gt;
&lt;li&gt;A price copied from an old screenshot may no longer match the live catalog.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The first rule is therefore simple: compare a complete route, not a model name.&lt;/p&gt;

&lt;h2&gt;
  
  
  Separate the token buckets
&lt;/h2&gt;

&lt;p&gt;Token-based APIs commonly charge different rates for several token types.&lt;/p&gt;

&lt;p&gt;At minimum, keep these buckets separate:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;uncached input tokens;&lt;/li&gt;
&lt;li&gt;output tokens;&lt;/li&gt;
&lt;li&gt;cache-read tokens;&lt;/li&gt;
&lt;li&gt;cache-write or cache-creation tokens.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A normalized cost calculation is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cost = (
    input_tokens       * input_rate_per_1m
  + output_tokens      * output_rate_per_1m
  + cache_read_tokens  * cache_read_rate_per_1m
  + cache_write_tokens * cache_write_rate_per_1m
) / 1_000_000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use raw token counts for the &lt;code&gt;*_tokens&lt;/code&gt; values and prices per one million tokens for the &lt;code&gt;*_rate_per_1m&lt;/code&gt; values. The division by 1,000,000 converts the unit rates into the estimated cost.&lt;/p&gt;

&lt;p&gt;Do not add cache-read tokens to uncached input and then charge both rates. Do not apply the input rate to output tokens. Do not assume cache write and cache read have the same price.&lt;/p&gt;

&lt;h2&gt;
  
  
  Weight the comparison with a real workload
&lt;/h2&gt;

&lt;p&gt;An input-heavy workload and an output-heavy workload can produce opposite results from the same price table.&lt;/p&gt;

&lt;p&gt;Consider this hypothetical example:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Route&lt;/th&gt;
&lt;th&gt;Input / 1M&lt;/th&gt;
&lt;th&gt;Output / 1M&lt;/th&gt;
&lt;th&gt;Cache read / 1M&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Route A&lt;/td&gt;
&lt;td&gt;$0.50&lt;/td&gt;
&lt;td&gt;$5.00&lt;/td&gt;
&lt;td&gt;$0.05&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Route B&lt;/td&gt;
&lt;td&gt;$1.00&lt;/td&gt;
&lt;td&gt;$3.00&lt;/td&gt;
&lt;td&gt;$0.10&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Assume one workload uses:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;8 million uncached input tokens;&lt;/li&gt;
&lt;li&gt;2 million output tokens;&lt;/li&gt;
&lt;li&gt;5 million cache-read tokens.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Because these rates are per one million tokens, the quantities in the following equations are expressed in millions:&lt;/p&gt;

&lt;p&gt;The weighted costs are:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Route A = 8 × 0.50 + 2 × 5.00 + 5 × 0.05 = $14.25
Route B = 8 × 1.00 + 2 × 3.00 + 5 × 0.10 = $14.50
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Route A has the lower input price. Route B has the lower output price. Neither headline tells you the result by itself.&lt;/p&gt;

&lt;p&gt;These numbers are illustrative, not current XiuRouter or provider prices. Replace them with the live rates and your own token distribution.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep reference prices traceable
&lt;/h2&gt;

&lt;p&gt;A savings claim needs a reference source.&lt;/p&gt;

&lt;p&gt;Record:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the reference model;&lt;/li&gt;
&lt;li&gt;the provider or published source;&lt;/li&gt;
&lt;li&gt;the input, output, cache-read, and cache-write reference rates;&lt;/li&gt;
&lt;li&gt;the date or pricing version used;&lt;/li&gt;
&lt;li&gt;the gateway route being compared.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If the gateway maps one public model name to another source model, that mapping must be visible in the evidence. Otherwise, the comparison may combine two different products.&lt;/p&gt;

&lt;p&gt;XiuRouter's public pricing API exposes a &lt;code&gt;pricing_version&lt;/code&gt; and, where available, structured &lt;code&gt;reference_price&lt;/code&gt; fields such as &lt;code&gt;input&lt;/code&gt;, &lt;code&gt;output&lt;/code&gt;, &lt;code&gt;cache_read&lt;/code&gt;, &lt;code&gt;cache_write&lt;/code&gt;, and &lt;code&gt;source_model&lt;/code&gt;. The live response can change as models and routes change, so store the version with the comparison instead of treating one response as permanent.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use the price available to your API key
&lt;/h2&gt;

&lt;p&gt;Price is not independent of the route that delivers the request.&lt;/p&gt;

&lt;p&gt;A gateway can make the same model available through multiple service groups. A cheaper group may have different availability, permissions, or upstream characteristics. A key may also be restricted to only some groups or models.&lt;/p&gt;

&lt;p&gt;For XiuRouter, the September 12 public catalog has only &lt;code&gt;max&lt;/code&gt; as a selectable group. A single-group account does not need to choose a tier in the interface. If an existing key has a different group or account-specific access, include that group in the estimate and request check.&lt;/p&gt;

&lt;p&gt;Do not calculate using the cheapest visible group and then send production traffic through a different group.&lt;/p&gt;

&lt;h2&gt;
  
  
  Protocol compatibility is a separate decision
&lt;/h2&gt;

&lt;p&gt;Pricing does not prove that a client workflow will work.&lt;/p&gt;

&lt;p&gt;OpenAI Chat Completions, OpenAI Responses, Anthropic Messages, and Gemini GenerateContent have different request shapes and behavior. A model that works through one endpoint does not automatically work through another.&lt;/p&gt;

&lt;p&gt;Before accepting a lower price, confirm:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the client sends the protocol you expect;&lt;/li&gt;
&lt;li&gt;the route supports the required endpoint;&lt;/li&gt;
&lt;li&gt;tool calls and streaming work for the actual client;&lt;/li&gt;
&lt;li&gt;the selected key can access the model and service group.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A request that fails cannot be made economical by a lower token rate.&lt;/p&gt;

&lt;h2&gt;
  
  
  Verify the estimate against a real request
&lt;/h2&gt;

&lt;p&gt;A spreadsheet is only the estimate.&lt;/p&gt;

&lt;p&gt;Run a small, non-destructive task through the exact client configuration you plan to use. Then inspect the gateway's request or usage record.&lt;/p&gt;

&lt;p&gt;For XiuRouter, verify:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the intended API key;&lt;/li&gt;
&lt;li&gt;the intended model;&lt;/li&gt;
&lt;li&gt;the intended endpoint;&lt;/li&gt;
&lt;li&gt;the selected service group;&lt;/li&gt;
&lt;li&gt;request status;&lt;/li&gt;
&lt;li&gt;input, output, and cached-token usage;&lt;/li&gt;
&lt;li&gt;recorded cost.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If the usage record does not match the estimate, investigate the route before scaling traffic.&lt;/p&gt;

&lt;p&gt;Common causes include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the client used an older provider configuration;&lt;/li&gt;
&lt;li&gt;the API key selected a different model or group;&lt;/li&gt;
&lt;li&gt;the final request path was not the expected protocol route;&lt;/li&gt;
&lt;li&gt;cache usage differed from the assumption;&lt;/li&gt;
&lt;li&gt;the catalog changed after the estimate was created.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Include non-token costs explicitly
&lt;/h2&gt;

&lt;p&gt;Token rates are not always the complete commercial cost.&lt;/p&gt;

&lt;p&gt;Check whether the comparison also needs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;currency conversion;&lt;/li&gt;
&lt;li&gt;prepaid balance or recharge fees;&lt;/li&gt;
&lt;li&gt;taxes;&lt;/li&gt;
&lt;li&gt;minimum commitments;&lt;/li&gt;
&lt;li&gt;subscription fees;&lt;/li&gt;
&lt;li&gt;failed-request charging rules;&lt;/li&gt;
&lt;li&gt;image, audio, or other non-token pricing units.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Do not hide these costs inside an unexplained multiplier.&lt;/p&gt;

&lt;h2&gt;
  
  
  A practical comparison checklist
&lt;/h2&gt;

&lt;p&gt;Before choosing a route, confirm:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[ ] The model and source model are identified.&lt;/li&gt;
&lt;li&gt;[ ] The service group is fixed.&lt;/li&gt;
&lt;li&gt;[ ] The API protocol is fixed.&lt;/li&gt;
&lt;li&gt;[ ] Input and output rates use the same unit.&lt;/li&gt;
&lt;li&gt;[ ] Cache read and cache write are separate.&lt;/li&gt;
&lt;li&gt;[ ] The reference price has a source and checked-at time.&lt;/li&gt;
&lt;li&gt;[ ] The gateway price has a pricing version or checked-at time.&lt;/li&gt;
&lt;li&gt;[ ] The estimate uses a representative workload.&lt;/li&gt;
&lt;li&gt;[ ] Currency, taxes, subscriptions, and recharge costs are included when applicable.&lt;/li&gt;
&lt;li&gt;[ ] A real request completed through the expected route.&lt;/li&gt;
&lt;li&gt;[ ] The usage record matches the key, model, group, token buckets, and cost.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This method produces a smaller claim than "Gateway A is always cheaper," but it produces a claim that can be checked.&lt;/p&gt;

&lt;h2&gt;
  
  
  Usage records and conversation content
&lt;/h2&gt;

&lt;p&gt;Cost verification uses statistics such as model, token counts, charges and request status. It does not require saving the prompt or model reply.&lt;/p&gt;

&lt;p&gt;XiuRouter's &lt;a href="https://router.xiu.ai/en/data-privacy" rel="noopener noreferrer"&gt;Data Processing and Privacy statement&lt;/a&gt;, updated September 12, says that XiuRouter does not store model conversation content, use it for model training or sell user data. Usage statistics and model performance data are retained long term. Model developers process requests under the policies of their respective services; this is not a claim of zero retention across every provider.&lt;/p&gt;

&lt;h2&gt;
  
  
  XiuRouter sources
&lt;/h2&gt;

&lt;p&gt;Current model and route prices:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://router.xiu.ai/en/pricing" rel="noopener noreferrer"&gt;https://router.xiu.ai/en/pricing&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Machine-readable public pricing response:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://router.xiu.ai/api/pricing" rel="noopener noreferrer"&gt;https://router.xiu.ai/api/pricing&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Protocol and endpoint boundaries:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.xiu.ai/en/router/api-compatibility/" rel="noopener noreferrer"&gt;https://docs.xiu.ai/en/router/api-compatibility/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Prices, models, service groups, protocol support, and reference data can change. Re-run the comparison against the live catalog and verify a real request before using the result for a production decision.&lt;/p&gt;

&lt;p&gt;Disclosure: XiuRouter and XiuAI are operated by XiuLab Inc, a U.S. corporation.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>api</category>
      <category>programming</category>
      <category>webdev</category>
    </item>
    <item>
      <title>How to Verify an AI Subscription Delivery Without Trusting a Status Label</title>
      <dc:creator>Dashu</dc:creator>
      <pubDate>Mon, 31 Aug 2026 19:45:28 +0000</pubDate>
      <link>https://dev.to/xiuai-lab/how-to-verify-an-ai-subscription-delivery-without-trusting-a-status-label-1fl4</link>
      <guid>https://dev.to/xiuai-lab/how-to-verify-an-ai-subscription-delivery-without-trusting-a-status-label-1fl4</guid>
      <description>&lt;p&gt;If you already use ChatGPT or Claude, choose which account you want to use after buying. Activating a subscription on your current account and receiving a separate account are different purchases, even when the price is the same.&lt;/p&gt;

&lt;p&gt;For example, XiuStore currently lists both ChatGPT Plus options at &lt;strong&gt;$19.99 USD&lt;/strong&gt;. Here is what each one delivers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Choose the account before the price
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Option&lt;/th&gt;
&lt;th&gt;Price checked September 19, 2026&lt;/th&gt;
&lt;th&gt;What you receive&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;ChatGPT Plus on your own account&lt;/td&gt;
&lt;td&gt;$19.99 USD&lt;/td&gt;
&lt;td&gt;One month of Plus on the account you choose, with a redemption code and instructions in your order.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ChatGPT Plus with a new account&lt;/td&gt;
&lt;td&gt;$19.99 USD&lt;/td&gt;
&lt;td&gt;A separate single-user account with one month of Plus already enabled, plus sign-in details and instructions.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Claude Pro on your own account&lt;/td&gt;
&lt;td&gt;$20.59 USD&lt;/td&gt;
&lt;td&gt;One month of Pro on your existing Claude account, with the activation steps in your order.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;If you want to keep using your current ChatGPT account, choose &lt;strong&gt;activation on your own account&lt;/strong&gt;. The ready-to-use account option gives you a different account. For Claude Pro, the current option requires a Claude account you can already access.&lt;/p&gt;

&lt;p&gt;You can compare the options, prices, delivery steps, and support on the public &lt;a href="https://store.xiu.ai/en/products/chatgpt-plus/" rel="noopener noreferrer"&gt;ChatGPT Plus page&lt;/a&gt; and &lt;a href="https://store.xiu.ai/en/products/claude-pro/" rel="noopener noreferrer"&gt;Claude Pro page&lt;/a&gt; before signing in to buy. Prices can change; confirm the selected option's USD total at checkout. Any CNY amount shown is a reference conversion.&lt;/p&gt;

&lt;p&gt;ChatGPT Plus is a subscription for using ChatGPT. These Plus options do not include OpenAI API credits for your application or coding tools.&lt;/p&gt;

&lt;h2&gt;
  
  
  After payment, start with your order
&lt;/h2&gt;

&lt;p&gt;Open &lt;a href="https://store.xiu.ai/app/en/orders" rel="noopener noreferrer"&gt;My orders&lt;/a&gt; and select the purchase.&lt;/p&gt;

&lt;p&gt;For Plus activation on your account, retrieve the redemption code and follow the order's redemption link on the ChatGPT account you intend to use. For a new Plus account, follow the receiving-email instructions, then retrieve the account details when the order notification confirms completion. For Claude Pro, open the activation flow attached to that order.&lt;/p&gt;

&lt;p&gt;If the order is still being processed, follow its current instructions. Check the original order or contact support before paying for the same purchase again.&lt;/p&gt;

&lt;h2&gt;
  
  
  Confirm the subscription on the account you will use
&lt;/h2&gt;

&lt;p&gt;Open ChatGPT or Claude itself. Check that you are signed in to the intended account, that the plan says Plus or Pro as purchased, and that the visible subscription dates match the order. Try a feature included in that plan.&lt;/p&gt;

&lt;p&gt;If something is missing, open support from the original XiuStore order. Include the order reference, what the provider's account page shows, the time, and the full error message if there is one. That gives support a specific problem to resolve.&lt;/p&gt;

&lt;p&gt;The current listings describe subscription support separately from the purchased term. Their early-expiry policy refunds unused subscription days, rounded up to a full day; account bans are excluded. Read the selected option's full conditions before paying. A support period on another product does not, by itself, establish that product's subscription length.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://docs.xiu.ai/en/store/orders-and-delivery/" rel="noopener noreferrer"&gt;order and delivery guide&lt;/a&gt; explains where to find delivery details and request help. Keep the original order open until the account and plan match the option you bought.&lt;/p&gt;




&lt;p&gt;Published by XiuLab Inc, the operator of XiuStore. This guide was prepared with AI assistance and checked against the linked public product pages and delivery guide on September 19, 2026.&lt;/p&gt;

</description>
      <category>ecommerce</category>
      <category>ai</category>
      <category>product</category>
      <category>webdev</category>
    </item>
    <item>
      <title>How to Connect Codex to a Custom Responses API Provider and Verify the Route</title>
      <dc:creator>Dashu</dc:creator>
      <pubDate>Mon, 31 Aug 2026 18:16:44 +0000</pubDate>
      <link>https://dev.to/xiuai-lab/how-to-connect-codex-to-a-custom-responses-api-provider-and-verify-the-route-4aah</link>
      <guid>https://dev.to/xiuai-lab/how-to-connect-codex-to-a-custom-responses-api-provider-and-verify-the-route-4aah</guid>
      <description>&lt;p&gt;Changing an API base URL is not enough to prove that Codex is using the provider you intended.&lt;/p&gt;

&lt;p&gt;Codex is an agentic client. It needs more than a model that can return text. The provider must support the Responses API behavior Codex relies on, the API key must reach the process that launches Codex, the selected model must be available to that key, and the final request must arrive at the expected endpoint.&lt;/p&gt;

&lt;p&gt;This guide shows a conservative setup for a custom Responses API provider, using XiuRouter as the concrete example. The same verification method applies to other compatible gateways.&lt;/p&gt;

&lt;p&gt;The verification task sends model requests and can incur usage charges. "Read-only" refers to filesystem access; it does not make the model calls free. Check the &lt;a href="https://router.xiu.ai/en/pricing/" rel="noopener noreferrer"&gt;current model and service-tier prices&lt;/a&gt; before running the test.&lt;/p&gt;

&lt;h2&gt;
  
  
  The configuration has four separate decisions
&lt;/h2&gt;

&lt;p&gt;A working Codex provider configuration answers four questions:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Which model should Codex request?&lt;/li&gt;
&lt;li&gt;Which named provider should Codex use?&lt;/li&gt;
&lt;li&gt;Which base URL should receive the request?&lt;/li&gt;
&lt;li&gt;Which environment variable contains the API key?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Keep those decisions explicit. A minimal user-level configuration looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="py"&gt;model&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"YOUR_MODEL_ID"&lt;/span&gt;
&lt;span class="py"&gt;model_provider&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"xiurouter"&lt;/span&gt;

&lt;span class="nn"&gt;[model_providers.xiurouter]&lt;/span&gt;
&lt;span class="py"&gt;name&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"XiuRouter"&lt;/span&gt;
&lt;span class="py"&gt;base_url&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"https://router-api.xiu.ai/v1"&lt;/span&gt;
&lt;span class="py"&gt;env_key&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"XIUROUTER_API_KEY"&lt;/span&gt;
&lt;span class="py"&gt;wire_api&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"responses"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use a model ID that is currently visible to your account. Do not copy a model name from an old screenshot or another user's configuration and assume your key can access it.&lt;/p&gt;

&lt;p&gt;The important line is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="py"&gt;wire_api&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"responses"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Codex uses the Responses API for its native agent workflow. A provider that only accepts Chat Completions requests may be useful for other clients, but it is not automatically a drop-in Codex provider.&lt;/p&gt;

&lt;p&gt;OpenAI's Codex configuration reference also defines &lt;code&gt;base_url&lt;/code&gt;, &lt;code&gt;env_key&lt;/code&gt;, and &lt;code&gt;wire_api&lt;/code&gt; as separate provider settings. Treat them as separate failure boundaries when debugging.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep the API key out of &lt;code&gt;config.toml&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;The configuration should name an environment variable, not contain the secret:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="py"&gt;env_key&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"XIUROUTER_API_KEY"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For a terminal session:&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;XIUROUTER_API_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"YOUR_KEY"&lt;/span&gt;
codex
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For Codex Desktop on macOS, the application may not inherit variables from your terminal shell. Set the variable in the launch environment, then fully quit and reopen Codex:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;launchctl setenv XIUROUTER_API_KEY &lt;span class="s2"&gt;"YOUR_KEY"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This distinction matters. A correct key in &lt;code&gt;.zshrc&lt;/code&gt; can still produce a &lt;code&gt;401&lt;/code&gt; if the desktop application was launched outside that shell.&lt;/p&gt;

&lt;p&gt;Do not print the key during diagnosis. Check whether the variable exists and whether the request succeeds, not the secret value itself.&lt;/p&gt;

&lt;h2&gt;
  
  
  Start with a reversible configuration
&lt;/h2&gt;

&lt;p&gt;Do not overwrite a working provider before the new route has passed a real task.&lt;/p&gt;

&lt;p&gt;Keep the previous provider block in the file and change only the active &lt;code&gt;model&lt;/code&gt; and &lt;code&gt;model_provider&lt;/code&gt; lines. That gives you a fast rollback if the custom route fails during a longer agent run.&lt;/p&gt;

&lt;p&gt;It is also safer to test the new provider in project-level configuration before promoting it to your user-wide default. OpenAI documents project configuration in &lt;code&gt;.codex/config.toml&lt;/code&gt;, while user defaults live in &lt;code&gt;~/.codex/config.toml&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The practical rule is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;project config for a bounded test;&lt;/li&gt;
&lt;li&gt;user config after the provider has passed;&lt;/li&gt;
&lt;li&gt;old provider retained until rollback is no longer needed.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Verify the provider in a new task
&lt;/h2&gt;

&lt;p&gt;After changing the provider configuration, restart the client as needed and create a new local task. Tasks that were already open can retain their previous provider, so use the new task to verify the route.&lt;/p&gt;

&lt;p&gt;In that task, ask Codex to perform a small read-only operation that requires tool use.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Inspect this repository, identify the test command, and summarize the main modules. Do not modify files.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This is more useful than asking the model to say hello. A plain text response proves only that one request returned text. A repository inspection exercises the agent loop, tool instructions, streaming, and follow-up turns without creating a destructive side effect.&lt;/p&gt;

&lt;p&gt;Then verify the request on the provider side.&lt;/p&gt;

&lt;p&gt;For XiuRouter, the usage record should show:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the intended API key;&lt;/li&gt;
&lt;li&gt;the intended model;&lt;/li&gt;
&lt;li&gt;the Responses path;&lt;/li&gt;
&lt;li&gt;a successful status;&lt;/li&gt;
&lt;li&gt;usage and cost recorded for the request.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The expected path is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/v1/responses
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If no corresponding record appears, do not assume the request used the new provider. Codex may still be using an older active configuration, or the application may not have inherited the environment variable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Diagnose failures by boundary
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;401 Unauthorized&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Check the process environment first.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Was Codex launched after the environment variable was set?&lt;/li&gt;
&lt;li&gt;Does the variable name exactly match &lt;code&gt;env_key&lt;/code&gt;?&lt;/li&gt;
&lt;li&gt;Is the key valid for the current account?&lt;/li&gt;
&lt;li&gt;Is a project-level configuration overriding the user-level provider?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For Codex Desktop, quit the application completely after changing the launch environment.&lt;/p&gt;

&lt;h3&gt;
  
  
  The model is missing or rejected
&lt;/h3&gt;

&lt;p&gt;Model visibility and key permissions are separate from protocol compatibility.&lt;/p&gt;

&lt;p&gt;A gateway can support the Responses API while a particular key still lacks access to the selected model. Recheck the current model catalog and the key's scope instead of changing protocol settings at random.&lt;/p&gt;

&lt;h3&gt;
  
  
  The request hits the wrong URL
&lt;/h3&gt;

&lt;p&gt;Inspect the final request path.&lt;/p&gt;

&lt;p&gt;With:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="py"&gt;base_url&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"https://router-api.xiu.ai/v1"&lt;/span&gt;
&lt;span class="py"&gt;wire_api&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"responses"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;the client should call &lt;code&gt;/v1/responses&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;If you see a duplicated path such as &lt;code&gt;/v1/v1/responses&lt;/code&gt;, the base URL and endpoint path have both included the version prefix. Fix the configuration boundary that owns the duplicate instead of adding another redirect.&lt;/p&gt;

&lt;h3&gt;
  
  
  A simple prompt works, but an agent task fails
&lt;/h3&gt;

&lt;p&gt;This usually means the test was too shallow.&lt;/p&gt;

&lt;p&gt;Codex needs the Responses API behavior used by its real agent loop. Tool calls, streaming events, multi-turn state, and error handling can fail even when a one-shot text request returns &lt;code&gt;200&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Use the smallest real task that reproduces the failure. Record:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Codex version;&lt;/li&gt;
&lt;li&gt;provider name;&lt;/li&gt;
&lt;li&gt;model ID;&lt;/li&gt;
&lt;li&gt;final request path;&lt;/li&gt;
&lt;li&gt;HTTP status;&lt;/li&gt;
&lt;li&gt;whether a usage record exists;&lt;/li&gt;
&lt;li&gt;the first failing agent action.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That evidence is much more useful than "the custom provider does not work."&lt;/p&gt;

&lt;h3&gt;
  
  
  The route works, but long tasks are unstable
&lt;/h3&gt;

&lt;p&gt;Separate initial compatibility from runtime reliability.&lt;/p&gt;

&lt;p&gt;Check whether failures correlate with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;long streaming responses;&lt;/li&gt;
&lt;li&gt;tool-heavy loops;&lt;/li&gt;
&lt;li&gt;upstream model availability;&lt;/li&gt;
&lt;li&gt;rate limits;&lt;/li&gt;
&lt;li&gt;context size;&lt;/li&gt;
&lt;li&gt;client or network interruption.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Do not hide those failures by repeatedly retrying a destructive task. Reproduce them with a read-only task first.&lt;/p&gt;

&lt;h2&gt;
  
  
  A practical acceptance checklist
&lt;/h2&gt;

&lt;p&gt;Before making the custom provider your default, confirm all of the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A new local task reads the intended configuration and provider.&lt;/li&gt;
&lt;li&gt;The API key is supplied through the named environment variable.&lt;/li&gt;
&lt;li&gt;The selected model is available to that key.&lt;/li&gt;
&lt;li&gt;The final request path is &lt;code&gt;/v1/responses&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;A read-only tool-using task completes.&lt;/li&gt;
&lt;li&gt;The provider records the expected key, model, status, usage, and cost.&lt;/li&gt;
&lt;li&gt;The previous provider is still available for rollback.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is the difference between "the configuration looks right" and "the route has been verified."&lt;/p&gt;

&lt;h2&gt;
  
  
  XiuRouter-specific setup
&lt;/h2&gt;

&lt;p&gt;XiuRouter's Agent integrations page generates a Codex configuration based on the selected app, operating system, API key, model permissions, and whether the user is creating a new setup or replacing an existing provider. It also keeps the verification step separate from the configuration step.&lt;/p&gt;

&lt;p&gt;The public integration guide is here:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://router.xiu.ai/en/integrations" rel="noopener noreferrer"&gt;https://router.xiu.ai/en/integrations&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The current Codex setup and restart instructions are here:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.xiu.ai/en/router/integrations/codex/" rel="noopener noreferrer"&gt;https://docs.xiu.ai/en/router/integrations/codex/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The API compatibility reference is here:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.xiu.ai/en/router/api-compatibility/" rel="noopener noreferrer"&gt;https://docs.xiu.ai/en/router/api-compatibility/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The OpenAI Codex configuration documentation is here:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://developers.openai.com/codex/config-basic" rel="noopener noreferrer"&gt;https://developers.openai.com/codex/config-basic&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://developers.openai.com/codex/config-reference" rel="noopener noreferrer"&gt;https://developers.openai.com/codex/config-reference&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The product-specific values may change. Recheck the current model catalog, key permissions, and integration output before copying a configuration into a production workflow.&lt;/p&gt;

&lt;p&gt;Configuration and product boundaries reviewed against the linked guides on September 19, 2026.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>api</category>
      <category>programming</category>
      <category>openai</category>
    </item>
    <item>
      <title>A Delivery Label Is Not a Fulfillment Model</title>
      <dc:creator>Dashu</dc:creator>
      <pubDate>Sun, 30 Aug 2026 15:07:39 +0000</pubDate>
      <link>https://dev.to/xiuai-lab/a-delivery-label-is-not-a-fulfillment-model-5b8</link>
      <guid>https://dev.to/xiuai-lab/a-delivery-label-is-not-a-fulfillment-model-5b8</guid>
      <description>&lt;p&gt;Digital products are often sold with one short promise: &lt;strong&gt;instant delivery&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;That label is convenient until the product behind it changes.&lt;/p&gt;

&lt;p&gt;A subscription may require activation on the buyer's existing account. Another&lt;br&gt;
listing may deliver a separate account. A one-time service may require manual&lt;br&gt;
processing. If all three are represented by a free-form string, an old order can&lt;br&gt;
show instructions that no longer match the actual workflow.&lt;/p&gt;

&lt;p&gt;We found this class of problem while auditing &lt;a href="https://store.xiu.ai/en/" rel="noopener noreferrer"&gt;XiuStore&lt;/a&gt;,&lt;br&gt;
our service for AI accounts and subscriptions. The useful lesson is broader than&lt;br&gt;
one storefront:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Product promises, order snapshots, and operational delivery instructions are&lt;br&gt;
related, but they are not the same data.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This article presents a small model for keeping them separate.&lt;/p&gt;
&lt;h2&gt;
  
  
  The three facts a digital order needs
&lt;/h2&gt;

&lt;p&gt;A digital order usually combines three kinds of information.&lt;/p&gt;
&lt;h3&gt;
  
  
  1. The offer the buyer accepted
&lt;/h3&gt;

&lt;p&gt;This is the commercial fact at checkout:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;product and option&lt;/li&gt;
&lt;li&gt;price and currency&lt;/li&gt;
&lt;li&gt;stated delivery mode&lt;/li&gt;
&lt;li&gt;support coverage&lt;/li&gt;
&lt;li&gt;terms shown before purchase&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These values should be preserved with the order. If the catalog changes later,&lt;br&gt;
the order must still explain what the buyer paid for.&lt;/p&gt;
&lt;h3&gt;
  
  
  2. The current order state
&lt;/h3&gt;

&lt;p&gt;This is the transaction state:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;created -&amp;gt; paid -&amp;gt; processing -&amp;gt; delivered
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The exact states vary by product, but they should describe what has happened to&lt;br&gt;
this order. A status such as &lt;code&gt;paid&lt;/code&gt; does not explain where the buyer should go&lt;br&gt;
next.&lt;/p&gt;
&lt;h3&gt;
  
  
  3. The workflow used to complete delivery
&lt;/h3&gt;

&lt;p&gt;This is the operational route:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;activate_existing_account
deliver_account
one_time_service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The workflow determines the next action shown to the buyer. It may point to an&lt;br&gt;
activation form, a delivery page, an order message, or a support path.&lt;/p&gt;

&lt;p&gt;The common mistake is to collapse all three facts into one string such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Payment completed. Delivered automatically.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That string mixes a transaction event, a fulfillment promise, and an&lt;br&gt;
instruction. It becomes stale as soon as one part changes.&lt;/p&gt;
&lt;h2&gt;
  
  
  Use a delivery type, not a marketing sentence
&lt;/h2&gt;

&lt;p&gt;A better model starts with an explicit fulfillment type:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="nx"&gt;FulfillmentMode&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
  &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;activate_existing_account&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
  &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;deliver_account&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
  &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;one_time_service&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The catalog can still show buyer-facing copy, but the workflow should not depend&lt;br&gt;
on parsing that copy.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;nextStepFor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;mode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;FulfillmentMode&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;switch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;mode&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;activate_existing_account&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="na"&gt;kind&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;activation&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;href&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/activate&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;deliver_account&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="na"&gt;kind&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;delivery&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;href&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/orders/current&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;one_time_service&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="na"&gt;kind&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;support&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;href&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/orders/current&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="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This keeps the routing decision structured. Copy can be translated or improved&lt;br&gt;
without changing delivery behavior.&lt;/p&gt;
&lt;h2&gt;
  
  
  Keep the snapshot, but do not replay every old label
&lt;/h2&gt;

&lt;p&gt;Order snapshots are important. They protect historical price, option, and&lt;br&gt;
support facts from later catalog edits.&lt;/p&gt;

&lt;p&gt;But a snapshot should not become an excuse to replay stale operational copy&lt;br&gt;
forever.&lt;/p&gt;

&lt;p&gt;For example, suppose a product was once marked as automatic delivery and later&lt;br&gt;
moved to manual processing. An old free-form &lt;code&gt;deliveryLabel&lt;/code&gt; may still say&lt;br&gt;
"delivered automatically" even though the current workflow is manual.&lt;/p&gt;

&lt;p&gt;The safer split is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;preserve the purchased option, price, and buyer-visible terms in the order;&lt;/li&gt;
&lt;li&gt;store or resolve a structured fulfillment mode;&lt;/li&gt;
&lt;li&gt;render current instructions from a versioned delivery policy;&lt;/li&gt;
&lt;li&gt;keep an audit trail when the operational route changes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The order remains historically accurate without sending the buyer into an&lt;br&gt;
obsolete workflow.&lt;/p&gt;
&lt;h2&gt;
  
  
  Render instructions from one policy
&lt;/h2&gt;

&lt;p&gt;Buyer-facing instructions should come from a single mapping rather than being&lt;br&gt;
copied into product cards, checkout responses, order pages, and support&lt;br&gt;
templates.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;fulfillmentCopy&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Record&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;
  &lt;span class="nx"&gt;FulfillmentMode&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nl"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;&amp;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;activate_existing_account&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Continue account activation&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="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Open the activation step and follow the instructions for this order.&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;deliver_account&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Review delivery details&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="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Open the order to view the delivered account and first-use checks.&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;one_time_service&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Processing&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="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;The service is being handled. Updates will appear in the order.&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="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This does not require a large workflow engine. A small enum, one mapping, and&lt;br&gt;
tests around the order page are often enough.&lt;/p&gt;

&lt;h2&gt;
  
  
  Test the buyer path, not only the API response
&lt;/h2&gt;

&lt;p&gt;A successful order API response does not prove that delivery is understandable.&lt;/p&gt;

&lt;p&gt;For each fulfillment mode, verify the customer-facing path:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The product page states what the buyer will receive.&lt;/li&gt;
&lt;li&gt;Checkout preserves the selected option and current price.&lt;/li&gt;
&lt;li&gt;The paid order shows the correct next action.&lt;/li&gt;
&lt;li&gt;The destination page matches the order and current language.&lt;/li&gt;
&lt;li&gt;The buyer can verify the final result on the relevant provider's official
service.&lt;/li&gt;
&lt;li&gt;Support coverage is visible without implying guarantees the seller cannot
make.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This is especially important for third-party AI services. Regional eligibility,&lt;br&gt;
identity checks, account restrictions, and appeals remain controlled by the&lt;br&gt;
original provider. A store can explain delivery and support, but it cannot&lt;br&gt;
override those rules.&lt;/p&gt;

&lt;h2&gt;
  
  
  What buyers should see before paying
&lt;/h2&gt;

&lt;p&gt;Good fulfillment modeling should become visible product information.&lt;/p&gt;

&lt;p&gt;A digital-product listing should answer:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Is this activation for my existing account, a delivered account, or a
one-time service?&lt;/li&gt;
&lt;li&gt;What is the current price and availability?&lt;/li&gt;
&lt;li&gt;What action will I need to take?&lt;/li&gt;
&lt;li&gt;Where will delivery details appear?&lt;/li&gt;
&lt;li&gt;What first-use checks should I perform?&lt;/li&gt;
&lt;li&gt;What support is included, and what is outside the seller's control?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;XiuStore documents this decision process in its guides for&lt;br&gt;
&lt;a href="https://docs.xiu.ai/en/store/choosing-products/" rel="noopener noreferrer"&gt;choosing a product&lt;/a&gt; and&lt;br&gt;
&lt;a href="https://docs.xiu.ai/en/store/orders-and-delivery/" rel="noopener noreferrer"&gt;checking orders and delivery&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The underlying engineering principle is simple: model the delivery contract&lt;br&gt;
before writing the delivery slogan.&lt;/p&gt;

&lt;h2&gt;
  
  
  A compact acceptance checklist
&lt;/h2&gt;

&lt;p&gt;Before releasing a new digital product or changing its fulfillment method,&lt;br&gt;
check:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[ ] Fulfillment mode is a structured value.&lt;/li&gt;
&lt;li&gt;[ ] Product copy matches that value.&lt;/li&gt;
&lt;li&gt;[ ] Checkout snapshots the commercial facts.&lt;/li&gt;
&lt;li&gt;[ ] Order instructions come from the active delivery policy.&lt;/li&gt;
&lt;li&gt;[ ] Old free-form labels cannot override the current route.&lt;/li&gt;
&lt;li&gt;[ ] Every fulfillment mode has an end-to-end buyer-path test.&lt;/li&gt;
&lt;li&gt;[ ] Support copy does not promise control over a third-party provider.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This separation prevents a small catalog change from becoming a misleading&lt;br&gt;
order page. More importantly, it lets the buyer understand what happens next&lt;br&gt;
without knowing anything about the store's internal implementation.&lt;/p&gt;




&lt;p&gt;Disclosure: This article was prepared with AI assistance from XiuAI's current&lt;br&gt;
product documentation and checked against the linked public pages on August 30,&lt;br&gt;
2026.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>ecommerce</category>
      <category>typescript</category>
      <category>product</category>
    </item>
    <item>
      <title>A 200 Response Is Not Enough: Testing Claude Code Through an Anthropic Gateway</title>
      <dc:creator>Dashu</dc:creator>
      <pubDate>Sun, 30 Aug 2026 12:56:41 +0000</pubDate>
      <link>https://dev.to/xiuai-lab/a-200-response-is-not-enough-testing-claude-code-through-an-anthropic-gateway-443h</link>
      <guid>https://dev.to/xiuai-lab/a-200-response-is-not-enough-testing-claude-code-through-an-anthropic-gateway-443h</guid>
      <description>&lt;p&gt;A 200 response from an AI gateway proves that one HTTP request worked. It does not prove that Claude Code can discover a model, send the right Messages payload, recover from an optional endpoint failure, and finish a task.&lt;/p&gt;

&lt;p&gt;That distinction matters when Claude Code is configured through an Anthropic-compatible gateway such as &lt;a href="https://router.xiu.ai/en/integrations" rel="noopener noreferrer"&gt;XiuRouter&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This guide uses a two-layer acceptance test:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Send a small request directly to &lt;code&gt;/v1/messages&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Run a complete short task in Claude Code.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The inference calls in both tests are billed at the selected model and service-tier rates. Check &lt;a href="https://router.xiu.ai/en/pricing" rel="noopener noreferrer"&gt;current pricing&lt;/a&gt; before running them.&lt;/p&gt;

&lt;p&gt;If the first layer fails, debug the gateway configuration. If it passes but the second layer fails, debug the client workflow instead of rotating keys or changing models at random.&lt;/p&gt;

&lt;h2&gt;
  
  
  Configure the API root, not the Messages path
&lt;/h2&gt;

&lt;p&gt;Claude Code appends &lt;code&gt;/v1/messages&lt;/code&gt; to the configured base URL. Set the API root without &lt;code&gt;/v1&lt;/code&gt;:&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;ANTHROPIC_BASE_URL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"https://router-api.xiu.ai"&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;ANTHROPIC_AUTH_TOKEN&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"YOUR_XIUROUTER_API_KEY"&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"1"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;ANTHROPIC_AUTH_TOKEN&lt;/code&gt; sends a Bearer token, which XiuRouter accepts on the Messages route. Gateway model discovery lets Claude Code load models exposed by the configured gateway.&lt;/p&gt;

&lt;p&gt;A base URL ending in &lt;code&gt;/v1&lt;/code&gt; produces the duplicated path:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://router-api.xiu.ai/v1/v1/messages
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is a configuration error, not a model error.&lt;/p&gt;

&lt;h2&gt;
  
  
  Test &lt;code&gt;/v1/messages&lt;/code&gt; before opening Claude Code
&lt;/h2&gt;

&lt;p&gt;Use an exact model ID visible to the intended XiuRouter key. Do not copy a model ID from an old article or another service group.&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;-X&lt;/span&gt; POST &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$ANTHROPIC_BASE_URL&lt;/span&gt;&lt;span class="s2"&gt;/v1/messages"&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;"Authorization: Bearer &lt;/span&gt;&lt;span class="nv"&gt;$ANTHROPIC_AUTH_TOKEN&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;"anthropic-version: 2023-06-01"&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": "YOUR_MODEL_ID",
    "max_tokens": 32,
    "messages": [
      {
        "role": "user",
        "content": "Reply only with: connected"
      }
    ]
  }'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The response should be JSON with a Messages &lt;code&gt;content&lt;/code&gt; value. Check more than the status code:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The body is JSON, not an HTML error page returned by a proxy.&lt;/li&gt;
&lt;li&gt;The response contains text content.&lt;/li&gt;
&lt;li&gt;The model and usage fields are plausible for the request.&lt;/li&gt;
&lt;li&gt;The request appears in the expected XiuRouter usage records.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;An HTTP 200 with an empty body, malformed JSON, or HTML is still a failed integration.&lt;/p&gt;

&lt;h2&gt;
  
  
  Then test the Claude Code workflow
&lt;/h2&gt;

&lt;p&gt;Start Claude Code in a non-critical repository:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;claude
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use &lt;code&gt;/model&lt;/code&gt; and select a model marked &lt;strong&gt;From gateway&lt;/strong&gt;. Run &lt;code&gt;/status&lt;/code&gt; and confirm the Anthropic base URL and gateway credential are active.&lt;/p&gt;

&lt;p&gt;The test task should exercise the client, not just produce a greeting. For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Read package.json and report the package manager, test command, and build command.
Do not edit any files.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A useful pass condition is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Claude Code discovers a gateway model.&lt;/li&gt;
&lt;li&gt;The task starts without an authentication or payload error.&lt;/li&gt;
&lt;li&gt;The client receives a usable Messages response.&lt;/li&gt;
&lt;li&gt;The task reaches a final answer.&lt;/li&gt;
&lt;li&gt;The corresponding gateway request is visible in usage records.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This catches failures that a standalone curl request cannot expose.&lt;/p&gt;

&lt;h2&gt;
  
  
  Treat &lt;code&gt;count_tokens&lt;/code&gt; 404 as a workflow signal
&lt;/h2&gt;

&lt;p&gt;XiuRouter does not expose a dedicated &lt;code&gt;/v1/messages/count_tokens&lt;/code&gt; route. Claude Code documents token counting as optional and can fall back through the inference endpoint.&lt;/p&gt;

&lt;p&gt;Do not classify the connection as broken from that 404 alone. Check what happens next:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If Claude Code falls back to &lt;code&gt;/v1/messages&lt;/code&gt; and completes the task, the missing optional route did not block the workflow.&lt;/li&gt;
&lt;li&gt;If the task stops after the 404, capture the client version and logs, then diagnose the client behavior.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The pass condition is task completion, not the absence of every warning.&lt;/p&gt;

&lt;h2&gt;
  
  
  Failure patterns and the shortest useful check
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;401&lt;/code&gt; or invalid token
&lt;/h3&gt;

&lt;p&gt;Confirm that the variable is &lt;code&gt;ANTHROPIC_AUTH_TOKEN&lt;/code&gt;, the key is active, and the shell that starts Claude Code actually contains the variable.&lt;/p&gt;

&lt;p&gt;If Claude Code reports multiple credential sources, run &lt;code&gt;/logout&lt;/code&gt; to use the gateway credential, or unset the gateway variables to keep the saved Claude login. Do not leave both paths ambiguous.&lt;/p&gt;

&lt;h3&gt;
  
  
  Gateway models do not appear
&lt;/h3&gt;

&lt;p&gt;Confirm:&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;CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"1"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Restart Claude Code after changing the environment. Also verify that the intended key can see at least one Claude model.&lt;/p&gt;

&lt;h3&gt;
  
  
  The request path is &lt;code&gt;/v1/v1/messages&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Remove &lt;code&gt;/v1&lt;/code&gt; from &lt;code&gt;ANTHROPIC_BASE_URL&lt;/code&gt;. The correct value is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://router-api.xiu.ai
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  A &lt;code&gt;400&lt;/code&gt; response names experimental fields
&lt;/h3&gt;

&lt;p&gt;Retry with:&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;CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"1"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is narrower than changing the model, key, and gateway at the same time.&lt;/p&gt;

&lt;h3&gt;
  
  
  HTTP 200 contains HTML
&lt;/h3&gt;

&lt;p&gt;Inspect the response &lt;code&gt;content-type&lt;/code&gt; and body. A CDN, login wall, or proxy can return an HTML page with a successful transport status. The direct curl test should return Messages JSON.&lt;/p&gt;

&lt;h3&gt;
  
  
  Direct Messages works, but Claude Code still fails
&lt;/h3&gt;

&lt;p&gt;Keep the successful curl response as evidence and narrow the remaining variables:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Claude Code version&lt;/li&gt;
&lt;li&gt;selected gateway model&lt;/li&gt;
&lt;li&gt;active environment variables&lt;/li&gt;
&lt;li&gt;credential-source warning&lt;/li&gt;
&lt;li&gt;optional endpoint fallback&lt;/li&gt;
&lt;li&gt;experimental request fields&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Changing one variable at a time preserves the known-good gateway result.&lt;/p&gt;

&lt;h2&gt;
  
  
  Roll back without leaving mixed credentials
&lt;/h2&gt;

&lt;p&gt;For the CLI, unset the gateway variables and restart Claude Code:&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;unset &lt;/span&gt;ANTHROPIC_BASE_URL
&lt;span class="nb"&gt;unset &lt;/span&gt;ANTHROPIC_AUTH_TOKEN
&lt;span class="nb"&gt;unset &lt;/span&gt;CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY
&lt;span class="nb"&gt;unset &lt;/span&gt;CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run &lt;code&gt;/status&lt;/code&gt; after restart and confirm that the previous connection is active.&lt;/p&gt;

&lt;p&gt;For the VS Code extension or Claude desktop Code, restore the previous environment or Third-Party Inference configuration, restart the application, and run the same status check.&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.xiu.ai/en/router/integrations/claude-code/" rel="noopener noreferrer"&gt;Connect Claude Code to XiuRouter&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.xiu.ai/en/router/api-compatibility/" rel="noopener noreferrer"&gt;XiuRouter API compatibility&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://router.xiu.ai/en/integrations" rel="noopener noreferrer"&gt;XiuRouter Agent integrations&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These references were reviewed on September 9, 2026. Model availability can change, so use the current catalogue and an exact model ID visible to the intended key.&lt;/p&gt;

&lt;p&gt;XiuAI and its products are operated by XiuLab Inc, a U.S. corporation.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>api</category>
      <category>claude</category>
      <category>programming</category>
    </item>
    <item>
      <title>One API Does Not Mean One Protocol: Chat Completions, Responses, Messages, and Gemini</title>
      <dc:creator>Dashu</dc:creator>
      <pubDate>Sun, 30 Aug 2026 10:40:07 +0000</pubDate>
      <link>https://dev.to/xiuai-lab/one-api-does-not-mean-one-protocol-chat-completions-responses-messages-and-gemini-39kd</link>
      <guid>https://dev.to/xiuai-lab/one-api-does-not-mean-one-protocol-chat-completions-responses-messages-and-gemini-39kd</guid>
      <description>&lt;p&gt;"OpenAI compatible" is useful shorthand, but it is not a complete integration contract.&lt;/p&gt;

&lt;p&gt;Two clients can accept the same API key and base domain while sending different request paths, authentication headers, payload shapes, streaming events, and tool-call formats. That difference matters when you connect coding agents, SDKs, or production applications to a multi-model gateway.&lt;/p&gt;

&lt;p&gt;At XiuAI, we expose four text-generation routes through &lt;a href="https://router.xiu.ai/en/" rel="noopener noreferrer"&gt;XiuRouter&lt;/a&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;OpenAI Chat Completions&lt;/li&gt;
&lt;li&gt;OpenAI Responses&lt;/li&gt;
&lt;li&gt;Anthropic Messages&lt;/li&gt;
&lt;li&gt;Gemini GenerateContent&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are protocol routes, not a list of currently available model families. For example, a Gemini GenerateContent route does not establish that Gemini-family models are in the current catalog. Check the model list visible to your key.&lt;/p&gt;

&lt;p&gt;The practical rule is simple:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Start with the protocol your client actually sends. Do not choose a protocol from the model name or from an "OpenAI compatible" label.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This article explains how to make that choice and how to verify the integration without turning a small configuration change into a production incident.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Choose the client protocol before the model
&lt;/h2&gt;

&lt;p&gt;A model name does not determine the request protocol.&lt;/p&gt;

&lt;p&gt;For example, the same model may be reachable through Chat Completions in one service group but not through Responses or Messages in another. A successful Chat Completions request is not proof that the same model and route will support Responses, Anthropic Messages, or Gemini GenerateContent.&lt;/p&gt;

&lt;p&gt;Use the client's native behavior as the starting point:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Client or application&lt;/th&gt;
&lt;th&gt;Preferred route&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Codex configured with a Responses provider&lt;/td&gt;
&lt;td&gt;OpenAI Responses&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Claude Code, Anthropic SDKs, and Claude-native clients&lt;/td&gt;
&lt;td&gt;Anthropic Messages&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;OpenCode and Vercel AI SDK using &lt;code&gt;@ai-sdk/openai-compatible&lt;/code&gt;; other Chat Completions clients&lt;/td&gt;
&lt;td&gt;Chat Completions&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Gemini SDKs and Gemini-native clients&lt;/td&gt;
&lt;td&gt;Gemini GenerateContent&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The current &lt;a href="https://docs.xiu.ai/en/router/integrations/opencode/" rel="noopener noreferrer"&gt;OpenCode guide&lt;/a&gt; and &lt;a href="https://docs.xiu.ai/en/router/integrations/vercel-ai-sdk/" rel="noopener noreferrer"&gt;Vercel AI SDK guide&lt;/a&gt; use Chat Completions through &lt;code&gt;@ai-sdk/openai-compatible&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;If the client documentation is unclear, inspect its official configuration guide or request logs. Do not infer the protocol from a generic compatibility badge.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Base URLs depend on what the client appends
&lt;/h2&gt;

&lt;p&gt;An OpenAI-compatible SDK usually appends paths under &lt;code&gt;/v1&lt;/code&gt;, so its configured base URL is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://router-api.xiu.ai/v1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A Claude client that appends &lt;code&gt;/v1/messages&lt;/code&gt;, or a Gemini client that appends &lt;code&gt;/v1beta/models/...&lt;/code&gt;, should use the API root:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://router-api.xiu.ai
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is a common source of duplicated paths such as &lt;code&gt;/v1/v1/messages&lt;/code&gt;, especially when a configuration field is called "API URL" without explaining whether it expects a domain, a base path, or a complete endpoint.&lt;/p&gt;

&lt;p&gt;For direct requests, use the complete path:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Protocol&lt;/th&gt;
&lt;th&gt;Method and path&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Chat Completions&lt;/td&gt;
&lt;td&gt;&lt;code&gt;POST /v1/chat/completions&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Responses&lt;/td&gt;
&lt;td&gt;&lt;code&gt;POST /v1/responses&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Anthropic Messages&lt;/td&gt;
&lt;td&gt;&lt;code&gt;POST /v1/messages&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Gemini GenerateContent&lt;/td&gt;
&lt;td&gt;&lt;code&gt;POST /v1beta/models/{model}:generateContent&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  3. Authentication is also protocol-specific
&lt;/h2&gt;

&lt;p&gt;OpenAI-compatible requests use a Bearer token:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;Authorization: Bearer YOUR_XIUROUTER_API_KEY
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Anthropic Messages can use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;x-api-key: YOUR_XIUROUTER_API_KEY
anthropic-version: 2023-06-01
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;XiuRouter also accepts a Bearer token on the Messages route for gateway clients such as Claude Code.&lt;/p&gt;

&lt;p&gt;Gemini GenerateContent can use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;x-goog-api-key: YOUR_XIUROUTER_API_KEY
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Gemini's &lt;code&gt;key&lt;/code&gt; query parameter is accepted as well, but headers are easier to keep out of access logs and copied URLs.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Run one small request on the exact production combination
&lt;/h2&gt;

&lt;p&gt;Before moving application traffic, test the exact combination of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;API key&lt;/li&gt;
&lt;li&gt;model ID&lt;/li&gt;
&lt;li&gt;service group&lt;/li&gt;
&lt;li&gt;protocol&lt;/li&gt;
&lt;li&gt;streaming mode&lt;/li&gt;
&lt;li&gt;tool or structured-output features you need&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;First list the models visible to the scoped key:&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://router-api.xiu.ai/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;$XIUROUTER_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;Then send one small request through the route your client will use. For Responses:&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://router-api.xiu.ai/v1/responses &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;$XIUROUTER_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": "YOUR_MODEL_ID",
    "input": "Reply only with: XiuRouter connected"
  }'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For Anthropic Messages:&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://router-api.xiu.ai/v1/messages &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"x-api-key: &lt;/span&gt;&lt;span class="nv"&gt;$XIUROUTER_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;"anthropic-version: 2023-06-01"&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": "YOUR_MODEL_ID",
    "max_tokens": 64,
    "messages": [
      {
        "role": "user",
        "content": "Reply only with: XiuRouter connected"
      }
    ]
  }'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After the response, verify the same request in usage records: key, model, service group, endpoint, token counts, status, and cost.&lt;/p&gt;

&lt;p&gt;The small test is billable. Check the &lt;a href="https://router.xiu.ai/en/pricing" rel="noopener noreferrer"&gt;current model and service-group pricing&lt;/a&gt; before sending it.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Know the compatibility boundaries
&lt;/h2&gt;

&lt;p&gt;A gateway route can support the core text request without implementing every provider feature.&lt;/p&gt;

&lt;p&gt;Current XiuRouter boundaries include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;/v1/messages/count_tokens&lt;/code&gt; has no dedicated route. Claude Code documents token counting as optional and can fall back through inference, but you still need to verify that the final task completes.&lt;/li&gt;
&lt;li&gt;The Responses route is stateless. Stored conversations, &lt;code&gt;previous_response_id&lt;/code&gt;, and background mode are outside the current compatibility scope.&lt;/li&gt;
&lt;li&gt;Some Responses models can use provider-hosted tools such as Web search. Check the intended model and service group, then verify the tool call count and its separate surcharge in Usage.&lt;/li&gt;
&lt;li&gt;XiuRouter exposes Gemini GenerateContent, not the Gemini Interactions API.&lt;/li&gt;
&lt;li&gt;Files, fine-tuning, image variations, and some legacy endpoints are not implemented by the current gateway.&lt;/li&gt;
&lt;li&gt;Tool calls, structured output, prompt caching, streaming events, and token accounting can differ when an inbound request is converted to an upstream provider format.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are not edge cases to hide in fine print. They determine whether an agent can finish a task, whether a retry is safe, and whether usage records match the client's expectations.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Use scoped keys and keep the rollback small
&lt;/h2&gt;

&lt;p&gt;Create one key per application or environment. Limit models, service groups, quota, expiration, and IP scope where appropriate.&lt;/p&gt;

&lt;p&gt;For a migration:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Keep the existing provider configuration available.&lt;/li&gt;
&lt;li&gt;Add XiuRouter as a separate provider or environment.&lt;/li&gt;
&lt;li&gt;Test a small non-critical task.&lt;/li&gt;
&lt;li&gt;Compare output, streaming, tool calls, token accounting, latency, and cost.&lt;/li&gt;
&lt;li&gt;Move traffic gradually.&lt;/li&gt;
&lt;li&gt;Keep the previous provider as the rollback path until the new route has passed real workloads.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Changing only a base URL is convenient. Treating that change as proof of full protocol compatibility is not.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reference
&lt;/h2&gt;

&lt;p&gt;The current endpoint table and limitations are maintained in the &lt;a href="https://docs.xiu.ai/en/router/api-compatibility/" rel="noopener noreferrer"&gt;XiuRouter API compatibility guide&lt;/a&gt;. The compatibility guide records its September 5, 2026 verification. This article was checked against the current published guides on September 19, 2026.&lt;/p&gt;

&lt;p&gt;XiuAI and its products are operated by XiuLab Inc, a U.S. corporation.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>api</category>
      <category>programming</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
