Updated November 23, 2026

Claude API discounts and zero-injection standard

XiuAI offers pay-as-you-go access to the Anthropic Claude API. To preserve capacity for coding and agent workloads, we have changed Claude pricing and now limit bulk output collection and extraction of internal reasoning.

Claude Code through XiuAI works as it does with a direct Anthropic API key. Clients other than Claude Code pay 1.3× the applicable rate. Other models, including GLM, follow their own pricing and usage rules.

How are Claude Code and other clients billed?
Claude is billed at a discount to official list rates; see Models and pricing for each model. The official Claude Code client pays the applicable rate, and SDKs, direct API calls and third-party clients pay 1.3×. Haiku uses the official list price as its base.
What is zero injection, and why does it matter?
To clients, XiuAI is equivalent to Anthropic’s own API: no added prompts, no model swaps and no rewritten replies. Claude Code gets the same capabilities, cache hits and multi-turn reasoning as with a direct Anthropic API key. The standard lists each exception and how to test it.
Does XiuAI store Claude conversations?
By default, ordinary requests leave no stored conversation text. Refusal event records without text are kept for 30 days. Only requests classified as reasoning extraction have text retained: the first 2,000 characters each of the system prompt and final user message, for up to 7 days.

Claude Code and other-client pricing

Claude models are billed at a discount to Anthropic’s list rates; see Models and pricing for current rates. Requests from the official Claude Code client pay the applicable rate. Requests from other clients pay 1.3× for uncached input, output, cache reads and both cache-write durations. The multiplier changes the rate only, and usage records still show actual token counts. Haiku uses Anthropic’s list price as its base.

How much does Haiku 5.5 cost?

XiuAI follows Anthropic’s short- and long-prompt list prices for this model, with no additional XiuAI tiers. Add uncached input, cache reads and cache writes for this request. Exactly 100,000 input tokens uses the first table. Above 100,000, the second table applies to all input, output and cache usage for that request. Output tokens do not count toward the threshold. USD rates checked November 23, 2026.

Haiku 5.5 · up to 100,000 input tokens

Per million tokensCC · list priceOther · 1.3×
Uncached input$0.10$0.13
Output$0.50$0.65
Cache reads$0.01$0.013
5-minute cache writes$0.125$0.1625
1-hour cache writes$0.20$0.26

Haiku 5.5 · over 100,000 input tokens

Per million tokensCC · list priceOther · 1.3×
Uncached input$0.50$0.65
Output$2.50$3.25
Cache reads$0.05$0.065
5-minute cache writes$0.625$0.8125
1-hour cache writes$1.00$1.30

How do I check a charge?

For each item, divide the token count by 1,000,000 and multiply by its per-million rate. Add the charges for uncached input, output, cache reads, 5-minute writes and 1-hour writes. The non-CC column already includes the 1.3× multiplier.

Other models work the same way. For example, if a set of usage costs $1.00 through Claude Code at the applicable rates, the same usage through an SDK costs $1.30, with the same token counts in the usage record.

Which clients qualify for Claude Code pricing?

Anthropic lists six ways to use Claude Code: the terminal CLI, VS Code, JetBrains, Claude Desktop, web and mobile (iOS and Android). XiuAI bills requests sent to its gateway. The client multiplier below depends on the product and session mode that sends the inference request.

