/v1/embed-jobsCreate an Embed JobThis API launches an async Embed job for a Dataset of type embed-input. The result of a completed embed job is new Dataset of type embed-output, which contains the original text entries and the corresponding embeddings.
Parameters
X-Client-NamestringheaderThe name of the project that is making the request.
Request body
application/json
dataset_idstringrequiredID of a [Dataset](https://docs.cohere.com/docs/datasets). The Dataset must be of type `embed-input` and must have a validation status `Validated`
embedding_typesarray of stringSpecifies the types of embeddings you want to get back. Not required and default is None, which returns the Embed Floats response type. Can be one or more of the following types. * `"float"`: Use this when you want to get back the default float embeddings. Valid for all models. * `"int8"`: Use this when you want to get back signed int8 embeddings. Valid for v3 and newer model versions. * `"uint8"`: Use this when you want to get back unsigned int8 embeddings. Valid for v3 and newer model versions. * `"binary"`: Use this when you want to get back signed binary embeddings. Valid for v3 and newer model versions. * `"ubinary"`: Use this when you want to get back unsigned binary embeddings. Valid for v3 and newer model versions.
Show child attributes
input_typestringrequiredSpecifies the type of input passed to the model. Required for embedding models v3 and higher. - `"search_document"`: Used for embeddings stored in a vector database for search use-cases. - `"search_query"`: Used for embeddings of search queries run against a vector DB to find relevant documents. - `"classification"`: Used for embeddings passed through a text classifier. - `"clustering"`: Used for the embeddings run through a clustering algorithm. - `"image"`: Used for embeddings with image input.
modelstring · stringrequiredID of the embedding model. Available models and corresponding embedding dimensions: - `embed-english-v3.0` : 1024 - `embed-multilingual-v3.0` : 1024 - `embed-english-light-v3.0` : 384 - `embed-multilingual-light-v3.0` : 384
namestringThe name of the embed job.
truncatestringOne of `START|END` to specify how the API will handle inputs longer than the maximum token length. Passing `START` will discard the start of the input. `END` will discard the end of the input. In both cases, input is discarded until the remaining input is exactly the maximum input token length for the model.
{
"dataset_id": "string",
"embedding_types": [
"base64"
],
"input_type": "classification",
"model": "string",
"name": "string",
"truncate": "END"
}Responses
Headers
X-API-WarningThe name of the project that is making the request.
Response from creating an embed job.
job_idstringrequiredmetaobjectShow child attributes
api_versionobjectShow child attributes
is_deprecatedbooleanis_experimentalbooleanversionstringrequiredbilled_unitsobjectShow child attributes
classificationsnumberThe number of billed classifications units.
image_tokensnumberThe number of billed image tokens.
imagesnumberThe number of billed images.
input_tokensnumberThe number of billed input tokens.
output_tokensnumberThe number of billed output tokens.
pagesnumberThe number of billed pages parsed.
search_unitsnumberThe number of billed search units.
cached_tokensnumberThe number of prompt tokens that hit the inference cache.
tokensobjectShow child attributes
input_tokensnumberThe number of tokens used as input to the model.
output_tokensnumberThe number of tokens produced by the model.
warningsarray of stringShow child attributes
{
"job_id": "string",
"meta": {
"api_version": {
"is_deprecated": true,
"is_experimental": true,
"version": "string"
},
"billed_units": {
"classifications": 0,
"image_tokens": 0,
"images": 0,
"input_tokens": 0,
"output_tokens": 0,
"pages": 0,
"search_units": 0
},
"cached_tokens": 0,
"tokens": {
"input_tokens": 0,
"output_tokens": 0
},
"warnings": [
"string"
]
}
}idstringmessagestring{
"id": "string",
"message": "string"
}idstringmessagestring{
"id": "string",
"message": "string"
}idstringmessagestring{
"id": "string",
"message": "string"
}idstringmessagestring{
"id": "string",
"message": "string"
}idstringmessagestring{
"id": "string",
"message": "string"
}idstringmessagestring{
"id": "string",
"message": "string"
}idstringmessagestring{
"id": "string",
"message": "string"
}idstringmessagestring{
"id": "string",
"message": "string"
}idstringmessagestring{
"id": "string",
"message": "string"
}idstringmessagestring{
"id": "string",
"message": "string"
}idstringmessagestring{
"id": "string",
"message": "string"
}idstringmessagestring{
"id": "string",
"message": "string"
}