## TL;DR

1) the API key is wrong, has trailing spaces, or expired.

## Fix

1. 1) the API key is wrong, has trailing spaces, or expired.
   Expected: you can confirm this matches your situation.

## When to use

- You are setting up or using this watsonx.ai auth failures feature.
- The symptom matches: key, region, project ID, and IAM scope order.

## When NOT to use

- Unrelated watsonx.ai auth failures issues (different feature, different failure).
- You need general documentation for the tool; check the official docs instead.

## Compatibility

Reported against watsonx.ai auth failures.

## Variant phrasings

### key, region, project ID, and IAM scope order

## Why it happens

Most watsonx 401/403 errors trace to one of four credential fields, in this order.

## Edge cases

- If your error message differs even slightly, this is probably a different issue; search the exact text.
- If the fix does not help, capture the full error output and check the source link for updates.