Client or appWhich session is making the call?Client multiplier
Terminal · Claude Code CLIRun Anthropic’s claude command directly on macOS, Linux, Windows or WSL, interactively or with claude -p. System and IDE terminals both qualify.1×
VS Code / Cursor · Claude Code extensionUse the panel provided by Anthropic’s Claude Code extension. Its panel also qualifies when you install the official extension in Cursor.1×
JetBrains · Claude Code pluginThe Anthropic plugin connects to the claude process, for example in the integrated terminal of IntelliJ IDEA, PyCharm or WebStorm.1×
Claude Desktop · CodeOpen a Code session in the official desktop app with XiuAI configured as its third-party inference gateway. In a supported SSH Code session the remote host connects to the gateway.1×
Claude Desktop · Chat / CoworkChat and Cowork, including the combined Unified Claude experience, are also official desktop features. When these sessions use XiuAI for third-party inference, the other-client rate applies.1.3×
SDKs, APIs and other toolsIncludes Anthropic’s Python and TypeScript API SDKs, apps embedding the Claude Agent SDK, the ant API CLI, direct HTTP calls, Cursor’s built-in agent, Cline and OpenCode. This rate applies when those tools call Claude, including over the Messages API. Every Claude request sent through an OpenAI-compatible endpoint also uses this rate.1.3×
Web, mobile and direct subscription useAnthropic handles hosted cloud sessions opened at claude.ai/code or in the iOS or Android app, as well as direct desktop subscription sessions. Your local XiuAI configuration does not reroute these calls.No XiuAI charge

How can I check my setup?

In the CLI, run /status and check that the Anthropic base URL points to XiuAI. In Claude Desktop, check whether you opened Code, Chat or Cowork and which provider is configured for third-party inference. Remote Control on web or mobile controls a separate session. Anthropic currently excludes third-party gateways such as XiuAI from Remote Control. For a billing question, find the call in your workspace and send XiuAI the request ID, client and mode.

Claude zero-injection standard

Why zero injection matters

Zero injection makes XiuAI equivalent to Anthropic’s own API from the client’s point of view: the model receives what you sent, and you receive what the model returned. Third-party gateways commonly drift in four ways: they add their own system prompt, swap in a cheaper model, cut off or rewrite replies, or inflate token counts. These rarely cause an error, but the same task gets worse results at a higher cost. The open-source Claude-Detection tool exists to detect exactly these problems.

For Claude Code: the same results as a direct Anthropic API key

Claude Code treats XiuAI as the Anthropic API and sends the same headers and request fields it sends when connected directly with an Anthropic Console API key. Anthropic’s gateway compatibility guide asks gateways to forward these unchanged and lists what breaks when they are altered. Zero injection follows that guidance, so the following work as they do on a direct connection:

  • Full model capabilities: adaptive thinking and effort, extended context, interleaved thinking, context management, on-demand MCP tool loading and structured outputs all depend on anthropic-beta headers arriving together with their request fields. When the headers are stripped, extended context and interleaved thinking silently stop working and the others fail with a 400.
  • Caching works, so long sessions cost less: Claude Code resends the full context every turn and relies on prefix caching to bill the repeated part at the cache-read rate, one tenth of the uncached input rate. The cache requires an exact prefix match. If a gateway adds a prompt ahead of the system prompt, rewrites the system prompt or drops cache_control markers, every later turn bills as uncached input, with no error. The attribution block Claude Code places at the start of the system prompt is removed by Anthropic only when it arrives unchanged, so it stays out of the model input and the cache.
  • Reasoning carries across turns: Claude can build on its thinking from earlier turns as long as the system prompt, tool definitions and earlier messages match the request that produced it. If a gateway rewrites any of them, the API rejects the earlier thinking blocks, and Claude Code has to drop them and retry, losing that reasoning for the rest of the conversation.
  • Context stays available for your task: injected text counts toward the context window, triggers auto-compaction earlier and makes the usage in /usage diverge from what you actually sent.
  • You get what you selected: choosing Opus in /model calls Opus, and replies and tool-call arguments come back intact, without truncation or added text.

For SDKs and your own applications

System prompts, tool definitions and output formats you tuned on the official API behave the same on XiuAI. The model sees only what you wrote, so extra instructions cannot shift its role, tone or refusal behavior. JSON and tool-call arguments stay parseable, and evaluations and production behavior reflect the model you selected. These clients also receive the compatibility handling in Article 4, which adds a small number of input tokens.

This consistency is subject to the protocol handling in Article 3: XiuAI may adjust cache breakpoints and duration to improve hit rates, with no surcharge, and removes earlier thinking blocks whose signatures cannot be validated upstream. XiuAI does not currently provide the count_tokens endpoint, so /context in Claude Code shows an estimate. Run /usage in Claude Code to see how much of the main conversation’s input came from the cache.

