NAME

OpenAPI::Client::OpenAI::Methods - Methods for OpenAI API

DESCRIPTION

Yes, this isn't perfect. But it's a start. The OpenAI API is complex and and the OpenAPI::Client module is a bit opaque at times. We'll add more later.

METHODS

addUploadPart

Adds a Part to an Upload object. A Part represents a chunk of bytes from the file you are trying to upload.

Each Part can be at most 64 MB, and you can add Parts until you hit the Upload maximum of 8 GB.

It is possible to add multiple Parts in parallel. You can decide the intended order of the Parts when you complete the Upload .

Parameters

upload_id

The ID of the Upload.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: upload_abc123

  • Enum: N/A

Request Body

The request body is complicated. See OpenAPI::Client::OpenAI::Schema for details.

archive-project

Archives a project in the organization. Archived projects cannot be used or updated.

Parameters

project_id

The ID of the project.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

cancelBatch

Cancels an in-progress batch. The batch will be in status cancelling for up to 10 minutes, before changing to cancelled, where it will have partial results (if any) available in the output file.

Parameters

batch_id

The ID of the batch to cancel.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

cancelFineTuningJob

Immediately cancel a fine-tune job.

Parameters

fine_tuning_job_id

The ID of the fine-tuning job to cancel.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: ft-AF1WoRqd3aJAHsqc9NY7iL8F

  • Enum: N/A

cancelRun

Cancels a run that is in_progress.

Parameters

thread_id

The ID of the thread to which this run belongs.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

run_id

The ID of the run to cancel.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

cancelUpload

Cancels the Upload. No Parts may be added after an Upload is cancelled.

Parameters

upload_id

The ID of the Upload.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: upload_abc123

  • Enum: N/A

cancelVectorStoreFileBatch

Cancel a vector store file batch. This attempts to cancel the processing of files in this batch as soon as possible.

Parameters

vector_store_id

The ID of the vector store that the file batch belongs to.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

batch_id

The ID of the file batch to cancel.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

completeUpload

Completes the Upload .

Within the returned Upload object, there is a nested File object that is ready to use in the rest of the platform.

You can specify the order of the Parts by passing in an ordered list of the Part IDs.

The number of bytes uploaded upon completion must match the number of bytes initially specified when creating the Upload object. No Parts may be added after an Upload is completed.

Parameters

upload_id

The ID of the Upload.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: upload_abc123

  • Enum: N/A

Request Body

The request body is complicated. See OpenAPI::Client::OpenAI::Schema for details.

create-project

Create a new project in the organization. Projects can be created and archived, but cannot be deleted.

This method does not take any path or URL parameters.

Request Body

The request body is complicated. See OpenAPI::Client::OpenAI::Schema for details.

create-project-service-account

Creates a new service account in the project. This also returns an unredacted API key for the service account.

Parameters

project_id

The ID of the project.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

Request Body

The request body is complicated. See OpenAPI::Client::OpenAI::Schema for details.

create-project-user

Adds a user to the project. Users must already be members of the organization to be added to a project.

Parameters

project_id

The ID of the project.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

Request Body

The request body is complicated. See OpenAPI::Client::OpenAI::Schema for details.

createAssistant

Create an assistant with a model and instructions.

This method does not take any path or URL parameters.

Request Body

The request body is complicated. See OpenAPI::Client::OpenAI::Schema for details.

createBatch

Creates and executes a batch from an uploaded file of requests

This method does not take any path or URL parameters.

Request Body

The request body is complicated. See OpenAPI::Client::OpenAI::Schema for details.

createChatCompletion

Creates a model response for the given chat conversation. =head3 Examples

See the following files in the distribution for examples:

  • examples/chat.pl

This method does not take any path or URL parameters.

Request Body

The request body is complicated. See OpenAPI::Client::OpenAI::Schema for details.

createCompletion

Creates a completion for the provided prompt and parameters. =head3 Examples

See the following files in the distribution for examples:

  • examples/translate.pl

This method does not take any path or URL parameters.

Request Body

The request body is complicated. See OpenAPI::Client::OpenAI::Schema for details.

createEmbedding

Creates an embedding vector representing the input text.

This method does not take any path or URL parameters.

Request Body

The request body is complicated. See OpenAPI::Client::OpenAI::Schema for details.

createFile

