OpenAPI::Client::OpenAI::Methods(3)

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 <https://platform.openai.com/docs/api-reference/uploads/object> 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 <https://platform.openai.com/docs/api-reference/uploads/complete> .

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::Path for details.

  admin-api-keys-create
Create an organization admin API key

This method does not take any path or URL parameters.

Request Body

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

  admin-api-keys-delete
Delete an organization admin API key

Parameters

key_id

•   Type: string

•   In: path

•   Required: True

•   Default: N/A

•   Example: N/A

•   Enum: N/A

  admin-api-keys-get
Retrieve a single organization API key

Parameters

key_id

•   Type: string

•   In: path

•   Required: True

•   Default: N/A

•   Example: N/A

•   Enum: N/A

  admin-api-keys-list
List organization API keys

Parameters

after

•   Type: string

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

order

•   Type: string

•   In: query

•   Required: False

•   Default: asc

•   Example: N/A

•   Enum: asc, desc

limit

•   Type: integer

•   In: query

•   Required: False

•   Default: 20

•   Example: N/A

•   Enum: N/A

  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 <https://platform.openai.com/docs/api-reference/uploads/object> .

Within the returned Upload object, there is a nested File <https://platform.openai.com/docs/api-reference/files/object> 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::Path 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::Path 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::Path 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::Path for details.

  create-realtime-session
Create an ephemeral API token for use in client-side applications with the Realtime API. Can be configured with the same session parameters as the "session.update" client event.

It responds with a session object, plus a "client_secret" key which contains a usable ephemeral API token that can be used to authenticate browser clients for the Realtime API.

This method does not take any path or URL parameters.

Request Body

The request body is complicated. See OpenAPI::Client::OpenAI::Path 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::Path 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::Path for details.

  createChatCompletion
Creates a model response for the given chat conversation. Learn more in the text generation <https://platform.openai.com/docs/guides/text-generation>, vision <https://platform.openai.com/docs/guides/vision>, and audio <https://platform.openai.com/docs/guides/audio> guides.

Parameter support can differ depending on the model used to generate the response, particularly for newer reasoning models. Parameters that are only supported for reasoning models are noted below. For the current state of unsupported parameters in reasoning models, refer to the reasoning guide <https://platform.openai.com/docs/guides/reasoning>. =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::Path 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::Path for details.

  createEmbedding
Creates an embedding vector representing the input text. =head3 Examples

See the following files in the distribution for examples:

•   examples/get-embeddings.pl

This method does not take any path or URL parameters.

Request Body

The request body is complicated. See OpenAPI::Client::OpenAI::Path 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 <https://platform.openai.com/docs/assistants/tools> 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 200 MB in size. The input also has a specific required format.

Please contact us <https://help.openai.com/> 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::Path 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 <https://platform.openai.com/docs/guides/fine-tuning>

This method does not take any path or URL parameters.

Request Body

The request body is complicated. See OpenAPI::Client::OpenAI::Path 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::Path 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::Path 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::Path for details.

  createMessage
Create a message.

Parameters

thread_id

The ID of the thread <https://platform.openai.com/docs/api-reference/threads> 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::Path for details.

  createModeration
Classifies if text and/or image inputs are potentially harmful. Learn more in the moderation guide <https://platform.openai.com/docs/guides/moderation>.

This method does not take any path or URL parameters.

Request Body

The request body is complicated. See OpenAPI::Client::OpenAI::Path 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::Path 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::Path 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::Path 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::Path 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::Path 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::Path for details.

  createUpload
Creates an intermediate Upload <https://platform.openai.com/docs/api-reference/uploads/object> 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 <https://platform.openai.com/docs/api-reference/files/object> 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 "purpose"s, 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 <https://platform.openai.com/docs/api-reference/files/create>.

This method does not take any path or URL parameters.

Request Body

The request body is complicated. See OpenAPI::Client::OpenAI::Path 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::Path for details.

  createVectorStoreFile
