<?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: Xisu AI Team</title>
    <description>The latest articles on DEV Community by Xisu AI Team (@xisuai_official).</description>
    <link>https://dev.to/xisuai_official</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%2Fuser%2Fprofile_image%2F4192121%2Fb7f5fb8c-44b9-4838-8b04-bdbb2bdec046.png</url>
      <title>DEV Community: Xisu AI Team</title>
      <link>https://dev.to/xisuai_official</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/xisuai_official"/>
    <language>en</language>
    <item>
      <title>How do you fix "Auth conflict", 401, and /v1/v1 404 with ANTHROPIC_BASE_URL?</title>
      <dc:creator>Xisu AI Team</dc:creator>
      <pubDate>Tue, 27 Oct 2026 03:45:34 +0000</pubDate>
      <link>https://dev.to/xisuai_official/how-do-you-fix-auth-conflict-401-and-v1v1-404-with-anthropicbaseurl-418d</link>
      <guid>https://dev.to/xisuai_official/how-do-you-fix-auth-conflict-401-and-v1v1-404-with-anthropicbaseurl-418d</guid>
      <description>&lt;h1&gt;
  
  
  How do you fix "Auth conflict", 401, and /v1/v1 404 with ANTHROPIC_BASE_URL?
&lt;/h1&gt;

&lt;p&gt;&lt;code&gt;401 Unauthorized&lt;/code&gt; usually means the client sent the wrong credential or sent two conflicting credential sources. The &lt;code&gt;/v1/v1&lt;/code&gt; error is a URL composition problem: the documented base URL already ends in &lt;code&gt;/v1&lt;/code&gt;, so a client that appends another &lt;code&gt;/v1&lt;/code&gt; creates an invalid path. Set the base URL once, use one API key source, and test the final request URL before running the full coding workflow.&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;p&gt;Use this base URL when the client accepts a base URL that already includes the API version:&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://api.xisu.ai/v1"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Do not configure an additional &lt;code&gt;/v1&lt;/code&gt; suffix in the client. The valid chat endpoint is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;POST $ANTHROPIC_BASE_URL/chat/completions
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For authentication, keep one active API key source. Remove stale shell variables, inherited credentials, or an interactive login token that the client may prefer over the configured key. Then verify the request with a direct &lt;code&gt;curl&lt;/code&gt; call before debugging the client itself.&lt;/p&gt;

&lt;h2&gt;
  
  
  Environment
&lt;/h2&gt;

&lt;p&gt;This test uses a command-line coding client configured with a custom API base URL and an API key. The provider endpoint is an API-compatible chat interface. The documented base URL is the value exported in the TL;DR above, referred to below as &lt;code&gt;$ANTHROPIC_BASE_URL&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The documented model used in the minimal request below is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gpt-6-luna
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The supported chat endpoint is:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;The test date for this article is 2026-10-27. Documentation facts were checked against the source material updated on 2026-10-25; the API compatibility reference is marked updated on 2026-10-04. The test method is deliberately split into two stages:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Test the URL and key with a direct HTTP request.&lt;/li&gt;
&lt;li&gt;Start the CLI client with the same environment and confirm that it does not modify the path or select a second credential.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The exact client version is not specified here, so this article does not assume a particular version-specific flag or configuration file format.&lt;/p&gt;

&lt;h2&gt;
  
  
  Error log
&lt;/h2&gt;

&lt;p&gt;These are representative failure patterns. The important values are the status code, the final request path, and the credential source selected by the client.&lt;/p&gt;

&lt;h3&gt;
  
  
  Error 1: authentication conflict
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Auth conflict: more than one authentication source is configured.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Some clients can read credentials from an interactive session, a local configuration file, and environment variables. If more than one source is active, the client may reject the request before sending it or may select a credential different from the one expected by the user.&lt;/p&gt;

