1
2
3
4
5
6
7
curl https://api.openai.com/v1/responses \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-d '{
"model": "gpt-5.5",
"input": "Write a short bedtime story about a unicorn."
}'
1
2
3
4
5
6
7
8
9
import OpenAI from "openai";
const client = new OpenAI();
const response = await client.responses.create({
model: "gpt-5.5",
input: "Write a short bedtime story about a unicorn.",
});
console.log(response.output_text);
1
2
3
4
5
6
7
8
9
from openai import OpenAI
client = OpenAI()
response = client.responses.create(
model="gpt-5.5",
input="Write a short bedtime story about a unicorn."
)
print(response.output_text)
1
2
3
4
5
6
7
8
9
10
using OpenAI.Responses;
string apiKey = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!;
var client = new OpenAIResponseClient(model: "gpt-5.5", apiKey: apiKey);
OpenAIResponse response = client.CreateResponse(
"Write a short bedtime story about a unicorn."
);
Console.WriteLine(response.GetOutputText());
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.responses.Response;
import com.openai.models.responses.ResponseCreateParams;
public class Main {
public static void main(String[] args) {
OpenAIClient client = OpenAIOkHttpClient.fromEnv();
ResponseCreateParams params = ResponseCreateParams.builder()
.model("gpt-5.5")
.input("Write a short bedtime story about a unicorn.")
.build();
Response response = client.responses().create(params);
System.out.println(response.outputText());
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package main
import (
"context"
"fmt"
"github.com/openai/openai-go/v3"
"github.com/openai/openai-go/v3/responses"
)
func main() {
client := openai.NewClient()
response, err := client.Responses.New(context.Background(), openai.ResponseNewParams{
Model: "gpt-5.5",
Input: responses.ResponseNewParamsInputUnion{
OfString: openai.String("Write a short bedtime story about a unicorn."),
},
})
if err != nil {
panic(err)
}
fmt.Println(response.OutputText())
}
1
2
3
4
5
6
7
8
9
10
require "openai"
openai = OpenAI::Client.new
response = openai.responses.create(
model: "gpt-5.5",
input: "Write a short bedtime story about a unicorn."
)
puts(response.output_text)
1
2
3
4
5
openai responses create \
--model gpt-5.5 \
--input "Write a short bedtime story about a unicorn." \
--raw-output \
--transform 'output.#(type=="message").content.0.text'