More screenshots

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    Responses API Migration: Chat Completions to Responses

    1

    - **State management** configures multi-turn conversations using `previous_response_id` or the Conversations API.

    Free

    1 useSecurity scanned
    Responses API Migration: Chat Completions to Responses

    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

    CheckBeforeAfter
    Snapshot tests (15 prompts)15/1515/15
    Valid JSON replies15/1515/15
    Same tool sequence-15/15
    Scanner findings110

    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.completions or Assistants API usage to generate a migration checklist.
    • Parameter mapping converts messages to instructions, max_tokens to max_output_tokens, and updates response_format schemas.
    • Tool refactoring flattens nested function tools and converts tool-call loops to the new function_call_output item format.
    • State management configures multi-turn conversations using previous_response_id or the Conversations API.
    • Stream conversion maps legacy chunking logic to new semantic events like output_text.delta.

    How it works

    1. Scan the repository using the included scripts to generate a human-readable or JSON migration report.
    2. Snapshot existing behavior with baseline tests for prompts, schema validity, and tool sequences.
    3. Map legacy Chat Completion calls to the responses.create syntax following the provided Python and TypeScript patterns.
    4. 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. 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. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 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

    Permissions

    Terminal / Shell
    Read Files
    Write Files
    Network Access
    Listed6 days ago

    What's inside

    Frequently Asked Questions

    This skill automates the transition from legacy OpenAI Chat Completions and the sunsetting Assistants API to the new Responses API by scanning your code, mapping deprecated parameters, and refactoring tool-calling logic.

    The skill fully supports both Python and TypeScript SDKs, as well as raw HTTP implementations for OpenAI and Azure OpenAI/Microsoft Foundry deployments.

    You receive the automated codebase scanning scripts, comprehensive parameter mapping patterns for Python/TypeScript, and a suite of verification tests to ensure your new implementation matches baseline behavior.

    Yes, it is designed specifically to handle the structural shifts in multi-turn conversations, including the conversion of nested function tools and the implementation of state management using `previous_response_id`.

    While the skill automates the vast majority of the transition, it cannot migrate the `n` parameter (multiple completions) as it is unsupported in the new API, and it requires a manual check for region-specific tool availability on Azure.

    Simply run the included scanning utility against your repository to generate a migration report; the tool then provides a step-by-step checklist to map your legacy calls to the `responses.create` syntax.

    New in APIs & Backend

    Free