<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Model123 Blog]]></title><description><![CDATA[Model123 Blog]]></description><link>https://model123-ai.hashnode.dev</link><image><url>https://cdn.hashnode.com/uploads/logos/6adad312a48cd2e249e9605a/c540eab4-c1e5-41b1-ac2d-718ff9feda15.png</url><title>Model123 Blog</title><link>https://model123-ai.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Fri, 04 Dec 2026 23:30:53 GMT</lastBuildDate><atom:link href="https://model123-ai.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Debug Codex API Providers by Tracing the Request Contract]]></title><description><![CDATA[An API error in a coding assistant can look like a model problem. The model name gets changed, the key gets copied again, and the base URL is edited until…]]></description><link>https://model123-ai.hashnode.dev/debug-codex-api-providers-by-tracing-the-request-contract</link><guid isPermaLink="true">https://model123-ai.hashnode.dev/debug-codex-api-providers-by-tracing-the-request-contract</guid><dc:creator><![CDATA[无趣儿]]></dc:creator><pubDate>Thu, 03 Dec 2026 04:12:06 GMT</pubDate><content:encoded><![CDATA[<p>An API error in a coding assistant can look like a model problem. The model name gets changed, the key gets copied again, and the base URL is edited until something works. That trial-and-error loop often hides the real issue: the client may be reading a different provider profile, environment variable, endpoint path, or wire protocol than the one you meant to configure.</p>
<p><strong>Disclosure:</strong> This branded technical guide was prepared for PingCode AI, a model API provider and developer-guide publisher. The configuration example is generic and has not been tested against a live API.</p>
<p>Codex custom providers make those pieces explicit. A useful debugging method is to follow one request through the same configuration layers Codex uses, changing one variable at a time. The goal is to identify where the request contract stops matching the service—not to guess which model might fix it.</p>
<h2>Start with the active provider</h2>
<p>Before editing TOML, record the model and provider you expect to use. Check the command line for a <code>--profile</code> selection and check whether the project has a trusted <code>.codex/config.toml</code> that overrides user settings. Codex configuration can come from several layers, so the file open in your editor may not be the file that determines the active request.</p>
<p>The <a href="https://developers.openai.com/codex/config-basic">Codex configuration basics</a> explain the main configuration locations and precedence. For a one-run diagnostic, use an explicit profile or command-line override only when you can state exactly what value it changes. Avoid rewriting several settings at once; that makes a successful retry difficult to explain and a failed retry difficult to diagnose.</p>
<h2>Trace the provider fields</h2>
<p>A custom provider usually connects several independent choices: the model ID, the provider ID, the service base URL, the environment variable name that holds the credential, and the API wire format. A generic TOML shape looks like this:</p>
<pre><code class="language-toml">model_provider = "team_gateway"
model = "model-id-from-provider"

