You can integrate third-party LLM models from a variety of supported providers through the AI Gateway system. The gateway also supports the configuration of routing policies, enabling use cases such as load balancing and fallback across multiple models.
Note:
When importing a model from OpenRouter, always set the max_token parameter explicitly. If you skip this step, the system defaults to 65536 tokens. This high token count can cause the request to fail if you don’t have enough credits.
You can add a model to the watsonx Orchestrate AI gateway using the orchestrate models import command.
1
Define the model specification file
granite-3-3-8b-model.yaml
Copy
Ask AI
spec_version: v1kind: modelname: virtual-model/watsonx/ibm/granite-3.3-8b-instructdisplay_name: IBM watsonx.ai (Granite)description: |IBM watsonx.ai model using Space-scoped configuration.tags:- ibm- watsonxmodel_type: chatprovider_config: watsonx_space_id: my-space-id # For any non-sensitive field not already provided by the connection
A list of tags used to quickly identify models.To set this model as the default model selection in the ui dropdown on the manage agents page,
please include the special tag default.
A collection of configuration options needed to connect to provider. The required provider configuration
fields are determined by the provider. Examples can be seen below.The values of the provider_config is merged with any additional configuration provided by
a key_value connection bound to the model at import time.Secure values and values which you do not want to repeat for each model, should
be provided via your connection instead.
2
Create an API key connection
Copy
Ask AI
orchestrate connections add -a watsonx_credentialsorchestrate connections configure -a watsonx_credentials --env draft -k key_value -t teamorchestrate connections set-credentials -a watsonx_credentials --env draft -e "api_key=my_watsonx_api_key"
--file (-f): File path of the spec file containing the model configuration.
--app-id (-a): The app ID of a key_value connection containing provider configuration details. These will be merged with the values provided in the provider_config section of the spec.
The fields which can either be set by connection or by the provider_config field of the model. Values from
a connection will be merged with the provider_config.
Then, you can define a specification file to provide the details about the model and the provider configuration specifications:
gpt-5-2025-08-07.yaml
Copy
Ask AI
spec_version: v1kind: modelname: openai/gpt-5-2025-08-07display_name: GPT 5description: |- GPT-5 is our flagship model for coding, reasoning, and agentic tasks across domains. Learn more in our GPT-5 usage guide.tags:- openai- gptmodel_type: chatprovider_config: custom_host: https://my-openai-compatible-server
2
Create an API key connection
To safely use the OpenAI API key, you must first create a connection:
BASH
Copy
Ask AI
orchestrate connections add -a openai_credentialsorchestrate connections configure -a openai_credentials --env draft -k key_value -t teamorchestrate connections set-credentials -a openai_credentials --env draft -e "api_key=my_openai_key"
3
Add the model
You can now add the model using the specification file and the connection that you created:
The fields which can either be set by connection or by the provider_config field of the model. Values from
a connection will be merged with the provider_config.
When connecting to a watsonx.ai instance hosted in CPD, this is the url of the CPD cluster hosting watsonx.ai.Required connecting to on-prem (CPD) hosted wx.ai instances
When connecting to a watsonx.ai instance hosted in CPD, this is username of a user with access to the CPD cluster.Required connecting to on-prem (CPD) hosted wx.ai instances
When connecting to a watsonx.ai instance hosted in CPD, this is password of a user with access to the CPD cluster.Required connecting to on-prem (CPD) hosted wx.ai instances
spec_version: v1kind: modelname: watsonx/ibm/granite-3.3-8b-instructdisplay_name: IBM watsonx.ai (Granite)description: | IBM watsonx.ai model using Space-scoped configuration.tags:- ibm- watsonxmodel_type: chatprovider_config: watsonx_space_id: my-space-id
2
Create an API key connection
Copy
Ask AI
orchestrate connections add -a watsonx_credentialsorchestrate connections configure -a watsonx_credentials --env draft -k key_value -t teamorchestrate connections set-credentials -a watsonx_credentials --env draft -e "api_key=my_watsonx_api_key"
Provide one of: watsonx_space_id, watsonx_project_id, or watsonx_deployment_id.
Include watsonx_cpd_url, watsonx_cpd_username, watsonx_cpd_passwordonly for on-prem (CPD) setups.
When deploying Deploy on Demand (DoD) models, you need to explicitly provide the model configuration during registration. Set these configuration values according to the model’s requirements, since they don’t automatically transfer during inference from the WXO side.
The fields which can either be set by connection or by the provider_config field of the model. Values from
a connection will be merged with the provider_config.
The fields which can either be set by connection or by the provider_config field of the model. Values from
a connection will be merged with the provider_config.
spec_version: v1kind: modelname: anthropic/claude-3display_name: Anthropic Claude 3description: | Anthropic Claude model for safe and helpful AI interactions.tags:- anthropic- claudemodel_type: chatprovider_config: {}
2
Create an API key connection
Copy
Ask AI
orchestrate connections add -a anthropic_credentialsorchestrate connections configure -a anthropic_credentials --env draft -k key_value -t teamorchestrate connections set-credentials -a anthropic_credentials --env draft -e "api_key=my_anthropic_key"
The fields which can either be set by connection or by the provider_config field of the model. Values from
a connection will be merged with the provider_config.
spec_version: v1kind: modelname: google/gemini-2.5-prodisplay_name: Google Generative AI (Gemini 2.5 Pro)description: | Google Generative AI model via API key authentication.tags:- google- genaimodel_type: chatprovider_config: {}
2
Create an API key connection
Copy
Ask AI
orchestrate connections add -a google_credentialsorchestrate connections configure -a google_credentials --env draft -k key_value -t teamorchestrate connections set-credentials -a google_credentials --env draft -e "api_key=my_google_api_key"
The fields which can either be set by connection or by the provider_config field of the model. Values from
a connection will be merged with the provider_config.
The fields which can either be set by connection or by the provider_config field of the model. Values from
a connection will be merged with the provider_config.
The fields which can either be set by connection or by the provider_config field of the model. Values from
a connection will be merged with the provider_config.
You must provide either the api_key, aws_secret_access_key, or aws_access_key_id.
You must provide the model name in the name field.
When deploying Deploy on Demand (DoD) models, you need to explicitly provide the model configuration during registration. Set these configuration values according to the model’s requirements, since they don’t automatically transfer during inference from the watsonx Orchestrate side.
The fields which can either be set by connection or by the provider_config field of the model. Values from
a connection will be merged with the provider_config.
The fields which can either be set by connection or by the provider_config field of the model. Values from
a connection will be merged with the provider_config.
The fields which can either be set by connection or by the provider_config field of the model. Values from
a connection will be merged with the provider_config.
The fields which can either be set by connection or by the provider_config field of the model. Values from
a connection will be merged with the provider_config.
Before you import the model, it is a good idea to test your connection to guarantee the watsonx Orchestrate Developer Edition server can connect to the Ollama server.
Use the following curl command to test your connection, replacing 198.51.100.42 with the IP address that you obtained in the previous step:
Enter the watsonx Orchestrate Developer Edition gateway container:
Copy
Ask AI
docker exec -it docker-wxo-agent-gateway-1 sh
Run the curl command again from within the container shell.
Tips:
If you experience connection issues with Ollama:
Wait a few minutes after starting the server before running the command.
Restart the Ollama server.
Close any VPN clients.
Try reconnecting to both Wi-Fi and wired Ethernet simultaneously.
Avoid switching networks during the process.
Reset the watsonx Orchestrate Developer Edition server:
Copy
Ask AI
orchestrate server reset
4
Define the model specification file
For Ollama, you don’t need to create a connection or use an actual API key. You can use a string such as ollama as an API key.You must use your current local network IP address as your URL. Ollama will not work if you use localhost or 0.0.0.0 in the model specification file.
ollama-llama2.yaml
Copy
Ask AI
spec_version: v1kind: modelname: ollama/llama3.2:latestdisplay_name: Ollama LLaMA 3.2description: | Ollama-hosted LLaMA 3.2 model for local or edge deployments.tags:- ollama- llama2model_type: chatprovider_config: api_key: ollama custom_host: http://198.51.100.42:11434
Remember: Replace http://198.51.100.42:11434 with the IP address that you have obtained in the previous step.
For on-premises installations which have models only provisioned through the AI gateway, it’s possible to select which of these
models should be marked as the default model by using the following default tag:
granite-default-model.yaml
Copy
Ask AI
spec_version: v1kind: modelname: watsonx/ibm/granite-3.3-8b-instructdisplay_name: IBM watsonx.ai (Granite)description: | IBM watsonx.ai model using Space-scoped configuration.tags:- default # <-- this marks this as the Default model in the ui dropdownmodel_type: chatprovider_config: watsonx_space_id: my-space-id
Note:For on-premises installations using only externally hosted virtual-models, at least one model must be specified as the default model or it will not be possible
to open the “Create Agent” page in the UI.
Registering a watsonx model by using your watsonx credentials
You can also register a watsonx model that uses your watsonx credentials supplied in your .env file when you start the watsonx Orchestrate Developer Edition.For that, your .env file must contain either:
Your watsonx.ai credentials with the WATSONX_APIKEY and WATSONX_SPACE_ID environment variables.
Or, your watsonx Orchestrate credentials with the WO_INSTANCE and WO_API_KEY environment variables.
To learn how to configure you .env file with these credentials, see Installing the watsonx Orchestrate Developer Edition.To register the watsonx model through this method, you must create an api_key credential with the value “gateway”. You also don’t need to specify a space_id when you add the model. See the following example: