How to hit the Cohere API

Cohere's API at https://api.cohere.com covers chat (v2), embeddings, and reranking search results.

Authentication

Get a key at dashboard.cohere.com. Send it as Authorization: Bearer <key>. In the examples it's written {{COHERE_API_KEY}}.

Full reference: https://docs.cohere.com/reference/about

Chat

The reply is in message.content.

curl https://api.cohere.com/v2/chat \
  -H "Authorization: Bearer {{COHERE_API_KEY}}" \
  -H "Content-Type: application/json" \
  -d '{"model": "command-a-plus-05-2026", "messages": [{"role": "user", "content": "Summarize what a REST API is."}]}'
Run in PostTaco

List models

curl https://api.cohere.com/v1/models \
  -H "Authorization: Bearer {{COHERE_API_KEY}}"
Run in PostTaco