[model_providers.team_gateway]
name = "Team Gateway"
base_url = "https://api.example.com/v1"
env_key = "TEAM_GATEWAY_API_KEY"
wire_api = "responses"
</code></pre>
<p>The table name and <code>model_provider</code> value must point to the same provider ID. The <code>env_key</code> value is the variable name Codex should read; it is not the secret itself. Keep the key outside the TOML file and out of source control, screenshots, terminal transcripts, and support tickets.</p>
<p>You can verify that the process has a value without displaying the credential. In a compatible shell, test whether the variable is set and print only “present” or “missing.” If it is missing, check that the variable is exported in the same environment that launches Codex. A variable available in one terminal session may not be available to a desktop app launched from another environment.</p>
<h2>Check the URL and protocol separately</h2>
<p>Treat the base URL as a boundary, not a place to paste a full request path. Follow the service’s current documentation for whether the base should end in <code>/v1</code>; do not add a route such as <code>/responses</code> unless the provider specifically instructs you to. A path error can produce a 404 even when the host and credential are valid.</p>
<p>Then check the wire protocol. A service that accepts Chat Completions is not automatically compatible with the Responses API. Codex’s <a href="https://developers.openai.com/codex/config-advanced">advanced configuration guide</a> documents custom model providers and the available configuration surface. For context on why the words “OpenAI-compatible” can cover different behaviors, see this HackerNoon analysis of <a href="https://hackernoon.com/local-llms-need-more-than-openai-compatible-endpoints">local models and API compatibility</a>.</p>
<p>Change either the URL or protocol for a test, not both. If the service supports only one API style, use that documented choice; do not infer compatibility from an endpoint name alone. The <a href="https://toml.io/en/">TOML specification</a> is also useful when a parse error points to quoting, table names, or another syntax issue.</p>
<h2>Read the failure as evidence</h2>
<p>Once the configuration is internally consistent, make one small request and note the time. Match the client error to the service’s request log or dashboard using the timestamp and, when available, a request ID. A 401 points first to credential presence, variable-name matching, and key validity. A 404 points first to the base path and model ID. A protocol or response-shape error points to the wire format and the provider’s actual feature support. These are diagnostic clues, not guarantees; use the service’s own response and logs to confirm the cause.</p>
<p>Keep the test safe: never paste a live key into a public issue, and rotate it if it is exposed. Once one request succeeds, capture the exact provider ID, model ID, base URL, protocol, and credential-variable name—without the secret—in a team setup note. That makes later comparisons reproducible.</p>
<p>The PingCode AI content team maintains a <a href="https://news.pingcode.ai/">developer guide hub</a> with practical setup, troubleshooting, and API-use articles. This article is a general debugging workflow; always follow the current documentation for the specific client and API provider you use.</p>
]]></content:encoded></item><item><title><![CDATA[How to Read an AI API Bill: Tokens, Caching, and Channel Discounts]]></title><description><![CDATA[Learn how to estimate AI API costs from input, output, cache tokens, and channel discounts, then reconcile your estimate with usage logs.]]></description><link>https://model123-ai.hashnode.dev/how-to-read-an-ai-api-bill-tokens-caching-and-channel-discounts</link><guid isPermaLink="true">https://model123-ai.hashnode.dev/how-to-read-an-ai-api-bill-tokens-caching-and-channel-discounts</guid><category><![CDATA[AI]]></category><category><![CDATA[api]]></category><dc:creator><![CDATA[无趣儿]]></dc:creator><pubDate>Wed, 02 Dec 2026 07:08:13 GMT</pubDate><content:encoded><![CDATA[<p>AI API bills can be hard to estimate if you multiply only the prompt size by one input price. Output tokens, cache writes and reads, model tiers, and channel discounts can all change the final amount.</p>
<p>This guide uses PingCode AI’s public pricing page and billing documentation to show a repeatable way to estimate a call and reconcile it with the usage log. It is a documentation walkthrough; I did not make a live API request for this article.</p>
<h2>Start with the four token buckets</h2>
<table>
<thead>
<tr>
<th>Usage bucket</th>
<th>What it usually represents</th>
</tr>
</thead>
<tbody><tr>
<td>Input tokens</td>
<td>The prompt, code, and context sent to the model</td>
</tr>
<tr>
<td>Output tokens</td>
<td>The response or code generated by the model</td>
</tr>
<tr>
<td>Cache creation tokens</td>
<td>Content written into a cache</td>
</tr>
<tr>
<td>Cache read tokens</td>
<td>Content read from an existing cache</td>
</tr>
</tbody></table>
<p>A client may show one total, but the billing page can price these buckets differently. Treat them as separate quantities when you estimate cost.</p>
<h2>Convert usage to the price unit</h2>
<p>PingCode AI lists model prices in RMB per million tokens and separates input, output, cache creation, and cache read prices. Some models also have tiers based on context length. Before calculating, confirm the selected model, the standard or group price view, the context tier, and whether the cache buckets have their own rates.</p>
<p>For each bucket, divide the token count by 1,000,000, then multiply by that bucket’s price:</p>
<pre><code class="language-text">pre-discount cost = input millions × input rate
                  + output millions × output rate
                  + cache-write millions × cache-write rate
                  + cache-read millions × cache-read rate

