Skip to main content
Cohere logo

Cohere

Overview

The Cohere platform builds natural language processing and generation into your product with a few lines of code. Use Cohere to solve a broad spectrum of natural language use cases, including classification, semantic search, paraphrasing, summarization, and content generation.

Setting up Cohere

Create an access token

To get started with Cohere, you'll need a API key. Cohere offers two kinds of API keys: trial keys (with a variety of attendant limitations), and production keys (which have no such limitations). To get a trial key register through the Cohere dashboard.

To create a production key:

  1. Log in to Cohere
  2. Got to the API Keys
  3. Click Create Production key
  4. Copy the API key to configure your integration's connection

Learn more about Cohere API Authentication.

Add integration

Once you have an access token, you're ready to set up your Superblocks integration.

  1. In the web app, navigate to the Integrations page
  2. Click on the Cohere tile
  3. Name the integration
  4. Paste your credentials into the relevant fields
  5. Optionally, add more configurations to set credentials for different environments
  6. Click Create
success

Cohere connected Now you can use Cohere in any Application, Workflow, or Scheduled Job.

Use Cohere in APIs

Once your Cohere integration is created, you can start calling Cohere actions in Superblocks APIs.

Cohere actions are REST requests. To learn more about REST requests in Superblocks, see the Building REST requests guide.

Certain Cohere actions support streaming. Learn more about building APIs in Superblocks that

stream data from REST APIs

.

Supported actions

Chat

Generates a text response to a user message. To learn how to use the Chat API with Streaming and RAG follow our [Text Generation guides](https://docs.cohere.com/docs/chat-api).

Generate

> 🚧 Warning > > This API is marked as "Legacy" and is no longer maintained. Follow the [migration guide](/docs/migrating-from-cogenerate-to-cochat) to start using the Chat API. Generates realistic text conditioned on a given input.

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](/docs/semantic-search).

List Embed Jobs

The list embed job endpoint allows users to view all embed jobs history for that specific user.

Create an Embed Job

This API launches an async Embed job for a [Dataset](https://docs.cohere.com/docs/datasets) 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.

Fetch an Embed Job

This API retrieves the details about an embed job started by the same user.

Cancel an Embed Job

This API allows users to cancel an active embed job. Once invoked, the embedding process will be terminated, and users will be charged for the embeddings processed up to the cancellation point. It's important to note that partial results will not be available to users after cancellation.

Rerank

This endpoint takes in a query and a list of texts and produces an ordered array with each text assigned a relevance score.

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](https://docs.cohere.com/docs/classify-fine-tuning) trained on classification examples don't require the `examples` parameter to be passed in explicitly.

List Datasets

List datasets that have been created.

Create a Dataset

Create a dataset by uploading a file. See ['Dataset Creation'](https://docs.cohere.com/docs/datasets#dataset-creation) for more information.

Get Dataset Usage

View the dataset storage usage for your Organization. Each Organization can have up to 10GB of storage across all their users.

Get a Dataset

Retrieve a dataset by ID. See ['Datasets'](https://docs.cohere.com/docs/datasets) for more information.

Delete a Dataset

Delete a dataset by ID. Datasets are automatically deleted after 30 days, but they can also be deleted manually.

Tokenize

This endpoint splits input text into smaller units called tokens using byte-pair encoding (BPE). To learn more about tokenization and byte pair encoding, see the tokens page.

Detokenize

This endpoint takes tokens using byte-pair encoding and returns their text representation. To learn more about tokenization and byte pair encoding, see the tokens page.

List Connectors

Returns a list of connectors ordered by descending creation date (newer first). See ['Managing your Connector'](https://docs.cohere.com/docs/managing-your-connector) for more information.

Create a Connector

Creates a new connector. The connector is tested during registration and will cancel registration when the test is unsuccessful. See ['Creating and Deploying a Connector'](https://docs.cohere.com/docs/creating-and-deploying-a-connector) for more information.

Get a Connector

Retrieve a connector by ID. See ['Connectors'](https://docs.cohere.com/docs/connectors) for more information.

Update a Connector

Update a connector by ID. Omitted fields will not be updated. See ['Managing your Connector'](https://docs.cohere.com/docs/managing-your-connector) for more information.

Delete a Connector

Delete a connector by ID. See ['Connectors'](https://docs.cohere.com/docs/connectors) for more information.

Authorize with oAuth

Authorize the connector with the given ID for the connector oauth app. See ['Connector Authentication'](https://docs.cohere.com/docs/connector-authentication) for more information.

Get a Model

Returns the details of a model, provided its name.

List Models

Returns a list of models available for use. The list contains models from Cohere as well as your fine-tuned models.

Check API key

Checks that the api key in the Authorization header is valid and active

List Fine Tuned Models

Train and Deploy a Fine Tuned Model

Get Fine Tuned Model

Update Fine Tuned Model

Delete Fine Tuned Model

List Fine Tuned Model Events

List Fine Tuned Model Metrics

and 17 more

Generic HTTP Request

Every SaaS integration in Superblocks comes with a built in Generic HTTP Request Action. This is a powerful action you can use to call Cohere API endpoints not in the Superblocks supported actions.

To use this action simply add the method, path, required query parameters, and body for the desired endpoint.

info

Learn more about REST requests in Superblocks in our Building REST requests guide.

Generic HTTP Requests use the authentication set up and base URL you've configured for your integration, making it an easy for your team to extend Superblocks Integrations to meet their needs.