{
    "$schema": "./provider-rules.schema.json",
    "id": "cohere",
    "errors": {
        "rules": [
            {
                "pattern": "invalid api token|Authentication|\\b401\\b|invalid_api_token",
                "caseSensitive": true,
                "class": "authentication",
                "message": "Invalid Cohere API key. Check COHERE_API_KEY. Get one at https://dashboard.cohere.com/api-keys"
            },
            {
                "pattern": "rate limit|\\b429\\b",
                "caseSensitive": true,
                "class": "rate-limit",
                "message": "Cohere rate limit exceeded. Back off and retry."
            },
            {
                "pattern": "model_not_found|\\b404\\b",
                "caseSensitive": true,
                "class": "invalid-model",
                "message": "Cohere model '{model}' not found. Use command-r, command-r-plus, or command-r7b-12-2024."
            },
            {
                "pattern": "trial limit|trial_limit",
                "caseSensitive": true,
                "class": "provider",
                "message": "Cohere trial usage limit exceeded. Upgrade at https://dashboard.cohere.com/billing."
            }
        ]
    }
}
