NAME

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

DESCRIPTION

This document describes the API endpoint at /threads.

PATHS

POST /threads

Create a thread.

Operation ID

createThread

$client->createThread( ... );

Parameters

Request Body

Content Type: application/json

Options to create a new thread. If no thread is provided when running a 
request, an empty thread will be created.

Example:

{
   "messages" : [
      {
         "attachments" : [
            {
               "tools" : [
                  null
               ]
            }
         ]
      }
   ],
   "tool_resources" : {
      "code_interpreter" : {
         "file_ids" : [
            null
         ]
      },
      "file_search" : {
         "vector_store_ids" : [
            null
         ],
         "vector_stores" : [
            {
               "file_ids" : [
                  null
               ]
            }
         ]
      }
   }
}


         

Responses

Status Code: 200

OK

Content Types:

  • application/json

    Example (See the OpenAI spec for more detail):

    {
      "id": "thread_abc123",
      "object": "thread",
      "created_at": 1698107661,
      "metadata": {}
    }

SEE ALSO

OpenAPI::Client::OpenAI::Path

COPYRIGHT AND LICENSE

Copyright (C) 2023-2025 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.