Skip to main content

Cohere AI

Cohere AI provides access to powerful language models for text generation, embeddings, and natural language understanding. The Cohere connector enables you to generate text completions, create embeddings for semantic search, and interact with Cohere's language models for various AI-powered applications.

Cohere AI icon

Power end-to-end data operations for your Cohere AI API with Nexla. Our bi-directional Cohere AI connector is purpose-built for Cohere AI, making it simple to ingest data, sync it across systems, and deliver it anywhere — all with no coding required. Nexla turns API-sourced data into ready-to-use, reusable data products and makes it easy to send data to Cohere AI or any other destination. With comprehensive monitoring, lineage tracking, and access controls, Nexla keeps your Cohere AI workflows fast, secure, and fully governed.

Features

Type: API

SourceDestination

  • Seamless API Integration: Connect to any endpoint as source or destination without coding, with automatic data product creation
  • Visual Composition & Chaining: Build complex integrations using visual templates, chain API calls, and compose workflows with data validation and filtering
  • API Proxy: Expose curated slices of your data securely with a secure and customizable API proxy that validates and transforms data on the fly
  • Request optimization with intelligent batching, retry, and caching to minimize API calls and costs

Prerequisites

Before creating a Cohere AI credential, you'll need to obtain API credentials from Cohere. The Cohere API uses Bearer token authentication with API keys.

To obtain the required API credentials for Cohere:

  1. Sign in to Cohere Dashboard: Navigate to https://cohere.com/ and sign in to your Cohere account. If you don't have an account, you can create one by clicking Sign up and following the registration process.

  2. Access API Keys: Once signed in, navigate to your Cohere dashboard. Look for the API Keys section, which is typically accessible from the account menu, settings, or dashboard.

  3. Create API Key: Click the Create API Key button or similar option to generate a new API key. Provide a descriptive name for your API key (e.g., "Nexla Integration") to help identify its purpose.

  4. Copy API Key: After creation, copy the API key immediately. Cohere API keys are sensitive credentials that should be stored securely. Store this key securely, as you'll need it when creating the credential in Nexla.

Cohere API keys are sensitive credentials that provide access to your Cohere account and API usage. Keep these keys secure and never share them publicly or commit them to version control systems. The API key is used in the Authorization header as Bearer {key} for all API requests.

The Cohere API requires the following configuration:

  • Base URL: The base URL for Cohere API requests. The default is https://api.cohere.com.
  • API Version: The API version to use for requests. The default is v1.

All requests to the Cohere API must include the Authorization header with your API key in the format Bearer {api_key}. The API accepts JSON in request bodies and returns JSON in response bodies.

For complete information about Cohere API authentication and getting started, see the Cohere API Documentation.

Authenticate

Credentials required

Authenticate using Cohere API Key

FieldRequiredSecretDescription
API KeyYesYesCohere-provided secret API key
Base URLYesNoBase URL of the Cohere API.
API VersionYesNoParameter for defining the API version for Cohere requests

Create a credential in Nexla

  1. After selecting the data source/destination type, click the Add Credential tile to open the Add New Credential overlay.

New Credential Overlay – Cohere AI

CohereCred.png
  1. Enter a name for the credential in the Credential Name field and a short, meaningful description in the Credential Description field.

  2. API Key: Enter your Cohere API key in the API Key field. This is the secret token that authenticates your application with the Cohere API. You can obtain this key from your Cohere dashboard under API Keys.

  3. Base URL: Enter the base URL for your Cohere API requests in the Base URL field. The default value is https://api.cohere.com. This should match the Cohere API endpoint you're using.

  4. API Version: Enter the API version for your Cohere API requests in the API Version field. The default value is v1. This version determines which API endpoints and features are available.

    The API key is sensitive information that should be kept secure. Nexla will store this credential securely and use it only for API authentication purposes. The API key is sent in the Authorization header as Bearer {key} for all Cohere API requests.

  5. Click the Save button at the bottom of the overlay. The newly added credential will now appear in a tile on the Authenticate screen during data source/destination creation.

Use as a data source

To create a new data flow, navigate to the Integrate section, and click the New Data Flow button. Select the Cohere AI connector tile, then select the credential that will be used to connect to the Cohere AI instance, and click Next; or, create a new Cohere AI credential for use in this flow. Cohere AI data sources can ingest data from Cohere's language models, allowing you to generate text completions, create embeddings, and interact with Cohere's AI models—useful for extracting AI-generated content, analyzing embeddings, or processing language model responses.

Endpoint templates

Nexla provides pre-built templates that can be used to rapidly configure data sources to ingest data from common Cohere AI endpoints. Select the endpoint from which this source will fetch data from the Endpoint pulldown menu. Available endpoint templates are listed in the expandable boxes below.

