TsgcHTTP_API_OpenAI › Methods

TsgcHTTP_API_OpenAI Methods

Public methods grouped by purpose, followed by the full alphabetical list.

Chat Completions

NameDescription
CreateChatCompletionSends a chat completion request to the OpenAI Chat Completions endpoint and returns the model reply
CreateCompletionCalls the legacy OpenAI Completions endpoint for prompt-based text generation
CreateEditCalls the OpenAI Edits endpoint to apply an instruction-based edit to an input text

Responses

NameDescription
CreateResponseCreates a new model response using the OpenAI Responses API
RetrieveResponseRetrieves a previously created response from the OpenAI Responses API by its identifier
DeleteResponseDeletes a stored response from the OpenAI Responses API
CancelResponseCancels a background response that is still in progress on the OpenAI Responses API
ListInputItemsLists the input items that were provided when a response was created

Images

NameDescription
CreateImageGenerates one or more images from a text prompt using the OpenAI Images endpoint
CreateImageEditEdits an existing image using a text prompt and an optional transparency mask
CreateImageVariationGenerates prompt-free variations of an existing image using the OpenAI Images endpoint

Audio

NameDescription
CreateSpeechGenerates audio speech from input text using an OpenAI text-to-speech model
CreateTranscriptionTranscribes an audio recording into text using an OpenAI speech-to-text model such as Whisper
CreateTranscriptionFromFileTranscribes a local audio file into text using an OpenAI speech-to-text model
CreateTranslationTranslates non-English audio into English text using an OpenAI speech model
CreateTranslationFromFileTranslates a local non-English audio file into English text using an OpenAI speech model

Embeddings

NameDescription
CreateEmbeddingsCreates vector embeddings for one or more input strings using an OpenAI embedding model

Moderation

NameDescription
CreateModerationClassifies text against OpenAI's content policy to detect potentially harmful or unsafe content

Files

NameDescription
UploadFileUploads a file to OpenAI for use with assistants, fine-tuning, batch jobs or vision features
ListFilesLists all files previously uploaded to the authenticated OpenAI organization
RetrieveFileRetrieves metadata for a single file previously uploaded to OpenAI
RetrieveFileContentDownloads the raw content of a file previously uploaded to OpenAI
DeleteFilePermanently deletes a file previously uploaded to OpenAI

Uploads

NameDescription
CreateUploadInitiates a multipart upload session for transferring a large file to OpenAI in parts
AddUploadPartUploads one part of a previously created multipart upload session
CompleteUploadCompletes a multipart upload by assembling the specified parts into the final file
CancelUploadCancels a multipart upload session and discards any parts already transferred

Fine-tuning

NameDescription
CreateFineTuningJobStarts a new fine-tuning job that customizes a base model on a previously uploaded training file
ListFineTuningJobsLists fine-tuning jobs belonging to the authenticated organization with cursor-based pagination
RetrieveFineTuningJobRetrieves the current state of a fine-tuning job including status and result model name
CancelFineTuningJobCancels a running fine-tuning job before it completes training
ListFineTuningJobEventsLists status and progress events emitted by a fine-tuning job
ListFineTuningJobCheckpointsLists the intermediate model checkpoints produced during a fine-tuning job
CreateFineTuneCreates a fine-tune using the legacy fine-tunes API (deprecated, use CreateFineTuningJob instead)
ListFineTunesLists fine-tunes using the legacy fine-tunes API (deprecated, use ListFineTuningJobs instead)
RetrieveFineTuneRetrieves a legacy fine-tune by id (deprecated, use RetrieveFineTuningJob instead)
CancelFineTuneCancels a legacy fine-tune in progress (deprecated, use CancelFineTuningJob instead)
ListFineTuneEventsLists events for a legacy fine-tune (deprecated, use ListFineTuningJobEvents instead)
DeleteFineTuneModelDeletes a fine-tuned model so it is no longer available for inference

Assistants

NameDescription
CreateAssistantCreates a new Assistant with model, instructions, tools and metadata
ListAssistantsReturns a paginated list of Assistants belonging to your organization
RetrieveAssistantRetrieves the full definition of an Assistant by its identifier
ModifyAssistantUpdates an existing Assistant with new model, instructions, tools or metadata
DeleteAssistantPermanently deletes an Assistant by its identifier

Threads