Create a vector store file by attaching a File <https://platform.openai.com/docs/api-reference/files> 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::Path 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::Path 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 <https://platform.openai.com/docs/api-reference/files/delete> 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 <https://platform.openai.com/docs/api-reference/threads> 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 <https://platform.openai.com/docs/api-reference/threads> 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::Path 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 <https://platform.openai.com/docs/api-reference/audit-logs/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. "after" 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 objfoo, your subsequent call can include after=objfoo 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. "before" is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with objfoo, your subsequent call can include before=objfoo 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. "after" 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 objfoo, your subsequent call can include after=objfoo 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. "after" 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 objfoo, your subsequent call can include after=objfoo 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-rate-limits
Returns the rate limits per model for 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

limit

A limit on the number of objects to be returned. The default is 100.

•   Type: integer

•   In: query

•   Required: False

•   Default: 100

•   Example: N/A

•   Enum: N/A

after

A cursor for use in pagination. "after" 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 objfoo, your subsequent call can include after=objfoo 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. "before" is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, beginning with objfoo, your subsequent call can include before=objfoo 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-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. "after" 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 objfoo, your subsequent call can include after=objfoo 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. "after" 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 objfoo, your subsequent call can include after=objfoo 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. "after" 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 objfoo, your subsequent call can include after=objfoo 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. "after" 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 objfoo, your subsequent call can include after=objfoo 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

emails

Filter by the email address of users.

•   Type: array

•   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 "created_at" timestamp of the objects. "asc" for ascending order and "desc" for descending order.

•   Type: string

•   In: query

•   Required: False

•   Default: desc

•   Example: N/A

•   Enum: asc, desc

after

A cursor for use in pagination. "after" 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 objfoo, your subsequent call can include after=objfoo 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. "before" is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with objfoo, your subsequent call can include before=objfoo 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. "after" 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 objfoo, your subsequent call can include after=objfoo 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.

Parameters

purpose

Only return files with the given purpose.

•   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 10,000, and the default is 10,000.

•   Type: integer

•   In: query

•   Required: False

•   Default: 10000

•   Example: N/A

•   Enum: N/A

order

Sort order by the "created_at" timestamp of the objects. "asc" for ascending order and "desc" for descending order.

•   Type: string

•   In: query

•   Required: False

•   Default: desc

•   Example: N/A

•   Enum: asc, desc

after

A cursor for use in pagination. "after" 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 objfoo, your subsequent call can include after=objfoo 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

  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 "created_at" timestamp of the objects. "asc" for ascending order and "desc" for descending order.

•   Type: string

•   In: query

•   Required: False

•   Default: desc

•   Example: N/A

•   Enum: asc, desc

after

A cursor for use in pagination. "after" 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 objfoo, your subsequent call can include after=objfoo 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. "before" is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with objfoo, your subsequent call can include before=objfoo 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 <https://platform.openai.com/docs/api-reference/threads> 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 "created_at" timestamp of the objects. "asc" for ascending order and "desc" for descending order.

•   Type: string

•   In: query

•   Required: False

•   Default: desc

•   Example: N/A

•   Enum: asc, desc

after

A cursor for use in pagination. "after" 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 objfoo, your subsequent call can include after=objfoo 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. "before" is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with objfoo, your subsequent call can include before=objfoo 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 "created_at" timestamp of the objects. "asc" for ascending order and "desc" for descending order.

•   Type: string

•   In: query

•   Required: False

•   Default: desc

•   Example: N/A

•   Enum: asc, desc

after

A cursor for use in pagination. "after" 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 objfoo, your subsequent call can include after=objfoo 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. "before" is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with objfoo, your subsequent call can include before=objfoo 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 "created_at" timestamp of the objects. "asc" for ascending order and "desc" for descending order.

•   Type: string

•   In: query

•   Required: False

•   Default: desc

•   Example: N/A

•   Enum: asc, desc

after

A cursor for use in pagination. "after" 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 objfoo, your subsequent call can include after=objfoo 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. "before" is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with objfoo, your subsequent call can include before=objfoo 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 "created_at" timestamp of the objects. "asc" for ascending order and "desc" for descending order.

•   Type: string

•   In: query

•   Required: False

•   Default: desc

•   Example: N/A

•   Enum: asc, desc

after

A cursor for use in pagination. "after" 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 objfoo, your subsequent call can include after=objfoo 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. "before" is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with objfoo, your subsequent call can include before=objfoo 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 "created_at" timestamp of the objects. "asc" for ascending order and "desc" for descending order.

•   Type: string

•   In: query

•   Required: False

•   Default: desc

•   Example: N/A

•   Enum: asc, desc

