An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
Here is the analysis based on your inputs.
Region Availability
GPT-5 is currently supported for global standard deployment for East US 2 and Sweden central Global Standard and Data zone deployment.
Endpoint format
The endpoint used in your code is using v1/chat completion and not using api version too
$endpoint = "https://sagul-me43r8sb-swedencentral.services.ai.azure.com/v1/chat/completions"
As per documentation
Suggested syntax for text chat completion is as below
POST https://{resource}.services.ai.azure.com/models/chat/completions?api-version=2024-05-01-preview
{
"modalities": [
"text"
],
"messages": [
{
"role": "system",
"content": "You are a helpful assistant"
},
"role": "user",
"content": "Explain Riemann's conjecture"
}
"frequency_penalty": 0,
"presence_penalty": 0,
"temperature": 0,
"top_p": 0,
"seed": 21,
"model": "my-model-name"
}]
Correct Usage in Azure OpenAI SDK
import os
import base64
from openai import AzureOpenAI
endpoint = os.getenv("ENDPOINT_URL", "https://<yourazureopaniname>.openai.azure.com/") deployment = os.getenv("DEPLOYMENT_NAME", "gpt-5")
subscription_key = os.getenv("AZURE_OPENAI_API_KEY", "REPLACE_WITH_YOUR_KEY_VALUE_HERE")
# Initialize Azure OpenAI client with key-based authentication
client = AzureOpenAI(
azure_endpoint=endpoint,
api_key=subscription_key,
api_version="2025-01-01-preview",
)
# IMAGE_PATH = "YOUR_IMAGE_PATH"
# encoded_image = base64.b64encode(open(IMAGE_PATH, 'rb').read()).decode('ascii')
# Prepare the chat prompt
chat_prompt = [
{
"role": "developer",
"content": [
{
"type": "text",
"text": "You are an AI assistant that helps people find information."
}
]
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "How would earth look to aliens."
}
]
}
]
# Include speech result if speech is enabled
messages = chat_prompt
# Generate the completion
completion = client.chat.completions.create(
model=deployment,
messages=messages,
max_completion_tokens=16384,
stop=None,
stream=False
)
print(completion.to_json())
Ask
Could you also confirm that
You had O3 access prior or GPT 5 image access through Gated form already.
Thank you