NameDescription
CreateThreadCreates a new Thread optionally seeded with initial messages and tool resources
RetrieveThreadRetrieves a Thread definition by its identifier
ModifyThreadUpdates the tool resources and metadata of an existing Thread
DeleteThreadPermanently deletes a Thread and all of its messages

Messages

NameDescription
CreateMessageAppends a new message to an existing Thread
ListMessagesLists messages stored in a Thread with optional Run filtering and pagination
RetrieveMessageRetrieves a single message from a Thread by its identifier
ModifyMessageUpdates the metadata of an existing message in a Thread
DeleteMessageDeletes a specific message from a Thread

Runs

NameDescription
CreateRunStarts a new Run of an Assistant against an existing Thread
ListRunsLists Runs executed on a given Thread with pagination support
RetrieveRunRetrieves the current state of a Run, including status and usage
ModifyRunUpdates the metadata of an existing Run
CancelRunCancels an in-progress Run before it completes
SubmitToolOutputsToRunReturns tool function outputs to a Run that is waiting in requires_action state
ListRunStepsLists the execution steps that make up a Run
RetrieveRunStepsRetrieves a single Run step by its identifier

Vector stores

NameDescription
CreateVectorStoreCreates a new vector store used by the file_search tool
ListVectorStoresReturns a paginated list of vector stores in the current organization
RetrieveVectorStoreRetrieves a vector store by its identifier
ModifyVectorStoreUpdates the name, expiration policy or metadata of an existing vector store
DeleteVectorStorePermanently deletes a vector store and its index
CreateVectorStoreFileAttaches an uploaded file to a vector store for indexing
ListVectorStoreFilesLists files attached to a vector store, optionally filtered by indexing status
RetrieveVectorStoreFileRetrieves the status of a file attached to a vector store
DeleteVectorStoreFileDetaches a file from a vector store without deleting the underlying file
CreateVectorStoreFileBatchAttaches multiple files to a vector store in a single batch operation
RetrieveVectorStoreFileBatchRetrieves a vector store file batch by its identifier
CancelVectorStoreFileBatchCancels a vector store file batch currently in progress
ListVectorStoreFilesBatchLists the files that belong to a given vector store file batch

Batches

NameDescription
CreateBatchSubmits a new Batch job for asynchronous bulk inference at reduced cost
RetrieveBatchRetrieves the current state of a Batch job by its identifier
ListBatchesReturns a paginated list of Batch jobs for the current organization
CancelBatchCancels a Batch job that has not yet completed

All Methods (alphabetical)

NameDescription
AddUploadPartUploads one part of a previously created multipart upload session
CancelBatchCancels a Batch job that has not yet completed
CancelFineTuneCancels a legacy fine-tune in progress (deprecated, use CancelFineTuningJob instead)
CancelFineTuningJobCancels a running fine-tuning job before it completes training
CancelResponseCancels a background response that is still in progress on the OpenAI Responses API
CancelRunCancels an in-progress Run before it completes
CancelUploadCancels a multipart upload session and discards any parts already transferred
CancelVectorStoreFileBatchCancels a vector store file batch currently in progress
CompleteUploadCompletes a multipart upload by assembling the specified parts into the final file
CreateAssistantCreates a new Assistant with model, instructions, tools and metadata
CreateBatchSubmits a new Batch job for asynchronous bulk inference at reduced cost
CreateChatCompletionSends a chat completion request to the OpenAI Chat Completions endpoint and returns the model reply
CreateCompletionCalls the legacy OpenAI Completions endpoint for prompt-based text generation
CreateEditCalls the OpenAI Edits endpoint to apply an instruction-based edit to an input text
CreateEmbeddingsCreates vector embeddings for one or more input strings using an OpenAI embedding model
CreateFineTuneCreates a fine-tune using the legacy fine-tunes API (deprecated, use CreateFineTuningJob instead)
CreateFineTuningJobStarts a new fine-tuning job that customizes a base model on a previously uploaded training file
CreateImageGenerates one or more images from a text prompt using the OpenAI Images endpoint
CreateImageEditEdits an existing image using a text prompt and an optional transparency mask
CreateImageVariationGenerates prompt-free variations of an existing image using the OpenAI Images endpoint
CreateMessageAppends a new message to an existing Thread
CreateModerationClassifies text against OpenAI's content policy to detect potentially harmful or unsafe content
CreateResponseCreates a new model response using the OpenAI Responses API
CreateRunStarts a new Run of an Assistant against an existing Thread
CreateSpeechGenerates audio speech from input text using an OpenAI text-to-speech model
CreateThreadCreates a new Thread optionally seeded with initial messages and tool resources
CreateTranscriptionTranscribes an audio recording into text using an OpenAI speech-to-text model such as Whisper
CreateTranscriptionFromFileTranscribes a local audio file into text using an OpenAI speech-to-text model
CreateTranslationTranslates non-English audio into English text using an OpenAI speech model
CreateTranslationFromFileTranslates a local non-English audio file into English text using an OpenAI speech model
CreateUploadInitiates a multipart upload session for transferring a large file to OpenAI in parts
CreateVectorStoreCreates a new vector store used by the file_search tool
CreateVectorStoreFileAttaches an uploaded file to a vector store for indexing
CreateVectorStoreFileBatchAttaches multiple files to a vector store in a single batch operation
DeleteAssistantPermanently deletes an Assistant by its identifier
DeleteFilePermanently deletes a file previously uploaded to OpenAI
DeleteFineTuneModelDeletes a fine-tuned model so it is no longer available for inference
DeleteMessageDeletes a specific message from a Thread
DeleteResponseDeletes a stored response from the OpenAI Responses API
DeleteThreadPermanently deletes a Thread and all of its messages
DeleteVectorStorePermanently deletes a vector store and its index
DeleteVectorStoreFileDetaches a file from a vector store without deleting the underlying file
ListAssistantsReturns a paginated list of Assistants belonging to your organization
ListBatchesReturns a paginated list of Batch jobs for the current organization
ListFilesLists all files previously uploaded to the authenticated OpenAI organization
ListFineTuneEventsLists events for a legacy fine-tune (deprecated, use ListFineTuningJobEvents instead)
ListFineTunesLists fine-tunes using the legacy fine-tunes API (deprecated, use ListFineTuningJobs instead)
ListFineTuningJobCheckpointsLists the intermediate model checkpoints produced during a fine-tuning job
ListFineTuningJobEventsLists status and progress events emitted by a fine-tuning job
ListFineTuningJobsLists fine-tuning jobs belonging to the authenticated organization with cursor-based pagination
ListInputItemsLists the input items that were provided when a response was created
ListMessagesLists messages stored in a Thread with optional Run filtering and pagination
ListRunsLists Runs executed on a given Thread with pagination support
ListRunStepsLists the execution steps that make up a Run
ListVectorStoreFilesLists files attached to a vector store, optionally filtered by indexing status
ListVectorStoreFilesBatchLists the files that belong to a given vector store file batch
ListVectorStoresReturns a paginated list of vector stores in the current organization
ModifyAssistantUpdates an existing Assistant with new model, instructions, tools or metadata
ModifyMessageUpdates the metadata of an existing message in a Thread
ModifyRunUpdates the metadata of an existing Run
ModifyThreadUpdates the tool resources and metadata of an existing Thread
ModifyVectorStoreUpdates the name, expiration policy or metadata of an existing vector store
RetrieveAssistantRetrieves the full definition of an Assistant by its identifier
RetrieveBatchRetrieves the current state of a Batch job by its identifier
RetrieveFileRetrieves metadata for a single file previously uploaded to OpenAI
RetrieveFileContentDownloads the raw content of a file previously uploaded to OpenAI
RetrieveFineTuneRetrieves a legacy fine-tune by id (deprecated, use RetrieveFineTuningJob instead)
RetrieveFineTuningJobRetrieves the current state of a fine-tuning job including status and result model name
RetrieveMessageRetrieves a single message from a Thread by its identifier
RetrieveResponseRetrieves a previously created response from the OpenAI Responses API by its identifier
RetrieveRunRetrieves the current state of a Run, including status and usage
RetrieveRunStepsRetrieves a single Run step by its identifier
RetrieveThreadRetrieves a Thread definition by its identifier
RetrieveVectorStoreRetrieves a vector store by its identifier
RetrieveVectorStoreFileRetrieves the status of a file attached to a vector store
RetrieveVectorStoreFileBatchRetrieves a vector store file batch by its identifier
SubmitToolOutputsToRunReturns tool function outputs to a Run that is waiting in requires_action state
UploadFileUploads a file to OpenAI for use with assistants, fine-tuning, batch jobs or vision features