IBM watsonx.ai for IBM Cloud¶
Requirements¶
Starting work with IBM watsonx.ai for IBM Cloud refer to Getting started section in main product documentation.
Supported machine learning frameworks¶
For the list of supported machine learning frameworks (models) on IBM watsonx.ai for IBM Cloud, refer to watsonx.ai Documentation.
Authentication¶
To use watsonx.ai APIs, create an instance of APIClient with authentication details.
Note: Depending on the region of your provisioned service instance, use one of the following as your url:
Dallas: https://us-south.ml.cloud.ibm.com
London: https://eu-gb.ml.cloud.ibm.com
Frankfurt: https://eu-de.ml.cloud.ibm.com
Tokyo: https://jp-tok.ml.cloud.ibm.com
Note: To determine api_key go to https://cloud.ibm.com/iam/apikeys and generate your api key.
Example of creating the client using api key:
from ibm_watsonx_ai import APIClient
from ibm_watsonx_ai import Credentials
credentials = Credentials(
url = "https://us-south.ml.cloud.ibm.com",
api_key = "***********"
)
client = APIClient(credentials)
Example of creating the client using token:
from ibm_watsonx_ai import APIClient
from ibm_watsonx_ai import Credentials
credentials = Credentials(
url = "https://us-south.ml.cloud.ibm.com",
token = "***********",
)
client = APIClient(credentials)
Note: Setting default space/project id is mandatory. For details, refer to client.set.default_space()
API in this document.
Hint
You can copy the project_id from Project’s Manage tab (Project -> Manage -> General -> Details).