Article 1. Definition

Zero injection means XiuAI sends your request unchanged to the official Anthropic model you selected and returns the model’s reply unchanged. XiuAI adds no content of its own to the request or reply, does not substitute the model and does not rewrite the answer. The cases listed in Articles 3–5 are the exceptions.

The protocol handling in Article 3 and abuse prevention in Article 5 cover both official Claude Code and other clients. The compatibility handling in Article 4 applies only to other clients.

Article 2. Commitments

Subject to the exceptions in Articles 3–5, XiuAI makes these commitments.

ItemWhat XiuAI commits to
PromptsAdds no system prompts, roles or extra instructions of its own.
Messages and toolsPreserves the conversation and tool definitions as supplied.
ModelUses the requested model without substitution or downgrade.
ReplyReturns the output intact, without ads, watermarks, notes or truncation.
BillingBills from provider-reported usage without inflating token counts.

Article 3. Protocol handling

To connect to Anthropic’s official API, XiuAI applies the handling below. It affects protocol parameters only and does not change the content of your conversation.

  • Unsupported parameters are removed. An invalid combination, such as a non-default temperature on a model that does not support it, returns HTTP 400 with an explanation. XiuAI does not silently change the value.
  • The thinking parameter is normalized for the upstream protocol. Historical thinking blocks whose signatures cannot be validated upstream are removed to avoid an error. User-authored text is preserved.
  • XiuAI may adjust cache breakpoints and duration to improve hit rates. This can change the mix of reads and writes. Unless you request 1-hour caching, writes are charged at the 5-minute rate with no surcharge for the duration adjustment.
  • The refusal fallback parameter (fallbacks) in your request is passed through unchanged. If Anthropic then answers with another model after a refusal, that is your own choice and does not count as model substitution.

Article 4. Compatibility for other clients

Requests from clients other than the official Claude Code client can receive compatibility handling. It can add input tokens, and replies may lean slightly toward the style of an official client. This article does not apply to requests from the official Claude Code client.

For SDKs and other clients covered by this article, two separate changes can affect a charge. Compatibility handling adds actual input tokens. The 1.3× client multiplier applies to prices.

Article 5. Abuse prevention

Local replies to health probes: XiuAI answers the very short probe requests below itself. They are not sent to Claude and are not charged.

  • Greetings, such as hi, hello or 你好.
  • Connectivity tests, such as ping, test or say ok.
  • Requests to return specified text verbatim, such as “reply with exactly: …”.
  • Simple arithmetic.

Monitoring and uptime tools typically send these requests at high frequency. Forwarding all of them would create large volumes of repeated short requests upstream, trigger Anthropic’s abuse controls and reduce availability for every user. A local reply applies only when the entire request is one of the single, very short messages above. Normal conversations are unaffected.

A reply to a standalone “ping” only confirms that the service endpoint is reachable. Use a representative task to verify model behavior or tool calls.

Anti-distillation blocking: XiuAI rejects requests identified as distillation templates before forwarding them, at no charge. Articles 3 and 4 of the anti-distillation terms describe the error and the points.

Article 6. Verify zero injection

You can use the community open-source tool wxmb01/Claude-Detection to test for model substitution, reduced capability, injection or truncation. The table lists its injection-related checks.

Use requests of realistic length and compare runs on the same model, tools and client. The very short probes in Article 5 are answered by XiuAI itself and do not reflect the model. The tool makes API calls, so check its guide for request volumes and costs before running it.

CheckHow it worksExpected with zero injection
S1 · Visible injection (differential accounting)Add or remove a known passage in the same content and compare the difference in usage.The difference equals the token count of that passage.
S2 · Hidden injection (cache threshold)Lengthen the request step by step to find where cache writes begin. Anthropic documents the minimum cacheable length for each model, for example 512 tokens for Opus 5.5 and Sonnet 5.5.Caching begins at about the documented length. If X tokens were injected, it would begin X tokens earlier.
End-of-message canaryCheck whether anything was appended after a marker at the end of the message.No alert.
S18 · Injection condition matrixChange the system prompt and User-Agent, and test multi-turn and tool-enabled calls, comparing the added tokens for each condition.Matches the reference values supplied with the tool.
S19 · Output integrityAsk the model to repeat specified text verbatim.Identical text with nothing added.

