Skip to content

Azure AI Inference SDK fails to complete chat completion with gpt-4.1 #40539

Open
@charendt

Description

@charendt
  • Package Name: azure-ai-inference
  • Package Version: 1.0.0b9
  • Operating System: Windows 11
  • Python Version: 3.12.9

Describe the bug
Chat completion request fails with

ERROR:
JSONDecodeError: Expecting value: line 1 column 1 (char 0)

To Reproduce
Steps to reproduce the behavior:

client = ChatCompletionsClient(
    endpoint=endpoint,
    credential=AzureKeyCredential(os.getenv("AZURE_OPENAI_API_KEY"))    
)

response = client.complete(
    messages=[
        SystemMessage(content="You are a helpful assistant."),
        UserMessage(content="Where is Zurich?")
    ],
    model="gpt-4.1"
)

Expected behavior
Return the chat completion result

Screenshots
n/a

Additional context
This works fine with any other AOAI model, it only fails with gpt-4.1

Metadata

Metadata

Assignees

Labels

AI Model InferenceIssues related to the client library for Azure AI Model Inference (\sdk\ai\azure-ai-inference)Service AttentionWorkflow: This issue is responsible by Azure service team.customer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions