OpenAI
OpenAI API.
Functions
Accepts an incoming SIP call. Audio formats are negotiated by SIP; client data-channel settings do not apply.
Accepts an incoming SIP call using the supplied realtime session configuration.
Retrieves an assistant.
Create an assistant with a model and instructions.
Update an assistant.
Returns a list of assistants.
Attaches a trusted sideband to an existing session without sending session.start or replaying earlier events.
Attaches a file with attributes and chunking configuration.
Retrieves a batch.
Creates and executes a batch from an uploaded file of requests.
Cancels an in-progress batch.
Immediately cancel a fine-tune job.
Cancels an in-progress response.
Cancels a run that is Status.InProgress.
Cancel a vector store file batch. This attempts to cancel the processing of files in this batch as soon as possible.
Cancels a background response and returns its current result metadata.
Cancels an upload. Server errors, including invalid lifecycle transitions, propagate.
Creates a completion for the chat message.
List messages belonging to a stored completion.
Stream variant of chatCompletion.
Consumes and closes the upload source, using its actual media type such as image/png or audio/ogg. A not_detected result does not establish the asset's origin. The source is closed even on failure; uploads are not automatically retried.
Compacts context into items suitable for a later response.
Assembles the declared part IDs in their supplied order and returns the resulting file.
This is the main endpoint of the API. Returns the predicted completion for the given prompt, and can also return the probabilities of alternative tokens at each position if requested.
Stream variant of completion.
Lists container files with pagination metadata.
Lists containers while preserving pagination cursors and the has-more indicator.
Retrieves a conversation, or null when it does not exist.
Creates a conversation, optionally with initial items.
Retrieves an item, or null when it does not exist. Include requests additional item data.
Lists conversation items. Pass lastId as after to request the next page.
Copies a regular File resource into the container using a JSON file_id request.
Creates a batch with optional expiration for its output and error files.
Create a completion using richer content and custom tool declarations.
Creates a container with the requested files, skills and resource policy.
Adds up to 20 items and returns the created items with pagination metadata.
Create embeddings from text or token IDs and retain vector encoding metadata.
Creates a WebRTC session or places a real SIP call. Automatic retries are disabled for SIP; manually retrying an uncertain result can create duplicate calls.
Creates a response with current request controls and complete result metadata.
Create a run.
Uploads a skill directory or ZIP once. Every source is closed even on failure; uploads are not automatically retried.
Uploads an immutable version once, closing all sources even on failure. Newly uploaded versions may briefly return 404 on retrieval.
Generates complete audio with voice instructions or a custom voice reference.
Create a run with event streaming.
Create a thread and run it in one request with event streaming.
Create a thread and run it in one request.
Create a new vector store.
Create a vector store file by attaching a File to a vector store.
Creates a file batch with shared settings or per-file configuration.
Create a batch of vector store files.
Creates a vector store with current description and chunking options.
Creates a prompt-generated or consented sample-based voice. Sample sources are consumed and closed on success or failure, without automatic retries.
Uploads a recording of the speaker providing the required consent phrase. Its source is consumed and closed on success or failure, without automatic retries.
Answers the questions in request order. Any answer may be a refusal.
Delete an assistant.
Deletes a conversation. Returns false when it does not exist.
Delete a file. Only owners of organizations can delete files currently.
Delete a fine-tuned model through the Models API. This operation remains available independently of retired fine-tunes jobs. You must have the Owner role in your organization.
Deletes a stored response.
Delete a thread.
Delete a vector store.
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, OpenAI.delete(fileId).
Delete a stored completion; returns false if it does not exist.
Deletes a container, returning false if it no longer exists.
Deletes a container file, returning false if it no longer exists.
Removes an item and returns the updated conversation.
Deletes the skill and all its versions; returns false for HTTP 404.
Deletes a version by its version string; the API rejects deletion of a selected default.
Deletes a voice; returns false when it does not exist. Its consent recording remains available.
Deletes a consent recording; returns false when it does not exist.
Delete an endpoint; returns false when it no longer exists.
Downloads exact file bytes; missing files and other API errors propagate.
Downloads recording content for a session started with storage enabled.
Downloads the skill ZIP bundle as exact bytes. HTTP errors propagate.
Downloads the specified version's ZIP as exact bytes. HTTP errors propagate.
Creates a new edit for the provided input, instruction, and parameters.
Creates an embedding vector representing the input text.
Returns information about a specific file.
Upload a file that contains document(s) to be used across various endpoints/features.
Returns a list of files that belong to the user's organization.
Lists a page of files while preserving pagination cursors.
Gets info about to fine-tune job.
Creates a job that fine-tunes a specified model from a given dataset.
Get fine-grained status updates for fine-tune job.
Get fine-grained status updates for fine-tune job.
Get status updates for a fine-tuning job.
Get info about a fine-tuning job.
Creates a job that fine-tunes a specified model from a given dataset.
Lists checkpoints, retaining cursor metadata. Use the checkpoint model ID for permission operations.
Retrieves current job details, including nullable hyperparameters and paused states; returns null for HTTP 404.
List your organization's fine-tuning jobs.
Starts a primary WebSocket from stored conversation state; omitted overrides inherit the stored configuration.
Forks stored conversation state into a new WebRTC session.
Ends a SIP call.
Hangs up a call.
Edits referenced images using the current JSON contract and returns response metadata.
Generates base64 images with response metadata. An explicit current image model is required.
Streams edit events. Collection starts the request; cancellation closes its response. Service errors are emitted as error events.
Streams generation events. Collection starts the request; cancellation closes its response. Service errors are emitted as error events.
Creates an image given a prompt. Get images as base 64 JSON.
Creates an edited or extended image given an original image and a prompt. Get images as base 64 JSON.
Creates a variation of a given image. Get images as base 64 JSON.
Creates an image given a prompt. Get images as URLs.
Creates an edited or extended image given an original image and a prompt. Get images as URLs.
Creates a variation of a given image. Get images as URLs.
Opens a primary WebSocket and sends session.start. secure=false is intended only for trusted local test servers.
Retrieve a message.
Create a message.
Modify a message.
Retrieves a model instance, providing basic information about the model such as the owner and permission.
Lists the currently available models, and provides basic information about each one such as the owner and availability.
Classifies text and image content together using an omni-moderation model.
Classifies if a text violates OpenAI's Content Policy.
Requests a pause and returns current job details. The job can initially be in the pausing state.
Exchanges an SDP offer for an answer. The caller owns the WebRTC peer connection and media tracks.
Creates an ephemeral credential without exposing the server API key to a client.
Opens a scoped WebSocket conversation. Use model for a new session or callId for an existing call's sideband. secure=false is only for trusted local test servers.
Opens a scoped continuous translation WebSocket. The server requires the model query parameter.
Creates a continuous translation credential.
Transfers a SIP call to a nonblank tel: or sip: target URI.
Transfers a SIP call to a tel: or sip: URI.
Rejects an incoming SIP call with a required SIP status from 300 to 699.
Rejects an incoming SIP call; statusCode is an optional SIP status.
Retrieves a response by its identifier.
Creates a model response.
Lists input items for a response.
Lists current input items, optionally including tool or reasoning fields.
Counts input tokens without generating output.
Opens a scoped Responses WebSocket. The block owns the connection lifetime. Requires a WebSocket-capable engine. secure=false is intended only for trusted local servers.
Resumes a paused job and returns current job details.
Resumes events from a stored background response after a sequence number.
Retrieves a container, or null if it does not exist.
Retrieves a container-file resource, or null if it no longer exists.
Retrieves current file metadata, including its expiration timestamp.
Retrieves a current response, optionally including additional tool or reasoning fields.
Retrieves skill metadata, or null for HTTP 404.
Retrieves a version by its version string, or null for HTTP 404.
Rotate a signing key, optionally retaining the old key for 24 hours.
Retrieves a project safety alert. API errors, including missing resources, propagate.
Retrieves a safety case. API errors, including missing resources, propagate.
Searches indexed file chunks with optional attribute filters.
Lists project skills with cursor metadata.
Lists immutable versions with version-resource cursor IDs.
Generates audio from the input text.
Streams binary speech audio chunks. Collection starts the request; cancellation closes it.
Streams base64 audio deltas and completion usage using server-sent events.
Retrieve a stored completion; returns null if it does not exist.
List stored completions with pagination and optional filters.
Stream richer message and custom tool deltas.
Streams a current response. Cancelling collection closes the HTTP connection.
When a run has the status: Status.RequiresAction and required action is RequiredAction.SubmitToolOutputs, 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 using event streaming.
When a run has the status: Status.RequiresAction and required action is RequiredAction.SubmitToolOutputs, 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.
Send a sample event; inspect the returned statusCode for receiver success.
Retrieve a thread.
Create a thread.
Modify a thread.
Transcribes audio with modern controls and returns usage, confidence and speaker data.
Transcribes audio into the input language.
Streams transcription text, completion and speaker-segment events. Collection starts the request. Cancelling collection releases the response. Model support for streaming varies.
Translates audio into English.
Update metadata on a stored completion.
Updates the supplied metadata keys, preserving existing keys that are not included.
Changes the default version pointer to an existing version string.
Update a vector store.
Updates supplied fields, including explicit nulls, without create-only file IDs.
Replaces file attributes; null clears all attributes.
Changes only the recording's label; its audio and language are unchanged.
Update an endpoint configuration.
Creates an upload with its expected total length and resulting file's expiration policy.
Uploads raw bytes once, closing the source even on failure. Use a fresh source for each request; uploads are not automatically retried.
Uploads a file with optional expiration and returns current response metadata.
Uploads one part. Consumes and closes data's source; use a new source for every call. Parts may be uploaded concurrently; their final order is chosen by completeUpload.
Retrieve a vector store.
Lists files in a batch using file identifiers as cursors.
Retrieves an indexed file, or null if it does not exist.
Retrieves a vector store file batch.
Retrieves parsed content rather than the original binary file.
Returns a list of vector store files.
Returns a list of vector store files in a batch.
Lists indexed files using file identifiers as cursors and preserves pagination metadata.
List all vector stores.
Retrieves a consent recording's metadata, or null when it does not exist.
Lists consent recordings; use the lastId cursor to retrieve another page.
Create an endpoint; signingSecret is returned only here and during rotation.
Retrieve endpoint configuration without returning its signing key.
List project endpoints with cursor metadata.