Skip to content

Commit f68f162

Browse files
authored
Add code samples for the overview page (#685)
* Add developer quickstart sample * Update header of the sample code * Update the folder structure
1 parent 0be768a commit f68f162

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)