OpenAI API billing, real numbers के साथ समझाया गया

Updated 2026-07-15

OpenAI API billing prepaid है और per token metered है: आप पहले credits load करते हैं, फिर हर request model की rate पर input और output token counts के आधार पर आपके balance से draw down करती है। gpt-5.5 पर, output tokens का cost input tokens का 6x है, इसलिए response की length और context की habits किसी भी और चीज़ से ज्यादा आपके bill को decide करती हैं।

Quick answer: OpenAI API billing कैसे काम करती है

तीन numbers आपके bill की हर line decide करते हैं: भेजे गए input tokens, generate हुए output tokens, और आपके चुने हुए model का per-million-token rate। कोई subscription नहीं है और कोई per-request fee नहीं है। Multiply करें, एक million से divide करें, हो गया। पेच यह है कि ये तीन numbers अलग-अलग तरीके से behave करते हैं। Chat history accumulate होने के साथ input tokens चुपचाप बढ़ते हैं, output tokens एक बड़ा per-token premium carry करते हैं, और आप जब भी model switch करते हैं rate बदल जाता है। इस guide का बाकी हिस्सा mechanics, current gpt-5.5 rates, तीन पूरी तरह worked examples, और वे जगहें cover करता है जहां bills बिना warning के jump करते हैं।

  • Billing unit: tokens, input (prompt + history) और output (reply) के लिए अलग-अलग metered
  • Payment model: prepaid credits, per request draw down होते हैं; zero balance पर requests fail होती हैं जब तक auto-recharge on न हो
  • Usage tiers आपके rate limits बदलते हैं, prices नहीं
  • Batch API: 24 hours तक wait कर सकने वाले asynchronous jobs के लिए half price

Prepaid credits, usage tiers, और Batch API

OpenAI ने API accounts को prepaid billing पर move कर दिया: आप पहले credits खरीदते हैं और usage उन्हें draw down करता है। दो details लोगों को पकड़ लेती हैं। पहला, unused credits purchase के 12 महीने बाद expire हो जाते हैं, इसलिए January में एक साल का budget load करना एक donation है अगर आपका traffic कम है। दूसरा, balance zero होते ही आपकी requests तुरंत errors return करना शुरू कर देती हैं, जो एक outage जैसा दिखता है अगर billing dashboard किसी के जिम्मे न हो। Auto-recharge hard stop को fix करता है लेकिन natural spending cap हटा देता है, इसलिए इसे usage limits के साथ pair करें। Usage tiers दूसरी mechanic हैं। जैसे-जैसे cumulative spend और account age बढ़ते हैं accounts tiers climb करते हैं, और हर tier आपके rate limits (requests per minute और tokens per minute) बढ़ाता है। Tiers per-token prices नहीं बदलते। अगर आपको कम volume पर 429 errors मिल रहे हैं, तो आप एक low tier में हैं, और fix spend history या rate-limit increase request है, कोई अलग plan नहीं। Batch API वह एक built-in discount है जिसके around plan करना worth है: requests की एक file submit करें, 24-hour window के अंदर results accept करें, और input और output दोनों पर standard rate का आधा pay करें। जो भी user-facing और latency-sensitive न हो (evals, backfills, summarization, classification) वह यहां belong करता है। Cached input भी discounted होता है जब आपके prompts एक लंबा stable prefix share करते हैं, जो static instructions को पहले और variable content को आखिर में रखने का reward देता है।

API response से exact usage track करें

बाद में किसी tokenizer library से tokens estimate करने की जरूरत नहीं है। हर chat completion response में एक usage object होता है जिसमें exact counts होते हैं जिनके लिए आपसे bill किया गया। हर call पर इसे log करें और आपका cost accounting ground truth बन जाता है, approximation नहीं। एक पेच: streaming enabled होने पर, usage object तभी भेजा जाता है जब आप इसे stream_options के through मांगें। अगर आपके logs zero-token streamed requests दिखाते हैं, तो यही वजह है।

curl https://api.openai.com/v1/chat/completions \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.5",
    "messages": [{"role": "user", "content": "Summarize the attached notes in one line."}],
    "max_completion_tokens": 200,
    "stream_options": {"include_usage": true}
  }'

# Response में exact billed counts include होते हैं:
# "usage": {
#   "prompt_tokens": 42,
#   "completion_tokens": 118,
#   "total_tokens": 160
# }

दस lines में एक OpenAI API cost calculator बनाएं

Online cost calculators price बदलते ही उसी हफ्ते stale हो जाते हैं। usage object से feed होने वाला दस-line function ऐसा कभी नहीं करता। हर model के लिए एक rates table रखें, multiply करें, और हर request ID के साथ dollar figure log करें। ध्यान दें कि reasoning-capable models hidden reasoning tokens को completion tokens के रूप में bill करते हैं, इसलिए नीचे का calculator तब तक सही रहता है जब तक आप खुद visible text count करने के बजाय response से completion_tokens पढ़ते हैं।

