### GET /v1/datasets Source: https://raw.githubusercontent.com/cohere-ai/cohere-developer-experience/refs/heads/main/cohere-openapi.yaml List datasets that have been created. ```markdown ### Parameters - **datasetType** (string, query, optional): optional filter by dataset type - **before** (string (date-time), query, optional): optional filter before a date - **after** (string (date-time), query, optional): optional filter after a date - **limit** (number, query, optional): optional limit to number of results - **offset** (number, query, optional): optional offset to start of results - **validationStatus** (DatasetValidationStatus, query, optional): optional filter by validation status - **X-Client-Name** (string, header, optional): The name of the project that is making the request. ### Responses #### 200 - A successful response. - **datasets** (array (Dataset)) Array items: - **id** (string) (required): The dataset ID - **name** (string) (required): The name of the dataset - **created_at** (string (date-time)) (required): The creation date - **updated_at** (string (date-time)) (required): The last update date - **dataset_type** (string (embed-input|embed-result|cluster-result|cluster-outliers|reranker-finetune-input|single-label-classification-finetune-input|chat-finetune-input|multi-label-classification-finetune-input|batch-chat-input|batch-openai-chat-input|batch-embed-v2-input|batch-chat-v2-input)) (required): The type of the dataset ("embed-input"|"embed-result"|"cluster-result"|"cluster-outliers"|"reranker-finetune-input"|"single-label-classification-finetune-input"|"chat-finetune-input"|"multi-label-classification-finetune-input"|"batch-chat-input"|"batch-openai-chat-input"|"batch-embed-v2-input"|"batch-chat-v2-input") - **validation_status** (string (unknown|queued|processing|failed|validated|skipped)) (required): The validation status of the dataset ("unknown"|"queued"|"processing"|"failed"|"validated"|"skipped") - **validation_error** (string): Errors found during validation - **schema** (string): the avro schema of the dataset - **required_fields** (array (string)) - **preserve_fields** (array (string)) - **dataset_parts** (array (DatasetPart)): the underlying files that make up the dataset Array items: - **id** (string) (required): The dataset part ID - **name** (string) (required): The name of the dataset part - **url** (string): The download url of the file - **index** (integer (int32)): The index of the file - **size_bytes** (integer (int32)): The size of the file in bytes - **num_rows** (integer (int32)): The number of rows in the file - **original_url** (string): The download url of the original file - **samples** (array (string)): The first few rows of the parsed file - **validation_warnings** (array (string)): warnings found during validation - **parse_info** (object) - **separator** (string) - **delimiter** (string) - **metrics** (object) - **finetune_dataset_metrics** (object) - **trainable_token_count** (number (int64)): The number of tokens of valid examples that can be used for training. - **total_examples** (number (int64)): The overall number of examples. - **train_examples** (number (int64)): The number of training examples. - **train_size_bytes** (number (int64)): The size in bytes of all training examples. - **eval_examples** (number (int64)): Number of evaluation examples. - **eval_size_bytes** (number (int64)): The size in bytes of all eval examples. - **reranker_data_metrics** (object) - **num_train_queries** (number (int64)): The number of training queries. - **num_train_relevant_passages** (number (int64)): The sum of all relevant passages of valid training examples. - **num_train_hard_negatives** (number (int64)): The sum of all hard negatives of valid training examples. - **num_eval_queries** (number (int64)): The number of evaluation queries. - **num_eval_relevant_passages** (number (int64)): The sum of all relevant passages of valid eval examples. - **num_eval_hard_negatives** (number (int64)): The sum of all hard negatives of valid eval examples. - **chat_data_metrics** (object) - **num_train_turns** (number (int64)): The sum of all turns of valid train examples. - **num_eval_turns** (number (int64)): The sum of all turns of valid eval examples. - **preamble** (string): The preamble of this dataset. - **classify_data_metrics** (object) - **label_metrics** (array (LabelMetric)) Array items: - **total_examples** (number (int64)): Total number of examples for this label - **label** (string): value of the label - **samples** (array (string)): samples for this label #### 400 - response - **message** (string) - **id** (string) #### 401 - response - **message** (string) - **id** (string) #### 403 - response - **message** (string) - **id** (string) #### 404 - response - **message** (string) - **id** (string) #### 422 - response - **message** (string) - **id** (string) #### 429 - response - **message** (string) - **id** (string) #### 498 - response - **message** (string) - **id** (string) #### 499 - response - **message** (string) - **id** (string) #### 500 - response - **message** (string) - **id** (string) #### 501 - response - **message** (string) - **id** (string) #### 503 - response - **message** (string) - **id** (string) #### 504 - response - **message** (string) - **id** (string) ### Example Usage ```bash curl -X GET "https://api.cohere.com/v1/datasets?datasetType=string&before=2023-01-01T00:00:00Z&after=2023-01-01T00:00:00Z&limit=0&offset=0&validationStatus=value" ``` ``` -------------------------------- ### GET /v1/models Source: https://raw.githubusercontent.com/cohere-ai/cohere-developer-experience/refs/heads/main/cohere-openapi.yaml Returns a list of models available for use. ```markdown ### Parameters - **page_size** (number, query, optional): Maximum number of models to include in a page Defaults to `20`, min value of `1`, max value of `1000`. - **page_token** (string, query, optional): Page token provided in the `next_page_token` field of a previous response. - **endpoint** (CompatibleEndpoint, query, optional): When provided, filters the list of models to only those that are compatible with the specified endpoint. - **default_only** (boolean, query, optional): When provided, filters the list of models to only the default model to the endpoint. This parameter is only valid when `endpoint` is provided. ### Responses #### 200 - OK **ListModelsResponse** - **models** (array (GetModelResponse)) (required) Array items: - **name** (string): Specify this name in the `model` parameter of API requests to use your chosen model. - **is_deprecated** (boolean): Whether the model is deprecated or not. - **endpoints** (array (CompatibleEndpoint)): The API endpoints that the model is compatible with. - **finetuned** (boolean): Whether the model has been fine-tuned or not. - **context_length** (number): The maximum number of tokens that the model can process in a single request. Note that not all of these tokens are always available due to special tokens and preambles that Cohere has added by default. - **tokenizer_url** (string): Public URL to the tokenizer's configuration file. - **default_endpoints** (array (CompatibleEndpoint)): The API endpoints that the model is default to. - **features** (array (string)): The features that the model supports. - **sampling_defaults** (object): Default sampling parameters for this model when omitted from API requests. - **temperature** (number (float)) - **k** (integer (int32)) - **p** (number (float)) - **frequency_penalty** (number (float)) - **presence_penalty** (number (float)) - **max_tokens_per_doc** (integer (int32)) - **next_page_token** (string): A token to retrieve the next page of results. Provide in the page_token parameter of the next request. #### 400 - response - **message** (string) - **id** (string) #### 401 - response - **message** (string) - **id** (string) #### 403 - response - **message** (string) - **id** (string) #### 404 - response - **message** (string) - **id** (string) #### 422 - response - **message** (string) - **id** (string) #### 429 - response - **message** (string) - **id** (string) #### 498 - response - **message** (string) - **id** (string) #### 499 - response - **message** (string) - **id** (string) #### 500 - response - **message** (string) - **id** (string) #### 501 - response - **message** (string) - **id** (string) #### 503 - response - **message** (string) - **id** (string) #### 504 - response - **message** (string) - **id** (string) ### Example Usage ```bash curl -X GET "https://api.cohere.com/v1/models?page_size=0&page_token=string&endpoint=value&default_only=true" ``` ``` -------------------------------- ### POST /v1/summarize Source: https://raw.githubusercontent.com/cohere-ai/cohere-developer-experience/refs/heads/main/cohere-openapi.yaml This API is marked as "Legacy" and is no longer maintained. Follow the [migration guide](https://docs.cohere.com/docs/migrating-from-cogenerate-to-cochat) to start using the Chat API. Generates a summary in English for a given text. ```markdown ### Parameters - **X-Client-Name** (string, header, optional): The name of the project that is making the request. ### Request Body **Content-Type:** application/json - **text** (string) (required): The text to generate a summary for. Can be up to 100,000 characters long. Currently the only supported language is English. - **length** (string (short|medium|long)): One of `short`, `medium`, `long`, or `auto` defaults to `auto`. Indicates the approximate length of the summary. If `auto` is selected, the best option will be picked based on the input text. ("short"|"medium"|"long") - **format** (string (paragraph|bullets)): One of `paragraph`, `bullets`, or `auto`, defaults to `auto`. Indicates the style in which the summary will be delivered - in a free form paragraph or in bullet points. If `auto` is selected, the best option will be picked based on the input text. ("paragraph"|"bullets") - **model** (string): The identifier of the model to generate the summary with. Currently available models are `command` (default), `command-nightly` (experimental), `command-light`, and `command-light-nightly` (experimental). Smaller, "light" models are faster, while larger models will perform better. - **extractiveness** (string (low|medium|high)): One of `low`, `medium`, `high`, or `auto`, defaults to `auto`. Controls how close to the original text the summary is. `high` extractiveness summaries will lean towards reusing sentences verbatim, while `low` extractiveness summaries will tend to paraphrase more. If `auto` is selected, the best option will be picked based on the input text. ("low"|"medium"|"high") - **temperature** (number): Ranges from 0 to 5. Controls the randomness of the output. Lower values tend to generate more “predictable” output, while higher values tend to generate more “creative” output. The sweet spot is typically between 0 and 1. - **additional_command** (string): A free-form instruction for modifying how the summaries get generated. Should complete the sentence "Generate a summary _". Eg. "focusing on the next steps" or "written by Yoda" ### Responses #### 200 - OK - **id** (string): Generated ID for the summary - **summary** (string): Generated summary for the text - **meta** (object) - **api_version** (object) - **version** (string) (required) - **is_deprecated** (boolean) - **is_experimental** (boolean) - **billed_units** (object) - **images** (number): The number of billed images. - **input_tokens** (number): The number of billed input tokens. - **image_tokens** (number): The number of billed image tokens. - **output_tokens** (number): The number of billed output tokens. - **search_units** (number): The number of billed search units. - **classifications** (number): The number of billed classifications units. - **tokens** (object) - **input_tokens** (number): The number of tokens used as input to the model. - **output_tokens** (number): The number of tokens produced by the model. - **cached_tokens** (number): The number of prompt tokens that hit the inference cache. - **warnings** (array (string)) #### 400 - response - **message** (string) - **id** (string) #### 401 - response - **message** (string) - **id** (string) #### 403 - response - **message** (string) - **id** (string) #### 404 - response - **message** (string) - **id** (string) #### 422 - response - **message** (string) - **id** (string) #### 429 - response - **message** (string) - **id** (string) #### 498 - response - **message** (string) - **id** (string) #### 499 - response - **message** (string) - **id** (string) #### 500 - response - **message** (string) - **id** (string) #### 501 - response - **message** (string) - **id** (string) #### 503 - response - **message** (string) - **id** (string) #### 504 - response - **message** (string) - **id** (string) ### Example Usage ```bash curl -X POST "https://api.cohere.com/v1/summarize" \ -H "Content-Type: application/json" \ -d '{ "text": "string", "length": "medium", "format": "paragraph", "model": "string", "extractiveness": "low", "temperature": "0.3", "additional_command": "string" }' ``` ``` -------------------------------- ### GET /v1/finetuning/finetuned-models Source: https://raw.githubusercontent.com/cohere-ai/cohere-developer-experience/refs/heads/main/cohere-openapi.yaml Returns a list of fine-tuned models that the user has access to. ```markdown ### Parameters - **page_size** (integer (int32), query, optional): Maximum number of results to be returned by the server. If 0, defaults to 50. - **page_token** (string, query, optional): Request a specific page of the list results. - **order_by** (string, query, optional): Comma separated list of fields. For example: "created_at,name". The default sorting order is ascending. To specify descending order for a field, append " desc" to the field name. For example: "created_at desc,name". Supported sorting fields: - created_at (default) - **X-Client-Name** (string, header, optional): The name of the project that is making the request. ### Responses #### 200 - A successful response. **ListFinetunedModelsResponse** - **finetuned_models** (array (object)): List of fine-tuned models matching the request. Array items: - **id** (string): read-only. FinetunedModel ID. - **name** (string) (required): FinetunedModel name (e.g. `foobar`). - **creator_id** (string): read-only. User ID of the creator. - **organization_id** (string): read-only. Organization ID. - **settings** (object) (required): The configuration used for fine-tuning. - **base_model** (object) (required): The base model used for fine-tuning. - **name** (string): The name of the base model. - **version** (string): read-only. The version of the base model. - **base_type** (string (BASE_TYPE_UNSPECIFIED|BASE_TYPE_GENERATIVE|BASE_TYPE_CLASSIFICATION|BASE_TYPE_RERANK|BASE_TYPE_CHAT)) (required): The possible types of fine-tuned models. - BASE_TYPE_UNSPECIFIED: Unspecified model. - BASE_TYPE_GENERATIVE: Deprecated: Generative model. - BASE_TYPE_CLASSIFICATION: Classification model. - BASE_TYPE_RERANK: Rerank model. - BASE_TYPE_CHAT: Chat model. ("BASE_TYPE_UNSPECIFIED"|"BASE_TYPE_GENERATIVE"|"BASE_TYPE_CLASSIFICATION"|"BASE_TYPE_RERANK"|"BASE_TYPE_CHAT") - **strategy** (string (STRATEGY_UNSPECIFIED|STRATEGY_VANILLA|STRATEGY_TFEW)): The possible strategy used to serve a fine-tuned models. - STRATEGY_UNSPECIFIED: Unspecified strategy. - STRATEGY_VANILLA: Deprecated: Serve the fine-tuned model on a dedicated GPU. - STRATEGY_TFEW: Deprecated: Serve the fine-tuned model on a shared GPU. ("STRATEGY_UNSPECIFIED"|"STRATEGY_VANILLA"|"STRATEGY_TFEW") - **dataset_id** (string) (required): The data used for training and evaluating the fine-tuned model. - **hyperparameters** (object): The fine-tuning hyperparameters. - **early_stopping_patience** (integer (int32)): Stops training if the loss metric does not improve beyond the value of `early_stopping_threshold` after this many times of evaluation. - **early_stopping_threshold** (number (double)): How much the loss must improve to prevent early stopping. - **train_batch_size** (integer (int32)): The batch size is the number of training examples included in a single training pass. - **train_epochs** (integer (int32)): The number of epochs to train for. - **learning_rate** (number (double)): The learning rate to be used during training. - **lora_alpha** (integer (int32)): Controls the scaling factor for LoRA updates. Higher values make the updates more impactful. - **lora_rank** (integer (int32)): Specifies the rank for low-rank matrices. Lower ranks reduce parameters but may limit model flexibility. - **lora_target_modules** (string (LORA_TARGET_MODULES_UNSPECIFIED|LORA_TARGET_MODULES_QV|LORA_TARGET_MODULES_QKVO|LORA_TARGET_MODULES_QKVO_FFN)): The possible combinations of LoRA modules to target. - LORA_TARGET_MODULES_UNSPECIFIED: Unspecified LoRA target modules. - LORA_TARGET_MODULES_QV: LoRA adapts the query and value matrices in transformer attention layers. - LORA_TARGET_MODULES_QKVO: LoRA adapts query, key, value, and output matrices in attention layers. - LORA_TARGET_MODULES_QKVO_FFN: LoRA adapts attention projection matrices and feed-forward networks (FFN). ("LORA_TARGET_MODULES_UNSPECIFIED"|"LORA_TARGET_MODULES_QV"|"LORA_TARGET_MODULES_QKVO"|"LORA_TARGET_MODULES_QKVO_FFN") - **multi_label** (boolean): read-only. Whether the model is single-label or multi-label (only for classification). - **wandb** (object): The Weights & Biases configuration. - **project** (string) (required): The WandB project name to be used during training. - **api_key** (string) (required): The WandB API key to be used during training. - **entity** (string): The WandB entity name to be used during training. - **status** (string (STATUS_UNSPECIFIED|STATUS_FINETUNING|STATUS_DEPLOYING_API|STATUS_READY|STATUS_FAILED|STATUS_DELETED|STATUS_TEMPORARILY_OFFLINE|STATUS_PAUSED|STATUS_QUEUED)): The possible stages of a fine-tuned model life-cycle. - STATUS_UNSPECIFIED: Unspecified status. - STATUS_FINETUNING: The fine-tuned model is being fine-tuned. - STATUS_DEPLOYING_API: Deprecated: The fine-tuned model is being deployed. - STATUS_READY: The fine-tuned model is ready to receive requests. - STATUS_FAILED: The fine-tuned model failed. - STATUS_DELETED: The fine-tuned model was deleted. - STATUS_TEMPORARILY_OFFLINE: Deprecated: The fine-tuned model is temporarily unavailable. - STATUS_PAUSED: Deprecated: The fine-tuned model is paused (Vanilla only). - STATUS_QUEUED: The fine-tuned model is queued for training. ("STATUS_UNSPECIFIED"|"STATUS_FINETUNING"|"STATUS_DEPLOYING_API"|"STATUS_READY"|"STATUS_FAILED"|"STATUS_DELETED"|"STATUS_TEMPORARILY_OFFLINE"|"STATUS_PAUSED"|"STATUS_QUEUED") - **created_at** (string (date-time)): read-only. Creation timestamp. - **updated_at** (string (date-time)): read-only. Latest update timestamp. - **completed_at** (string (date-time)): read-only. Timestamp for the completed fine-tuning. - **last_used** (string (date-time)): read-only. Deprecated: Timestamp for the latest request to this fine-tuned model. - **next_page_token** (string): Pagination token to retrieve the next page of results. If the value is "", it means no further results for the request. - **total_size** (integer (int32)): Total count of results. #### 400 - Bad Request **Error** - **message** (string): A developer-facing error message. #### 401 - Unauthorized **Error** - **message** (string): A developer-facing error message. #### 403 - Forbidden **Error** - **message** (string): A developer-facing error message. #### 404 - Not Found **Error** - **message** (string): A developer-facing error message. #### 500 - Internal Server Error **Error** - **message** (string): A developer-facing error message. #### 503 - Status Service Unavailable **Error** - **message** (string): A developer-facing error message. ### Example Usage ```bash curl -X GET "https://api.cohere.com/v1/finetuning/finetuned-models?page_size=0&page_token=string&order_by=string" ``` ``` -------------------------------- ### GET /v2/batches Source: https://raw.githubusercontent.com/cohere-ai/cohere-developer-experience/refs/heads/main/cohere-openapi.yaml List the batches for the current user ```markdown ### Parameters - **page_size** (integer (int32), query, optional): The maximum number of batches to return. The service may return fewer than this value. If unspecified, at most 50 batches will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000. - **page_token** (string, query, optional): A page token, received from a previous `ListBatches` call. Provide this to retrieve the subsequent page. - **order_by** (string, query, optional): Batches can be ordered by creation time or last updated time. Use `created_at` for creation time or `updated_at` for last updated time. - **X-Client-Name** (string, header, optional): The name of the project that is making the request. ### Responses #### 200 - A successful response. **ListBatchesResponse** - **batches** (array (object)): The batches that belong to the authenticated user. Array items: - **id** (string): read-only. Batch ID. - **name** (string) (required): Batch name (e.g. `foobar`). - **creator_id** (string): read-only. User ID of the creator. - **org_id** (string): read-only. Organization ID. - **status** (string (BATCH_STATUS_UNSPECIFIED|BATCH_STATUS_QUEUED|BATCH_STATUS_IN_PROGRESS|BATCH_STATUS_CANCELING|BATCH_STATUS_COMPLETED|BATCH_STATUS_FAILED|BATCH_STATUS_CANCELED)): The possible stages of a batch life-cycle. - BATCH_STATUS_UNSPECIFIED: Unspecified status. - BATCH_STATUS_QUEUED: The batch has been queued. - BATCH_STATUS_IN_PROGRESS: The batch is in-progress. - BATCH_STATUS_CANCELING: The batch is being canceled. - BATCH_STATUS_COMPLETED: The batch has been completed. - BATCH_STATUS_FAILED: The batch has failed. - BATCH_STATUS_CANCELED: The batch has been canceled. ("BATCH_STATUS_UNSPECIFIED"|"BATCH_STATUS_QUEUED"|"BATCH_STATUS_IN_PROGRESS"|"BATCH_STATUS_CANCELING"|"BATCH_STATUS_COMPLETED"|"BATCH_STATUS_FAILED"|"BATCH_STATUS_CANCELED") - **created_at** (string (date-time)): read-only. Creation timestamp. - **updated_at** (string (date-time)): read-only. Latest update timestamp. - **input_dataset_id** (string) (required): ID of the dataset the batch reads inputs from. - **output_dataset_id** (string) - **input_tokens** (string (int64)): read-only. The total number of input tokens in the batch. - **output_tokens** (string (int64)): read-only. The total number of output tokens in the batch. - **model** (string) (required): The name of the model the batch uses. - **num_records** (integer (int32)): read-only. The total number of records in the batch. - **num_successful_records** (integer (int32)): read-only. The current number of successful records in the batch. - **num_failed_records** (integer (int32)): read-only. The current number of failed records in the batch. - **status_reason** (string): read-only. More details about the reason for the status of a batch job. - **next_page_token** (string): A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages. #### 400 - Bad Request **BatchError** - **message** (string): A developer-facing error message. #### 401 - Unauthorized **BatchError** - **message** (string): A developer-facing error message. #### 403 - Forbidden **BatchError** - **message** (string): A developer-facing error message. #### 404 - Not Found **BatchError** - **message** (string): A developer-facing error message. #### 500 - Internal Server Error **BatchError** - **message** (string): A developer-facing error message. #### 503 - Status Service Unavailable **BatchError** - **message** (string): A developer-facing error message. ### Example Usage ```bash curl -X GET "https://api.cohere.com/v2/batches?page_size=0&page_token=string&order_by=string" ``` ``` -------------------------------- ### POST /v1/classify Source: https://raw.githubusercontent.com/cohere-ai/cohere-developer-experience/refs/heads/main/cohere-openapi.yaml 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](https://docs.cohere.com/docs/classify-fine-tuning) trained on classification examples don't require the `examples` parameter to be passed in explicitly. ```markdown ### Parameters - **X-Client-Name** (string, header, optional): The name of the project that is making the request. ### Request Body **Content-Type:** application/json - **inputs** (array (string)) (required): 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 `x` tokens of each input, and `x` varies depending on which underlying model is powering classification. The maximum token length for each model is listed in the "max tokens" column [here](https://docs.cohere.com/docs/models). Note: by default the `truncate` parameter is set to `END`, so tokens exceeding the limit will be automatically dropped. This behavior can be disabled by setting `truncate` to `NONE`, which will result in validation errors for longer texts. - **examples** (array (ClassifyExample)): 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 `{text: "...",label: "..."}`. Note: [Fine-tuned Models](https://docs.cohere.com/docs/classify-fine-tuning) trained on classification examples don't require the `examples` parameter to be passed in explicitly. Array items: - **text** (string) - **label** (string) - **model** (string): ID of a [Fine-tuned](https://docs.cohere.com/v2/docs/classify-starting-the-training) Classify model - **preset** (string): The ID of a custom playground preset. You can create presets in the [playground](https://dashboard.cohere.com/playground). If you use a preset, all other parameters become optional, and any included parameters will override the preset's parameters. (example: "my-preset-a58sbd") - **truncate** (string (NONE|START|END)): One of `NONE|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. If `NONE` is selected, when the input exceeds the maximum input token length an error will be returned. ("NONE"|"START"|"END") ### Responses #### 200 - OK - **id** (string) (required) - **classifications** (array (object)) (required) Array items: - **id** (string) (required) - **input** (string): The input text that was classified - **prediction** (string): The predicted label for the associated query (only filled for single-label models) - **predictions** (array (string)) (required): An array containing the predicted labels for the associated query (only filled for single-label classification) - **confidence** (number (float)): The confidence score for the top predicted class (only filled for single-label classification) - **confidences** (array (number (float))) (required): An array containing the confidence scores of all the predictions in the same order - **labels** (object) (required): A map containing each label and its confidence score according to the classifier. All the confidence scores add up to 1 for single-label classification. For multi-label classification the label confidences are independent of each other, so they don't have to sum up to 1. - **classification_type** (string (single-label|multi-label)) (required): The type of classification performed ("single-label"|"multi-label") - **meta** (object) - **api_version** (object) - **version** (string) (required) - **is_deprecated** (boolean) - **is_experimental** (boolean) - **billed_units** (object) - **images** (number): The number of billed images. - **input_tokens** (number): The number of billed input tokens. - **image_tokens** (number): The number of billed image tokens. - **output_tokens** (number): The number of billed output tokens. - **search_units** (number): The number of billed search units. - **classifications** (number): The number of billed classifications units. - **tokens** (object) - **input_tokens** (number): The number of tokens used as input to the model. - **output_tokens** (number): The number of tokens produced by the model. - **cached_tokens** (number): The number of prompt tokens that hit the inference cache. - **warnings** (array (string)) #### 400 - response - **message** (string) - **id** (string) #### 401 - response - **message** (string) - **id** (string) #### 403 - response - **message** (string) - **id** (string) #### 404 - response - **message** (string) - **id** (string) #### 422 - response - **message** (string) - **id** (string) #### 429 - response - **message** (string) - **id** (string) #### 498 - response - **message** (string) - **id** (string) #### 499 - response - **message** (string) - **id** (string) #### 500 - response - **message** (string) - **id** (string) #### 501 - response - **message** (string) - **id** (string) #### 503 - response - **message** (string) - **id** (string) #### 504 - response - **message** (string) - **id** (string) ### Example Usage ```bash curl -X POST "https://api.cohere.com/v1/classify" \ -H "Content-Type: application/json" \ -d '{ "inputs": [ "string" ], "examples": [ "value" ], "model": "string", "preset": "my-preset-a58sbd", "truncate": "END" }' ``` ```