Skip to content

Azure OpenAI missing edits endpoint for gpt-image-1 #2608

@IBakh-Tea

Description

@IBakh-Tea

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

The AzureOpenAI client has an endpoint for /images/generations but does not contain an endpoint for '/images/edits'.
This causes a 404 error when attempting to call the edits endpoint with an AzureOpenAI client.

To Reproduce

from openai import AzureOpenAI
client = AzureOpenAI(
    api_version=config.OPENAI_API_VERSION,
    api_key=config.AZURE_OPENAI_API_KEY,
    azure_endpoint=config.AZURE_OPENAI_ENDPOINT
)
...
response = client.images.edit(
    model="gpt-image-1",
    prompt=prompt,
    image=image_bytes,
    size=config.IMAGE_SIZE,
    quality=config.IMAGE_QUALITY,
    n=config.IMAGE_COUNT,
    output_format="png",
    output_compression=100,
)

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

Code snippets

OS

Windows

Python version

3.12

Library version

1.105.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Azurefor issues relating to the Azure OpenAI servicebugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions