- Home
- Skills
- APIs & Backend
- Responses API Migration: Chat Completions to Responses
More screenshots
Works with the AI Agents you already use
Responses API Migration: Chat Completions to Responses
- **State management** configures multi-turn conversations using `previous_response_id` or the Conversations API.
Free
Responses API Migration: Chat Completions to Responses
Example session with this skill installed
Our support bot uses chat.completions with tools and JSON output in Python. Migrate it to the Responses API without changing behaviour.
- Read your context and instructions
- Compiled the responses api migration
Migration: support bot -> Responses API
Scan (scan_chat_completions.py ./bot): 11 findings in 3 files - 2 calls, 2 messages, 1 max_tokens, 1 response_format, 1 nested tool, 3 tool_calls/role:"tool", 1 choices[0].
1. Tools flattened
TOOLS = [{"type": "function", "name": "lookup_order",
"description": "Get order status by id",
"parameters": {"type": "object", "properties": {"order_id": {"type": "string"}},
"required": ["order_id"], "additionalProperties": False}}]
2. Tool loop + JSON output
items = [{"role": "user", "content": question}]
while True:
r = client.responses.create(model=MODEL, instructions=SYSTEM, input=items, tools=TOOLS,
max_output_tokens=600,
text={"format": {"type": "json_schema", "name": "reply", "schema": REPLY_SCHEMA, "strict": True}})
calls = [o for o in r.output if o.type == "function_call"]
if not calls:
break
items += r.output
for c in calls:
items.append({"type": "function_call_output", "call_id": c.call_id,
"output": json.dumps(lookup_order(**json.loads(c.arguments)))})
reply = json.loads(r.output_text)
3. Verification
| Check | Before | After |
|---|---|---|
| Snapshot tests (15 prompts) | 15/15 | 15/15 |
| Valid JSON replies | 15/15 | 15/15 |
| Same tool sequence | - | 15/15 |
| Scanner findings | 11 | 0 |
Notes: instructions is resent every turn (it does not carry over with previous_response_id); store=False set because the bot handles customer data.
Next steps: ship behind USE_RESPONSES_API, canary 10% for 3 days, then remove the old path.
Connects securely to your tools. The creator never sees your data.
About this skill
Legacy OpenAI Chat Completions and the Assistants API (sunset in August 2026) require migration to the new Responses API to maintain compatibility and access new features. This skill automates the transition by scanning your codebase, mapping deprecated parameters to their new equivalents, and handling the structural changes in tool calling and streaming.
What it does
- Codebase scanning identifies every instance of
chat.completionsor Assistants API usage to generate a migration checklist. - Parameter mapping converts
messagestoinstructions,max_tokenstomax_output_tokens, and updatesresponse_formatschemas. - Tool refactoring flattens nested function tools and converts tool-call loops to the new
function_call_outputitem format. - State management configures multi-turn conversations using
previous_response_idor the Conversations API. - Stream conversion maps legacy chunking logic to new semantic events like
output_text.delta.
How it works
- Scan the repository using the included scripts to generate a human-readable or JSON migration report.
- Snapshot existing behavior with baseline tests for prompts, schema validity, and tool sequences.
- Map legacy Chat Completion calls to the
responses.createsyntax following the provided Python and TypeScript patterns. - Verify the migration by re-running the scanner until zero legacy findings remain.
Frameworks & tools
Supports Python and TypeScript SDKs, raw HTTP requests, OpenAI, and Azure OpenAI / Microsoft Foundry deployments.
Why this beats prompting it yourself
Manual migration often leads to broken tool loops or silent parameter drops that cause runtime errors. This skill provides a systematic scanning utility and precise mapping logic for complex features like reasoning models and built-in search tools that general prompts often hallucinate.
Use cases
- Migrating production apps before the August 2026 Assistants API sunset.
- Converting legacy Chat Completions to use built-in web search, file search, or MCP tools.
- Porting OpenAI implementations to Azure OpenAI Responses API endpoints.
- Updating streaming implementations to use semantic event handlers.
Known limitations
Does not support the n parameter for multiple completions as it is not present in the Responses API. Requires manual verification of region-specific tool availability on Azure.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for APIs & Backend.
Does not support the 'n' parameter. Manual verification required for Azure region-specific tool availability. Requires OpenAI SDK v1.52.0 or later.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
1 use
Times used to date
Free to use
No account required to browse
Trust & safety
Security scan
Security scan passed 6 days ago
- Free with an Agensi account