Skip to content

New responses API does not work with AzureOpenAI #2184

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task done
alexprengere opened this issue Mar 12, 2025 · 5 comments
Closed
1 task done

New responses API does not work with AzureOpenAI #2184

alexprengere opened this issue Mar 12, 2025 · 5 comments

Comments

@alexprengere
Copy link

alexprengere commented Mar 12, 2025

Confirm this is an issue with the Python library and not an underlying OpenAI API

  • This is an issue with the Python library

Describe the bug

On the latest version of openai==1.66.2, I have this current code that works well:

import os
from openai import AzureOpenAI

client = AzureOpenAI(
    api_version=os.getenv("OPENAI_API_VERSION"),
    api_key=os.getenv("OPENAI_API_KEY"),
    azure_endpoint=os.getenv("OPENAI_AZURE_ENDPOINT"),
)

completions = client.chat.completions.create(
    model=os.getenv("OPENAI_AZURE_DEPLOYMENT"),
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "What is the capital of the United States?"},
    ],
)
print(completions.choices[0].message.content)
# returns 'The capital of the United States is Washington, D.C.'

I wanted to test the new responses API, so I followed the docs:

import os
from openai import AzureOpenAI

client = AzureOpenAI(
    api_version=os.getenv("OPENAI_API_VERSION"),
    api_key=os.getenv("OPENAI_API_KEY"),
    azure_endpoint=os.getenv("OPENAI_AZURE_ENDPOINT"),
)

response = client.responses.create(
    model=os.getenv("OPENAI_AZURE_DEPLOYMENT"),
    instructions="You are a coding assistant that talks like a pirate.",
    input="How do I check if a Python object is an instance of a class?",
)
print(response.output_text)

But this results in:

openai.NotFoundError: Error code: 404 - {'error': {'code': '404', 'message': 'Resource not found'}}

Am I missing something or is this just not supported yet? Note that the deployed model on Azure is GPT-4o.

To Reproduce

All information required is above.

Code snippets

OS

Fedora

Python version

Python3.10

Library version

openai==1.66.2

@alexprengere alexprengere added the bug Something isn't working label Mar 12, 2025
@kristapratico
Copy link
Contributor

@alexprengere Responses API is not supported on Azure yet. I can't share an ETA, but I expect support to come soon.

@RobertCraigie RobertCraigie removed the bug Something isn't working label Mar 12, 2025
@RobertCraigie RobertCraigie closed this as not planned Won't fix, can't repro, duplicate, stale Mar 12, 2025
@alexprengere
Copy link
Author

@RobertCraigie wouldn't it be better to keep this issue open until the feature lands? Or perhaps I misunderstood @kristapratico, and indeed this is "not planned".

@RobertCraigie
Copy link
Collaborator

Ah sorry, we tend to only keep issues open that are relevant to the SDK. If it's an API issue we'll close it.

@kristapratico is there a better place for people to track support for Responses in Azure?

@kristapratico
Copy link
Contributor

Responses API support is planned for Azure. I think the best place I can provide to track support is the "what's new" page on MS Learn: https://learn.microsoft.com/azure/ai-services/openai/whats-new

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants