Introducing the classifications endpoint
The OpenAI API also provides the classifications endpoint for text classification tasks. The classifications endpoint simplifies many classification tasks. It uses a combination of semantic search and completions engines to classify text based on the samples you provide. You can provide up to 200 examples along with your HTTP request or you can pre-uploaded files containing example data.
The URL for the classifications endpoint is https://api.openai.com/v1/classifications. It expects an HTTP POST
with a JSON body containing input parameters. One of the required parameters is the query parameter. The value of the query parameter is the text to classify. The query value is first used to do a semantic search to find relevant examples from the examples provided. Then, the examples are used, along with the query, to create a prompt for a defined completions engine that will classify the text.
The...