Skip to main content

IBM - Watsonx.ai

IBM - Watsonx.ai is available on the Spanway gateway through the watsonx/ model prefix. You register an IBM - Watsonx.ai model once in the gateway's config.yaml (or through the Admin UI), and every application then calls it through the gateway's OpenAI-compatible API with a Spanway virtual key. The provider credential stays on the gateway, and every request is authenticated, rate limited, logged and costed in the same way as any other provider.

The gateway translates requests and responses for IBM - Watsonx.ai natively, so provider specific parameters and errors are mapped to the OpenAI format for you.

Supported endpoints​

The gateway's endpoint support matrix lists the following endpoints for IBM - Watsonx.ai. Each link explains the request shape and the gateway features that apply to that endpoint.

Model types​

The bundled price map lists 31 IBM - Watsonx.ai models across these modes: Chat, Transcription. The mode decides which gateway endpoint a model is meant for, and it is also used by the gateway's health checks to send the right kind of test request.

Environment variables​

The IBM - Watsonx.ai integration reads the following environment variables. Variables marked as required are the ones the gateway's environment validation checks for this provider. You can also pass any of these values directly in spanway_params (for example api_key or api_base), and the per-model value wins over the environment.

VariableRequiredPurpose
HOSTED_VLLM_API_BASENoOverrides the provider base URL
HOSTED_VLLM_API_KEYNoCredential the gateway sends to the provider
WATSONX_IAM_URLNoOverrides the provider base URL
WX_API_KEYNoCredential the gateway sends to the provider
WATSONX_API_KEYNoCredential the gateway sends to the provider
WATSONX_APIKEYNoRead by the provider integration
WATSONX_ZENAPIKEYNoRead by the provider integration
WATSONX_PROJECT_IDNoProject the requests are billed to
WX_PROJECT_IDNoProject the requests are billed to
PROJECT_IDNoProject the requests are billed to
WATSONX_REGIONNoRegion or location of the deployment
WX_REGIONNoRegion or location of the deployment
REGIONNoRegion or location of the deployment
WATSONX_DEPLOYMENT_SPACE_IDNoRead by the provider integration
WATSONX_SPACE_IDNoRead by the provider integration
WX_SPACE_IDNoRead by the provider integration
SPACE_IDNoRead by the provider integration
WATSONX_TOKENNoCredential the gateway sends to the provider
WATSONX_API_BASENoOverrides the provider base URL
WATSONX_URLNoOverrides the provider base URL
WX_URLNoOverrides the provider base URL
WML_URLNoOverrides the provider base URL

Reference a variable from config.yaml with the os.environ/ prefix so that the secret never appears in the file itself. Secrets can also come from a secret manager, see secret managers.

Register a model on the gateway​

Add an entry to model_list in config.yaml. The model_name is the public name your applications send, and spanway_params.model tells the gateway which provider and upstream model to call.

model_list:
- model_name: mistral-large
spanway_params:
model: watsonx/mistralai/mistral-large
api_key: os.environ/HOSTED_VLLM_API_KEY
api_base: os.environ/WATSONX_URL
project_id: os.environ/WATSONX_PROJECT_ID

Start the gateway with this file:

spanway --config config.yaml
Private preview

Spanway is in private preview. The container images and Helm charts will be published soon. To request access, write to sales@spanway.ai, and preview customers receive download instructions in their onboarding pack.

To add the model without a restart, call POST /model/new with the same model_name and spanway_params, or use the Models + Endpoints page in the Admin UI. See model management for details.

Call the model through the gateway​

Send requests to the gateway's /v1/chat/completions endpoint with a virtual key. The gateway maps the public model name to the IBM - Watsonx.ai deployment, translates the request, and returns the response in the OpenAI format.

curl -X POST http://localhost:4000/v1/chat/completions \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "mistral-large",
"messages": [{"role": "user", "content": "Summarize what an AI gateway does in two sentences."}]
}'

