Files
agent-framework/dotnet/samples/GettingStarted/AgentWithOpenAI
T
Alexander Zarei 2f0b2db12a fix: Standardize OpenAI API key environment variable naming (#1001) (#2629)
- Replace OPENAI_APIKEY with OPENAI_API_KEY across all samples
- Replace AZURE_FOUNDRY_OPENAI_APIKEY with AZURE_FOUNDRY_OPENAI_API_KEY
- Ensures consistency with OpenAI's standard naming convention
- Applies to .NET and Python samples

Fixes #1001

Co-authored-by: Alexander Zarei <alzarei@users.noreply.github.com>
2f0b2db12a ยท 2025-12-10 10:33:35 +00:00
History
..

Agent Framework with OpenAI

These samples show how to use the Agent Framework with the OpenAI exchange types.

By default, the .Net version of Agent Framework uses the Microsoft.Extensions.AI.Abstractions exchange types.

For developers who are using the OpenAI SDK this can be problematic because there are conflicting exchange types which can cause confusion.

Agent Framework provides additional support to allow OpenAI developers to use the OpenAI exchange types.

Sample Description
Creating an AIAgent This sample demonstrates how to create and run a basic agent with native OpenAI SDK types. Shows both regular and streaming invocation of the agent.
Using Reasoning Capabilities This sample demonstrates how to create an AI agent with reasoning capabilities using OpenAI's reasoning models and response types.
Creating an Agent from a ChatClient This sample demonstrates how to create an AI agent directly from an OpenAI.Chat.ChatClient instance using OpenAIChatClientAgent.
Creating an Agent from an OpenAIResponseClient This sample demonstrates how to create an AI agent directly from an OpenAI.Responses.OpenAIResponseClient instance using OpenAIResponseClientAgent.