Module types

Source
Expand description

Types used in OpenAI API requests and responses. These types are created from component schemas in the OpenAPI spec

Modules§

realtimerealtime
responses

Structs§

AddUploadPartRequest
Request parameters for adding a part to an Upload
AssistantObject
Represents an assistant that can call the model and use tools.
AssistantToolCodeInterpreterResources
AssistantToolFileSearchResources
AssistantToolResources
AssistantToolsFileSearch
Retrieval tool
AssistantToolsFileSearchOverrides
AssistantToolsFunction
Function tool
AssistantVectorStore
AssistantsNamedToolChoice
Specifies a tool the model should use. Use to force the model to call a specific tool.
AudioInput
AuditLog
A log of a user action or configuration change within this organization.
AuditLogActor
The actor who performed the audit logged action.
AuditLogActorApiKey
The API Key used to perform the audit logged action.
AuditLogActorServiceAccount
The service account that performed the audit logged action.
AuditLogActorSession
The session in which the audit logged action was performed.
AuditLogActorUser
The user who performed the audit logged action.
AuditLogApiKeyCreated
The details for events with the type api_key.created.
AuditLogApiKeyCreatedData
The payload used to create the API key.
AuditLogApiKeyDeleted
The details for events with the type api_key.deleted.
AuditLogApiKeyUpdated
The details for events with the type api_key.updated.
AuditLogApiKeyUpdatedChangesRequested
The payload used to update the API key.
AuditLogInviteAccepted
The details for events with the type invite.accepted.
AuditLogInviteDeleted
The details for events with the type invite.deleted.
AuditLogInviteSent
The details for events with the type invite.sent.
AuditLogInviteSentData
The payload used to create the invite.
AuditLogLoginFailed
The details for events with the type login.failed.
AuditLogLogoutFailed
The details for events with the type logout.failed.
AuditLogOrganizationUpdated
The details for events with the type organization.updated.
AuditLogOrganizationUpdatedChangesRequested
The payload used to update the organization settings.
AuditLogOrganizationUpdatedChangesRequestedSettings
The organization settings.
AuditLogProject
The project that the action was scoped to. Absent for actions not scoped to projects.
AuditLogProjectArchived
The details for events with the type project.archived.
AuditLogProjectCreated
The details for events with the type project.created.
AuditLogProjectCreatedData
The payload used to create the project.
AuditLogProjectUpdated
The details for events with the type project.updated.
AuditLogProjectUpdatedChangesRequested
The payload used to update the project.
AuditLogServiceAccountCreated
The details for events with the type service_account.created.
AuditLogServiceAccountCreatedData
The payload used to create the service account.
AuditLogServiceAccountDeleted
The details for events with the type service_account.deleted.
AuditLogServiceAccountUpdated
The details for events with the type service_account.updated.
AuditLogServiceAccountUpdatedChangesRequested
The payload used to updated the service account.
AuditLogUserAdded
The details for events with the type user.added.
AuditLogUserAddedData
The payload used to add the user to the project.
AuditLogUserDeleted
The details for events with the type user.deleted.
AuditLogUserUpdated
The details for events with the type user.updated.
AuditLogUserUpdatedChangesRequested
The payload used to update the user.
Base64Embedding
Represents an base64-encoded embedding vector returned by embedding endpoint.
Base64EmbeddingVector
Batch
BatchError
BatchErrors
BatchRequest
BatchRequestArgs
Builder for BatchRequest.
BatchRequestCounts
BatchRequestInput
The per-line object of the batch input file
BatchRequestOutput
The per-line object of the batch output and error files
BatchRequestOutputError
BatchRequestOutputResponse
Category
CategoryAppliedInputTypes
A list of the categories along with the input type(s) that the score applies to.
CategoryScore
A list of the categories along with their scores as predicted by model.
ChatChoice
ChatChoiceLogprobs
ChatChoiceStream
ChatCompletionAudio
ChatCompletionFunctionsDeprecated
ChatCompletionFunctionsArgs
Builder for ChatCompletionFunctions.
ChatCompletionMessageToolCall
ChatCompletionMessageToolCallChunk
ChatCompletionNamedToolChoice
Specifies a tool the model should use. Use to force the model to call a specific function.
ChatCompletionRequestAssistantMessage
ChatCompletionRequestAssistantMessageArgs
Builder for ChatCompletionRequestAssistantMessage.
ChatCompletionRequestAssistantMessageAudio
ChatCompletionRequestDeveloperMessage
ChatCompletionRequestDeveloperMessageArgs
Builder for ChatCompletionRequestDeveloperMessage.
ChatCompletionRequestFunctionMessage
ChatCompletionRequestFunctionMessageArgs
Builder for ChatCompletionRequestFunctionMessage.
ChatCompletionRequestMessageContentPartAudio
Learn about audio inputs.
ChatCompletionRequestMessageContentPartAudioArgs
Builder for ChatCompletionRequestMessageContentPartAudio.
ChatCompletionRequestMessageContentPartImage
ChatCompletionRequestMessageContentPartImageArgs
Builder for ChatCompletionRequestMessageContentPartImage.
ChatCompletionRequestMessageContentPartRefusal
ChatCompletionRequestMessageContentPartRefusalBuilder
Builder for ChatCompletionRequestMessageContentPartRefusal.
ChatCompletionRequestMessageContentPartText
ChatCompletionRequestMessageContentPartTextArgs
Builder for ChatCompletionRequestMessageContentPartText.
ChatCompletionRequestSystemMessage
ChatCompletionRequestSystemMessageArgs
Builder for ChatCompletionRequestSystemMessage.
ChatCompletionRequestToolMessage
Tool message
ChatCompletionRequestToolMessageArgs
Builder for ChatCompletionRequestToolMessage.
ChatCompletionRequestUserMessage
ChatCompletionRequestUserMessageArgs
Builder for ChatCompletionRequestUserMessage.
ChatCompletionResponseMessage
A chat completion message generated by the model.
ChatCompletionResponseMessageAudio
ChatCompletionStreamOptions
Options for streaming response. Only set this when you set stream: true.
ChatCompletionStreamResponseDelta
A chat completion delta generated by streamed model responses.
ChatCompletionTokenLogprob
ChatCompletionTool
ChatCompletionToolArgs
Builder for ChatCompletionTool.
Choice
CodeInterpreter
ComparisonFilter
A filter used to compare a specified attribute key to a given value using a defined comparison operation.
CompleteUploadRequest
Request parameters for completing an Upload
CompletionTokensDetails
Breakdown of tokens used in a completion.
CompletionUsage
Usage statistics for the completion request.
CompoundFilter
Combine multiple filters using and or or.
ContentModerationResult
CreateAssistantRequest
CreateAssistantRequestArgs
Builder for CreateAssistantRequest.
CreateAssistantToolFileSearchResources
CreateAssistantToolResources
CreateBase64EmbeddingResponse
CreateChatCompletionRequest
CreateChatCompletionRequestArgs
Builder for CreateChatCompletionRequest.
CreateChatCompletionResponse
Represents a chat completion response returned by model, based on the provided input.
CreateChatCompletionStreamResponse
Represents a streamed chunk of a chat completion response returned by model, based on the provided input.
CreateCompletionRequest
CreateCompletionRequestArgs
Builder for CreateCompletionRequest.
CreateCompletionResponse
CreateEmbeddingRequest
CreateEmbeddingRequestArgs
Builder for CreateEmbeddingRequest.
CreateEmbeddingResponse
CreateFileRequest
CreateFileRequestArgs
Builder for CreateFileRequest.
CreateFineTuningJobRequest
CreateFineTuningJobRequestArgs
Builder for CreateFineTuningJobRequest.
CreateImageEditRequest
CreateImageEditRequestArgs
Builder for CreateImageEditRequest.
CreateImageRequest
CreateImageRequestArgs
Builder for CreateImageRequest.
CreateImageVariationRequest
CreateImageVariationRequestArgs
Builder for CreateImageVariationRequest.
CreateMessageRequest
CreateMessageRequestArgs
Builder for CreateMessageRequest.
CreateModerationRequest
CreateModerationRequestArgs
Builder for CreateModerationRequest.
CreateModerationResponse
Represents if a given text input is potentially harmful.
CreateRunRequest
CreateRunRequestArgs
Builder for CreateRunRequest.
CreateSpeechRequest
CreateSpeechRequestArgs
Builder for CreateSpeechRequest.
CreateSpeechResponse
CreateThreadAndRunRequest
CreateThreadAndRunRequestArgs
Builder for CreateThreadAndRunRequest.
CreateThreadRequest
CreateThreadRequestArgs
Builder for CreateThreadRequest.
CreateTranscriptionRequest
CreateTranscriptionRequestArgs
Builder for CreateTranscriptionRequest.
CreateTranscriptionResponseJson
Represents a transcription response returned by model, based on the provided input.
CreateTranscriptionResponseVerboseJson
Represents a verbose json transcription response returned by model, based on the provided input.
CreateTranslationRequest
CreateTranslationRequestArgs
Builder for CreateTranslationRequest.
CreateTranslationResponseJson
CreateTranslationResponseVerboseJson
CreateUploadRequest
Request to create an upload object that can accept byte chunks in the form of Parts.
CreateUploadRequestArgs
Builder for CreateUploadRequest.
CreateVectorStoreFileBatchRequest
CreateVectorStoreFileBatchRequestArgs
Builder for CreateVectorStoreFileBatchRequest.
CreateVectorStoreFileRequest
CreateVectorStoreFileRequestArgs
Builder for CreateVectorStoreFileRequest.
CreateVectorStoreRequest
CreateVectorStoreRequestArgs
Builder for CreateVectorStoreRequest.
DPOHyperparameters
DeleteAssistantResponse
DeleteFileResponse
DeleteMessageResponse
DeleteModelResponse
DeleteThreadResponse
DeleteVectorStoreFileResponse
DeleteVectorStoreResponse
DeltaCodeInterpreter
Embedding
Represents an embedding vector returned by embedding endpoint.
EmbeddingUsage
FileCitation
FileInput
FilePath
FileSearchRankingOptions
The ranking options for the file search. If not specified, the file search tool will use the auto ranker and a score_threshold of 0.
FineTuneDPOMethod
FineTuneJobError
For fine-tuning jobs that have failed, this will contain more information on the cause of the failure.
FineTuneSupervisedMethod
FineTuningIntegration
FineTuningJob
The fine_tuning.job object represents a fine-tuning job that has been created through the API.
FineTuningJobCheckpoint
The fine_tuning.job.checkpoint object represents a model checkpoint for a fine-tuning job that is ready to use.
FineTuningJobCheckpointMetrics
FineTuningJobEvent
Fine-tuning job event object
FunctionCall
The name and arguments of a function that should be called, as generated by the model.
FunctionCallStream
FunctionName
FunctionObject
FunctionObjectArgs
Builder for FunctionObject.
Hyperparameters
ImageFile
ImageInput
ImageUrl
ImageUrlArgs
Builder for ImageUrl.
ImagesResponse
InputAudio
Invite
Represents an individual invite to the organization.
InviteDeleteResponse
InviteListResponse
InviteRequest
InviteRequestArgs
Builder for InviteRequest.
LastError
ListAssistantsResponse
ListAuditLogsResponse
Represents a list of audit logs.
ListBatchesResponse
ListFilesResponse
ListFineTuningJobCheckpointsResponse
ListFineTuningJobEventsResponse
ListMessagesResponse
ListModelResponse
ListPaginatedFineTuningJobsResponse
ListRunStepsResponse
ListRunsResponse
ListVectorStoreFilesResponse
ListVectorStoresResponse
Logprobs
MessageAttachment
MessageContentImageFileObject
References an image File in the content of a message.
MessageContentImageUrlObject
References an image URL in the content of a message.
MessageContentRefusalObject
MessageContentTextAnnotationsFileCitationObject
A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the “file_search” tool to search files.
MessageContentTextAnnotationsFilePathObject
MessageContentTextObject
The text content that is part of a message.
MessageCreation
MessageDelta
MessageDeltaContentImageFileObject
References an image File in the content of a message.
MessageDeltaContentImageUrlObject
MessageDeltaContentRefusalObject
MessageDeltaContentText
MessageDeltaContentTextAnnotationsFileCitationObject
A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the “file_search” tool to search files.
MessageDeltaContentTextAnnotationsFilePathObject
A URL for the file that’s generated when the assistant used the code_interpreter tool to generate a file.
MessageDeltaContentTextObject
The text content that is part of a message.
MessageDeltaObject
Represents a message delta i.e. any changed fields on a message during streaming.
MessageIncompleteDetails
MessageObject
Represents a message within a thread.
MessageRequestContentTextObject
Model
Describes an OpenAI model offering that can be used with the API.
ModerationImageUrl
Image URL configuration for image moderation
ModifyAssistantRequest
ModifyAssistantRequestArgs
Builder for ModifyAssistantRequest.
ModifyMessageRequest
ModifyRunRequest
ModifyThreadRequest
OpenAIFile
The File object represents a document that has been uploaded to OpenAI.
Project
Represents an individual project.
ProjectApiKey
Represents an individual API key in a project.
ProjectApiKeyDeleteResponse
Represents the response object for deleting a project API key.
ProjectApiKeyListResponse
Represents the response object for listing project API keys.
ProjectApiKeyOwner
Represents the owner of a project API key.
ProjectCreateRequest
The project create request payload.
ProjectCreateRequestArgs
Builder for ProjectCreateRequest.
ProjectListResponse
A list of Project objects.
ProjectServiceAccount
Represents an individual service account in a project.
ProjectServiceAccountApiKey
Represents the API key associated with a project service account.
ProjectServiceAccountCreateRequest
Represents the request object for creating a project service account.
ProjectServiceAccountCreateResponse
Represents the response object for creating a project service account.
ProjectServiceAccountDeleteResponse
Represents the response object for deleting a project service account.
ProjectServiceAccountListResponse
Represents the response object for listing project service accounts.
ProjectUpdateRequest
The project update request payload.
ProjectUpdateRequestArgs
Builder for ProjectUpdateRequest.
ProjectUser
Represents an individual user in a project.
ProjectUserCreateRequest
The project user create request payload.
ProjectUserCreateRequestArgs
Builder for ProjectUserCreateRequest.
ProjectUserDeleteResponse
ProjectUserListResponse
ProjectUserUpdateRequest
ProjectUserUpdateRequestArgs
Builder for ProjectUserUpdateRequest.
PromptTokensDetails
Breakdown of tokens used in a completion.
RankingOptions
Ranking options for search.
RequiredAction
ResponseFormatJsonSchema
RunCompletionUsage
RunObject
Represents an execution run on a thread.
RunObjectIncompleteDetails
RunStepCompletionUsage
RunStepDelta
RunStepDeltaObject
Represents a run step delta i.e. any changed fields on a run step during streaming.
RunStepDeltaStepDetailsMessageCreationObject
Details of the message creation by the run step.
RunStepDeltaStepDetailsToolCallsCodeObject
Details of the Code Interpreter tool call the run step was involved in.
RunStepDeltaStepDetailsToolCallsCodeOutputImageObject
Code interpreter image output
RunStepDeltaStepDetailsToolCallsCodeOutputLogsObject
Text output from the Code Interpreter tool call as part of a run step.
RunStepDeltaStepDetailsToolCallsFileSearchObject
RunStepDeltaStepDetailsToolCallsFunctionObject
Function tool call
RunStepDeltaStepDetailsToolCallsObject
Details of the tool call.
RunStepDetailsMessageCreationObject
Details of the message creation by the run step.
RunStepDetailsToolCallsCodeObject
Code interpreter tool call
RunStepDetailsToolCallsCodeOutputImageObject
RunStepDetailsToolCallsCodeOutputLogsObject
Text output from the Code Interpreter tool call as part of a run step.
RunStepDetailsToolCallsFileSearchObject
File search tool call
RunStepDetailsToolCallsFileSearchObjectFileSearch
RunStepDetailsToolCallsFileSearchResultObject
A result instance of the file search.
RunStepDetailsToolCallsFileSearchResultObjectContent
RunStepDetailsToolCallsFunctionObject
RunStepDetailsToolCallsObject
Details of the tool call.
RunStepFunctionObject
RunStepFunctionObjectDelta
RunStepObject
Represents a step in execution of a run.
RunToolCallObject
StaticChunkingStrategy
Static Chunking Strategy
SubmitToolOutputs
SubmitToolOutputsRunRequest
TextData
ThreadObject
Represents a thread that contains messages.
ToolsOutputs
ToolsOutputsArgs
Builder for ToolsOutputs.
TopLogprobs
TranscriptionSegment
TranscriptionWord
TruncationObject
Thread Truncation Controls
UpdateVectorStoreRequest
UpdateVectorStoreRequestArgs
Builder for UpdateVectorStoreRequest.
Upload
The Upload object can accept byte chunks in the form of Parts.
UploadPart
The upload Part represents a chunk of bytes we can add to an Upload object.
User
Represents an individual user within an organization.
UserDeleteResponse
Confirmation of the deleted user
UserListResponse
A list of User objects.
UserRoleUpdateRequest
UserRoleUpdateRequestArgs
Builder for UserRoleUpdateRequest.
VectorStoreExpirationAfter
Vector store expiration policy
VectorStoreFileBatchCounts
VectorStoreFileBatchObject
A batch of files attached to a vector store.
VectorStoreFileContentObject
Represents the parsed content of a vector store file.
VectorStoreFileContentResponse
Represents the parsed content of a vector store file.
VectorStoreFileCounts
VectorStoreFileError
VectorStoreFileObject
VectorStoreObject
A vector store is a collection of processed files can be used by the file_search tool.
VectorStoreSearchRequest
VectorStoreSearchRequestArgs
Builder for VectorStoreSearchRequest.
VectorStoreSearchResultContentObject
VectorStoreSearchResultItem
VectorStoreSearchResultsPage
WandB
WebSearchLocation
Approximate location parameters for the search.
WebSearchOptions
Options for the web search tool.
WebSearchUserLocation

