<?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: Iron Man</title>
    <description>The latest articles on DEV Community by Iron Man (@iron_man_bb32fc27aec35771).</description>
    <link>https://dev.to/iron_man_bb32fc27aec35771</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%2F4277470%2Fd9752999-d602-4ad6-86ed-77dc1bc1485a.png</url>
      <title>DEV Community: Iron Man</title>
      <link>https://dev.to/iron_man_bb32fc27aec35771</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/iron_man_bb32fc27aec35771"/>
    <language>en</language>
    <item>
      <title>Running Claude Code pay-as-you-go: three setups and what each one bills</title>
      <dc:creator>Iron Man</dc:creator>
      <pubDate>Wed, 02 Dec 2026 04:38:08 +0000</pubDate>
      <link>https://dev.to/iron_man_bb32fc27aec35771/running-claude-code-pay-as-you-go-three-setups-and-what-each-one-bills-l11</link>
      <guid>https://dev.to/iron_man_bb32fc27aec35771/running-claude-code-pay-as-you-go-three-setups-and-what-each-one-bills-l11</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Disclosure:&lt;/strong&gt; I run ScaleMax, a prepaid API gateway that is option 3 below.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Claude Code is a terminal agent. It talks to whatever sits behind &lt;code&gt;ANTHROPIC_BASE_URL&lt;/code&gt; using the Anthropic Messages API, so you have more billing choices than a monthly plan.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Anthropic's own API key (pay-as-you-go, Claude models)
&lt;/h2&gt;

&lt;p&gt;If you want Claude models and you can pay by card in US dollars, this is the simplest option. You buy prepaid credit in the Anthropic Console, create a key, and Claude Code bills per token. Prompt caching is billed at the provider's cached rates, which matters a lot for an agent that resends the same context on every step.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. A self-hosted gateway (LiteLLM and similar)
&lt;/h2&gt;

&lt;p&gt;Run a proxy that speaks the Anthropic Messages API and routes to whichever providers you already pay for. You get full control and need one more service to operate. LiteLLM's docs have a Claude Code setup page.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. A hosted Anthropic-compatible gateway
&lt;/h2&gt;

&lt;p&gt;A hosted gateway gives you a key and a base URL and handles the routing. Use one when you want other model families in Claude Code, or a payment method the providers don't take.&lt;/p&gt;

