Cohere 401 Invalid API Token Error

Share
Fixed in latest version API Updated November 14, 2026Based on 3 user reportsHow we research

Quick answer

A 401 means the key is missing, invalid or expired. Check that the key is sent, copied fully, and still active in the dashboard.

Most likely fix: Verify the key is sent

How to fix it

Try these in order — the most common fix is first.

  1. 1. Verify the key is sent

    1. Confirm CO_API_KEY is set in the running process (print its length, not the value)
    2. Pass it explicitly: cohere.ClientV2(api_key=...)
    3. Restart the server or notebook so new env vars load
    Did this fix it?
  2. 2. Create a fresh key

    1. Open dashboard.cohere.com > API Keys
    2. Create a new key and replace the old one
    3. Remove trailing spaces and quotes
    Did this fix it?
  3. 3. If the message says the key has expired

    1. Create a Production key in the dashboard as the error text suggests
    2. Update deployments and secrets managers
    Did this fix it?

Symptoms

Responses return 401 with messages like 'no api key supplied', 'invalid api token', or 'Your API key has expired'.

Why it happens

  • API key not set or environment variable not loaded
  • Key copied with extra spaces or truncated
  • Key deleted or expired in the dashboard
  • Trial key expired and Production key not created

This guide also covers

  • cohere invalid api token
  • cohere 401 unauthorized
  • cohere no api key supplied

Still not working?

If Cohere keeps failing, you're not alone. See every Cohere problem users report or the alternatives people switch to.

Have an app idea? Our small team builds any software: web and mobile apps, games, desktop, AI tools. Price agreed together.

Talk to us
Fixed it? Share this guide

The same problem in other apps

All not loading, error messages & connection guides →

Other Cohere errors