Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Cohere

Generate text and embeddings, rerank documents, tokenize text, and browse Cohere models.

Connectors

Choose the connector that matches your authentication method. The options below use the names shown in StackAI.

Connector
Authentication

Cohere

API Key

Cohere

Connect to Cohere to generate chat responses and embeddings, rerank documents, tokenize text, and browse models.

Set up in Cohere

  1. Prepare the Cohere account or service that the workflow will access. Grant access to the required resources and operations.

  2. API Key: Create an API key in the Cohere dashboard under API Keys.

Set up in StackAI

  1. Open Settings → Connections, add a connection, and select Cohere.

  2. Enter the credentials and connection details in the fields below.

  3. Save the connection and check its connection status. Select this saved connection when configuring an action or feature that uses it.

Connection fields

StackAI field
Required
What to enter

API Key

Yes

Create an API key in the Cohere dashboard under API Keys. Provider instructions.

Verify the connection

Check that the connection is healthy. Then run a read operation against a resource the connected account can access. A successful connection check confirms authentication; it does not guarantee permission for every action.

If access is denied, check the credential or OAuth permissions, the selected account or environment, and access to the specific resource. Update expired credentials or reconnect after permissions change.

Use an action

  1. Add the required Cohere action to the workflow.

  2. Select a connection when the action requests one.

  3. Complete the required fields. Use the reference picker when a value comes from another workflow step.

  4. Run the workflow and inspect the action’s output. Check the result before using it in a later step.

Actions

Create Chat Completion

Generate a Cohere assistant response from a user message.

Inputs

Field
Type
Required
Description

Model

select (string)

No

Cohere Command model used to generate the response. Options load from the selected connection. Default: command-a-plus-05-2026.

Message

textarea

Yes

The request or prompt for the assistant.

System Message

textarea

No

Optional instructions that guide how the assistant responds.

Maximum Output Tokens

integer

No

Maximum number of tokens Cohere may generate. Default: 1024.

Temperature

number

No

Controls response randomness from focused to varied. Default: 0.3.

Outputs

Field
Type
Description

Response Text

textarea

Text generated by Cohere.

Response ID

string

Cohere identifier for the response.

Finish Reason

string

Why Cohere stopped generating.

Token Usage

object

Input and output token counts reported by Cohere.

Generate Embeddings

Convert text into Cohere vector embeddings.

Inputs

Field
Type
Required
Description

Model

select (string)

No

Cohere Embed model used to create the vectors. Options load from the selected connection. Default: embed-v4.0.

Texts

array

Yes

One or more text values to turn into embeddings.

Input Type

select (string)

No

How the resulting vectors will be used. Available values: Search Document, Search Query, Classification, Clustering. Default: search_document.

Output Dimension

select (string)

No

Number of values in each Embed v4 vector. Available values: 256, 512, 1024, 1536. Default: 1536.

Outputs

Field
Type
Description

Request ID

string

Cohere identifier for the embedding request.

Embeddings

array

Float vectors in the same order as the input texts.

Input Texts

array

Input texts aligned with the returned embedding vectors.

Dimensions

integer

Number of values in each embedding vector.

Billed Input Tokens

integer

Input tokens Cohere billed for the embedding request.

Rerank Documents

Order documents by relevance to a search query.

Inputs

Field
Type
Required
Description

Model

select (string)

No

Cohere Rerank model used to score the documents. Options load from the selected connection. Default: rerank-v4.0-pro.

Query

string

Yes

Question or search phrase used to judge relevance.

Documents

array

Yes

Text documents to rank from most to least relevant.

Maximum Results

integer

No

Maximum number of ranked documents to return.

Outputs

Field
Type
Description

Ranked Documents

object_array

Documents ordered by relevance with their scores.

Request ID

string

Cohere identifier for the rerank request, when returned.

Billed Search Units

number

Search units Cohere billed for the rerank request.

Tokenize Text

Split text into the tokens used by a Cohere model.

Inputs

Field
Type
Required
Description

Model

select (string)

No

Cohere model whose tokenizer should be used. Options load from the selected connection. Default: command-a-03-2025.

Text

textarea

Yes

Text to split into model tokens.

Outputs

Field
Type
Description

Token IDs

array

Integer token IDs produced by Cohere.

Token Strings

array

Text fragments aligned with the returned token IDs.

Token Count

integer

Number of tokens in the input text.

API Version

string

Cohere API version reported for tokenization.

List Models

List Cohere models available to the connected API key.

Inputs

Field
Type
Required
Description

Compatible Endpoint

select (string)

No

Only return models compatible with this Cohere endpoint. Available values: Chat, Embed, Classify, Summarize, Rerank, Rate, Generate.

Default Models Only

boolean

No

Only show the default model for the selected endpoint. Default: false.

Maximum Models

integer

No

Soft cap on the number of models to return. Minimum: 1. Maximum: 1000. Default: 100.

Page Token

string

No

Continue from a previous List Models result.

Outputs

Field
Type
Description

Models

object_array

Models available to the connected account.

Next Page Token

string

Pass this back as Page Token to continue.

Important behavior

Actions that create, update, send, or delete data can change the connected service. Review their inputs before running them. A retry can repeat an operation; consider this when configuring retries for actions that change data.

The catalog lists the fields and capabilities available in the supplied provider definition. Availability can also depend on your deployment and organization’s Feature Access settings.

Last updated

Was this helpful?