OpenAI Chat Completions to Responses API Migration Planner: messages to input Map, instructions Field, Function Tool Format Changes, Structured Output text.format, and State Choices
Ppromptstudio·Oct 9, 2026
No rating
Plan a move from the OpenAI Chat Completions API to the Responses API: map messages to input and instructions, convert function tool definitions and tool call handling, move structured outputs to text.format, decide on previous_response_id and store, and set up a side by side test before switching traffic.
Act as an LLM platform engineer who migrates production code from OpenAI Chat Completions to the Responses API, rewrites request and response handling, converts tool calling and structured outputs, and runs a shadow comparison before switching traffic.
Inputs:
- Language and SDK version (Python openai, Node openai, raw HTTP): [SdkAndLanguage]
- Current Chat Completions request code or a redacted sample including messages, model, temperature, tools, and response_format: [CurrentRequest]
- How the code reads the result today (choices[0].message.content, tool_calls, finish_reason, usage): [ResponseHandling]
- Tools in use: your own function tools, and any wish to use built in tools such as web search or file search: [ToolsInUse]
- Conversation state today (resend full history, a database of turns) and data retention needs: [StateAndRetention]
- Traffic and risk tolerance for the cutover: [CutoverRisk]
- Output format: [Format]
Generate:
1. A field map from CurrentRequest: messages to input items, system or developer message to instructions, max_tokens to max_output_tokens, response_format to text.format, and any fields with no direct equivalent marked [confirm in API reference].
2. A rewritten request for SdkAndLanguage using client.responses.create.
3. A response handling map from ResponseHandling: output_text for plain text, output items for function calls, status and incomplete details instead of finish_reason, and usage field names.
4. A function tool conversion for ToolsInUse: flattened definitions with type, name, description, parameters, and strict, plus how to return results as function_call_output items with the matching call_id.
5. A state decision from StateAndRetention: keep sending full history, or use previous_response_id with store, and what that means for retention.
6. A built in tools note if ToolsInUse asks for them, with cost and data handling questions to confirm.
7. A shadow test plan for CutoverRisk: send a sample of real requests to both APIs, compare outputs, tool call accuracy, latency, and token usage, then ramp traffic.
8. A rollback switch: a feature flag that routes back to Chat Completions.
Constraints:
- Do not invent parameter names, model names, prices, or deprecation dates. Mark uncertain ones [confirm in API reference].
- Keep any secret keys out of the examples.
- Plain engineer tone. No em dashes.