Skip to content

Commit 86f5c71

Browse files
authored
docs: clarify Azure Realtime GA endpoint configuration (#2440)
1 parent 2531843 commit 86f5c71

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

docs/realtime/guide.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,3 +199,17 @@ This gives you direct access to the [`RealtimeModel`][agents.realtime.model.Real
199199
## Examples
200200

201201
For complete working examples, check out the [examples/realtime directory](https://github.com/openai/openai-agents-python/tree/main/examples/realtime) which includes demos with and without UI components.
202+
203+
## Azure OpenAI endpoint format
204+
205+
When connecting to Azure OpenAI, use the GA Realtime endpoint format and pass credentials via
206+
headers in `model_config`:
207+
208+
```python
209+
model_config = {
210+
"url": "wss://<your-resource>.openai.azure.com/openai/v1/realtime?model=<deployment-name>",
211+
"headers": {"api-key": "<your-azure-api-key>"},
212+
}
213+
```
214+
215+
For token-based auth, use `{"authorization": f"Bearer {token}"}` in `headers`.

docs/realtime/quickstart.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,3 +226,31 @@ Or pass it directly when creating the session:
226226
```python
227227
session = await runner.run(model_config={"api_key": "your-api-key"})
228228
```
229+
230+
## Azure OpenAI endpoint format
231+
232+
If you connect to Azure OpenAI instead of OpenAI's default endpoint, pass a GA Realtime URL in
233+
`model_config["url"]` and set auth headers explicitly.
234+
235+
```python
236+
session = await runner.run(
237+
model_config={
238+
"url": "wss://<your-resource>.openai.azure.com/openai/v1/realtime?model=<deployment-name>",
239+
"headers": {"api-key": "<your-azure-api-key>"},
240+
}
241+
)
242+
```
243+
244+
You can also use a bearer token:
245+
246+
```python
247+
session = await runner.run(
248+
model_config={
249+
"url": "wss://<your-resource>.openai.azure.com/openai/v1/realtime?model=<deployment-name>",
250+
"headers": {"authorization": f"Bearer {token}"},
251+
}
252+
)
253+
```
254+
255+
Avoid using the legacy beta path (`/openai/realtime?api-version=...`) with realtime agents. The
256+
SDK expects the GA Realtime interface.

0 commit comments

Comments
 (0)