You can also use the following methods.

  • Token reconciliation: compare Anthropic’s count_tokens result for a request with the input usage this service returns for the same request. The two should match, except in the cases listed in Article 4. With caching enabled, input usage is the sum of input_tokens, cache_creation_input_tokens and cache_read_input_tokens in usage. count_tokens is Anthropic’s estimate and does not apply caching logic, so individual requests can differ by a small amount.
  • Model self-report: ask the model “Did you see any other content before this message?” With zero injection it should answer no. Treat the answer as a supporting signal and read it alongside the usage, cache and output results.
  • The coverage in the tool’s report shows which checks actually ran. Confirm that the relevant checks ran before interpreting the results.

Article 7. Report a discrepancy

If a result differs from this standard, send XiuAI the request ID and the time it occurred so we can review the individual call.

Claude usage and anti-distillation terms

Article 1. Purpose and scope

XiuAI adopts these terms to keep the service stable and fair and to prevent models from being used for distillation or capability replication. They cover every user and request that calls a Claude model through XiuAI and form part of the XiuAI Terms of Service. Using the service constitutes acceptance of these terms.

Article 2. Prohibited uses

You may not use the service for any of the following. A single request may not reveal its purpose, so XiuAI considers patterns across requests. For example, asking Claude to explain a code change is an ordinary development task. Using its answers, scores or demonstrations as training material to teach those abilities to another model falls under this article.

  • Using model outputs to train, fine-tune, distill, or improve any machine learning model.
  • Systematically collecting, scraping, or storing model outputs to build training, distillation, or evaluation datasets.
  • Inducing the model to reveal its reasoning or chain of thought, including asking it to write its thinking into specified tags, sections, or formats.
  • Submitting questions with fixed templates at scale, harvesting answers in bulk, or collecting comparisons and scores to train reward models or replicate model capabilities.
  • Attempting to reconstruct model weights, parameters, architecture, or system prompts.

Article 3. Template detection and blocking

XiuAI maintains distillation template detection rules and updates them as needed. Each request is checked before it is sent to the model provider, and only the system prompt and final user message are checked. A request identified as a distillation template is rejected with HTTP 400 (invalid_request_error). It is not sent to the provider and incurs no charge. Every match counts toward refusal scoring (see Article 4). The detection rules are not published.

Invalid parameters can also return HTTP 400, so check the error details before attributing points to a request.

Article 4. Refusal scoring

When the model provider refuses a request (stop_reason: refusal) or Article 3 blocks it, XiuAI adds points for the caller as shown below. Provider refusals are scored by stop_details.category, with 1 point for an unspecified category. A network error, timeout or invalid parameter alone is not a refusal. The weights reflect how closely each behavior relates to distillation. The bio and cyber weights are lower because legitimate research and development can trigger them.

Each request is scored at most once. Internal gateway retries and refusals that arrive mid-stream are scored once, based on the final result of that request. If a request sets fallbacks and a fallback model completes the answer, it earns no points. If it still ends in a refusal after the fallback, it is scored once.

An upstream refusal can incur a charge depending on its category and whether output had started. With fallbacks, the refusal that triggered the fallback can also be billed. XiuAI charges for the usage the provider actually records. With direct access, look up the request ID in your usage records. If you use a third-party service, ask it to help check the charge.

A caller under this article depends on whether the request carries a valid sub-user header (see Article 5). With the header, the caller is the API key and sub-user ID pair. Without it, the caller is the API key. For example, if a platform labels Alice and Bob separately, Alice’s refusals accrue only to Alice. If the platform sends no header, both users’ refusals accrue to the API key.

CategoryPoints per event
Template match (blocked under Article 3)5
reasoning_extraction (extracting reasoning)5
frontier_llm (frontier model development)3
bio (high-risk biological content)1
cyber (high-risk cybersecurity content)1
Other or unspecified refusal1