after

A cursor for use in pagination. "after" 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 objfoo, your subsequent call can include after=objfoo 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. "before" is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with objfoo, your subsequent call can include before=objfoo 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.

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::Path for details.

  modify-project-user
Modifies a user's role 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

Request Body

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

  modify-user
Modifies a user's role in 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

Request Body

The request body is complicated. See OpenAPI::Client::OpenAI::Path 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::Path 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::Path for details.

  modifyRun
Modifies a run.

Parameters

thread_id

The ID of the thread <https://platform.openai.com/docs/api-reference/threads> 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::Path 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::Path 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::Path 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 <https://platform.openai.com/docs/guides/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 <https://platform.openai.com/docs/api-reference/threads> 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::Path for details.

  update-project-rate-limits
Updates a project rate limit.

Parameters

project_id

The ID of the project.

•   Type: string

•   In: path

•   Required: True

•   Default: N/A

•   Example: N/A

•   Enum: N/A

rate_limit_id

The ID of the rate limit.

•   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::Path for details.

  usage-audio-speeches
Get audio speeches usage details for the organization.

Parameters

start_time

Start time (Unix seconds) of the query time range, inclusive.

•   Type: integer

•   In: query

•   Required: True

•   Default: N/A

•   Example: N/A

•   Enum: N/A

end_time

End time (Unix seconds) of the query time range, exclusive.

•   Type: integer

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

bucket_width

Width of each time bucket in response. Currently "1m", "1h" and "1d" are supported, default to "1d".

•   Type: string

•   In: query

•   Required: False

•   Default: 1d

•   Example: N/A

•   Enum: 1m, 1h, 1d

project_ids

Return only usage for these projects.

•   Type: array

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

user_ids

Return only usage for these users.

•   Type: array

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

api_key_ids

Return only usage for these API keys.

•   Type: array

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

models

Return only usage for these models.

•   Type: array

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

group_by

Group the usage data by the specified fields. Support fields include "project_id", "user_id", "api_key_id", "model" or any combination of them.

•   Type: array

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

limit

Specifies the number of buckets to return. - "bucket_width=1d": default: 7, max: 31 - "bucket_width=1h": default: 24, max: 168 - "bucket_width=1m": default: 60, max: 1440

•   Type: integer

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

page

A cursor for use in pagination. Corresponding to the "next_page" field from the previous response.

•   Type: string

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

  usage-audio-transcriptions
Get audio transcriptions usage details for the organization.

Parameters

start_time

Start time (Unix seconds) of the query time range, inclusive.

•   Type: integer

•   In: query

•   Required: True

•   Default: N/A

•   Example: N/A

•   Enum: N/A

end_time

End time (Unix seconds) of the query time range, exclusive.

•   Type: integer

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

bucket_width

Width of each time bucket in response. Currently "1m", "1h" and "1d" are supported, default to "1d".

•   Type: string

•   In: query

•   Required: False

•   Default: 1d

•   Example: N/A

•   Enum: 1m, 1h, 1d

project_ids

Return only usage for these projects.

•   Type: array

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

user_ids

Return only usage for these users.

•   Type: array

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

api_key_ids

Return only usage for these API keys.

•   Type: array

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

models

Return only usage for these models.

•   Type: array

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

group_by

Group the usage data by the specified fields. Support fields include "project_id", "user_id", "api_key_id", "model" or any combination of them.

•   Type: array

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

limit

Specifies the number of buckets to return. - "bucket_width=1d": default: 7, max: 31 - "bucket_width=1h": default: 24, max: 168 - "bucket_width=1m": default: 60, max: 1440

•   Type: integer

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

page

A cursor for use in pagination. Corresponding to the "next_page" field from the previous response.

•   Type: string

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

  usage-code-interpreter-sessions
Get code interpreter sessions usage details for the organization.

Parameters

start_time

Start time (Unix seconds) of the query time range, inclusive.

•   Type: integer

•   In: query

•   Required: True

•   Default: N/A

•   Example: N/A

•   Enum: N/A

end_time

End time (Unix seconds) of the query time range, exclusive.

•   Type: integer

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

bucket_width

Width of each time bucket in response. Currently "1m", "1h" and "1d" are supported, default to "1d".

•   Type: string

•   In: query

•   Required: False

•   Default: 1d

