Hello everyone,
I have been able to set up my Codex CLI tool (for the codex-mini model) by following the steps respectively, however i had to map my AZURE_OPENAI_API_KEY to the OPENAI_API_KEY (by adding this line inside the WSL env. OPENAI_API_KEY=AZURE_OPENAI_API_KEY) for it to authenticate me and successfully run as a CLI tool.
Im trying now to use that model in one of my endpoints in my asp dot net Core web app, i have installed the recent OpenAI nuget package and used the OpenAI.Responses module, however im having a hard time doing the mapping step again, i saw in the docs that you are supposed to do it this way as attached in the snippet, but that didnt quite work because the OPENAI_API_KEY was empty since it didnt get mapped properly in the web app. Is there a way i can map it?
And let me know if i can use the “codex-mini” model in the web app at first.
using System;
using OpenAI.Responses;
OpenAIResponseClient client = new(
model: "gpt-4.1",
apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
);
OpenAIResponse response = client.CreateResponse("Tell me a three sentence bedtime story about a unicorn.");
Console.WriteLine(response.GetOutputText());
EDIT: i just tried another response API model and im having the same issue