AI API बंद होने से पहले migration audit कैसे पूरा करें
Dependencies, control requests, tool calls, streaming, errors, पुराने-नए path की तुलना, cutover और rollback वाला audit plan।
विषय-सूची
केवल model या Base URL बदलना migration नहीं है: streaming, tool calls, errors, limits और usage बदल सकते हैं। प्राथमिक source की shutdown date, पूरा dependency inventory, contract comparison और reversible cutover चाहिए। 25-08-2026 को OpenAI Deprecations में date और replacement देता है; generally available के लिए छह महीने, specialized के लिए तीन और preview के लिए कम समय हो सकता है। calendar उसी entry से बनाएं।
1. घटना लिखें
Code बदलने से पहले official source, checked date, पुराने/नए endpoint और model, shutdown_date और owner लिखें। Provider notice में date न हो तो unknown रखें, recheck owner दें और urgency न गढ़ें.
deprecation_source: https://developers.openai.com/api/docs/deprecations
checked_at: 2026-08-25
old_endpoint: /v1/chat/completions
old_model: OLD_MODEL_ID
replacement_endpoint: /v1/chat/completions
replacement_model: NEW_MODEL_ID
shutdown_date: YYYY-MM-DD
owner: team-name
2. dependencies का inventory
endpoint, Base URL, protocol, ID/fallback, payload/messages, tool schema/required fields/choice, SSE parser/usage, errors/retry, prompt, services, cron, workflows, SDK, CI, serverless, n8n/Dify, secret store और jobs शामिल करें। Secret value नहीं, केवल name और owner रखें।
3. control requests
Sanitized वास्तविक cases लें: factual text, required JSON, valid tool call, no-tool case, complete stream, 4xx और transient error/test double। Wording नहीं, schema, arguments, application result, required facts, stream end और retry compare करें; cost और latency अलग मापें।
4. streaming और errors अलग जांचें
event/data, completion, usage location, first token से पहले/partial output के बाद disconnect और external action duplicate होने की संभावना दर्ज करें। HTTP status, machine-readable code और retry boundary रखें। 401, 403, schema validation error को auto retry न करें; 429/temporary 5xx में Retry-After, attempt cap और idempotency लगाएं।
5. dual run
Test में old path baseline हो और new path को वही fixtures मिलें। रखें:
case_id | old_result | new_result | contract_pass | difference | decision
tool arguments, fields, stream end या error बदलने पर client fix या explicit acceptance चाहिए।
BetterToken के लिए https://www.bettertoken.ai/v1/chat/completions, user Bearer Key और current Model ID उपयोग करें। एक test Key बनाएं, current Chat Completions contract के अनुसार control request चलाएं और HTTP status तथा एक verifiable response field दर्ज करें; यह format जांचता है, model equivalence नहीं।
Cutover से पहले fields को current contract से मिलाएं। Chat Completions guide खोलें
6. reversible cutover
feature flag/versioned config, owner/window, metrics, exact rollback condition और secrets रहित old config तैयार करें। दोनों contracts deploy करें, controlled traffic से शुरू करें, compare करें, criteria pass पर बढ़ाएं, written invariant टूटने पर rollback करें और shutdown से पहले observation के बाद old path हटाएं। सुधार और फिर run के लिए समय रखें: rollback बंद API नहीं लौटाता।
readiness
official link/date, owned inventory, versioned fixtures/results, हर material difference का decision और measurable runbook जरूरी हैं। कोई भी न हो तो 200 के बाद भी migration_in_progress रखें।
Sources: https://developers.openai.com/api/docs/deprecations और https://docs.bettertoken.ai/api-reference/chat-completions.