Article 5. Sub-user identification

If one API key serves several sub-users, such as a third-party platform or a shared team key, you can identify the sub-user on each request. Scoring and suspensions then apply only to the sub-user who sent the request, and other sub-users on the same key are unaffected. Without the header, the whole API key is scored and suspended as one caller. Developers who use their own key only for themselves do not need it.

ItemRequirement
HeaderX-Xiu-Sub-User: <ID>
FormatLetters, digits and _ . : -, 1–128 characters (^[A-Za-z0-9_.:-]{1,128}$)
ValueYour platform’s internal user ID or a hash of it. It must be stable and must not contain personal information such as an email address or phone number
EndpointsEvery Claude endpoint, including Anthropic Messages and OpenAI-compatible endpoints
Invalid valueTreated as absent. The request proceeds without an error, and the response header X-Xiu-Sub-User: ignored flags it
Valid valueResponse header X-Xiu-Sub-User: accepted
  • Your platform’s server must set this header on every request and overwrite any value supplied by the client. Passing a client value through lets sub-users impersonate others or rotate IDs to evade suspensions, and the platform bears the consequences (see Article 6, paragraph 3).
  • IDs are case-sensitive, matched exactly and scoped to their API key. The same ID under two keys means two different sub-users. A new ID counts as a new sub-user, but changing IDs does not evade Article 6, paragraph 3.
  • The XiuAI gateway removes this header. It is never sent to the model provider, and its value is never echoed in a response.
  • XiuAI does not identify sub-users from request body fields such as metadata.user_id or user. These fields are protocol metadata, not sub-user identifiers.

Article 6. Violation thresholds

XiuAI adds up each caller’s points over the windows below. Reaching the threshold in any window counts as one violation. The windows are rolling: each time points are added, XiuAI looks back over the previous minute, 5 minutes, hour and day. The thresholds are set against normal use, and ordinary development and Q&A do not reach them. For example, four 5-point events from the same caller within any 60 seconds reach 20 points and count as one violation.

API key total limit: XiuAI also adds up points across all requests on each API key, with or without a sub-user header and whatever the ID. Reaching the total limit in any window counts as one violation for that API key. The total limit is five times the caller threshold, leaving room for platforms with many sub-users. XiuAI may adjust it for an individual API key after review. Rotating IDs or replacing suspended sub-users does not evade this paragraph.

Each event is assessed for the sub-user first and then for the API key. Both can be found in violation at the same time.

WindowCaller thresholdAPI key total limit
1 minute20 points100 points
5 minutes30 points150 points
1 hour50 points250 points
1 day100 points500 points

Article 7. Suspension and reinstatement

After a violation, XiuAI automatically suspends the caller. The suspension length increases with the number of violations within 30 days.

Violations within 30 daysSuspensionReinstatement
First5 minutesAutomatic
Second1 hourAutomatic
Third1 dayAutomatic
Fourth3 daysAutomatic
Fifth and subsequentPermanentManual, after appeal
  • Scope: a suspended sub-user loses access only for requests carrying that ID on that API key. A suspended API key, including after a violation without a sub-user header or under the total limit in Article 6, paragraph 3, loses access for every request, with or without a sub-user header.
  • Violation counts are kept per caller. A sub-user’s violations do not count toward its API key. Violations without a sub-user header and total-limit violations are combined in the API key’s count and follow the table above.
  • During a suspension, requests return HTTP 403 (permission_error). They are not sent to the model provider and incur no charge. Response headers give the scope and reinstatement time: X-Xiu-Ban-Scope: sub_user | api_key and X-Xiu-Ban-Until: <RFC 3339 time> | permanent.
  • No points accrue during a suspension. Scoring starts again after reinstatement. The violation count resets after 30 consecutive days without a violation.

Only Claude requests accrue points, but a suspension covers requests to every model. For example, an API key suspended after Claude refusals cannot call GLM during the suspension. A suspension affects only the suspended API key or sub-user. Other API keys on the same account keep working.

