azure-openai-to-responses

Migrate Python applications from Azure OpenAI Chat Completions to the unified Responses API.

73.6k|24.3k|Updated Nov 28, 2024
One-click install
npx skills add https://github.com/microsoft/ai-agents-for-beginners --skill azure-openai-to-responses
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: azure-openai-to-responses
Source: https://github.com/microsoft/ai-agents-for-beginners/tree/main/.agents/skills/azure-openai-to-responses
Command: npx skills add https://github.com/microsoft/ai-agents-for-beginners --skill azure-openai-to-responses

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires openai, azure-identity, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill addresses the technical debt and deprecation risks associated with legacy Azure OpenAI Chat Completions by providing a structured, automated path to the modern, unified Responses API.

Core Features & Use Cases

  • Automated Detection: Scans Python codebases to identify legacy API calls, deprecated constructors, and outdated response handling patterns.
  • Migration Guidance: Provides precise parameter mapping and code transformation logic for streaming, tools, structured output, and multi-turn conversations.
  • Use Case: A developer needs to upgrade a production Python application to support GPT-5 and ensure future-proof compatibility with the Azure OpenAI v1 endpoint.

Quick Start

Run the detect_legacy script on your project directory to identify all code paths requiring migration to the Responses API.

Frequently Asked Questions about azure-openai-to-responses

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate from AzureOpenAI to the standard OpenAI client?

Replace the AzureOpenAI constructor with the standard OpenAI client, set the base_url to your Azure endpoint with the /openai/v1/ suffix, and remove the api_version parameter entirely.

Does the Responses API support streaming?

Yes, the Responses API supports streaming via the Responses client. You must update your event handling to listen for response.output_text.delta events instead of the legacy chat.completion.chunk events.

Why is my tool-calling code failing after migration?

The Responses API uses a flat tool definition format where name, description, and parameters are top-level keys. Ensure your tool definitions are not nested under a function key as they were in Chat Completions.

Can I use the Responses API with GitHub Models?

No, GitHub Models does not support the Responses API. You must remove any code paths pointing to GitHub Models endpoints and switch to a supported Azure OpenAI or OpenAI deployment.

What is the minimum value for max_output_tokens?

Azure OpenAI enforces a minimum of 16 for max_output_tokens. Values below this will return a 400 error; use 50 or higher for testing and 1000+ for production workloads.