final cost = pre-discount cost × channel discount factor
</code></pre>
<p>For example, a call with 800,000 input tokens, 100,000 output tokens, 200,000 cache-creation tokens, and 300,000 cache-read tokens uses 0.8, 0.1, 0.2, and 0.3 million tokens in the calculation. Insert the current rate for each bucket; the example intentionally does not hard-code prices that may change.</p>
<h2>Read the discount as a multiplier</h2>
<p>A displayed discount can be ambiguous. A “20% discount” can mean paying 80% of list price, while a “20% rate” or “2 折” can mean paying 20%. PingCode AI’s billing example uses a factor of 0.2: a pre-discount amount of RMB 1 becomes RMB 0.2. Confirm the wording and the actual channel shown for the call before applying a multiplier.</p>
<p>The <a href="https://pingcode.ai/pricing">model pricing page</a> can show standard and group prices; compare the model and context tier with the <a href="https://pingcode.ai/docs/pricing">billing documentation</a>. Do not use a screenshot or old rate as a current quote.</p>
<h2>Reconcile the estimate with the usage log</h2>
<ol>
<li>Send a small, identifiable request and note its time, model, and client.</li>
<li>Find the matching entry in the usage log. Compare the model, token buckets, and charge.</li>
<li>Recalculate with the rate tier and discount that applied to that request.</li>
<li>Use the usage dashboard to confirm the balance and time range.</li>
</ol>
<p>If the balance is available but a request fails, check whether the key is enabled and unexpired, the total or model limit, the IP allowlist, and the endpoint, key, and model actually used by the client. Adding balance does not change a key’s permissions or limits.</p>
<p>Before sharing a log or screenshot, hide API keys, account identifiers, and any customer data. For a specific call, the usage record is the source of truth; the formula is a way to check it, not a substitute for the provider’s recorded charge.</p>
<h2>Quick checklist</h2>
<ul>
<li>Are the rates in RMB per million tokens?</li>
<li>Did you calculate input, output, cache creation, and cache reads separately?</li>
<li>Did you choose the right model and context-length tier?</li>
<li>Does the discount label describe the discount amount or the payable factor?</li>
<li>Do the usage log and price view refer to the same call and time period?</li>
</ul>
<p><strong>Sources:</strong> <a href="https://pingcode.ai/docs/pricing">PingCode AI billing documentation</a> · <a href="https://pingcode.ai/pricing">PingCode AI model prices</a></p>
<p>Disclosure: This article was written with AI assistance and checked against the linked public documentation. No live API request was made; rates and channel terms can change.</p>
<h2>More from PingCode AI</h2>
<p><a href="https://news.pingcode.ai/">PingCode AI Content Center</a></p>
]]></content:encoded></item><item><title><![CDATA[Configure PingCode AI in CC Switch: Claude Code vs. Codex endpoints]]></title><description><![CDATA[CC Switch can keep separate provider configurations for Claude Code and Codex, but the two clients need different endpoint paths and upstream formats. This…]]></description><link>https://model123-ai.hashnode.dev/configure-pingcode-ai-in-cc-switch-claude-code-vs-codex-endpoints</link><guid isPermaLink="true">https://model123-ai.hashnode.dev/configure-pingcode-ai-in-cc-switch-claude-code-vs-codex-endpoints</guid><dc:creator><![CDATA[无趣儿]]></dc:creator><pubDate>Thu, 19 Nov 2026 03:38:41 GMT</pubDate><content:encoded><![CDATA[<p>CC Switch can keep separate provider configurations for Claude Code and Codex, but the two clients need different endpoint paths and upstream formats. This guide walks through a PingCode AI example, then shows how to check which provider handled a test request.</p>
<p>Disclosure: This product tutorial promotes PingCode AI and was written with AI assistance using its public documentation. The screenshots are documentation examples, not evidence of a live test. No API request was made for this article.</p>
<h2>1. Choose the client before adding a provider</h2>
<p>Install CC Switch and obtain an active PingCode AI key from its key-management page. Keep the complete key out of screenshots, chat, and version control. Before switching, record your existing provider and keep a way to restore your previous settings.</p>
<p>In CC Switch, select <strong>Claude Code</strong> in the sidebar, then choose <strong>Add Provider</strong> and the custom configuration. Codex has its own provider list; configuring one client does not configure the other.</p>
<p><img src="https://cdn.hashnode.com/uploads/covers/6adad312a48cd2e249e9605a/01ffb19e-facc-403e-b801-e5807248dd8c.png" alt="The PingCode AI documentation highlights Claude Code and Add Provider in CC Switch" /></p>
<p><em>Figure 1. Documentation example: select the client and locate Add Provider. The visible state is an example, not this article's test result.</em></p>
<h2>2. Configure Claude Code</h2>
<p>For the Claude Code custom provider, enter the PingCode AI key and use:</p>
<ul>
<li>Request URL: <code>https://api.pingcode.ai</code></li>
<li>Upstream format: <code>Anthropic Messages (native)</code></li>
<li>Model mapping: fetch the model list and choose a model available to the account. A display name is not necessarily the model sent in the request.</li>
</ul>
<p><img src="https://cdn.hashnode.com/uploads/covers/6adad312a48cd2e249e9605a/5b2f7edb-b663-4c1f-9921-9aad3f2e2fa8.png" alt="A documentation example highlights the Claude request URL and native Anthropic format" /></p>
<p><em>Figure 2. The documentation highlights the Claude request URL; the key field is masked. This image does not establish a successful connection.</em></p>
<h2>3. Configure Codex separately</h2>
<p>Switch to Codex in CC Switch and add a custom provider. The <a href="https://pingcode.ai/docs/cc-switch">PingCode AI CC Switch guide</a> currently specifies:</p>
<ul>
<li>Request URL: <code>https://api.pingcode.ai/v1</code> — retain <code>/v1</code>.</li>
<li>Upstream format: <code>Responses (native)</code>.</li>
<li>Model: fetch the model list and select an available model.</li>
</ul>
<p><img src="https://cdn.hashnode.com/uploads/covers/6adad312a48cd2e249e9605a/57dcedee-f7c5-4cfb-b36a-6d08ae52b9fe.png" alt="The PingCode AI documentation table lists the Codex URL, protocol, and model selection" /></p>
<p><em>Figure 3. The documentation's Codex parameter table specifies the <code>/v1</code> URL and Responses format.</em></p>
<p><img src="https://cdn.hashnode.com/uploads/covers/6adad312a48cd2e249e9605a/f67addfe-6588-4557-9eee-7549f7c8aec3.png" alt="A CC Switch documentation example highlights Responses as the upstream format" /></p>
<p><em>Figure 4. Documentation example: select Responses (native) for Codex.</em></p>
<p>The practical distinction: Claude uses the root URL and Anthropic Messages; Codex uses the URL with <code>/v1</code> and Responses. Match the key and model to the same provider rather than copying settings blindly between clients.</p>
<h2>4. Enable the provider and verify the request</h2>
<p>Save and enable the provider, completely restart the relevant client, and open a new session. Record the time, client, selected model, and key name. A small test can avoid exposing project content:</p>
<pre><code class="language-text">Reply only “Connection successful”. Do not read or modify files or run commands.
</code></pre>
<p>After a response, open the PingCode AI usage log and compare the time, key, and model with the test. A single interaction can generate adjacent requests, so consider the surrounding records. A response or saved configuration alone does not prove which provider handled it. Calls may incur charges; check the current <a href="https://pingcode.ai/pricing">pricing page</a> and your account conditions first.</p>
<h2>If it still uses the old provider</h2>
<ol>
<li>Confirm that the intended client and provider are selected and enabled in CC Switch.</li>
<li>Check the URL path and upstream format against the table above; verify the key is active and has access to the selected model.</li>
<li>Restart the relevant client, run one new small test, and record its time.</li>
<li>If the usage log has no match, clear excess filters, expand the time window, and check that the account owns the key.</li>
</ol>
<p>These checks establish the path for the individual test, not a guarantee that every later session uses the same settings. Interface labels and available models can change; consult the current documentation when configuring your own environment.</p>
]]></content:encoded></item><item><title><![CDATA[Cutting AI API costs by 70%: intelligent routing across 10+ LLMs]]></title><description><![CDATA[Most teams pay premium prices for frontier models even when a cheaper model would do the job just as well — and when their single provider has an outage…]]></description><link>https://model123-ai.hashnode.dev/cutting-ai-api-costs-by-70-intelligent-routing-across-10-llms</link><guid isPermaLink="true">https://model123-ai.hashnode.dev/cutting-ai-api-costs-by-70-intelligent-routing-across-10-llms</guid><dc:creator><![CDATA[无趣儿]]></dc:creator><pubDate>Fri, 23 Oct 2026 04:42:21 GMT</pubDate><content:encoded><![CDATA[<p>Most teams pay premium prices for frontier models even when a cheaper model would do the job just as well — and when their single provider has an outage, their product goes down with it.</p>
<p>We built [Model123](<a href="https://www.model123.ai">https://www.model123.ai</a>) to solve exactly this. Here's how intelligent model routing works and what kind of savings you can realistically expect.</p>
<p>## One model doesn't fit all workloads</p>
<p>A typical AI product runs many different workloads:</p>
<p>- **Chat and support** — needs strong reasoning, high volume</p>
<p>- **Classification and extraction** — small models handle this fine</p>
<p>- **Coding assistance** — needs top-tier code models like Claude or Codex</p>
<p>- **Summarization** — mid-tier models are usually enough</p>
<p>Paying Claude/GPT prices for classification work is like hiring a senior engineer to sort emails. The fix: route each request to the cheapest model that meets your quality bar.</p>
<p>## What Model123 does</p>
<p>Model123 is an enterprise AI platform giving you **one API for 10+ leading models** — Claude, Codex, GPT, Gemini, DeepSeek, Qwen, Kimi, Grok, Doubao, MiniMax and GLM — with:</p>
<p>- **Intelligent routing** — requests matched to the right model based on task, latency and cost</p>
<p>- **Sub-300ms responses** with a 99.99% SLA</p>
<p>- **Pay-as-you-go from $10** — no per-seat fees, no minimum commit</p>
<p>- **Drop-in SDK compatibility** with OpenAI, Anthropic and Google APIs — migration is usually a one-line base-URL change</p>
<p>Teams typically cut AI spend by **up to 70%** versus single-provider setups.</p>
<p>## Migration in three steps</p>
<p>1. Point your existing SDK's base URL at Model123</p>
<p>2. Swap in your Model123 key</p>
<p>3. Pick a routing policy: cost-optimized, quality-optimized, or per-workload rules</p>
<p>No adapter layer, no rewrite.</p>
<p>## Who it's for</p>
<p>Engineering teams running real production AI workloads who care about reliability *and* unit economics. If inference spend is meaningful — or a single-provider outage has burned you — it's worth testing the routing quality against your own workload.</p>
<p>👉 [model123.ai](<a href="https://www.model123.ai">https://www.model123.ai</a>) — start with a $10 credit. Questions welcome in the comments.</p>
]]></content:encoded></item></channel></rss>