For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
DASHBOARDPLAYGROUNDDOCSCOMMUNITYLOG IN
Guides and conceptsAPI ReferenceRelease NotesLLMUCookbooks
Guides and conceptsAPI ReferenceRelease NotesLLMUCookbooks
  • Get Started
    • Introduction
    • Installation
    • Creating a client
    • Playground
    • FAQs
  • Models
    • An Overview of Cohere's Models
    • Embed
    • Rerank
    • Aya
  • Text Generation
    • Introduction to Text Generation at Cohere
    • Using the Chat API
    • Streaming Responses
    • Structured Outputs
    • Predictable Outputs
    • Advanced Generation Parameters
    • Retrieval Augmented Generation (RAG)
    • Tool Use
    • Tokens and Tokenizers
    • Migrating from the Generate API to the Chat API
    • Summarizing Text
    • Safety Modes
  • Embeddings (Vectors, Search, Retrieval)
    • Introduction to Embeddings at Cohere
    • Semantic Search with Embeddings
    • Multimodal Embeddings
    • Batch Embedding Jobs
  • Going to Production
    • API Keys and Rate Limits
    • Going Live
    • Deprecations
    • How Does Cohere's Pricing Work?
  • Integrations
    • Integrating Embedding Models with Other Tools
    • Cohere and LangChain
    • LlamaIndex and Cohere
  • Deployment Options
    • Overview
    • SDK Compatibility
  • Tutorials
    • Cookbooks
    • LLM University
    • Build Things with Cohere!
  • Responsible Use
    • Security
    • Usage Policy
    • Command A Technical Report
    • Command R and Command R+ Model Card
  • Cohere Labs
    • Cohere Labs Acceptable Use Policy
  • More Resources
    • Cohere Toolkit
    • Datasets
    • Improve Cohere Docs
LogoLogodocs
DASHBOARDPLAYGROUNDDOCSCOMMUNITYLOG IN
On this page
  • Overview
  • Unsupported Features
  • Example for Migrating from Generate to Chat
  • Fine-tuned Models
Text Generation

Migrating from the Generate API to the Chat API

Was this page helpful?
Edit this page
Previous

Summarizing Text with the Chat Endpoint

Next
Built with

The Generate API is slated for deprecation on Aug 26, 2025.

In order to use Cohere generative functionality, we recommend using the Chat endpoint. This guide outlines how to migrate from Generate to Chat in order to get improved performance and to eliminate any potential interruptions.

Overview

While the Generate endpoint works with raw prompts, the Chat endpoint is designed for a conversational interface between a User and an Assistant.

Here’s an example:

PYTHON
1import cohere
2
3co = cohere.ClientV2()
4
5# BEFORE
6co.generate(prompt="Write me three bullet points for my resume")
7
8# AFTER
9co.chat(
10 model="command-a-03-2025",
11 messages=[
12 {
13 "role": "user",
14 "content": "Write me three bullet points for my resume",
15 }
16 ],
17)

Unsupported Features

The following parameters were previously available in Generate but are not supported by Chat.

  • num_generations: To achieve the same outcome as num_generations=n in Chat, please call co.chat() n times.
  • stop_sequences and end_sequences: Going forward, we ask users to trim model outputs on their side instead of setting a stop sequence.
  • logit_bias: This is not supported in the Chat endpoint.
  • truncate: This is not supported in the Chat endpoint.
  • preset: This is not supported in the Chat endpoint. Please create and store presets on your end instead of storing them via our endpoints.

Example for Migrating from Generate to Chat

Here are some steps you can take to ensure that your migration goes smoothly:

  • Ensure that you’re using the message parameter instead of the prompt parameter. The primary way of communicating with the Chat API is via message. Going forward, send the contents of your prompt through message and not through prompt.
  • No changes have been made to k, p, frequency_penalty, presence_penalty, max_tokens, stream, or temperature, so those should behave as expected.

Fine-tuned Models

Models that were fine-tuned to use the Generate API will work with the Chat API. Remember not to use the chat_history parameter, as this parameter is only supported for models fine-tuned for Chat.

We will not delete or disable the Generate endpoint, but we suggest fine-tuning models for use with the Chat endpoint in the future.