=encoding utf8

=head1 NAME

OpenAPI::Client::OpenAI::Path::responses - Documentation for the /responses path.

=head1 OPERATIONS

=head2 POST /responses

=head3 createResponse

  $client->create_response({
      body => { ... },
  });

Creates a model response. Provide
L<text|https://platform.openai.com/docs/guides/text> or
L<image|https://platform.openai.com/docs/guides/images> inputs to generate
L<text|https://platform.openai.com/docs/guides/text> or
L<JSON|https://platform.openai.com/docs/guides/structured-outputs> outputs.
Have the model call your own
L<custom code|https://platform.openai.com/docs/guides/function-calling> or use
built-in L<tools|https://platform.openai.com/docs/guides/tools> like
L<web search|https://platform.openai.com/docs/guides/tools-web-search> or
L<file search|https://platform.openai.com/docs/guides/tools-file-search> to
use your own data as input for the model's response.

=head4 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
    }

=head4 Responses

B<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
    }

=head1 SCHEMAS

=head2 CreateResponse

See L<https://platform.openai.com/docs/api-reference> for details.

=head2 Response

See L<https://platform.openai.com/docs/api-reference> for details.

=head2 ResponseStreamEvent

See L<https://platform.openai.com/docs/api-reference> for details.

=head1 SEE ALSO

L<OpenAPI::Client::OpenAI::Path>

=head1 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.

=cut