# USD per 1M tokens: {"in": input_rate, "out": output_rate}
RATES = {
    "gpt-5.5": {"in": 4.00, "out": 24.00},
    "claude-sonnet-4-6": {"in": 2.40, "out": 12.00},
    "deepseek-v4-flash": {"in": 0.126, "out": 0.252},
}

def cost_usd(model: str, prompt_tokens: int, completion_tokens: int) -> float:
    rate = RATES[model]
    return (prompt_tokens * rate["in"] + completion_tokens * rate["out"]) / 1_000_000

usage = response.usage
print(f"{cost_usd('gpt-5.5', usage.prompt_tokens, usage.completion_tokens):.6f}")

gpt-5.5 price table और model comparison

नीचे के rates APIsRouter catalog हैं: APIsRouter एक OpenAI-compatible gateway है (Base URL https://api.apisrouter.com/v1) pay-as-you-go billing और कोई subscription नहीं के साथ, जहां global models official list से 20% नीचे priced हैं और Chinese models अपनी official rates से नीचे हैं। /topup पर checkout को किसी signup की जरूरत नहीं: पहले pay करें, key email पर आती है, और पहला top-up +100% balance add करता है। एक direct account budget करने से पहले हमेशा OpenAI के pricing page पर उनके official rates confirm करें, क्योंकि list prices बदलते रहते हैं। Context के लिए, वही catalog उन models को carry करता है जिनके against लोग actually gpt-5.5 को weigh करते हैं। chat-heavy workloads के लिए kimi-k2.6 और mimo भी listed हैं।

gpt-5.5 rates per unit के हिसाब से broken down। एक typical chat turn करीब 1.3 cents cost करता है।
gpt-5.5 unitInputOutput
Per 1M tokens$4.00$24.00
Per 1K tokens$0.004$0.024
Typical chat turn (1,500 in, 300 out)$0.0060$0.0072

Price पर gpt-5.5 कैसे compare करता है

वही math, अलग rates। Model choice एक token bill पर सबसे बड़ा single lever है, और ज्यादातर workloads एक model चुनने के बजाय models को mix करते हैं।

Catalog rates, USD में।
Model IDInput / 1MOutput / 1MPositioning
gpt-5.5$4.00$24.00OpenAI flagship, सबसे strong general reasoning
claude-opus-4-7$4.00$20.00Deep reasoning, long-form analysis
claude-sonnet-4-6$2.40$12.00सबसे ऊंची prose quality; Anthropic policy इसे SFW creative writing तक limit करती है
gemini-3.5-flash$1.20$7.20Fast multimodal workhorse
glm-5$0.514$2.314लंबे chat sessions के लिए value pick
deepseek-v4-pro$0.3915$0.783Character roleplay के लिए community favorite
deepseek-v4-flash$0.126$0.252सबसे सस्ता long-session option
grok-4.5$1.60$4.80xAI की published policy mature fictional themes allow करती है

Worked examples: तीन workloads end to end priced

तीनों examples ऊपर वाले gpt-5.5 rates use करते हैं ($4.00 input, $24.00 output per 1M tokens)। Example 1, एक production chatbot: प्रति महीना 100,000 requests, हर एक औसतन 1,500 input और 300 output tokens। Input: 150M tokens $4.00 पर $600 है। Output: 30M tokens $24.00 पर $720 है। Total: $1,320 प्रति महीना, और ध्यान दें कि tokens का पांचवां हिस्सा होने के बावजूद output bill के आधे से ज्यादा है। Example 2, एक 60-turn roleplay या character-chat session जहां frontend हर turn पर औसतन 6,000-token context resend करता है 250-token replies के साथ। Input: 360K tokens $1.44 है। Output: 15K tokens $0.36 है। Total: प्रति session करीब $1.80। वही session deepseek-v4-flash पर करीब पांच cents cost करता है, यही वजह है कि long-session chat users हर turn पर flagships शायद ही चलाते हैं। Example 3, 20,000 documents को summarize करना, हर एक 2,500 input और 150 output tokens पर। Input: 50M tokens $200 है। Output: 3M tokens $72 है। Total: एक synchronous job के रूप में $272, या Batch API के through करीब $136 क्योंकि यहां कुछ भी latency-sensitive नहीं है।

WorkloadInput tokensOutput tokensgpt-5.5 cost
Chatbot, 100K requests/mo (1,500 in / 300 out)150M30M$1,320 / महीना
60-turn chat session (6K context resent, 250-token replies)360K15K~$1.80 / session
20,000 docs summarize करें (2,500 in / 150 out)50M3M$272 sync, ~$136 batched

Cost surprises जो OpenAI bills को बढ़ा देते हैं

इनमें से कोई भी per-request test में नहीं दिखता। ये महीना दो पर दिखते हैं, जब sessions लंबे चलते हैं और history window चुपचाप तीन गुना हो चुकी होती है। दिन एक से ही usage object को instrument करें और समय के साथ per session input tokens का graph बनाएं; वह एक chart ऊपर की ज्यादातर list पकड़ लेता है।

  • History resend: हर chat turn पूरी conversation resend करता है, इसलिए जब तक आप trim नहीं करते per session input cost roughly turn count के square के हिसाब से बढ़ता है
  • Output premium: gpt-5.5 का output अपने input rate का 6x है, इसलिए verbose replies और unset length caps bills पर हावी रहते हैं
  • Reasoning tokens: hidden chain-of-thought completion tokens के रूप में bill होती है जिसे आप text में कभी देखते ही नहीं
  • Client timeouts: अगर server के generate करना शुरू करने के बाद आपकी तरफ से request abandon हो जाती है, तो generated tokens फिर भी bill होते हैं
  • Vision inputs: images tokenized होती हैं और एक single high-detail image हजारों input tokens cost कर सकती है
  • Credit expiry: 12 महीने से पहले खरीदा गया prepaid balance चला जाता है, spend हुआ हो या नहीं

OpenAI API costs कैसे कम करें

Routing सबसे बड़ा lever है। जो teams traffic को एक flagship और deepseek-v4-flash या glm-5 जैसे value model के बीच split करती हैं वे typically किसी भी prompt tweak से कहीं ज्यादा spend काटती हैं, क्योंकि cheap model high-volume turns handle करता है। खासकर character-chat और roleplay frontends के लिए, deepseek-v4-pro और deepseek-v4-flash की pair value पर common community answer है, kimi-k2.6 और mimo test करने लायक हैं, और polished SFW prose सबसे ज्यादा मायने रखने पर Claude models pick हैं। आप जो भी frontend connect करें, उसकी terms of service और age requirements follow करें। Billing math खुद कभी नहीं बदलती: tokens in, tokens out, rate। इन तीन numbers को अपने logs में लाएं और हर cost decision guesswork के बजाय arithmetic बन जाता है।

  • हर call पर max_completion_tokens से output cap करें; यह मौजूद सबसे सस्ता guardrail है
  • History को एक sliding window से trim करें, या पुराने turns को verbatim resend करने के बजाय एक compact note में summarize करें
  • Non-interactive work को Batch API पर move करें और half rate pay करें
  • एक लंबा stable system prompt पहले और variable content आखिर में रखें ताकि cached-input discounts actually trigger हों
  • Task के हिसाब से route करें: classification, extraction, और casual chat turns को flagship की जरूरत नहीं; gpt-5.5 को उन steps के लिए रखें जो cheaper models पर fail होते हैं
  • Balance alerts और per-key limits set करें ताकि एक runaway loop account को drain न कर सके

अक्सर पूछे जाने वाले प्रश्न

OpenAI API billing कैसे काम करती है?

यह prepaid है और per token metered है। आप पहले credits खरीदते हैं, फिर हर request use किए गए model के लिए input tokens गुणा input rate plus output tokens गुणा output rate deduct करती है। कोई subscription नहीं है; credits खत्म होने पर, requests तब तक fail होती हैं जब तक आप top up न करें या auto-recharge trigger न हो।

क्या OpenAI API use करने के लिए free है?

नहीं। API usage के लिए कोई ongoing free tier नहीं है; हर token prepaid credits के against bill होता है। New accounts के लिए कभी-कभार promotional credits होते हैं लेकिन वे expire हो जाते हैं। अगर testing के लिए आपको free option चाहिए, तो कुछ third-party gateways और local models यह gap भर देते हैं।

OpenAI API का cost प्रति 1,000 tokens कितना होता है?

Current gpt-5.5 catalog rates पर, 1,000 input tokens $0.004 cost करते हैं और 1,000 output tokens $0.024 cost करते हैं। 1,500 input और 300 output tokens का एक typical chat turn करीब 1.3 cents का पड़ता है।

मेरा OpenAI API bill इतना ज्यादा क्यों है?

आमतौर पर तीन में से एक: chat history हर turn पर पूरी resend होना जिससे input session length के साथ बढ़ता है, ऐसे model पर uncapped output जिसका output rate उसके input rate का 6x है, या hidden reasoning tokens का completion tokens के रूप में bill होना। यह पता लगाने के लिए per request usage object log करें कि कौन सी वजह है।

क्या OpenAI API credits expire होते हैं?

हां। Prepaid credits purchase के 12 महीने बाद expire हो जाते हैं, चाहे आपने उन्हें use किया हो या नहीं। एक बड़ा balance पहले से load करने के बजाय अपने actual monthly burn से matching increments में खरीदें।

क्या OpenAI API, ChatGPT Plus से सस्ता है?

Light या bursty usage के लिए, हां: एक mid-tier model पर महीने के कुछ million tokens एक subscription से कम पड़ते हैं। एक flagship model पर लंबे contexts वाली heavy daily chat के लिए, API ज्यादा cost कर सकता है। decide करने से पहले अपने expected token counts को rate math से गुजार लें।