Generate Text

This endpoint generates text completions using Cohere's language models. Use this endpoint when you need to generate text, complete prompts, or create AI-generated content using Cohere's models.

  • Enter the model name in the Model field. Common Cohere models include command (default), command-light, command-nightly, and command-light-nightly. The default is command.
  • Enter the prompt text in the Prompt field. This is the input text that Cohere will use to generate the completion.
  • Optionally, enter the maximum number of tokens to generate in the Max Tokens field. The default is 300. This controls the length of the generated text.
  • Optionally, enter the temperature value in the Temperature field. The default is 0.75. Temperature controls randomness (0-5), where lower values are more deterministic and higher values are more creative.
  • Optionally, enter the k value in the k field. The default is 0. This parameter specifies the number of most likely tokens to sample from (nucleus sampling).
  • Optionally, enter the p (top-p) value in the Top P field. The default is 1. This parameter specifies the cumulative probability for nucleus sampling (0-1).
  • Optionally, enter stop sequences in the Stop Sequences field as an array. The default is an empty array. Stop sequences are text patterns where generation will stop.
  • Enter a schedule in the Schedule field to specify when this data source should run. The schedule uses cron expression format.

The generate endpoint is useful for creating text completions, summaries, and other text generation tasks. Temperature and top-p parameters control the creativity and randomness of the generated text. For complete information about text generation, see the Cohere API Documentation.

Chat Completion

This endpoint generates conversational responses using Cohere's chat models. Use this endpoint when you need to have conversations with Cohere's models, build chatbots, or create interactive AI applications.

  • Enter the model name in the Model field. Common Cohere chat models include command-r (default), command-r-plus, and other command variants. The default is command-r.
  • Enter the message text in the Message field. This is the user message that Cohere will respond to in the conversation.
  • Enter a schedule in the Schedule field to specify when this data source should run. The schedule uses cron expression format.

The chat endpoint is designed for conversational interactions and maintains context better than the generate endpoint. Chat models are optimized for multi-turn conversations. For complete information about chat completions, see the Cohere API Documentation.

Generate Embeddings

This endpoint generates embeddings (vector representations) for input texts using Cohere's embedding models. Use this endpoint when you need to create embeddings for semantic search, similarity matching, or machine learning applications.

  • Enter the model name in the Model field. Common Cohere embedding models include embed-english-v3.0 (default), embed-multilingual-v3.0, and other embedding variants. The default is embed-english-v3.0.
  • Enter the input type in the Input Type field. Common values include search_document (default) for documents to be searched, search_query for search queries, classification for classification tasks, and clustering for clustering tasks. The default is search_document.
  • Enter the texts to embed in the Texts field as a JSON array of strings. The default format is a JSON array like ["hello", "goodbye"]. Each string in the array will be embedded separately.
  • Enter a schedule in the Schedule field to specify when this data source should run. The schedule uses cron expression format.

Embeddings are vector representations of text that capture semantic meaning. They are useful for semantic search, similarity matching, and machine learning applications. The input type parameter helps optimize embeddings for different use cases. For complete information about embeddings, see the Cohere API Documentation.

Once the selected endpoint template has been configured, click the Test button to the right of the endpoint selection menu to retrieve a sample of the data that will be fetched. Sample data will be displayed in the Endpoint Test Result panel on the right, allowing you to verify that the source is configured correctly before saving.

Manual configuration

Cohere AI data sources can also be manually configured to ingest data from any valid Cohere AI API endpoint, including endpoints not covered by the pre-built templates, chained API calls, or custom request parameters. Select the Advanced tab at the top of the configuration screen, and follow the instructions in Connect to Any API to configure the API method, endpoint URL, date/time and lookup macros, path to data, metadata, and request headers.

Cohere API URLs typically follow the format: https://api.cohere.com/v1/generate for text generation, https://api.cohere.com/v1/chat for chat completions, or https://api.cohere.com/v1/embed for embeddings. For the Response Data Path, use $.generations[*].text to extract individual generated text completions from generate responses, $.embeddings to extract the embeddings array from embed responses, or $.text to extract the chat response from chat responses. You do not need to include authentication headers (Authorization: Bearer {key}) as these are automatically included from your credentials; the Content-Type header should be set to application/json for most Cohere API requests. For complete information about Cohere API endpoints, see the Cohere API Documentation.

Once all of the relevant settings have been configured, click the Create button in the upper right corner of the screen to save and create the new Cohere AI data source. Nexla will now begin ingesting data from the configured endpoint and will organize any data that it finds into one or more Nexsets.