Stay ahead of the curve with our daily and weekly newsletters, bringing you the latest updates and exclusive insights on the AI industry. Discover More
Cohere has unveiled the latest versions of its application programming interfaces (APIs) for its AI models – Chat, Embed, Rerank, and Classify.
Collectively known as API V2, Cohere is candid about its intention to align more closely with AI industry standards. This move is designed to make it easier for developers to transition their applications to Cohere’s models, offering a competitive alternative to OpenAI, Anthropic, Google, Mistral, and Meta.
Earlier this month, Andreessen Horowitz (A16z) general partner Martin Casado shared a graph on X, revealing the results of a survey from AI API platform Kong. The survey, which involved 800 enterprise leaders, showed the large language models (LLMs) they were using.
OpenAI’s ChatGPT led the pack with a 27% market share, followed by Microsoft’s Azure AI cloud service at 18% and Google Gemini at 17%. Cohere, a Toronto-based startup co-founded by former Google researchers, was second-to-last with a 5% share. This shows that Cohere, despite its innovative approach, has a significant gap to close to win over the enterprise customers it’s targeting.
Boosted reliability with refined settings
A key change in the V2 API release is the requirement for developers to specify the model version in their API calls.
In the past, this field was optional, leading to unpredictable behavior when new models were launched and the default model changed.
By making the model version a compulsory field, Cohere ensures developers maintain consistent application performance, especially in scenarios involving Embed models, where using different versions can affect results.
The revamped Chat API introduces several usability enhancements, including the consolidation of input parameters into a single messages
array. This replaces the previous structure that required separate message
, chat_history
, and preamble
parameters.
This modification 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.
Enhanced tool integration and streaming support
The new APIs from Cohere also boost 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 broader range of applications.
Moreover, 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.
Continued support for existing APIs
Cohere has assured that the V1 suite of APIs will remain 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.
Developer resources
To ease the transition to API V2, Cohere has launched a new SDK and an OpenAPI specification for its updated endpoint.
These resources, along with a comprehensive Chat Migration Guide, are available on the Cohere platform. Developers are invited to share feedback and suggestions via the company’s Discord community.
The release of Cohere’s API V2 marks a significant stride in making its platform more user-friendly and efficient for developers. With these updates, the company aims to provide a more streamlined and predictable development experience, and ultimately, attract users from OpenAI and other popular APIs.