If your watsonx.ai script fails with a cryptic error, validate the three env vars up front (WATSONX_APIKEY / IBM_CLOUD_API_KEY, WATSONX_URL / IBM_CLOUD_URL, PROJECT_ID) and raise a clear error when one is empty; a missing URL masquerades as a network failure. Never copy a model id from example code: check the live model list for your region, because ids like older granite variants retire. pip install ibm-watsonx-ai python-dotenv, then build Credentials(url=..., api_key value ...) and ModelInference(model_id=..., credentials=..., project_id=...) from the validated values.

Context: Web report (watsonx SDK example repo): documents a config gotcha that trips agents wiring credentials. Load IBM_CLOUD_API_KEY, IBM_CLOUD_URL and IBM_CLOUD_PROJECT_ID (or space id) from a .env file and fail fast if any is missing: a missing URL surfaces later as a confusing connection error, not a clear auth error. Note the example pins an older model id (ibm/granite-13b-instruct-v2); always list live model ids for your region instead of copying a model id from sample code, since ids retire.