Upload a file that can be used across various endpoints. Individual files can be up to 512 MB, and the size of all files uploaded by one organization can be up to 100 GB.

The Assistants API supports files up to 2 million tokens and of specific file types. See the Assistants Tools guide for details.

The Fine-tuning API only supports .jsonl files. The input also has certain required formats for fine-tuning chat or completions models.

The Batch API only supports .jsonl files up to 100 MB in size. The input also has a specific required format.

Please contact us if you need to increase these storage limits.

This method does not take any path or URL parameters.

Request Body

The request body is complicated. See OpenAPI::Client::OpenAI::Schema for details.

createFineTuningJob

Creates a fine-tuning job which begins the process of creating a new model from a given dataset.

Response includes details of the enqueued job including job status and the name of the fine-tuned models once complete.

Learn more about fine-tuning

This method does not take any path or URL parameters.

Request Body

The request body is complicated. See OpenAPI::Client::OpenAI::Schema for details.

createImage

Creates an image given a prompt.

This method does not take any path or URL parameters.

Request Body

The request body is complicated. See OpenAPI::Client::OpenAI::Schema for details.

createImageEdit

Creates an edited or extended image given an original image and a prompt.

This method does not take any path or URL parameters.

Request Body

The request body is complicated. See OpenAPI::Client::OpenAI::Schema for details.

createImageVariation

Creates a variation of a given image.

This method does not take any path or URL parameters.

Request Body

The request body is complicated. See OpenAPI::Client::OpenAI::Schema for details.

createMessage

Create a message.

Parameters

thread_id

The ID of the thread to create a message for.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

Request Body

The request body is complicated. See OpenAPI::Client::OpenAI::Schema for details.

createModeration

Classifies if text is potentially harmful.

This method does not take any path or URL parameters.

Request Body

The request body is complicated. See OpenAPI::Client::OpenAI::Schema for details.

createRun

Create a run.

Parameters

thread_id

The ID of the thread to run.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

include[]

A list of additional fields to include in the response. Currently the only supported value is step_details.tool_calls[*].file_search.results[*].content to fetch the file search result content.

See the file search tool documentation for more information.

  • Type: array

  • In: query

  • Required: False

  • Default: N/A

  • Example: N/A

  • Enum: N/A

Request Body

The request body is complicated. See OpenAPI::Client::OpenAI::Schema for details.

createSpeech

Generates audio from the input text.

This method does not take any path or URL parameters.

Request Body

The request body is complicated. See OpenAPI::Client::OpenAI::Schema for details.

createThread

Create a thread.

This method does not take any path or URL parameters.

Request Body

The request body is complicated. See OpenAPI::Client::OpenAI::Schema for details.

createThreadAndRun

Create a thread and run it in one request.

This method does not take any path or URL parameters.

Request Body

The request body is complicated. See OpenAPI::Client::OpenAI::Schema for details.

createTranscription

Transcribes audio into the input language. =head3 Examples

See the following files in the distribution for examples:

  • examples/transcribe-audio.pl

This method does not take any path or URL parameters.

Request Body

The request body is complicated. See OpenAPI::Client::OpenAI::Schema for details.

createTranslation

Translates audio into English.

This method does not take any path or URL parameters.

Request Body

The request body is complicated. See OpenAPI::Client::OpenAI::Schema for details.

createUpload

Creates an intermediate Upload object that you can add Parts to. Currently, an Upload can accept at most 8 GB in total and expires after an hour after you create it.

Once you complete the Upload, we will create a File object that contains all the parts you uploaded. This File is usable in the rest of our platform as a regular File object.

For certain purposes, the correct mime_type must be specified. Please refer to documentation for the supported MIME types for your use case: - Assistants

For guidance on the proper filename extensions for each purpose, please follow the documentation on creating a File.

This method does not take any path or URL parameters.

Request Body

The request body is complicated. See OpenAPI::Client::OpenAI::Schema for details.

createVectorStore

Create a vector store.

This method does not take any path or URL parameters.

Request Body

The request body is complicated. See OpenAPI::Client::OpenAI::Schema for details.

createVectorStoreFile

Create a vector store file by attaching a File to a vector store.

Parameters

vector_store_id

The ID of the vector store for which to create a File.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: vs_abc123

  • Enum: N/A

Request Body

The request body is complicated. See OpenAPI::Client::OpenAI::Schema for details.

