# OpenAI API

> Use AI models such as ChatGPT or DALL-E to experience the capabilities of AI.

OpenAI is a machine learning API from openai.com. Requests are authenticated with an API key. It is served over HTTPS and allows browser requests (CORS). Its OpenAPI description documents 28 endpoints.

## At a glance

- Category: [Machine Learning](https://www.openparable.com/apis/category/machine-learning)
- Provider: openai.com
- Authentication: API key
- HTTPS: Yes
- CORS: Yes
- Base URL: https://api.openai.com/v1
- Documentation: https://openai.com/index/openai-api
- OpenAPI description: https://api.apis.guru/v2/specs/openai.com/1.2.0/openapi.json
- Version: 1.2.0
- Specification updated: 2023-03-03

## Example request

```bash
curl -X GET "https://api.openai.com/v1/files" \
  -H "Accept: application/json" \
  -H "X-API-Key: YOUR_API_KEY"
```

## Endpoints

- `POST /answers` (deprecated) — Answers the specified question using the provided documents and examples. The endpoint first [searches](/docs/api-reference/searches) over provided documents o
- `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` (deprecated) — Classifies the specified `query` using provided examples. The endpoint first [searches](/docs/api-reference/searches) over the labeled examples to select the o
- `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` (deprecated) — Lists the currently available (non-finetuned) models, and provides basic information about each one such as the owner and availability.
- `GET /engines/{engine_id}` (deprecated) — Retrieves a model instance, providing basic information about it such as the owner and availability.
- `POST /engines/{engine_id}/search` (deprecated) — 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 o
- `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 u
- `GET /files/{file_id}` — Returns information about a specific file.
- `DELETE /files/{file_id}` — Delete a file.
- `GET /files/{file_id}/content` — Returns the contents of the specified file
- `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 fi
- `GET /fine-tunes/{fine_tune_id}` — Gets info about the fine-tune job. [Learn more about Fine-tuning](/docs/guides/fine-tuning)
- `POST /fine-tunes/{fine_tune_id}/cancel` — Immediately cancel a fine-tune job.
- `GET /fine-tunes/{fine_tune_id}/events` — Get fine-grained status updates for a fine-tune job.
- `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.
- `GET /models/{model}` — Retrieves a model instance, providing basic information about the model such as the owner and permissioning.
- `DELETE /models/{model}` — Delete a fine-tuned model. You must have the Owner role in your organization.
- `POST /moderations` — Classifies if text violates OpenAI's Content Policy

## Questions

### Does the OpenAI API need an API key?

Yes. The OpenAI API uses API key authentication; the documentation explains how to get credentials.

### Can I call the OpenAI API from the browser?

Yes. The OpenAI API sends CORS headers, so a web page can call it directly with fetch().

### Does the OpenAI API support HTTPS?

Yes, the OpenAI API is served over HTTPS.

### How many endpoints does the OpenAI API have?

Its OpenAPI description lists 28 endpoints in version 1.2.0. All of them are shown on this page.

### What are alternatives to the OpenAI API?

Other Machine Learning APIs include Dialogflow, Hugging Face, WolframAlpha, OpenRouter, Laya Decision Gateway.

## Similar machine learning APIs

- [Dialogflow](https://www.openparable.com/apis/dialogflow): Natural Language Processing
- [Hugging Face](https://www.openparable.com/apis/hugging-face): AI model hub with inference API for NLP, computer vision, and audio
- [WolframAlpha](https://www.openparable.com/apis/wolframalpha): Provides specific answers to questions using data and algorithms
- [OpenRouter](https://www.openparable.com/apis/openrouter): Unified API for 300+ LLMs from OpenAI, Anthropic, Meta, Mistral and more, with a free tier
- [Laya Decision Gateway](https://www.openparable.com/apis/laya-decision-gateway): Sub-35ms AI gateway for prompt injection defense, support ticket triage & content moderation
- [ElevenLabs API Documentation](https://www.openparable.com/apis/elevenlabs-documentation): This is the documentation for the ElevenLabs API. You can use this API to use our service programmatically, this is done by using your xi-api-key. <br/> You can view your xi-api-key using the 'Profile' tab on https://beta.elevenlabs.io. Our API is experimental so all endpoints are subject to change.
- [Mistral AI](https://www.openparable.com/apis/mistral-ai): High-performance LLM API by Mistral AI including Mistral and Mixtral models, with a free tier
- [Google Gemini](https://www.openparable.com/apis/google-gemini): Multimodal generative AI for text, vision, and code generation
- [Cohere](https://www.openparable.com/apis/cohere): NLP API for text generation, embeddings, classification and summarization with a free trial tier
- [Groq](https://www.openparable.com/apis/groq): Fast AI inference API with free tier, supports Llama, Mixtral, Gemma models
- [Wolfram](https://www.openparable.com/apis/wolfram): Compute answers using Wolfram's breakthrough technology & knowledgebase, relied on by millions of students & professionals. For math, science, nutrition, history, geography, engineering, mathematics, linguistics, sports, finance, music…
- [Keen IO](https://www.openparable.com/apis/keen-io): Keen is a fully managed event streaming platform built on Apache Kafka. Start streaming in minutes with 30 days free.

Listed from: public-apis database (MIT), APIs.guru (CC0). Check the provider's terms before use.

---

Source: https://www.openparable.com/apis/openai (OpenParable). Cite the canonical URL above.