•   Example: N/A

•   Enum: 1m, 1h, 1d

project_ids

Return only usage for these projects.

•   Type: array

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

group_by

Group the usage data by the specified fields. Support fields include "project_id".

•   Type: array

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

limit

Specifies the number of buckets to return. - "bucket_width=1d": default: 7, max: 31 - "bucket_width=1h": default: 24, max: 168 - "bucket_width=1m": default: 60, max: 1440

•   Type: integer

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

page

A cursor for use in pagination. Corresponding to the "next_page" field from the previous response.

•   Type: string

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

  usage-completions
Get completions usage details for the organization.

Parameters

start_time

Start time (Unix seconds) of the query time range, inclusive.

•   Type: integer

•   In: query

•   Required: True

•   Default: N/A

•   Example: N/A

•   Enum: N/A

end_time

End time (Unix seconds) of the query time range, exclusive.

•   Type: integer

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

bucket_width

Width of each time bucket in response. Currently "1m", "1h" and "1d" are supported, default to "1d".

•   Type: string

•   In: query

•   Required: False

•   Default: 1d

•   Example: N/A

•   Enum: 1m, 1h, 1d

project_ids

Return only usage for these projects.

•   Type: array

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

user_ids

Return only usage for these users.

•   Type: array

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

api_key_ids

Return only usage for these API keys.

•   Type: array

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

models

Return only usage for these models.

•   Type: array

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

batch

If "true", return batch jobs only. If "false", return non-batch jobs only. By default, return both.

•   Type: boolean

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

group_by

Group the usage data by the specified fields. Support fields include "project_id", "user_id", "api_key_id", "model", "batch" or any combination of them.

•   Type: array

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

limit

Specifies the number of buckets to return. - "bucket_width=1d": default: 7, max: 31 - "bucket_width=1h": default: 24, max: 168 - "bucket_width=1m": default: 60, max: 1440

•   Type: integer

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

page

A cursor for use in pagination. Corresponding to the "next_page" field from the previous response.

•   Type: string

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

  usage-costs
Get costs details for the organization.

Parameters

start_time

Start time (Unix seconds) of the query time range, inclusive.

•   Type: integer

•   In: query

•   Required: True

•   Default: N/A

•   Example: N/A

•   Enum: N/A

end_time

End time (Unix seconds) of the query time range, exclusive.

•   Type: integer

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

bucket_width

Width of each time bucket in response. Currently only "1d" is supported, default to "1d".

•   Type: string

•   In: query

•   Required: False

•   Default: 1d

•   Example: N/A

•   Enum: 1d

project_ids

Return only costs for these projects.

•   Type: array

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

group_by

Group the costs by the specified fields. Support fields include "project_id", "line_item" and any combination of them.

•   Type: array

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

limit

A limit on the number of buckets to be returned. Limit can range between 1 and 180, and the default is 7.

•   Type: integer

•   In: query

•   Required: False

•   Default: 7

•   Example: N/A

•   Enum: N/A

page

A cursor for use in pagination. Corresponding to the "next_page" field from the previous response.

•   Type: string

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

  usage-embeddings
Get embeddings usage details for the organization.

Parameters

start_time

Start time (Unix seconds) of the query time range, inclusive.

•   Type: integer

•   In: query

•   Required: True

•   Default: N/A

•   Example: N/A

•   Enum: N/A

end_time

End time (Unix seconds) of the query time range, exclusive.

•   Type: integer

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

bucket_width

Width of each time bucket in response. Currently "1m", "1h" and "1d" are supported, default to "1d".

•   Type: string

•   In: query

•   Required: False

•   Default: 1d

•   Example: N/A

•   Enum: 1m, 1h, 1d

project_ids

Return only usage for these projects.

•   Type: array

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

user_ids

Return only usage for these users.

•   Type: array

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

api_key_ids

Return only usage for these API keys.

•   Type: array

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

models

Return only usage for these models.

•   Type: array

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

group_by

Group the usage data by the specified fields. Support fields include "project_id", "user_id", "api_key_id", "model" or any combination of them.

•   Type: array

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

limit

Specifies the number of buckets to return. - "bucket_width=1d": default: 7, max: 31 - "bucket_width=1h": default: 24, max: 168 - "bucket_width=1m": default: 60, max: 1440

•   Type: integer

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