createVectorStoreFileBatch

Create a vector store file batch.

Parameters

vector_store_id

The ID of the vector store for which to create a File Batch.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: vs_abc123

  • Enum: N/A

Request Body

The request body is complicated. See OpenAPI::Client::OpenAI::Schema for details.

delete-invite

Delete an invite. If the invite has already been accepted, it cannot be deleted.

Parameters

invite_id

The ID of the invite to delete.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

delete-project-api-key

Deletes an API key from the project.

Parameters

project_id

The ID of the project.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

key_id

The ID of the API key.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

delete-project-service-account

Deletes a service account from the project.

Parameters

project_id

The ID of the project.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

service_account_id

The ID of the service account.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

delete-project-user

Deletes a user from the project.

Parameters

project_id

The ID of the project.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

user_id

The ID of the user.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

delete-user

Deletes a user from the organization.

Parameters

user_id

The ID of the user.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

deleteAssistant

Delete an assistant.

Parameters

assistant_id

The ID of the assistant to delete.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

deleteFile

Delete a file.

Parameters

file_id

The ID of the file to use for this request.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

deleteMessage

Deletes a message.

Parameters

thread_id

The ID of the thread to which this message belongs.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

message_id

The ID of the message to delete.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

deleteModel

Delete a fine-tuned model. You must have the Owner role in your organization to delete a model.

Parameters

model

The model to delete

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: ft:gpt-4o-mini:acemeco:suffix:abc123

  • Enum: N/A

deleteThread

Delete a thread.

Parameters

thread_id

The ID of the thread to delete.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

deleteVectorStore

Delete a vector store.

Parameters

vector_store_id

The ID of the vector store to delete.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

deleteVectorStoreFile

Delete a vector store file. This will remove the file from the vector store but the file itself will not be deleted. To delete the file, use the delete file endpoint.

Parameters

vector_store_id

The ID of the vector store that the file belongs to.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

file_id

The ID of the file to delete.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

downloadFile

Returns the contents of the specified file.

Parameters

file_id

The ID of the file to use for this request.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

getAssistant

Retrieves an assistant.

Parameters

assistant_id

The ID of the assistant to retrieve.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

getMessage

Retrieve a message.

Parameters

thread_id

The ID of the thread to which this message belongs.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

message_id

The ID of the message to retrieve.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

getRun

Retrieves a run.

Parameters

thread_id

The ID of the thread that was run.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

run_id

The ID of the run to retrieve.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

getRunStep

Retrieves a run step.

Parameters

thread_id

The ID of the thread to which the run and run step belongs.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

run_id

The ID of the run to which the run step belongs.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

step_id

The ID of the run step to retrieve.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

include[]

A list of additional fields to include in the response. Currently the only supported value is step_details.tool_calls[*].file_search.results[*].content to fetch the file search result content.

See the file search tool documentation for more information.

  • Type: array

  • In: query

  • Required: False

  • Default: N/A

  • Example: N/A

  • Enum: N/A

getThread

Retrieves a thread.

Parameters

thread_id

The ID of the thread to retrieve.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

getVectorStore

Retrieves a vector store.

Parameters

vector_store_id

The ID of the vector store to retrieve.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

getVectorStoreFile

Retrieves a vector store file.

Parameters

vector_store_id

The ID of the vector store that the file belongs to.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: vs_abc123

  • Enum: N/A

file_id

The ID of the file being retrieved.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: file-abc123

  • Enum: N/A

getVectorStoreFileBatch

Retrieves a vector store file batch.

Parameters

vector_store_id

The ID of the vector store that the file batch belongs to.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: vs_abc123

  • Enum: N/A

batch_id

The ID of the file batch being retrieved.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: vsfb_abc123

  • Enum: N/A

inviteUser

Create an invite for a user to the organization. The invite must be accepted by the user before they have access to the organization.

This method does not take any path or URL parameters.

Request Body

The request body is complicated. See OpenAPI::Client::OpenAI::Schema for details.

list-audit-logs

List user actions and configuration changes within this organization.

Parameters

effective_at

Return only events whose effective_at (Unix seconds) is in this range.

  • Type: object

  • In: query

  • Required: False

  • Default: N/A

  • Example: N/A

  • Enum: N/A

project_ids[]

Return only events for these projects.

  • Type: array

  • In: query

  • Required: False

  • Default: N/A

  • Example: N/A

  • Enum: N/A