&lt;h3&gt;
  
  
  Error 2: 401 response
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;HTTP/1.1 401 Unauthorized
{
  "error": {
    "message": "authentication failed"
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A 401 response means the server received the request but did not accept its authentication. Typical causes are an empty key, a stale key, an extra quote in the variable value, or a client that sent a different key than the one being inspected in the shell.&lt;/p&gt;

&lt;h3&gt;
  
  
  Error 3: duplicated API version
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;HTTP/1.1 404 Not Found
GET /v1/v1/chat/completions
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The configured base URL already ends in &lt;code&gt;/v1&lt;/code&gt;. If the client adds &lt;code&gt;/v1/chat/completions&lt;/code&gt; to a base URL that it first normalizes incorrectly, the final path becomes &lt;code&gt;/v1/v1/chat/completions&lt;/code&gt;. The server cannot match that route.&lt;/p&gt;

&lt;h2&gt;
  
  
  Cause
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. The base URL is being treated as both a root and a versioned path
&lt;/h3&gt;

&lt;p&gt;A base URL is not always handled consistently. One client expects a bare host root, then adds &lt;code&gt;/v1&lt;/code&gt;. Another client expects the complete versioned base URL (&lt;code&gt;$ANTHROPIC_BASE_URL&lt;/code&gt;) and adds only the operation path.&lt;/p&gt;

&lt;p&gt;Therefore, the client configuration must not add another &lt;code&gt;/v1&lt;/code&gt; segment. The correct composition is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;base URL:  $ANTHROPIC_BASE_URL
path:      /chat/completions
result:    $ANTHROPIC_BASE_URL/chat/completions
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The incorrect composition is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;base URL:  $ANTHROPIC_BASE_URL
path:      /v1/chat/completions
result:    $ANTHROPIC_BASE_URL/v1/chat/completions
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. More than one credential source is active
&lt;/h3&gt;

&lt;p&gt;An authentication conflict is usually local configuration state, not a model or endpoint problem. Check for these sources:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;An API key variable in the current shell.&lt;/li&gt;
&lt;li&gt;A key exported by the parent shell or terminal profile.&lt;/li&gt;
&lt;li&gt;A local client configuration file.&lt;/li&gt;
&lt;li&gt;An interactive login session.&lt;/li&gt;
&lt;li&gt;A wrapper script that injects another authorization header.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The safest test is to start a clean shell, export one key, and print only non-secret metadata such as whether the variable is present and its character count. Do not print the key itself.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. The key is valid but the request is not the request you inspected
&lt;/h3&gt;

&lt;p&gt;A successful environment check does not prove that the client used that value. Debug output may reveal that the client selected a stored token or rewrote the base URL. Compare the final URL and the selected authentication source, not only the values in your shell.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fix (code)
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Step 1: create a clean test shell
&lt;/h3&gt;

&lt;p&gt;Start a new shell process without relying on inherited aliases or wrapper scripts. Then define the base URL exactly once.&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;"&lt;/span&gt;&lt;span class="nv"&gt;$ANTHROPIC_BASE_URL&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;API_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"replace-with-your-api-key"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use the actual API key in your local environment. Do not include it in source control, shell history shared with other users, issue reports, or logs.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: verify the variable shape without exposing the secret
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python - &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="no"&gt;PY&lt;/span&gt;&lt;span class="sh"&gt;'
import os

base = os.environ.get("ANTHROPIC_BASE_URL", "")
key = os.environ.get("API_KEY", "")

print("base_url:", base)
print("base_url_ends_with_v1:", base.endswith("/v1"))
print("key_present:", bool(key))
print("key_length:", len(key))
&lt;/span&gt;&lt;span class="no"&gt;PY
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Expected output should show the exact base URL, &lt;code&gt;True&lt;/code&gt; for the version suffix, and a nonzero key length. The key value itself must not appear.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: test the documented chat endpoint directly
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;--fail-with-body&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--request&lt;/span&gt; POST &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--url&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$ANTHROPIC_BASE_URL&lt;/span&gt;&lt;span class="s2"&gt;/chat/completions"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--header&lt;/span&gt; &lt;span class="s2"&gt;"Authorization: Bearer &lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;API_KEY&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--header&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;--data&lt;/span&gt; &lt;span class="s1"&gt;'{
    "model": "gpt-6-luna",
    "messages": [
      {"role": "user", "content": "Return the word OK."}
    ]
  }'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This test separates transport and authentication from client-specific URL handling. If it succeeds, the key and documented route work independently of the CLI client. If it returns 401, fix the key source before changing the base URL. If it returns 404 for &lt;code&gt;/v1/chat/completions&lt;/code&gt;, check the exact URL in the command and remove any wrapper that rewrites it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 4: remove duplicate path configuration
&lt;/h3&gt;

&lt;p&gt;Keep the base URL as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ANTHROPIC_BASE_URL
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then configure the client so its request path is only the operation path, not another versioned path. In pseudoconfiguration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;base_url = $ANTHROPIC_BASE_URL
path_prefix = empty
operation = /chat/completions
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Do not combine these values:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;base_url = $ANTHROPIC_BASE_URL
path_prefix = /v1
operation = /chat/completions
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the client cannot disable its hard-coded &lt;code&gt;/v1&lt;/code&gt; suffix, its URL builder is incompatible with this base URL format. Use a client configuration mode that accepts the complete versioned base URL, or call the documented endpoint through a small wrapper that constructs the URL exactly once. Do not guess a different undocumented base URL.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 5: reduce authentication to one source
&lt;/h3&gt;

&lt;p&gt;Before starting the client, remove temporary variables that may override the intended key. For example:&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;OLD_API_KEY
&lt;span class="nb"&gt;unset &lt;/span&gt;SESSION_TOKEN

&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;"&lt;/span&gt;&lt;span class="nv"&gt;$ANTHROPIC_BASE_URL&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;API_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"replace-with-your-api-key"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The variable names used by a specific client may differ. The rule is unchanged: one key, one authorization header, and one active login source. If the client has an interactive login mode, sign out of that mode for the test or use a clean profile. Do not troubleshoot a mixed credential state.&lt;/p&gt;

&lt;h2&gt;
  
  
  Error table
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Symptom&lt;/th&gt;
&lt;th&gt;Likely cause&lt;/th&gt;
&lt;th&gt;Verification&lt;/th&gt;
&lt;th&gt;Fix&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;Auth conflict&lt;/code&gt; before a request is sent&lt;/td&gt;
&lt;td&gt;Environment credentials and stored login are both active&lt;/td&gt;
&lt;td&gt;Start a clean shell and inspect which credential sources are enabled&lt;/td&gt;
&lt;td&gt;Keep one API key source and disable the other source&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;401 Unauthorized&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Empty, stale, malformed, or unexpected API key&lt;/td&gt;
&lt;td&gt;Run the direct &lt;code&gt;curl&lt;/code&gt; request and compare the selected key source&lt;/td&gt;
&lt;td&gt;Replace the key and remove overrides; do not print the key&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;404&lt;/code&gt; with &lt;code&gt;/v1/v1/chat/completions&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;The client appended &lt;code&gt;/v1&lt;/code&gt; to an already versioned base URL&lt;/td&gt;
&lt;td&gt;Enable safe request logging and inspect the final path&lt;/td&gt;
&lt;td&gt;Configure &lt;code&gt;$ANTHROPIC_BASE_URL&lt;/code&gt; as the complete base and remove the extra suffix&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;400 model_not_supported_for_endpoint&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A model was sent to the wrong endpoint&lt;/td&gt;
&lt;td&gt;Check whether the request uses chat or embeddings&lt;/td&gt;
&lt;td&gt;Use chat models with &lt;code&gt;/v1/chat/completions&lt;/code&gt; and vector models with &lt;code&gt;/v1/embeddings&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;The direct request works but the CLI fails&lt;/td&gt;
&lt;td&gt;The CLI rewrites the URL or chooses another credential&lt;/td&gt;
&lt;td&gt;Compare the direct request with client debug output&lt;/td&gt;
&lt;td&gt;Fix client URL composition or start the client with a clean profile&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Testing environment and references
&lt;/h2&gt;

&lt;p&gt;The procedure above is based on the documented quick-start flow and the API compatibility reference. The quick-start reference specifies the versioned base URL shown in the TL;DR, while the compatibility reference specifies &lt;code&gt;POST /v1/chat/completions&lt;/code&gt; and explains that request parameters are passed through without automatic rewriting.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.xisu.ai/library/quick-start" rel="noopener noreferrer"&gt;Quick-start API setup&lt;/a&gt; (the same documentation also covers API compatibility and endpoints)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The direct &lt;code&gt;curl&lt;/code&gt; test is intentionally minimal: one URL, one key, one model, and one chat message. Add streaming, tools, retries, or custom headers only after this request succeeds. Otherwise, multiple changes can hide the original failure.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Does changing the model fix a 401?
&lt;/h3&gt;

&lt;p&gt;No. A 401 is an authentication failure. First verify the key source and the authorization header with the direct request. Change the model only when the server reports a model or endpoint compatibility error.&lt;/p&gt;

&lt;h3&gt;
  
  
  Should &lt;code&gt;/v1&lt;/code&gt; appear twice when using a versioned base URL?
&lt;/h3&gt;

&lt;p&gt;No. With &lt;code&gt;$ANTHROPIC_BASE_URL&lt;/code&gt; as the base URL, the final chat request should be &lt;code&gt;$ANTHROPIC_BASE_URL/chat/completions&lt;/code&gt;. A final path containing &lt;code&gt;/v1/v1&lt;/code&gt; indicates duplicate URL composition.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is the safest way to debug an authentication conflict?
&lt;/h3&gt;

&lt;p&gt;Use a clean shell, configure one key, avoid interactive login state, and print only non-secret metadata. Then run the direct &lt;code&gt;curl&lt;/code&gt; request before launching the full client. This identifies whether the problem is the credential, the endpoint, or the client’s configuration layer.&lt;/p&gt;

&lt;p&gt;The author works on the Xisu AI team.&lt;/p&gt;

</description>
      <category>api</category>
      <category>debugging</category>
      <category>cli</category>
      <category>authentication</category>
    </item>
    <item>
      <title>A Practical Checklist for Connecting an OpenAI-Compatible Client to Xisu AI</title>
      <dc:creator>Xisu AI Team</dc:creator>
      <pubDate>Sun, 18 Oct 2026 15:40:34 +0000</pubDate>
      <link>https://dev.to/xisuai_official/a-practical-checklist-for-connecting-an-openai-compatible-client-to-xisu-ai-m51</link>
      <guid>https://dev.to/xisuai_official/a-practical-checklist-for-connecting-an-openai-compatible-client-to-xisu-ai-m51</guid>
      <description>&lt;p&gt;&lt;em&gt;Disclosure: I work on Xisu AI. This post was drafted with AI assistance and reviewed by our team.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The most common API integration problem is not the model. It is a client that still points to the original provider’s endpoint while using a key from somewhere else.&lt;/p&gt;

&lt;p&gt;If your client supports the OpenAI API format, connecting it to Xisu AI usually requires only three changes: create a key, set the compatible base URL, and select a model available in the model marketplace. Your application logic can remain unchanged.&lt;/p&gt;

&lt;p&gt;This guide shows the setup and a practical way to diagnose the failures that tend to appear during the first request.&lt;/p&gt;

&lt;h2&gt;
  
  
  What you need before changing code
&lt;/h2&gt;

&lt;p&gt;Xisu AI provides an API gateway for models from multiple providers, including OpenAI, Anthropic, Google, DeepSeek, Qwen, Moonshot, Zhipu, xAI, Meta, Baidu, ByteDance, Tencent, NVIDIA, and MiniMax.&lt;/p&gt;

&lt;p&gt;The exact model names and prices should be checked in the Xisu AI model marketplace. Do not copy a model identifier from an unrelated provider and assume it is available. The request should use the model name shown in the marketplace.&lt;/p&gt;

&lt;p&gt;Before configuring your client:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Register on Xisu AI.&lt;/li&gt;
&lt;li&gt;Add balance to your account.&lt;/li&gt;
&lt;li&gt;Create an API key in the dashboard.&lt;/li&gt;
&lt;li&gt;Save the key immediately. The plain-text key is shown only once when it is created.&lt;/li&gt;
&lt;li&gt;Confirm that the selected model is available in the model marketplace.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Xisu AI charges based on actual token usage. Requests are settled after the call rather than pre-charged, and usage is recorded in the request logs.&lt;/p&gt;

&lt;h2&gt;
  
  
  The one setting that usually matters
&lt;/h2&gt;

&lt;p&gt;For an OpenAI-compatible client, use this base URL:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;https://api.xisu.ai/v1&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The important detail is the &lt;code&gt;/v1&lt;/code&gt; suffix. Many clients construct paths such as &lt;code&gt;/chat/completions&lt;/code&gt; automatically. If you provide the wrong base URL, the client may send the request to an endpoint that does not belong to the compatible API.&lt;/p&gt;

&lt;p&gt;A typical configuration concept looks like this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;API key: the key created in the Xisu AI dashboard&lt;/li&gt;
&lt;li&gt;Base URL: &lt;code&gt;https://api.xisu.ai/v1&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Model: an exact model name listed in the Xisu AI model marketplace&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If your client has separate fields for “API endpoint” and “API version,” do not add an extra version segment unless the client requires it. The base URL above already includes the compatible API version.&lt;/p&gt;

&lt;p&gt;The compatible API exposes chat completions, embeddings, model listing, and image generation endpoints. Image generation is supported, but image editing and variations are not. Voice-related endpoints are not currently open.&lt;/p&gt;

&lt;h2&gt;
  
  
  A low-risk way to test the connection
&lt;/h2&gt;

&lt;p&gt;Do not start by changing your production application. First, make one small request from the same client or command-line coding tool that you intend to use.&lt;/p&gt;

&lt;p&gt;Use this sequence:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Enter the Xisu AI API key.&lt;/li&gt;
&lt;li&gt;Set the base URL to &lt;code&gt;https://api.xisu.ai/v1&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Select one exact model name from the model marketplace.&lt;/li&gt;
&lt;li&gt;Send a short request with minimal input.&lt;/li&gt;
&lt;li&gt;Check whether the response returns normally.&lt;/li&gt;
&lt;li&gt;Open the request log and compare the model name, token count, and cost.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The request log is useful because it lets you verify what actually happened, rather than relying only on the client’s displayed provider name. Each call records the requested model, token usage, and cost. You can also use the &lt;code&gt;request_id&lt;/code&gt; to inspect an individual request.&lt;/p&gt;

&lt;p&gt;This is especially helpful when a desktop client displays a generic “AI provider” label or when a wrapper library silently applies its own defaults.&lt;/p&gt;

&lt;h2&gt;
  
  
  Troubleshooting checklist
&lt;/h2&gt;

&lt;h3&gt;
  
  
  The request is rejected immediately
&lt;/h3&gt;

&lt;p&gt;Check the following in order:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Is the API key copied correctly?&lt;/li&gt;
&lt;li&gt;Did you save the key when it was created?&lt;/li&gt;
&lt;li&gt;Is the client using &lt;code&gt;https://api.xisu.ai/v1&lt;/code&gt; as its base URL?&lt;/li&gt;
&lt;li&gt;Is there an accidental extra path after &lt;code&gt;/v1&lt;/code&gt;?&lt;/li&gt;
&lt;li&gt;Is the account balance above zero?&lt;/li&gt;
&lt;li&gt;Does the selected model name exactly match the model marketplace?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When the balance reaches zero, new requests are rejected. Your key and configuration remain available, and requests can resume after the balance is topped up.&lt;/p&gt;

&lt;h3&gt;
  
  
  The client says the model is unavailable
&lt;/h3&gt;

&lt;p&gt;Do not substitute a similar-looking model name. First open the model marketplace and copy the exact available name. Model availability and pricing are defined there, and the gateway executes the model you request rather than silently replacing it with another one.&lt;/p&gt;

&lt;p&gt;If you need to confirm that the request reached the intended model, inspect the request log and compare the recorded model name with the one configured in your client.&lt;/p&gt;

&lt;h3&gt;
  
  
  The cost looks different from your estimate
&lt;/h3&gt;

&lt;p&gt;Xisu AI bills according to actual token usage. Review the request log for the token count and final cost. Amounts are calculated to ten decimal places, so a small request can produce a very precise charge.&lt;/p&gt;

&lt;p&gt;A useful habit is to record the &lt;code&gt;request_id&lt;/code&gt; during testing. That gives you a specific item to check when comparing application behavior with dashboard usage.&lt;/p&gt;

&lt;h3&gt;
  
  
  You need separate limits for separate projects
&lt;/h3&gt;

&lt;p&gt;Create multiple keys and assign each one its own budget limit. This is useful for separating development, production, internal tools, or different team projects. If one key reaches its limit, it does not affect the other keys.&lt;/p&gt;

&lt;p&gt;Keys can also be revoked at any time, with the change taking effect immediately.&lt;/p&gt;

&lt;h2&gt;
  
  
  When OpenAI compatibility is not enough
&lt;/h2&gt;

&lt;p&gt;If you are using Claude Code or an Anthropic-native integration, Xisu AI also supports the Anthropic protocol. Set:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ANTHROPIC_BASE_URL=https://api.xisu.ai&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The same key and the same account balance work across the OpenAI-compatible and Anthropic protocols. This means you can switch protocol-specific clients without moving funds or creating a separate account.&lt;/p&gt;

&lt;p&gt;For most existing applications, however, the OpenAI-compatible configuration is the shortest path: preserve the application code, change the base URL, use the correct key, and select a model listed in the marketplace.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;If you want to test the setup, start with a small request and verify the resulting log entry before integrating it into a larger project.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.xisu.ai/?lang=en" rel="noopener noreferrer"&gt;https://www.xisu.ai/?lang=en&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3oztt0qsyv11aogfxhfy.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3oztt0qsyv11aogfxhfy.jpeg" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>api</category>
      <category>llm</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
