POST /v2/embed
This endpoint returns text embeddings. An embedding is a list of floating point numbers that captures semantic information about the text that it represents.
Embeddings can be used to create text classifiers as well as empower semantic search. To learn more about embeddings, see the embedding page.
If you want to learn more how to use the embedding model, have a look at the Semantic Search Guide.
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 |
---|---|---|---|
inputs[] |
Array | No |
An array of inputs for the model to embed. Maximum number of inputs per call is |
inputs[].content[] |
Array | Yes |
An array of objects containing the input data for the model to embed. |
input_type |
String | Yes |
Specifies the type of input passed to the model. Required for embedding models v3 and higher.
Possible values:
|
embedding_types[] |
Array | No |
Specifies the types of embeddings you want to get back. Can be one or more of the following types.
Default value: [ "float" ] |
images[] |
Array | No |
An array of image data URIs for the model to embed. Maximum number of images per call is The image must be a valid data URI. The image must be in either Image embeddings are supported with Embed v3.0 and newer models. |
texts[] |
Array | No |
An array of strings for the model to embed. Maximum number of texts per call is |
truncate |
String | No |
One of Passing If Possible values:
Default value: "END" |
max_tokens |
Integer | No |
The maximum number of tokens to embed per input. If the input text is longer than this, it will be truncated according to the |
output_dimension |
Integer | No |
The number of dimensions of the output embedding. This is only available for |
model |
String | Yes |
ID of one of the available Embedding models. |
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.