POST /v1/classify
This endpoint makes a prediction about which label fits the specified text inputs best. To make a prediction, Classify uses the provided examples
of text + label pairs as a reference.
Note: Fine-tuned models trained on classification examples don't require the examples
parameter to be passed in explicitly.
Servers
- https://api.cohere.com
Request headers
Name | Type | Required | Description |
---|---|---|---|
Content-Type |
String | Yes |
The media type of the request body.
Default value: "application/json" |
X-Client-Name |
String | No |
The name of the project that is making the request. |
Request body fields
Name | Type | Required | Description |
---|---|---|---|
preset |
String | No |
The ID of a custom playground preset. You can create presets in the playground. If you use a preset, all other parameters become optional, and any included parameters will override the preset's parameters. |
inputs[] |
Array | Yes |
A list of up to 96 texts to be classified. Each one must be a non-empty string.
There is, however, no consistent, universal limit to the length a particular input can be. We perform classification on the first |
examples[] |
Array | No |
An array of examples to provide context to the model. Each example is a text string and its associated label/class. Each unique label requires at least 2 examples associated with it; the maximum number of examples is 2500, and each example has a maximum length of 512 tokens. The values should be structured as |
examples[].text |
String | No | |
examples[].label |
String | No | |
truncate |
String | No |
One of Possible values:
Default value: "END" |
model |
String | No |
ID of a Fine-tuned Classify model |
How to start integrating
- Add HTTP Task to your workflow definition.
- Search for the API you want to integrate with and click on the name.
- This loads the API reference documentation and prepares the Http request settings.
- Click Test request to test run your request to the API and see the API's response.