event_types[]

Return only events with a type in one of these values. For example, project.created. For all options, see the documentation for the audit log object.

  • Type: array

  • In: query

  • Required: False

  • Default: N/A

  • Example: N/A

  • Enum: N/A

actor_ids[]

Return only events performed by these actors. Can be a user ID, a service account ID, or an api key tracking ID.

  • Type: array

  • In: query

  • Required: False

  • Default: N/A

  • Example: N/A

  • Enum: N/A

actor_emails[]

Return only events performed by users with these emails.

  • Type: array

  • In: query

  • Required: False

  • Default: N/A

  • Example: N/A

  • Enum: N/A

resource_ids[]

Return only events performed on these targets. For example, a project ID updated.

  • Type: array

  • In: query

  • Required: False

  • Default: N/A

  • Example: N/A

  • Enum: N/A

limit

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

  • Type: integer

  • In: query

  • Required: False

  • Default: 20

  • Example: N/A

  • Enum: N/A

after

A cursor for use in pagination. C is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with objIfoo in order to fetch the next page of the list.

  • Type: string

  • In: query

  • Required: False

  • Default: N/A

  • Example: N/A

  • Enum: N/A

before

A cursor for use in pagination. C is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with objIfoo in order to fetch the previous page of the list.

  • Type: string

  • In: query

  • Required: False

  • Default: N/A

  • Example: N/A

  • Enum: N/A

list-invites

Returns a list of invites in the organization.

Parameters

limit

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

  • Type: integer

  • In: query

  • Required: False

  • Default: 20

  • Example: N/A

  • Enum: N/A

after

A cursor for use in pagination. C is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with objIfoo in order to fetch the next page of the list.

  • Type: string

  • In: query

  • Required: False

  • Default: N/A

  • Example: N/A

  • Enum: N/A

list-project-api-keys

Returns a list of API keys in the project.

Parameters

project_id

The ID of the project.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

limit

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

  • Type: integer

  • In: query

  • Required: False

  • Default: 20

  • Example: N/A

  • Enum: N/A

after

A cursor for use in pagination. C is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with objIfoo in order to fetch the next page of the list.

  • Type: string

  • In: query

  • Required: False

  • Default: N/A

  • Example: N/A

  • Enum: N/A

list-project-service-accounts

Returns a list of service accounts in the project.

Parameters

project_id

The ID of the project.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

limit

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

  • Type: integer

  • In: query

  • Required: False

  • Default: 20

  • Example: N/A

  • Enum: N/A

after

A cursor for use in pagination. C is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with objIfoo in order to fetch the next page of the list.

  • Type: string

  • In: query

  • Required: False

  • Default: N/A

  • Example: N/A

  • Enum: N/A

list-project-users

Returns a list of users in the project.

Parameters

project_id

The ID of the project.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

limit

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

  • Type: integer

  • In: query

  • Required: False

  • Default: 20

  • Example: N/A

  • Enum: N/A

after

A cursor for use in pagination. C is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with objIfoo in order to fetch the next page of the list.

  • Type: string

  • In: query

  • Required: False

  • Default: N/A

  • Example: N/A

  • Enum: N/A

list-projects

Returns a list of projects.

Parameters

limit

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

  • Type: integer

  • In: query

  • Required: False

  • Default: 20

  • Example: N/A

  • Enum: N/A

after

A cursor for use in pagination. C is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with objIfoo in order to fetch the next page of the list.

  • Type: string

  • In: query

  • Required: False

  • Default: N/A

  • Example: N/A

  • Enum: N/A

include_archived

If true returns all projects including those that have been archived. Archived projects are not included by default.

  • Type: boolean

  • In: query

  • Required: False

  • Default: N/A

  • Example: N/A

  • Enum: N/A

list-users

Lists all of the users in the organization.

Parameters

limit

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

  • Type: integer

  • In: query

  • Required: False

  • Default: 20

  • Example: N/A

  • Enum: N/A

after

A cursor for use in pagination. C is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with objIfoo in order to fetch the next page of the list.

  • Type: string

  • In: query

  • Required: False

  • Default: N/A

  • Example: N/A

  • Enum: N/A

listAssistants

Returns a list of assistants.

Parameters

limit

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

  • Type: integer

  • In: query

  • Required: False

  • Default: 20

  • Example: N/A

  • Enum: N/A

