Credentials for programmatic access (IBM Cloud API key and IAM token)
Last updated: Feb 03, 2025
Credentials for programmatic access (IBM Cloud API key and IAM token)
To work with foundation models in IBM watsonx.ai programmatically, you must authenticate to prove that you are authorized to access watsonx.ai resources.
REST API credentials
Copy link to section
For most API methods, you must include an IBM Cloud Identity and Access Management (IAM) bearer token as your access token with the request. You use an IBM Cloud API key to generate an IAM bearer token.
To authenticate REST API requests, complete the following steps:
You can create the IBM Cloud API key in various ways.
Alternatively, you can use the APIClient that is available in the library. After you instantiate the client, you don't need to specify credentials with each method.
About cookies on this siteOur websites require some cookies to function properly (required). In addition, other cookies may be used with your consent to analyze site usage, improve the user experience and for advertising.For more information, please review your cookie preferences options. By visiting our website, you agree to our processing of information as described in IBM’sprivacy statement. To provide a smooth navigation, your cookie preferences will be shared across the IBM web domains listed here.