NAME
OpenAPI::Client::OpenAI::Path::responses - Documentation for the /responses path.
OPERATIONS
POST /responses
createResponse
$client->create_response({
body => { ... },
});
Creates a model response. Provide text or image inputs to generate text or JSON outputs. Have the model call your own custom code or use built-in tools like web search or file search to use your own data as input for the model's response.
Request body
Content-Type: application/json
Example:
{
"completed_at" : 1741476543,
"created_at" : 1741476542,
"error" : null,
"id" : "resp_67ccd2bed1ec8190b14f964abc0542670bb6a6b452d3795b",
"incomplete_details" : null,
"instructions" : null,
"max_output_tokens" : null,
"metadata" : {},
"model" : "gpt-5.4",
"object" : "response",
"output" : [
{
"content" : [
{
"annotations" : [],
"text" : "In a peaceful grove beneath a silver moon, a unicorn named Lumina discovered a hidden pool that reflected the stars. As she dipped her horn into the water, the pool began to shimmer, revealing a pathway to a magical realm of endless night skies. Filled with wonder, Lumina whispered a wish for all who dream to find their own hidden magic, and as she glanced back, her hoofprints sparkled like stardust.",
"type" : "output_text"
}
],
"id" : "msg_67ccd2bf17f0819081ff3bb2cf6508e60bb6a6b452d3795b",
"role" : "assistant",
"status" : "completed",
"type" : "message"
}
],
"parallel_tool_calls" : true,
"previous_response_id" : null,
"reasoning" : {
"effort" : null,
"summary" : null
},
"status" : "completed",
"store" : true,
"temperature" : 1,
"text" : {
"format" : {
"type" : "text"
}
},
"tool_choice" : "auto",
"tools" : [],
"top_p" : 1,
"truncation" : "disabled",
"usage" : {
"input_tokens" : 36,
"input_tokens_details" : {
"cached_tokens" : 0
},
"output_tokens" : 87,
"output_tokens_details" : {
"reasoning_tokens" : 0
},
"total_tokens" : 123
},
"user" : null
}
Responses
200 - OK
Content-Type: application/json
Example:
{
"completed_at" : 1741476543,
"created_at" : 1741476542,
"error" : null,
"id" : "resp_67ccd2bed1ec8190b14f964abc0542670bb6a6b452d3795b",
"incomplete_details" : null,
"instructions" : null,
"max_output_tokens" : null,
"metadata" : {},
"model" : "gpt-5.4",
"object" : "response",
"output" : [
{
"content" : [
{
"annotations" : [],
"text" : "In a peaceful grove beneath a silver moon, a unicorn named Lumina discovered a hidden pool that reflected the stars. As she dipped her horn into the water, the pool began to shimmer, revealing a pathway to a magical realm of endless night skies. Filled with wonder, Lumina whispered a wish for all who dream to find their own hidden magic, and as she glanced back, her hoofprints sparkled like stardust.",
"type" : "output_text"
}
],
"id" : "msg_67ccd2bf17f0819081ff3bb2cf6508e60bb6a6b452d3795b",
"role" : "assistant",
"status" : "completed",
"type" : "message"
}
],
"parallel_tool_calls" : true,
"previous_response_id" : null,
"reasoning" : {
"effort" : null,
"summary" : null
},
"status" : "completed",
"store" : true,
"temperature" : 1,
"text" : {
"format" : {
"type" : "text"
}
},
"tool_choice" : "auto",
"tools" : [],
"top_p" : 1,
"truncation" : "disabled",
"usage" : {
"input_tokens" : 36,
"input_tokens_details" : {
"cached_tokens" : 0
},
"output_tokens" : 87,
"output_tokens_details" : {
"reasoning_tokens" : 0
},
"total_tokens" : 123
},
"user" : null
}
Content-Type: text/event-stream
Example:
{
"completed_at" : 1741476543,
"created_at" : 1741476542,
"error" : null,
"id" : "resp_67ccd2bed1ec8190b14f964abc0542670bb6a6b452d3795b",
"incomplete_details" : null,
"instructions" : null,
"max_output_tokens" : null,
"metadata" : {},
"model" : "gpt-5.4",
"object" : "response",
"output" : [
{
"content" : [
{
"annotations" : [],
"text" : "In a peaceful grove beneath a silver moon, a unicorn named Lumina discovered a hidden pool that reflected the stars. As she dipped her horn into the water, the pool began to shimmer, revealing a pathway to a magical realm of endless night skies. Filled with wonder, Lumina whispered a wish for all who dream to find their own hidden magic, and as she glanced back, her hoofprints sparkled like stardust.",
"type" : "output_text"
}
],
"id" : "msg_67ccd2bf17f0819081ff3bb2cf6508e60bb6a6b452d3795b",
"role" : "assistant",
"status" : "completed",
"type" : "message"
}
],
"parallel_tool_calls" : true,
"previous_response_id" : null,
"reasoning" : {
"effort" : null,
"summary" : null
},
"status" : "completed",
"store" : true,
"temperature" : 1,
"text" : {
"format" : {
"type" : "text"
}
},
"tool_choice" : "auto",
"tools" : [],
"top_p" : 1,
"truncation" : "disabled",
"usage" : {
"input_tokens" : 36,
"input_tokens_details" : {
"cached_tokens" : 0
},
"output_tokens" : 87,
"output_tokens_details" : {
"reasoning_tokens" : 0
},
"total_tokens" : 123
},
"user" : null
}
SCHEMAS
CreateResponse
See https://platform.openai.com/docs/api-reference for details.
Response
See https://platform.openai.com/docs/api-reference for details.
ResponseStreamEvent
See https://platform.openai.com/docs/api-reference for details.
SEE ALSO
COPYRIGHT AND LICENSE
Copyright (C) 2023-2026 by Nelson Ferraz
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.14.0 or, at your option, any later version of Perl 5 you may have available.