Description

Build next-gen apps with OpenAI’s powerful models.

The OpenAI API can be applied to virtually any task that involves understanding or generating natural language or code. It offers a spectrum of models with different levels of power suitable for different tasks, as well as the ability to fine-tune your own custom models. These models can be used for everything from content generation to semantic search and classification:

  • GPT-3, GPT-3.5 and GPT-4: Perform a variety of natural language tasks.
  • Codex: Translates natural language to code.
  • DALL-E: Creates and edits original images.
  • Whisper: A general-purpose speech recognition model. It is trained on a large dataset of diverse audio and is also a multitasking model that can perform multilingual speech recognition, speech translation, and language identification.

Lightning Fast

The OpenAI APIs advanced inference infrastructure provides extremely short response times.

Scalable

It can handle high volume requests that scale with your needs.

Flexible

Easy to use and flexible enough to make machine learning teams more productive.

Supported Operations

OpenAI API

List assistants

Returns a list of assistants.

Create assistant

Create an assistant with a model and instructions.

Retrieve assistant

Retrieves an assistant.

Modify assistant

Modifies an assistant.

Delete assistant

Delete an assistant.

Create speech

Generates audio from the input text.

Create transcription

Transcribes audio into the input language.

Create translation

Translates audio into English.

List batch

List your organization's batches.

Create batch

Creates and executes a batch from an uploaded file of requests

Retrieve batch

Retrieves a batch.

Cancel batch

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.

List Chat Completions

List stored Chat Completions. Only Chat Completions that have been stored with the `store` parameter set to `true` will be returned.

Create chat completion

**Starting a new project?** We recommend trying [Responses](https://platform.openai.com/docs/api-reference/responses) to take advantage of the latest OpenAI platform features. Compare [Chat Completions with Responses](https://platform.openai.com/docs/guides/responses-vs-chat-completions?api-mode=responses). --- 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).

Get chat completion

Get a stored chat completion. Only Chat Completions that have been created with the `store` parameter set to `true` will be returned.

Update chat completion

Modify a stored chat completion. Only Chat Completions that have been created with the `store` parameter set to `true` can be modified. Currently, the only supported modification is to update the `metadata` field.

Delete chat completion

Delete a stored chat completion. Only Chat Completions that have been created with the `store` parameter set to `true` can be deleted.

Get chat messages

Get the messages in a stored chat completion. Only Chat Completions that have been created with the `store` parameter set to `true` will be returned.

Create ChatKit session

Create a ChatKit session

Cancel chat session

Cancel a ChatKit session

List ChatKit threads

List ChatKit threads

Retrieve ChatKit thread

Retrieve a ChatKit thread

Delete ChatKit thread

Delete a ChatKit thread

List ChatKit thread items

List ChatKit thread items

Create completion

Creates a completion for the provided prompt and parameters.

List containers

List Containers

Create container

Create Container

Retrieve container

Retrieve Container

Delete a container

Delete Container

List container files

List Container files

Create container file

Create a Container File You can send either a multipart/form-data request with the raw file content, or a JSON request with a file ID.

Retrieve container file

Retrieve Container File

Delete a container file

Delete Container File

Retrieve container file content

Retrieve Container File Content

Create a conversation

Create a conversation.

Retrieve a conversation

Get a conversation

Update a conversation

Update a conversation

Delete a conversation

Delete a conversation. Items in the conversation will not be deleted.

List items

List all items for a conversation with the given ID.

Create items

Create items in a conversation with the given ID.

Retrieve an item

Get a single item from a conversation with the given IDs.

Delete an item

Delete an item from a conversation with the given IDs.

Create embeddings

Creates an embedding vector representing the input text.

List evals

List evaluations for a project.

Create eval

Create the structure of an evaluation that can be used to test a model's performance. An evaluation is a set of testing criteria and the config for a data source, which dictates the schema of the data used in the evaluation. After creating an evaluation, you can run it on different models and model parameters. We support several types of graders and datasources. For more information, see the [Evals guide](https://platform.openai.com/docs/guides/evals).

Get an eval

Get an evaluation by ID.

Update an eval

Update certain properties of an evaluation.

Delete an eval

Delete an evaluation.

Get eval runs

Get a list of runs for an evaluation.

Create eval run

Kicks off a new run for a given evaluation, specifying the data source, and what model configuration to use to test. The datasource will be validated against the schema specified in the config of the evaluation.

Get an eval run

Get an evaluation run by ID.

Cancel eval run

Cancel an ongoing evaluation run.

Delete eval run

Delete an eval run.

Get eval run output items

Get a list of output items for an evaluation run.

Get an output item of an eval run

Get an evaluation run output item by ID.

List files

Returns a list of files.

Upload file

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 1 TB. - 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](https://platform.openai.com/docs/api-reference/fine-tuning/chat-input) or [completions](https://platform.openai.com/docs/api-reference/fine-tuning/completions-input) models. - The Batch API only supports `.jsonl` files up to 200 MB in size. The input also has a specific required [format](https://platform.openai.com/docs/api-reference/batch/request-input). Please [contact us](https://help.openai.com/) if you need to increase these storage limits.

Retrieve file

Returns information about a specific file.

Delete file

Delete a file and remove it from all vector stores.

Retrieve file content

Returns the contents of the specified file.

Run grader

Run a grader.

Validate grader

Validate a grader.

List checkpoint permissions

**NOTE:** This endpoint requires an [admin API key](../admin-api-keys). Organization owners can use this endpoint to view all permissions for a fine-tuned model checkpoint.

Create checkpoint permissions

**NOTE:** Calling this endpoint requires an [admin API key](../admin-api-keys). This enables organization owners to share fine-tuned models with other projects in their organization.

Delete checkpoint permission

**NOTE:** This endpoint requires an [admin API key](../admin-api-keys). Organization owners can use this endpoint to delete a permission for a fine-tuned model checkpoint.

List fine-tuning jobs

List your organization's fine-tuning jobs

Create fine-tuning job

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/model-optimization)

