OpenAI has disrupted the industry with the introduction of their Artificial General Intelligence (AGI) and its ability to understand or learn intellectual tasks. Its Generative Pre-trained Transformer (GPT) technology has taken the industry and society by storm. With GPT-3 and more recently GPT-4, and the ChatGPT AI tool built on top it, it provides a conversational interface that allows users to ask questions and get responses in natural language. This same functionality is available via their OpenAI APIs that include Text completion, Code completion, Chat completion, Image generation, Fine-tuning, Embeddings, Speech to text, Moderation, Rate limits, Error codes, Safety best practices, and Production best practices.
The OpenAPI Text Completions API alone allow developers to leverage many of the same functionalities that ChatGPT uses or offers. This API provides functionality for text generation, conversation, transformation, translation, conversion, completion, text insertion, summarization, and even fact-based summaries. Their Chat completions API allows you to create conversational agents, translate languages, and complete writing or code pieces. And their Speech-to-text API allows you to turn audio into text, transcribe or translate the audio into one of the supported languages. As of the time of this writing I counted 58 supported languages which are the trained languages that have less than 50% word error rate speech-to-text model accuracy. They also offer their Embeddings API that can be used to search, cluster, classify, and other functionality such as recommendations. And with their Image generation APIs (used by the DALL-E app) you can generate images based on a text prompt.
Their Pricing Model is based on tokens that can be purchased and used across their APIs. From their website “Prices are per 1,000 tokens. You can think of tokens as pieces of words, where 1,000 tokens is about 750 words. This paragraph is 35 tokens.”
- For ChatGPT gpt-3.5-turbo (model optimized for dialogue) the costs are $0.002 / 1K tokens.
- For GPT-4 (model that can follow complex instructions in natural language and solve difficult problems with accuracy, the costs are for Prompts (i.e. the input text/question asked) $0.03 to $0.06 / 1K tokens, and for Completion (i.e. the response) $0.06 to $0.12 / 1K tokens.
OpenAI implements rate limits to protect themselves from bad actors, and to ensure their services are available to everyone. Some products such as davinci (their most powerful InstructGPT model) cost 1 token per minute, while GPT-4 will cost 40K to 80K tokens per minute. Refer to the OpenAI API usage rate limits for more information. You can also read their cookbook on How to Handle Rate Limits.
Below is a summary of all the models that OpenAI currently offers; you can read more details including max tokens, training data, and other information by visiting the OpenAI Models page.
- GPT-4 – Currently in limited beta, it is a set of models that improve on GPT-3.5 and can understand as well as generate natural language or code
- GPT-3.5 – A set of models that improve on GPT-3 and can understand as well as generate natural language or code.
- DALL·E – Currently in beta, is a model that can generate and edit images given a natural language prompt.
- Whisper – Currently in beta, is a model that can convert audio into text
- Embeddings – A set of models that can convert text into a numerical form
- Moderation – A fine-tuned model that can detect whether text may be sensitive or unsafe.
- GPT-3 – A set of models that can understand and generate natural language.
- Codex – Deprecated, is a set of models that can understand and generate code, including translating natural language to code.