Cohere updates APIs to make it easier for devs to switch from other models


Join our daily and weekly newsletters for the latest updates and exclusive content on industry-leading AI coverage. Learn More


Cohere has announced the release of updated versions of its application programming interfaces (APIs) for its AI models Chat, Embed, Rerank, and Classify.

Collectively, the new API updates are known as API V2, and Cohere is being transparent about the fact that the updates are meant to more closely align with AI industry standards to make it easier for developers to switch their applications over to be powered by Cohere’s models in lieu of the competition: namely, OpenAI, Anthropic, Google, Mistral, and Meta.

Earlier this month, Andreessen Horowitz (A16z) general partner Martin Casado posted on X an image of a graph showing the results of a survey from AI API platform Kong of 800 enterprise leaders revealing the large language models (LLMs) they were using.

OpenAI’s ChatGPT dominated the chart with 27% market share compared to 18% using Microsoft’s Azure AI cloud service and 17% for Google Gemini. Cohere was second-to-last with a distant 5%, showing how the Toronto-based startup — co-founded by some of the former Google researchers behind the original 2017 Transformer paper that ushered in the generative AI era — has a lot of ground to make up to win over the enterprise customers it’s courting.

Enhanced reliability with more precise settings

One of the most significant changes in the V2 API release is the requirement for developers to specify the model version in their API calls.

Previously, this field was optional, which sometimes led to unexpected behavior when new models were released and the default model changed.

By making the model version a mandatory field, Cohere ensures that developers maintain consistent application performance, particularly in scenarios involving Embed models, where using different versions can impact results.

The updated Chat API introduces several usability improvements, including the consolidation of input parameters into a single messages array, replacing the previous structure that required separate message, chat_history, and preamble parameters.

This change simplifies the input process, allowing for more complex use cases where roles such as system or assistant can be assigned to the latest message in a chat sequence.

Cohere’s new APIs also enhance tool integration capabilities. In the V2 release, tools are defined using JSON schema instead of Python types, making the process more flexible and compatible with a wider range of applications.

Additionally, each tool call now includes a unique ID, enabling the API to correctly match tool results with their corresponding calls—an improvement over the V1 API, which lacked this feature.

For streaming interactions, the V2 Chat API has switched from JSON-stream events to Server Sent Events (SSE), providing a more robust and responsive experience for users.

Support for existing APIs

Cohere has confirmed that the V1 suite of APIs will continue to be supported, ensuring that developers who are not yet ready to migrate can still rely on existing implementations.

There will be no breaking changes to the V1 API or its associated SDKs.

However, the company recommends upgrading to V2 for enhanced stability and access to the latest features, such as model version enforcement and advanced chat capabilities.

Resources for developers

To facilitate the transition to API V2, Cohere has released a new SDK and an OpenAPI specification for its updated endpoint.

These resources, along with a detailed Chat Migration Guide, are available on the Cohere platform. Developers are encouraged to provide feedback and suggestions via the company’s Discord community.

Cohere’s API V2 release represents a significant step forward in making its platform more accessible and efficient for developers. With these updates, the company aims to offer a more streamlined and predictable development experience, and ultimately, win over users from OpenAI and other popular APIs.



Source link

About The Author