The same request works from any OpenAI SDK by setting the base URL to http://localhost:4000 and the API key to a Spanway virtual key. Create keys with POST /key/generate as described in virtual keys.

Models and pricing​

The table lists every IBM - Watsonx.ai model in the gateway's bundled price map. Prices are shown in US dollars per 1 million tokens, computed from the per-token values the gateway uses for spend tracking. Context window sizes are the provider limits recorded in the same file. Capabilities are the supports_* flags set for each model.

info

Prices come from the price map bundled with this Spanway build. They are used to calculate the spend recorded for each request, key, team and user. Your negotiated rates may differ, and you can override them per deployment with custom pricing.

Model (model value)ModeMax input tokensMax output tokensInput per 1M tokensOutput per 1M tokensOther pricingCapabilities
watsonx/bigscience/mt0-xxlChat4,0964,096$1.91$1.91
watsonx/bigscience/mt0-xxl-13bChat4,0964,096$1.91$1.91
watsonx/core42/jais-13b-chatChat8,1928,192$500.00$2000.00
watsonx/google/flan-t5-xl-3bChat8,1928,192$0.6$0.6
watsonx/ibm/granite-3-3-8b-instructChat8,1928,192$0.2$0.2tools
watsonx/ibm/granite-3-8b-instructChat8,1921,024$0.2$0.2tools, prompt caching, structured output
watsonx/ibm/granite-4-h-smallChat131,072131,072$0.0636$0.265tools
watsonx/ibm/granite-13b-chat-v2Chat8,1928,192$0.6$0.6
watsonx/ibm/granite-13b-instruct-v2Chat8,1928,192$0.6$0.6
watsonx/ibm/granite-guardian-3-2-2bChat8,1928,192$0.1$0.1
watsonx/ibm/granite-guardian-3-3-8bChat8,1928,192$0.2$0.2
watsonx/ibm/granite-ttm-512-96-r2Chat512512$0.38$0.38
watsonx/ibm/granite-ttm-1024-96-r2Chat512512$0.38$0.38
watsonx/ibm/granite-ttm-1536-96-r2Chat512512$0.38$0.38
watsonx/ibm/granite-vision-3-2-2bChat8,1928,192$0.1$0.1vision
watsonx/meta-llama/llama-3-2-1b-instructChat128,000128,000$0.1$0.1tools
watsonx/meta-llama/llama-3-2-3b-instructChat128,000128,000$0.15$0.15tools
watsonx/meta-llama/llama-3-2-11b-vision-instructChat128,000128,000$0.35$0.35tools, vision
watsonx/meta-llama/llama-3-2-90b-vision-instructChat128,000128,000$2.00$2.00tools, vision
watsonx/meta-llama/llama-3-3-70b-instructChat131,072131,072$0.753$0.753tools
watsonx/meta-llama/llama-4-maverick-17bChat131,0728,192$0.371$1.48tools
watsonx/meta-llama/llama-4-maverick-17b-128e-instruct-fp8Chat131,0728,192$0.371$1.48tools
watsonx/meta-llama/llama-guard-3-11b-visionChat128,000128,000$0.35$0.35vision
watsonx/mistralai/mistral-largeChat131,07216,384$3.00$10.00tools, prompt caching, structured output
watsonx/mistralai/mistral-medium-2505Chat128,000128,000$3.00$10.00tools
watsonx/mistralai/mistral-small-3-1-24b-instruct-2503Chat131,07216,384$0.106$0.318tools
watsonx/mistralai/mistral-small-2503Chat32,00032,000$0.1$0.3tools
watsonx/mistralai/pixtral-12b-2409Chat128,000128,000$0.35$0.35vision
watsonx/openai/gpt-oss-120bChat131,072131,072$0.159$0.636
watsonx/sdaia/allam-1-13b-instructChat8,1928,192$1.80$1.80
watsonx/whisper-large-v3-turboTranscription$0.0001 per input second, $0.0001 per output second