&lt;p&gt;With ScaleMax, for example:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export ANTHROPIC_BASE_URL="https://api.scalemax.pro"   # no /v1, Claude Code adds it
export ANTHROPIC_AUTH_TOKEN="YOUR_KEY"                  # sent as Authorization: Bearer
export ANTHROPIC_MODEL="gpt-6.2-sol"                    # any ID your key includes
export ANTHROPIC_DEFAULT_HAIKU_MODEL="gpt-6-luna"       # cheap model for background work
claude
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;To keep it, put the same values in the &lt;code&gt;env&lt;/code&gt; block of &lt;code&gt;~/.claude/settings.json&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Verify before a long session.&lt;/strong&gt; A tiny request catches a wrong URL or key in seconds:&lt;/p&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl &lt;a href="https://api.scalemax.pro/v1/messages" rel="noopener noreferrer"&gt;https://api.scalemax.pro/v1/messages&lt;/a&gt; \&lt;br&gt;
  -H "Authorization: Bearer YOUR_KEY" \&lt;br&gt;
  -H "anthropic-version: 2023-06-01" \&lt;br&gt;
  -H "content-type: application/json" \&lt;br&gt;
  -d '{"model":"gpt-6-luna","max_tokens":16,"messages":[{"role":"user","content":"Reply with K"}]}'&lt;br&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  What actually drives the bill&lt;br&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Context size per step.&lt;/strong&gt; An agent turn often resends tens of thousands of tokens. Count them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;How cached input is billed.&lt;/strong&gt; Option 1 bills cache reads at a discount. Gateways differ: some bill all input at the published input rate, others discount cache reads (ScaleMax bills cache reads below the input rate on models that support caching). Compare on your real workload, not the rate card.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The background model.&lt;/strong&gt; Claude Code sends lightweight work to the "Haiku" slot. Pointing &lt;code&gt;ANTHROPIC_DEFAULT_HAIKU_MODEL&lt;/code&gt; at a cheap model cuts cost without changing your main model.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tool-use reliability.&lt;/strong&gt; Non-Anthropic models differ in how well they follow Claude Code's tool protocol. Run a small task before a big refactor.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Quick decision
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;You want...&lt;/th&gt;
&lt;th&gt;Use&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Claude models, USD card, first-party terms&lt;/td&gt;
&lt;td&gt;Anthropic API key&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Full control, already paying several providers&lt;/td&gt;
&lt;td&gt;Self-hosted gateway&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Other model families in Claude Code, one prepaid key, UPI or card&lt;/td&gt;
&lt;td&gt;Hosted gateway&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;em&gt;I run ScaleMax. Setup guide: &lt;a href="https://scalemax.pro/claude-code" rel="noopener noreferrer"&gt;https://scalemax.pro/claude-code&lt;/a&gt;. Trial: $2 credit, no card.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>claude</category>
      <category>ai</category>
      <category>devtools</category>
      <category>productivity</category>
    </item>
    <item>
      <title>How to pay for an AI coding API from India with UPI (Claude Code, Codex, Cursor)</title>
      <dc:creator>Iron Man</dc:creator>
      <pubDate>Wed, 02 Dec 2026 04:36:21 +0000</pubDate>
      <link>https://dev.to/iron_man_bb32fc27aec35771/how-to-pay-for-an-ai-coding-api-from-india-with-upi-claude-code-codex-cursor-iof</link>
      <guid>https://dev.to/iron_man_bb32fc27aec35771/how-to-pay-for-an-ai-coding-api-from-india-with-upi-claude-code-codex-cursor-iof</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Disclosure:&lt;/strong&gt; I run ScaleMax, which is one of the options below. I've tried to make this useful even if you never use it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you've tried to buy API credit for a coding agent from India, you've probably hit the same wall I did. At the time of writing, the big model providers' API consoles sell prepaid credit in &lt;strong&gt;US dollars, to a card&lt;/strong&gt;. UPI and net banking aren't offered for API credit. (Some providers show rupee prices for their &lt;em&gt;chat subscriptions&lt;/em&gt;, but that's a different product from API credit.) Check each provider's billing page, because this changes.&lt;/p&gt;

&lt;p&gt;So what are your options?&lt;/p&gt;

&lt;h2&gt;
  
  
  Option 1: an international card
&lt;/h2&gt;

&lt;p&gt;If you have a credit card with international transactions switched on, this is the most direct route. You get first-party terms and new features on day one.&lt;/p&gt;

&lt;p&gt;Things to watch:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Turn on &lt;strong&gt;international / online transactions&lt;/strong&gt; in your bank app first. Most declines are this.&lt;/li&gt;
&lt;li&gt;Your bank adds a &lt;strong&gt;foreign-currency markup&lt;/strong&gt;, plus GST on that markup. Look up your card's rate.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Option 2: a prepaid gateway that bills in rupees
&lt;/h2&gt;

&lt;p&gt;A gateway sells you credit in rupees and relays your requests to the models. You change one base URL in your tool and keep working.&lt;/p&gt;

&lt;p&gt;What to check before trusting any gateway with your traffic:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Which endpoints does it speak?&lt;/strong&gt; You want OpenAI-compatible &lt;code&gt;/v1&lt;/code&gt; for most tools, and the Anthropic Messages API if you use Claude Code.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Can you see every request?&lt;/strong&gt; Tokens and cost per call, not just a balance.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;How is cached input billed?&lt;/strong&gt; Some gateways bill cached tokens at the full input rate, others at a discount. It matters for agents that resend a large context on every step.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Refunds and status page.&lt;/strong&gt; Is there a published policy and incident history?&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Example: setting it up with ScaleMax
&lt;/h3&gt;

