Generating an API key for AI assistant builder

To consume methods of the AI assistant builder API, you must generate an API key.

To generate an API key for AI assistant builder on watsonx Orchestrate, complete the following steps:

  1. Open AI assistant builder in watsonx Orchestrate.
  2. Select an AI assistant.
  3. Click Assistant settings.
  4. In the Assistant IDs and API details, click Generate API Key to generate the API key for the service instance URL.

Use the API key to authenticate your requests to the API by using apikey for the username and the value of the API key for the password. For example, if the API key is f128743asfdSF8bv, your API call by using the curl tool would have the following syntax:

curl -X {request_method} -u "apikey:f128743asfdSF8bv" "{endpointUrl}/v2/{method}

Where:

  • {request_method}

    The HTTP method for the request.

  • {endpointUrl}

    The URL of the service instance. This should include the /instances/{instance_id} part of the path. For example: https://api.us-south.assistant.watson.cloud.ibm.com/instances/{instance_id}

To view the service instance URL for AI assistant builder on watsonx Orchestrate, complete the following steps:

  1. Open AI assistant builder in watsonx Orchestrate.
  2. Select the Assistant.
  3. Click Assistant settings.
  4. In the Assistant IDs and API details, click View details to view the service instance URL.
  • {method}

    The method of the AI assistant builder API that you want to run. For details, see AI assistant builder API. The method for AI assistant builder and IBM watsonx Assistant are the same.

Important:Be aware that the API Key for the watsonx Orchestrate API has a limited validity period. The API Key is set to expire 1 year from the date of issuance.

Parent topic:

AI assistant builder API overview