APIHub
Back to Explore

OpenAI API

The OpenAI API provides programmatic access to a family of AI models for tasks such as text completion, chat, embeddings, edits, classifications, audio transcription/translation, image generation and editing, as well as utilities for searching documents, moderating content, managing files, and creating or managing fine‑tuned models.

Machine Learning
none
HTTPS
CORS: Unknown
Description enriched
Visit official documentation

Latency

674ms p95

Uptime

100.0% 30d

Playground

Verified

live

Endpoints

REST · JSON
GET

/engines/{engine_id}

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

  • engine_id (path, required) — The ID of the engine to use for this request
POST

/answers

Answers the specified question using the provided documents and examples. The endpoint first [searches](/docs/api-reference/searches) over provided documents or files to find relevant context. The relevant context is combined with the provided examples and question to create the prompt for [completion](/docs/api-reference/completions).

POST

/audio/transcriptions

Transcribes audio into the input language.

POST

/audio/translations

Translates audio into into English.

POST

/chat/completions

Creates a completion for the chat message

POST

/classifications

Classifies the specified `query` using provided examples. The endpoint first [searches](/docs/api-reference/searches) over the labeled examples to select the ones most relevant for the particular query. Then, the relevant examples are combined with the query to construct a prompt to produce the final label via the [completions](/docs/api-reference/completions) endpoint. Labeled examples can be provided via an uploaded `file`, or explicitly listed in the request using the `examples` parameter for quick tests and small scale use cases.

POST

/completions

Creates a completion for the provided prompt and parameters

POST

/edits

Creates a new edit for the provided input, instruction, and parameters.

POST

/embeddings

Creates an embedding vector representing the input text.

GET

/engines

Lists the currently available (non-finetuned) models, and provides basic information about each one such as the owner and availability.

POST

/engines/{engine_id}/search

The search endpoint computes similarity scores between provided query and documents. Documents can be passed directly to the API if there are no more than 200 of them. To go beyond the 200 document limit, documents can be processed offline and then used for efficient retrieval at query time. When `file` is set, the search endpoint searches over all the documents in the given file and returns up to the `max_rerank` number of documents. These documents will be returned along with their search scores. The similarity score is a positive score that usually ranges from 0 to 300 (but can sometimes go higher), where a score above 200 usually means the document is semantically similar to the query.

  • engine_id (path, required) — The ID of the engine to use for this request. You can select one of `ada`, `babbage`, `curie`, or `davinci`.
GET

/files

Returns a list of files that belong to the user's organization.

POST

/files

Upload a file that contains document(s) to be used across various endpoints/features. Currently, the size of all the files uploaded by one organization can be up to 1 GB. Please contact us if you need to increase the storage limit.

DELETE

/files/{file_id}

Delete a file.

  • file_id (path, required) — The ID of the file to use for this request
GET

/files/{file_id}

Returns information about a specific file.

  • file_id (path, required) — The ID of the file to use for this request
GET

/files/{file_id}/content

Returns the contents of the specified file

  • file_id (path, required) — The ID of the file to use for this request
GET

/fine-tunes

List your organization's fine-tuning jobs

POST

/fine-tunes

Creates a job that fine-tunes a specified 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](/docs/guides/fine-tuning)

GET

/fine-tunes/{fine_tune_id}

Gets info about the fine-tune job. [Learn more about Fine-tuning](/docs/guides/fine-tuning)

  • fine_tune_id (path, required) — The ID of the fine-tune job
POST

/fine-tunes/{fine_tune_id}/cancel

Immediately cancel a fine-tune job.

  • fine_tune_id (path, required) — The ID of the fine-tune job to cancel
GET

/fine-tunes/{fine_tune_id}/events

Get fine-grained status updates for a fine-tune job.

  • fine_tune_id (path, required) — The ID of the fine-tune job to get events for.
  • stream (query) — Whether to stream events for the fine-tune job. If set to true, events will be sent as data-only [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) as they become available. The stream will terminate with a `data: [DONE]` message when the job is finished (succeeded, cancelled, or failed). If set to false, only events generated so far will be returned.
POST

/images/edits

Creates an edited or extended image given an original image and a prompt.

POST

/images/generations

Creates an image given a prompt.

POST

/images/variations

Creates a variation of a given image.

GET

/models

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

DELETE

/models/{model}

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

  • model (path, required) — The model to delete
GET

/models/{model}

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

  • model (path, required) — The ID of the model to use for this request
POST

/moderations

Classifies if text violates OpenAI's Content Policy

28 endpoints auto-detected

curl -X GET \
  "https://api.openai.com/v1/engines/{engine_id}"

api.openai.com · HTTPS only