order

Sort order by the C timestamp of the objects. C for ascending order and C for descending order.

  • Type: string

  • In: query

  • Required: False

  • Default: desc

  • Example: N/A

  • Enum: asc, desc

after

A cursor for use in pagination. C is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with objIfoo in order to fetch the next page of the list.

  • Type: string

  • In: query

  • Required: False

  • Default: N/A

  • Example: N/A

  • Enum: N/A

before

A cursor for use in pagination. C is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with objIfoo in order to fetch the previous page of the list.

  • Type: string

  • In: query

  • Required: False

  • Default: N/A

  • Example: N/A

  • Enum: N/A

listBatches

List your organization's batches.

Parameters

after

A cursor for use in pagination. C is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with objIfoo in order to fetch the next page of the list.

  • Type: string

  • In: query

  • Required: False

  • Default: N/A

  • Example: N/A

  • Enum: N/A

limit

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

  • Type: integer

  • In: query

  • Required: False

  • Default: 20

  • Example: N/A

  • Enum: N/A

listFiles

Returns a list of files that belong to the user's organization.

Parameters

purpose

Only return files with the given purpose.

  • Type: string

  • In: query

  • Required: False

  • Default: N/A

  • Example: N/A

  • Enum: N/A

listFilesInVectorStoreBatch

Returns a list of vector store files in a batch.

Parameters

vector_store_id

The ID of the vector store that the files belong to.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

batch_id

The ID of the file batch that the files belong to.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

limit

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

  • Type: integer

  • In: query

  • Required: False

  • Default: 20

  • Example: N/A

  • Enum: N/A

order

Sort order by the C timestamp of the objects. C for ascending order and C for descending order.

  • Type: string

  • In: query

  • Required: False

  • Default: desc

  • Example: N/A

  • Enum: asc, desc

after

A cursor for use in pagination. C is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with objIfoo in order to fetch the next page of the list.

  • Type: string

  • In: query

  • Required: False

  • Default: N/A

  • Example: N/A

  • Enum: N/A

before

A cursor for use in pagination. C is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with objIfoo in order to fetch the previous page of the list.

  • Type: string

  • In: query

  • Required: False

  • Default: N/A

  • Example: N/A

  • Enum: N/A

filter

Filter by file status. One of in_progress, completed, failed, cancelled.

  • Type: string

  • In: query

  • Required: False

  • Default: N/A

  • Example: N/A

  • Enum: in_progress, completed, failed, cancelled

listFineTuningEvents

Get status updates for a fine-tuning job.

Parameters

fine_tuning_job_id

The ID of the fine-tuning job to get events for.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: ft-AF1WoRqd3aJAHsqc9NY7iL8F

  • Enum: N/A

after

Identifier for the last event from the previous pagination request.

  • Type: string

  • In: query

  • Required: False

  • Default: N/A

  • Example: N/A

  • Enum: N/A

limit

Number of events to retrieve.

  • Type: integer

  • In: query

  • Required: False

  • Default: 20

  • Example: N/A

  • Enum: N/A

listFineTuningJobCheckpoints

List checkpoints for a fine-tuning job.

Parameters

fine_tuning_job_id

The ID of the fine-tuning job to get checkpoints for.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: ft-AF1WoRqd3aJAHsqc9NY7iL8F

  • Enum: N/A

after

Identifier for the last checkpoint ID from the previous pagination request.

  • Type: string

  • In: query

  • Required: False

  • Default: N/A

  • Example: N/A

  • Enum: N/A

limit

Number of checkpoints to retrieve.

  • Type: integer

  • In: query

  • Required: False

  • Default: 10

  • Example: N/A

  • Enum: N/A

listMessages

Returns a list of messages for a given thread.

Parameters

thread_id

The ID of the thread the messages belong to.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

limit

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

  • Type: integer

  • In: query

  • Required: False

  • Default: 20

  • Example: N/A

  • Enum: N/A

order

Sort order by the C timestamp of the objects. C for ascending order and C for descending order.

  • Type: string

  • In: query

  • Required: False

  • Default: desc

  • Example: N/A

  • Enum: asc, desc

after

A cursor for use in pagination. C is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with objIfoo in order to fetch the next page of the list.

  • Type: string

  • In: query

  • Required: False

  • Default: N/A

  • Example: N/A

  • Enum: N/A