Retrieve fine-tuning job

Get info about a fine-tuning job. [Learn more about fine-tuning](https://platform.openai.com/docs/guides/model-optimization)

Cancel fine-tuning

Immediately cancel a fine-tune job.

List fine-tuning checkpoints

List checkpoints for a fine-tuning job.

List fine-tuning events

Get status updates for a fine-tuning job.

Pause fine-tuning

Pause a fine-tune job.

Resume fine-tuning

Resume a fine-tune job.

Create image edit

Creates an edited or extended image given one or more source images and a prompt. This endpoint only supports `gpt-image-1` and `dall-e-2`.

Create image

Creates an image given a prompt. [Learn more](https://platform.openai.com/docs/guides/images).

Create image variation

Creates a variation of a given image. This endpoint only supports `dall-e-2`.

List models

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

Retrieve model

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

Delete a fine-tuned model

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

Create moderation

Classifies if text and/or image inputs are potentially harmful. Learn more in the [moderation guide](https://platform.openai.com/docs/guides/moderation).

List all organization and project API keys.

List organization API keys

Create admin API key

Create an organization admin API key

Retrieve admin API key

Retrieve a single organization API key

Delete admin API key

Delete an organization admin API key

List audit logs

List user actions and configuration changes within this organization.

List organization certificates

List uploaded certificates for this organization.

Upload certificate

Upload a certificate to the organization. This does **not** automatically activate the certificate. Organizations can upload up to 50 certificates.

Activate certificates for organization

Activate certificates at the organization level. You can atomically and idempotently activate up to 10 certificates at a time.

Deactivate certificates for organization

Deactivate certificates at the organization level. You can atomically and idempotently deactivate up to 10 certificates at a time.

Get certificate

Get a certificate that has been uploaded to the organization. You can get a certificate regardless of whether it is active or not.

Modify certificate

Modify a certificate. Note that only the name can be modified.

Delete certificate

Delete a certificate from the organization. The certificate must be inactive for the organization and all projects.

Costs

Get costs details for the organization.

List invites

Returns a list of invites in the organization.

Create invite

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

Retrieve invite

Retrieves an invite.

Delete invite

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

List projects

Returns a list of projects.

Create project

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

Retrieve project

Retrieves a project.

Modify project

Modifies a project in the organization.

List project API keys

Returns a list of API keys in the project.

Retrieve project API key

Retrieves an API key in the project.

Delete project API key

Deletes an API key from the project.

Archive project

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

List project certificates

List certificates for this project.

Activate certificates for project

Activate certificates at the project level. You can atomically and idempotently activate up to 10 certificates at a time.

Deactivate certificates for project

Deactivate certificates at the project level. You can atomically and idempotently deactivate up to 10 certificates at a time.

List project rate limits

Returns the rate limits per model for a project.

Modify project rate limit

Updates a project rate limit.

List project service accounts

Returns a list of service accounts in the project.

Create project service account

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

Retrieve project service account

Retrieves a service account in the project.

Delete project service account

Deletes a service account from the project.

List project users

Returns a list of users in the project.

Create project user

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

Retrieve project user

Retrieves a user in the project.

Modify project user

Modifies a user's role in the project.

Delete project user

Deletes a user from the project.

Audio speeches

Get audio speeches usage details for the organization.

Audio transcriptions

Get audio transcriptions usage details for the organization.

Code interpreter sessions

Get code interpreter sessions usage details for the organization.

Completions

Get completions usage details for the organization.

Embeddings

Get embeddings usage details for the organization.

Images

Get images usage details for the organization.

Moderations

Get moderations usage details for the organization.

Vector stores

Get vector stores usage details for the organization.

List users

Lists all of the users in the organization.

Retrieve user

Retrieves a user by their identifier.

Modify user

Modifies a user's role in the organization.

Delete user

Deletes a user from the organization.

Create call

Create a new Realtime API call over WebRTC and receive the SDP answer needed to complete the peer connection.

Accept call

Accept an incoming SIP call and configure the realtime session that will handle it.

Hang up call

End an active Realtime API call, whether it was initiated over SIP or WebRTC.

Refer call

Transfer an active SIP call to a new destination using the SIP REFER verb.

Reject call

Decline an incoming SIP call by returning a SIP status code to the caller.

Create client secret

Create a Realtime client secret with an associated session configuration.

Create 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.

Create transcription session

Create an ephemeral API token for use in client-side applications with the Realtime API specifically for realtime transcriptions. Can be configured with the same session parameters as the `transcription_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.

Create a model response

Creates a model response. Provide [text](https://platform.openai.com/docs/guides/text) or [image](https://platform.openai.com/docs/guides/images) inputs to generate [text](https://platform.openai.com/docs/guides/text) or [JSON](https://platform.openai.com/docs/guides/structured-outputs) outputs. Have the model call your own [custom code](https://platform.openai.com/docs/guides/function-calling) or use built-in [tools](https://platform.openai.com/docs/guides/tools) like [web search](https://platform.openai.com/docs/guides/tools-web-search) or [file search](https://platform.openai.com/docs/guides/tools-file-search) to use your own data as input for the model's response.

Get input token counts

Get input token counts

Get a model response

Retrieves a model response with the given ID.

Delete a model response

Deletes a model response with the given ID.

Cancel a response

Cancels a model response with the given ID. Only responses created with the `background` parameter set to `true` can be cancelled. [Learn more](https://platform.openai.com/docs/guides/background).

List input items

Returns a list of input items for a given response.

Create thread

Create a thread.

Create thread and run

Create a thread and run it in one request.

Retrieve thread

Retrieves a thread.

Modify thread

Modifies a thread.

Delete thread

Delete a thread.

List messages

Returns a list of messages for a given thread.

Create message

Create a message.

Retrieve message

Retrieve a message.

Modify message

Modifies a message.

Delete message

Deletes a message.

List runs

Returns a list of runs belonging to a thread.

Create run

Create a run.

Retrieve run

Retrieves a run.

Modify run

Modifies a run.

Cancel a run

Cancels a run that is `in_progress`.

List run steps

Returns a list of run steps belonging to a run.

Retrieve run step

Retrieves a run step.

Submit tool outputs to run

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.

Create upload

Creates an intermediate [Upload](https://platform.openai.com/docs/api-reference/uploads/object) object that you can add [Parts](https://platform.openai.com/docs/api-reference/uploads/part-object) 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` values, the correct `mime_type` must be specified. Please refer to documentation for the [supported MIME types for your use case](https://platform.openai.com/docs/assistants/tools/file-search#supported-files). 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).

Cancel upload

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

Complete upload

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.

Add upload part

Adds a [Part](https://platform.openai.com/docs/api-reference/uploads/part-object) 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).

List vector stores

Returns a list of vector stores.

Create vector store

Create a vector store.

Retrieve vector store

Retrieves a vector store.

Modify vector store

Modifies a vector store.

Delete vector store

Delete a vector store.

Create vector store file batch

Create a vector store file batch.

Retrieve vector store file batch

Retrieves a vector store file batch.

Cancel vector store file batch

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

List vector store files in a batch

Returns a list of vector store files in a batch.

List vector store files

Returns a list of vector store files.

Create vector store file

Create a vector store file by attaching a [File](https://platform.openai.com/docs/api-reference/files) to a [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object).

Retrieve vector store file

Retrieves a vector store file.

Update vector store file attributes

Update attributes on a vector store file.

Delete vector store file

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.

Retrieve vector store file content

Retrieve the parsed contents of a vector store file.

Search vector store

Search a vector store for relevant chunks based on a query and file attributes filter.

List videos

List videos

Create video

Create a video

Retrieve video

Retrieve a video

Delete video

Delete a video

Retrieve video content

Download video content

Remix video

Create a video remix

Details
Last Update

2 months ago

Includes
openai-api-client