# What is the OpenAI API, and who can use it?

Date: 2020-06-12 · Author: Robert Scales · https://guidetoartificialintelligence.com/en/learn/what-is-the-openai-api/

**Answer:** The OpenAI API is a new web service, announced on June 11, 2020, that lets software send text to OpenAI's GPT-3 family of models and get a continuation back. For now it is a private beta: developers, companies and researchers join a waitlist and OpenAI approves them one by one.

Yesterday OpenAI opened a waitlist for a commercial product, the OpenAI API. An API (application programming interface) is a door one program uses to talk to another. Here, your program sends a piece of text, called a prompt, and OpenAI's servers send back a completion: more text that tries to follow the pattern you started.

Behind that door are models from the GPT-3 family, the large language models OpenAI described in its paper two weeks ago. OpenAI calls the interface general-purpose, because the same "text in, text out" call can be pointed at almost any English task, from summaries to classification to drafting.

## How the API works

Most AI services today are built for one job: a translation service translates, a sentiment tool labels reviews. The OpenAI API takes a different approach. You decide the job by what you write in the prompt. OpenAI describes this as programming the model by showing it a few examples, the same few-shot idea from the GPT-3 paper.

There are two more ways to steer it, according to the announcement. You can train the model further on a set of your own examples, small or large, to sharpen it for one task. And you can improve it using feedback from your users or from people hired to rate outputs.

OpenAI says results vary with how hard the task is. Simple, clearly patterned tasks tend to work; complex ones may not.

## Who can use it today

Access is not open to everyone yet. OpenAI is running a private beta, and so far it has vetted each user individually. Early participants named in the announcement include Algolia (search), Quizlet (study tools) and Reddit, along with researchers at the Middlebury Institute. Anyone else can request access through the waitlist on OpenAI's site.

OpenAI explains why it chose an API instead of publishing the model for download:

1. **Funding.** Selling access helps pay for its research, safety and policy work.
2. **Size.** The underlying models are very large and costly to run, which would leave them in the hands of big companies. Serving them online lets smaller organizations use them too.
3. **Control.** If a use turns out to be harmful, OpenAI can cut off access, which is not possible once a model is freely downloadable.

The company says it will end access for uses such as harassment, spam, radicalization or astroturfing (fake grassroots campaigns). It also acknowledges that the models carry biases, as its own paper documents, and says it is building tools to detect and reduce them.

## A first request, step by step

If you get into the beta, a first session might look like this:

1. Decide on one narrow task, for example turning a customer email into a one-line summary.
2. Write two or three real examples of email and summary pairs.
3. Add the new email at the end and leave the summary blank.
4. Send it and read the result. Change the examples, not the code, if the result is off.

```prompt
Email: Hi, my order #1042 arrived with a cracked lid. Can you send a new one?
Summary: Customer needs a replacement lid for order 1042.

Email: I was charged twice for my March subscription, please refund one.
Summary: Customer wants a refund for a duplicate March charge.

Email: Can I change my delivery address before Friday? I'm moving.
Summary:
```

> **Try it:** Pick a repetitive writing task from your own week. Write three example pairs for it on paper, in the format above, before you ever touch an API. If you can't write clear examples, the model won't find a clear pattern either.

## What could a small team build with it?

The most interesting point in the announcement may be the second reason above: a two-person company cannot train or host a model of this size, but it can make a web request. That changes who gets to experiment. A small team with a good idea and careful prompts can now test features that would have needed a research lab.

Realistic first projects are narrow and easy to check. A support desk could draft replies for a human to approve. A teacher could turn reading passages into practice questions. A small online shop could write first-draft product descriptions from a short list of features. A search tool could turn a plain-language question into a better query. In each case a person stays in the loop, reads the output, and fixes mistakes before anything reaches a customer.

Two habits will help. Keep the task small enough that you can test it on twenty real examples and count how often it works. And plan for wrong or odd answers from the start, since OpenAI itself says the models can produce biased or harmful text. Many builders expect the beta to fill up fast, so it is worth writing down your use case clearly now, while you wait for access.

## Sources

- OpenAI API: https://openai.com/index/openai-api/
- GPT-3: https://en.wikipedia.org/wiki/GPT-3
- Language Models are Few-Shot Learners: https://arxiv.org/abs/2005.14165