&lt;p&gt;ScaleMax checks out in rupees by UPI, Indian cards or net banking, at a fixed ₹100 = $1, with no payment fee. New accounts get $2 of trial credit without a card.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fastest:&lt;/strong&gt; run the installer and pick your tool. It backs up existing config files:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx scalemax@latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Manual: OpenAI-style tools&lt;/strong&gt; (Codex, Cursor, Cline, Continue, Aider, Zed)&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Base URL: https://api.scalemax.pro/v1
API key:  your key
Model:    an exact ID, e.g. gpt-6.2-sol or gpt-6-luna
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Manual: Claude Code&lt;/strong&gt; (Anthropic Messages endpoint, no /v1)&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export ANTHROPIC_BASE_URL="https://api.scalemax.pro"
export ANTHROPIC_AUTH_TOKEN="YOUR_KEY"
export ANTHROPIC_MODEL="gpt-6.2-sol"
claude
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Claude Code accepts any model ID your key includes on this endpoint. Tool-use quality varies by model, so run a small task first.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Check what your key can call:&lt;/strong&gt;&lt;/p&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl &lt;a href="https://api.scalemax.pro/v1/models" rel="noopener noreferrer"&gt;https://api.scalemax.pro/v1/models&lt;/a&gt; -H "Authorization: Bearer YOUR_KEY"&lt;br&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  What it costs in rupees&lt;br&gt;
&lt;/h2&gt;

&lt;p&gt;Credit is charged at each model's published per-1M-token rate. Packs add bonus credit. As of writing, ₹1,000 buys $105 of credit, so $1 of credit costs about ₹9.52.&lt;/p&gt;

&lt;p&gt;One coding-agent step with 30,000 input tokens and 2,000 output tokens:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Model&lt;/th&gt;
&lt;th&gt;Rate per 1M (in / out)&lt;/th&gt;
&lt;th&gt;Credit used&lt;/th&gt;
&lt;th&gt;≈ Rupees (₹1,000 pack)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;GPT-6.2 Sol&lt;/td&gt;
&lt;td&gt;$2 / $10&lt;/td&gt;
&lt;td&gt;$0.080&lt;/td&gt;
&lt;td&gt;₹0.76&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GPT-6.1 Terra&lt;/td&gt;
&lt;td&gt;$1 / $5&lt;/td&gt;
&lt;td&gt;$0.040&lt;/td&gt;
&lt;td&gt;₹0.38&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GPT-6 Luna&lt;/td&gt;
&lt;td&gt;$0.10 / $0.50&lt;/td&gt;
&lt;td&gt;$0.004&lt;/td&gt;
&lt;td&gt;₹0.04&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;These are the GPT models a pay-as-you-go key covers. DeepSeek, GLM, Kimi and Grok models are sold on a separate token pack with its own key, also priced in rupees (see the pricing link below).&lt;/p&gt;

&lt;p&gt;Agents resend context on every step. Cache reads can bill below the input rate on models that support caching, so the real figure is often lower. Multiply by your real step count, and watch the per-request log for the first day.&lt;/p&gt;

&lt;h2&gt;
  
  
  Which option should you pick?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;You have an international card and want first-party terms:&lt;/strong&gt; go direct.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;You pay by UPI, or want one key across several model families and tools:&lt;/strong&gt; a rupee-billing gateway is simpler.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Either way, keep keys out of your repo and your prompts, and set a small budget first.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Disclosure again: I run ScaleMax. Pricing and model list: &lt;a href="https://scalemax.pro/india" rel="noopener noreferrer"&gt;https://scalemax.pro/india&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>india</category>
      <category>api</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
