Cohere has launched updated application programming interfaces (APIs) for its AI models: Chat, Embed, Rerank, and Classify. These updates, referred to as API V2, aim to align more closely with industry standards, simplifying the transition for developers looking to implement Cohere’s models over competitors like OpenAI, Anthropic, Google, Mistral, and Meta.
According to a recent survey conducted by AI API platform Kong, which gathered input from 800 enterprise leaders, OpenAI’s ChatGPT leads the market with a 27% share, followed by Microsoft’s Azure AI at 18% and Google Gemini at 17%. Cohere holds a distant 5%, highlighting the need for the Toronto-based startup, co-founded by key researchers behind the original 2017 Transformer paper, to increase its presence among enterprise clients.
Enhanced Reliability and Usability
A key feature of the V2 API is the requirement for developers to specify the model version in API calls. This change addresses the inconsistency that arose when new models were released and default versions changed unexpectedly. Mandatory version specification ensures consistent application performance, especially in scenarios involving Embed models.
The updated Chat API also streamlines usability by consolidating input parameters into a single messages array, replacing the older structure that required separate parameters for message, chat history, and preamble. This new format allows for more complex use cases where roles, such as system or assistant, can be designated within the latest message.
Improved Integration and Streaming Support
Cohere’s updated APIs offer enhanced tool integration by defining tools using JSON schema instead of Python types, thus improving flexibility and compatibility with various applications. Each tool call now includes a unique ID, which facilitates accurate matching of tool results with their respective calls—a significant advancement over the V1 API.
Additionally, the V2 Chat API has transitioned from JSON-stream events to Server Sent Events (SSE) for streaming interactions, delivering a more reliable and responsive user experience.
Ongoing Support for Existing APIs
Cohere will continue to support the V1 suite of APIs, allowing developers who are not ready to migrate to rely on existing implementations. There will be no breaking changes to the V1 API or its SDKs; however, the company recommends upgrading to V2 to benefit from enhanced stability and the latest features, including model version enforcement and improved chat capabilities.
Resources for Developers
To assist with the transition to API V2, Cohere has introduced a new SDK and an OpenAPI specification for the updated endpoint. These resources, along with a comprehensive Chat Migration Guide, are accessible on the Cohere platform. Developers are encouraged to share feedback and suggestions through the company’s Discord community.
Cohere’s API V2 release marks a significant advancement in enhancing accessibility and efficiency for developers. With these updates, the company aims to provide a more streamlined and predictable development experience while competing with established players like OpenAI.