Suspensions do not use HTTP 429 or a Retry-After header. Official SDKs automatically retry a 429 according to Retry-After but do not retry a 403, which avoids pointless retries during a suspension. Read X-Xiu-Ban-Until and resume after that time. OpenAI-compatible endpoints use that protocol’s error format with the same status code and headers.

Article 8. Appeals

To appeal a permanent suspension, email your account, the time of the incident and the request ID to the address below. If a sub-user is permanently suspended, the owner of the API key appeals on its behalf and includes the sub-user ID. There is no need to send the API key secret or the full conversation.

XiuAI will review the related refusal records. If the decision was made in error, XiuAI immediately lifts the suspension and resets the violation count. If a use prohibited by Article 2 is confirmed, the suspension stands and the account balance will not be refunded.

The no-refund provision applies only when an API key is permanently suspended and a use prohibited by Article 2 is confirmed. A sub-user suspension does not affect the API key or the account balance. Rights that cannot be excluded by law are unaffected.

Temporary suspensions end automatically and need no appeal. If you believe points were added in error, send the request ID. If XiuAI confirms the error, it corrects the points and the violation count.

Article 9. Data handling

XiuAI does not use user requests or model outputs to train any model.

To detect distillation, for requests classified as reasoning extraction XiuAI retains the first 2,000 characters of the system prompt and of the final user message for no more than 7 days. They are used only for safety review and detection-rule updates and are then automatically deleted.

Refusal records (time, category, model, API key and sub-user ID) are kept for 30 days for scoring, monitoring and appeal review. They contain no request text.

Article 10. Developer guidance

To avoid false positives, we recommend that you:

  • Use the provider’s thinking parameter when you need reasoning, and do not ask the model to output its thinking in a particular format. You can still ask for evidence or a short explanation of a result.
  • Avoid submitting batches of requests from the same template.
  • After a refusal, revise the request before resubmitting it instead of retrying it unchanged.
  • If one API key serves several sub-users, send the sub-user header on every request (Article 5) so that one user’s behavior does not affect everyone. When you receive X-Xiu-Ban-Scope: sub_user, deal with that user on your platform.

Article 11. Changes to these terms

XiuAI may revise these terms as provider policies change, including point weights, thresholds and suspension durations. Revised terms take effect on publication, and the notice gives the exact effective time. Earlier requests and settled usage are not subject to the revised terms.

Appendix. Sub-user header example

This example sends an Anthropic Messages request for sub-user member-20931.

curl https://router-api.xiu.ai/v1/messages \
  -H "x-api-key: $XIUAI_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "X-Xiu-Sub-User: member-20931" \
  -H "content-type: application/json" \
  -d '{"model":"claude-sonnet-4-6","max_tokens":1024,"messages":[{"role":"user","content":"Hello"}]}'

With an SDK, set the header for each sub-user on your server. The Anthropic and OpenAI TypeScript SDKs use defaultHeaders and the Python SDKs use default_headers. You can also pass it per request with the headers option in TypeScript or extra_headers in Python. Never set it in a browser or client app.

Claude zero data retention (ZDR) and refusal exceptions

By default, XiuAI does not store prompts, conversation history or model replies from ordinary text calls. Only Claude requests classified as reasoning extraction qualify for excerpt retention under the table below. Even then, the excerpts exclude earlier user messages and model replies.

The 30-day period applies to refusal events. The platform’s data handling notice provides for long-term retention of usage and model performance statistics for billing reconciliation and analysis. This table describes XiuAI’s own retention. Upstream providers receive the content needed for inference and handle its use and retention under their own policies.

When retainedData, use, and retention period
Request classified as reasoning extractionXiuAI keeps at most the first 2,000 characters of the system prompt and the first 2,000 characters of the final user message, truncated separately. These data are kept for up to 7 days solely for safety review and detection-rule updates, then automatically deleted.
Refusal event, including a local template blockA record containing the time, category, model, API key and sub-user ID is kept for 30 days for scoring, monitoring, and appeal review. This record contains no request text.