page

A cursor for use in pagination. Corresponding to the "next_page" field from the previous response.

•   Type: string

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

  usage-images
Get images usage details for the organization.

Parameters

start_time

Start time (Unix seconds) of the query time range, inclusive.

•   Type: integer

•   In: query

•   Required: True

•   Default: N/A

•   Example: N/A

•   Enum: N/A

end_time

End time (Unix seconds) of the query time range, exclusive.

•   Type: integer

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

bucket_width

Width of each time bucket in response. Currently "1m", "1h" and "1d" are supported, default to "1d".

•   Type: string

•   In: query

•   Required: False

•   Default: 1d

•   Example: N/A

•   Enum: 1m, 1h, 1d

sources

Return only usages for these sources. Possible values are "image.generation", "image.edit", "image.variation" or any combination of them.

•   Type: array

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

sizes

Return only usages for these image sizes. Possible values are "256x256", "512x512", "1024x1024", "1792x1792", "1024x1792" or any combination of them.

•   Type: array

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

project_ids

Return only usage for these projects.

•   Type: array

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

user_ids

Return only usage for these users.

•   Type: array

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

api_key_ids

Return only usage for these API keys.

•   Type: array

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

models

Return only usage for these models.

•   Type: array

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

group_by

Group the usage data by the specified fields. Support fields include "project_id", "user_id", "api_key_id", "model", "size", "source" or any combination of them.

•   Type: array

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

limit

Specifies the number of buckets to return. - "bucket_width=1d": default: 7, max: 31 - "bucket_width=1h": default: 24, max: 168 - "bucket_width=1m": default: 60, max: 1440

•   Type: integer

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

page

A cursor for use in pagination. Corresponding to the "next_page" field from the previous response.

•   Type: string

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

  usage-moderations
Get moderations usage details for the organization.

Parameters

start_time

Start time (Unix seconds) of the query time range, inclusive.

•   Type: integer

•   In: query

•   Required: True

•   Default: N/A

•   Example: N/A

•   Enum: N/A

end_time

End time (Unix seconds) of the query time range, exclusive.

•   Type: integer

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

bucket_width

Width of each time bucket in response. Currently "1m", "1h" and "1d" are supported, default to "1d".

•   Type: string

•   In: query

•   Required: False

•   Default: 1d

•   Example: N/A

•   Enum: 1m, 1h, 1d

project_ids

Return only usage for these projects.

•   Type: array

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

user_ids

Return only usage for these users.

•   Type: array

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

api_key_ids

Return only usage for these API keys.

•   Type: array

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

models

Return only usage for these models.

•   Type: array

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

group_by

Group the usage data by the specified fields. Support fields include "project_id", "user_id", "api_key_id", "model" or any combination of them.

•   Type: array

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

limit

Specifies the number of buckets to return. - "bucket_width=1d": default: 7, max: 31 - "bucket_width=1h": default: 24, max: 168 - "bucket_width=1m": default: 60, max: 1440

•   Type: integer

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

page

A cursor for use in pagination. Corresponding to the "next_page" field from the previous response.

•   Type: string

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

  usage-vector-stores
Get vector stores usage details for the organization.

Parameters

start_time

Start time (Unix seconds) of the query time range, inclusive.

•   Type: integer

•   In: query

•   Required: True

•   Default: N/A

•   Example: N/A

•   Enum: N/A

end_time

End time (Unix seconds) of the query time range, exclusive.

•   Type: integer

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

bucket_width

Width of each time bucket in response. Currently "1m", "1h" and "1d" are supported, default to "1d".

•   Type: string

•   In: query

•   Required: False

•   Default: 1d

•   Example: N/A

•   Enum: 1m, 1h, 1d

project_ids

Return only usage for these projects.

•   Type: array

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

group_by

Group the usage data by the specified fields. Support fields include "project_id".

•   Type: array

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

limit

Specifies the number of buckets to return. - "bucket_width=1d": default: 7, max: 31 - "bucket_width=1h": default: 24, max: 168 - "bucket_width=1m": default: 60, max: 1440

•   Type: integer

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

page

A cursor for use in pagination. Corresponding to the "next_page" field from the previous response.

•   Type: string

•   In: query

•   Required: False

•   Default: N/A

•   Example: N/A

•   Enum: N/A

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.