before

A cursor for use in pagination. C is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with objIfoo in order to fetch the previous page of the list.

  • Type: string

  • In: query

  • Required: False

  • Default: N/A

  • Example: N/A

  • Enum: N/A

run_id

Filter messages by the run ID that generated them.

  • Type: string

  • In: query

  • Required: False

  • Default: N/A

  • Example: N/A

  • Enum: N/A

listModels

Lists the currently available models, and provides basic information about each one such as the owner and availability.

This method does not take any path or URL parameters.

listPaginatedFineTuningJobs

List your organization's fine-tuning jobs

Parameters

after

Identifier for the last job from the previous pagination request.

  • Type: string

  • In: query

  • Required: False

  • Default: N/A

  • Example: N/A

  • Enum: N/A

limit

Number of fine-tuning jobs to retrieve.

  • Type: integer

  • In: query

  • Required: False

  • Default: 20

  • Example: N/A

  • Enum: N/A

listRuns

Returns a list of runs belonging to a thread.

Parameters

thread_id

The ID of the thread the run belongs to.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

limit

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

  • Type: integer

  • In: query

  • Required: False

  • Default: 20

  • Example: N/A

  • Enum: N/A

order

Sort order by the C timestamp of the objects. C for ascending order and C for descending order.

  • Type: string

  • In: query

  • Required: False

  • Default: desc

  • Example: N/A

  • Enum: asc, desc

after

A cursor for use in pagination. C is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with objIfoo in order to fetch the next page of the list.

  • Type: string

  • In: query

  • Required: False

  • Default: N/A

  • Example: N/A

  • Enum: N/A

before

A cursor for use in pagination. C is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with objIfoo in order to fetch the previous page of the list.

  • Type: string

  • In: query

  • Required: False

  • Default: N/A

  • Example: N/A

  • Enum: N/A

listRunSteps

Returns a list of run steps belonging to a run.

Parameters

thread_id

The ID of the thread the run and run steps belong to.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

run_id

The ID of the run the run steps belong to.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

limit

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

  • Type: integer

  • In: query

  • Required: False

  • Default: 20

  • Example: N/A

  • Enum: N/A

order

Sort order by the C timestamp of the objects. C for ascending order and C for descending order.

  • Type: string

  • In: query

  • Required: False

  • Default: desc

  • Example: N/A

  • Enum: asc, desc

after

A cursor for use in pagination. C is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with objIfoo in order to fetch the next page of the list.

  • Type: string

  • In: query

  • Required: False

  • Default: N/A

  • Example: N/A

  • Enum: N/A

before

A cursor for use in pagination. C is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with objIfoo in order to fetch the previous page of the list.

  • Type: string

  • In: query

  • Required: False

  • Default: N/A

  • Example: N/A

  • Enum: N/A

include[]

A list of additional fields to include in the response. Currently the only supported value is step_details.tool_calls[*].file_search.results[*].content to fetch the file search result content.

See the file search tool documentation for more information.

  • Type: array

  • In: query

  • Required: False

  • Default: N/A

  • Example: N/A

  • Enum: N/A

listVectorStoreFiles

Returns a list of vector store files.

Parameters

vector_store_id

The ID of the vector store that the files belong to.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

limit

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

  • Type: integer

  • In: query

  • Required: False

  • Default: 20

  • Example: N/A

  • Enum: N/A

order

Sort order by the C timestamp of the objects. C for ascending order and C for descending order.

  • Type: string

  • In: query

  • Required: False

  • Default: desc

  • Example: N/A

  • Enum: asc, desc

after

A cursor for use in pagination. C is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with objIfoo in order to fetch the next page of the list.

  • Type: string

  • In: query

  • Required: False

  • Default: N/A

  • Example: N/A

  • Enum: N/A

before

A cursor for use in pagination. C is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with objIfoo in order to fetch the previous page of the list.

  • Type: string

  • In: query

  • Required: False

  • Default: N/A

  • Example: N/A

  • Enum: N/A

filter

Filter by file status. One of in_progress, completed, failed, cancelled.

  • Type: string

  • In: query

  • Required: False

  • Default: N/A

  • Example: N/A

  • Enum: in_progress, completed, failed, cancelled

listVectorStores

Returns a list of vector stores.

Parameters

