Skip to content
Release: Australia · Updated: 2026-03-12 · Official documentation · View source

Configure API credentials for a generic large language model (LLM) connector

Use a generic LLM connector to connect the ServiceNow AI Platform with an external AI provider to use generative AI capabilities in custom Virtual Agent topics, Flows, or scripts, like background and business rule scripts.

Before you begin

You must have access to the API of an external LLM in order to configure the credentials.

Role required: admin

About this task

You can connect an external LLM to the ServiceNow AI Platform by creating a connection alias to the model, create a model record that points to the alias, create a prompt record for the model, and then create a transformer record to transform the request or response from the LLM.

Procedure

  1. Navigate to All > Connections & Credentials > Credentials.

  2. Select API Key Credentials

  3. In the Name field, give your API credential a name.

    Including the name of the model in the API Key Credential makes it easier to identify later.

  4. In the API Key field, enter your model's API key.

Image omitted: gai-create-new-connection-custom-api.png
API Key Credentials form filled with name and API key.
  1. Select Submit to create the Credential.

    At this step, you have the API key information for the external LLM configured.

  2. Navigate to All > Connections & Credentials > Connections & Credential Aliases.

  3. Select New.

  4. In the Name field, enter a name for the credential alias.

    You do not need to change any other field values.

Image omitted: gai-create-new-connection-custom-alias.png
Connection & Credentials Alias record with name filled in.
  1. Select Submit.

  2. After you are redirected to the List view, find and open the record you just created.

  3. Select New in the Connections related list to create a new Connection record.

  4. Enter the name of the connection in the Name field.

  5. In the Credential field, select the Credential record you created with the model's API key.

    You can search the list of Credentials by typing the name of the Credential in the field. You can also select the lookup icon

Image omitted: icon-magnifying-glass-blue.png
No alternative text supplied

to open a modal with the full list.

  1. In the Connection alias field, select the alias record you created.

  2. For the Connection URL, enter the endpoint URL for the model.

    For example, a model from Hugging Face might start with "https://api-inference.huggingface.co". You can leave the remaining fields as they are.

Image omitted: gai-create-new-connection-custom.png
HTTP\(s\) Connection record filled in with My Model credential, alias, and connection URL.
  1. Select Submit.

Result

You have the connection and credential alias to use for connecting a generic LLM to use generative AI capabilities on the ServiceNow AI Platform. You can confirm this by navigating to All > Connections & Credentials > Connections & Credential Aliases and confirming that the connection appears in the related list.

Image omitted: gai-created-connection-custom.png
Finished credentials and alias for custom LLM.

What to do next

For more information on configuring a generic LLM, see configure a generic LLM connector