Enums§

AssistantStreamEvent
Represents an event emitted when streaming a Run.
AssistantToolType
AssistantTools
AssistantVectorStoreChunkingStrategy
AssistantsApiResponseFormatOption
Specifies the format that the model must output. Compatible with GPT-4o, GPT-4 Turbo, and all GPT-3.5 Turbo models since gpt-3.5-turbo-1106.
AssistantsApiToolChoiceOption
Controls which (if any) tool is called by the model. none means the model will not call any tools and instead generates a message. auto is the default value and means the model can pick between generating a message or calling one or more tools. required means the model must call one or more tools before responding to the user. Specifying a particular tool like {"type": "file_search"} or {"type": "function", "function": {"name": "my_function"}} forces the model to call that tool.
AttributeValue
The value to compare against the attribute key; supports string, number, or boolean types.
AudioResponseFormat
AuditLogActorApiKeyType
AuditLogEventType
The event type.
BatchCompletionWindow
BatchEndpoint
BatchRequestInputMethod
BatchSize
BatchStatus
Beta
ChatCompletionAudioFormat
ChatCompletionAudioVoice
ChatCompletionFunctionCall
ChatCompletionModalities
Output types that you would like the model to generate for this request.
ChatCompletionRequestAssistantMessageContent
ChatCompletionRequestAssistantMessageContentPart
ChatCompletionRequestDeveloperMessageContent
ChatCompletionRequestMessage
ChatCompletionRequestMessageContentPartRefusalBuilderError
Error type for ChatCompletionRequestMessageContentPartRefusalBuilder
ChatCompletionRequestSystemMessageContent
ChatCompletionRequestSystemMessageContentPart
ChatCompletionRequestToolMessageContent
ChatCompletionRequestToolMessageContentPart
ChatCompletionRequestUserMessageContent
ChatCompletionRequestUserMessageContentPart
ChatCompletionToolChoiceOption
Controls which (if any) tool is called by the model. none means the model will not call any tool and instead generates a message. auto means the model can pick between generating a message or calling one or more tools. required means the model must call one or more tools. Specifying a particular tool via {"type": "function", "function": {"name": "my_function"}} forces the model to call that tool.
ChatCompletionToolType
CodeInterpreterOutput
ComparisonType
Specifies the comparison operator: eq, ne, gt, gte, lt, lte.
CompletionFinishReason
CompoundFilterType
Type of operation: and or or.
CreateMessageRequestContent
DallE2ImageSize
DeltaCodeInterpreterOutput
DeltaStepDetails
EmbeddingInput
EncodingFormat
FilePurpose
FileSearchRanker
FineTuneMethod
The method used for fine-tuning.
FineTuningJobEventType
FineTuningJobIntegrationType
FineTuningJobStatus
FinishReason
Image
ImageDetail
ImageModel
ImageQuality
ImageResponseFormat
ImageSize
ImageStyle
InputAudioFormat
InputSource
InviteStatus
LastErrorCode
LearningRateMultiplier
Level
MessageAttachmentTool
MessageContent
MessageContentInput
MessageContentTextAnnotations
MessageDeltaContent
MessageDeltaContentTextAnnotations
MessageIncompleteDetailsType
MessageRole
MessageStatus
ModInputType
The type of input that was moderated
ModerationContentPart
Content part for multi-modal moderation input
ModerationInput
NEpochs
OpenAIFilePurpose
OrganizationRole
PredictionContent
Static predicted output content, such as the content of a text file that is being regenerated.
PredictionContentContent
The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly.
ProjectApiKeyOwnerType
ProjectStatus
active or archived
ProjectUserRole
owner or member
Prompt
Ranker
ReasoningEffort
ResponseFormat
Role
RunObjectIncompleteDetailsReason
RunStatus
RunStepDeltaStepDetailsToolCalls
RunStepDetailsToolCalls
RunStepType
ServiceTier
ServiceTierResponse
SpeechModel
SpeechResponseFormat
StepDetails
Stop
TimestampGranularity
TruncationObjectType
UploadPurpose
The intended purpose of the uploaded file.
UploadStatus
The status of an upload
VectorStoreChunkingStrategy
VectorStoreFileBatchStatus
VectorStoreFileErrorCode
VectorStoreFileObjectChunkingStrategy
VectorStoreFileStatus
VectorStoreSearchFilter
VectorStoreSearchQuery
VectorStoreStatus
Voice
WebSearchContextSize
The amount of context window space to use for the search.
WebSearchUserLocationType

Type Aliases§

AssistantEventStream
ChatCompletionResponseStream
Parsed server side events stream until an [DONE] is received from server.
CompletionResponseStream
Parsed server side events stream until an [DONE] is received from server.