To obtain a Watsonx.ai API key, follow these steps:
-
Sign up for IBM Cloud:
- Go to the IBM Cloud website.
- If you do not have an account, click on "Create an IBM Cloud account" and follow the instructions to sign up.
-
Create a Watsonx.ai Service:
- Once logged in, navigate to the IBM Cloud Dashboard.
- Click on "Catalog" in the top menu.
- Search for "Watsonx.ai" and select the service.
- Click on "Create" to provision the service.
-
Generate an API Key:
- After the service is created, go to the "Manage" tab of your Watsonx.ai service instance.
- Click on "Service credentials" in the left-hand menu.
- Click on "New credential" to generate a new API key.
- Provide a name for the credential and click "Add".
- Your new API key will be displayed. Copy this key for use in your application.
-
Configure the API Key in Your Application:
- Open the
.envfile in your project. - Add the following line, replacing
YOUR_API_KEYwith the API key you copied:WATSONX_API_KEY=YOUR_API_KEY
- Open the
By following these steps, you will obtain and configure your Watsonx.ai API key for use in your application.
You can find the IBM Watsonx.ai API documentation at the following link: IBM Watsonx.ai API Documentation