We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0be768a commit f68f162Copy full SHA for f68f162
docs/overview/responses/developer_quickstart.cs
@@ -0,0 +1,15 @@
1
+// SAMPLE: Generate text from a simple prompt through Responses API
2
+// PAGE: https://platform.openai.com/docs/overview
3
+// GUIDANCE: Instructions to run this code: https://aka.ms/oai/net/start
4
+#pragma warning disable OPENAI001
5
+
6
+#:package OpenAI@2.*
7
+#:property PublishAot=false
8
9
+using OpenAI.Responses;
10
11
+string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!;
12
+OpenAIResponseClient client = new(model: "gpt-5", apiKey: key);
13
+OpenAIResponse response = client.CreateResponse("Write a short bedtime story about a unicorn.");
14
15
+Console.WriteLine(response.GetOutputText());
0 commit comments