limit

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

  • Type: integer

  • In: query

  • Required: False

  • Default: 20

  • Example: N/A

  • Enum: N/A

order

Sort order by the C timestamp of the objects. C for ascending order and C for descending order.

  • Type: string

  • In: query

  • Required: False

  • Default: desc

  • Example: N/A

  • Enum: asc, desc

after

A cursor for use in pagination. C is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with objIfoo in order to fetch the next page of the list.

  • Type: string

  • In: query

  • Required: False

  • Default: N/A

  • Example: N/A

  • Enum: N/A

before

A cursor for use in pagination. C is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with objIfoo in order to fetch the previous page of the list.

  • Type: string

  • In: query

  • Required: False

  • Default: N/A

  • Example: N/A

  • Enum: N/A

modify-project

Modifies a project in the organization.

This method does not take any path or URL parameters.

Request Body

The request body is complicated. See OpenAPI::Client::OpenAI::Schema for details.

modify-project-user

Modifies a user's role in the project.

This method does not take any path or URL parameters.

Request Body

The request body is complicated. See OpenAPI::Client::OpenAI::Schema for details.

modify-user

Modifies a user's role in the organization.

This method does not take any path or URL parameters.

Request Body

The request body is complicated. See OpenAPI::Client::OpenAI::Schema for details.

modifyAssistant

Modifies an assistant.

Parameters

assistant_id

The ID of the assistant to modify.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

Request Body

The request body is complicated. See OpenAPI::Client::OpenAI::Schema for details.

modifyMessage

Modifies a message.

Parameters

thread_id

The ID of the thread to which this message belongs.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

message_id

The ID of the message to modify.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

Request Body

The request body is complicated. See OpenAPI::Client::OpenAI::Schema for details.

modifyRun

Modifies a run.

Parameters

thread_id

The ID of the thread that was run.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

run_id

The ID of the run to modify.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

Request Body

The request body is complicated. See OpenAPI::Client::OpenAI::Schema for details.

modifyThread

Modifies a thread.

Parameters

thread_id

The ID of the thread to modify. Only the metadata can be modified.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

Request Body

The request body is complicated. See OpenAPI::Client::OpenAI::Schema for details.

modifyVectorStore

Modifies a vector store.

Parameters

vector_store_id

The ID of the vector store to modify.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

Request Body

The request body is complicated. See OpenAPI::Client::OpenAI::Schema for details.

retrieve-invite

Retrieves an invite.

Parameters

invite_id

The ID of the invite to retrieve.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

retrieve-project

Retrieves a project.

Parameters

project_id

The ID of the project.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

retrieve-project-api-key

Retrieves an API key in the project.

Parameters

project_id

The ID of the project.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

key_id

The ID of the API key.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

retrieve-project-service-account

Retrieves a service account in the project.

Parameters

project_id

The ID of the project.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

service_account_id

The ID of the service account.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

retrieve-project-user

Retrieves a user in the project.

Parameters

project_id

The ID of the project.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

user_id

The ID of the user.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

retrieve-user

Retrieves a user by their identifier.

Parameters

user_id

The ID of the user.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

retrieveBatch

Retrieves a batch.

Parameters

batch_id

The ID of the batch to retrieve.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

retrieveFile

Returns information about a specific file.

Parameters

file_id

The ID of the file to use for this request.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

retrieveFineTuningJob

Get info about a fine-tuning job.

Learn more about fine-tuning

Parameters

fine_tuning_job_id

The ID of the fine-tuning job.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: ft-AF1WoRqd3aJAHsqc9NY7iL8F

  • Enum: N/A

retrieveModel

Retrieves a model instance, providing basic information about the model such as the owner and permissioning.

Parameters

model

The ID of the model to use for this request

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: gpt-4o-mini

  • Enum: N/A

submitToolOuputsToRun

When a run has the status: "requires_action" and required_action.type is submit_tool_outputs, this endpoint can be used to submit the outputs from the tool calls once they're all completed. All outputs must be submitted in a single request.

Parameters

thread_id

The ID of the thread to which this run belongs.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

run_id

The ID of the run that requires the tool output submission.

  • Type: string

  • In: path

  • Required: True

  • Default: N/A

  • Example: N/A

  • Enum: N/A

Request Body

The request body is complicated. See OpenAPI::Client::OpenAI::Schema for details.

COPYRIGHT AND LICENSE

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