Skip to Content
Launching the open-source gateway

Watsonx (gateway)

Route Watsonx calls through the Respan gateway with an OpenAI-compatible client. This setup uses your RESPAN_API_KEY; your application does not need to manage IBM Watsonx credentials directly.

Use a Watsonx model ID from your Respan model list . If your workspace uses a custom Watsonx deployment, use the model name shown in the platform.

Paste this into your coding agent:

Help me set up the Respan gateway with the Watsonx integration. Follow https://www.respan.ai/docs/integrations/gateway/watsonx.md

Setup

Install packages

Terminal
pip install openai

Set environment variables

Terminal
export RESPAN_API_KEY="YOUR_RESPAN_API_KEY"

No WATSONX_API_KEY is required in your application for gateway calls. The Respan gateway handles provider authentication and request logging.

Point an OpenAI-compatible client to the Respan gateway

Python
import os from openai import OpenAI client = OpenAI( api_key=os.environ["RESPAN_API_KEY"], base_url="https://api.respan.ai/api", ) response = client.chat.completions.create( model="YOUR_WATSONX_MODEL_ID", messages=[{"role": "user", "content": "Say hello in three languages."}], ) print(response.choices[0].message.content)

Switch models

Change the model parameter to use 1000+ models from different providers through the same gateway.

Python
response = client.chat.completions.create(model="YOUR_WATSONX_MODEL_ID", messages=messages) response = client.chat.completions.create(model="openai/gpt-6-sol", messages=messages) response = client.chat.completions.create(model="anthropic/claude-opus-5-5", messages=messages)

See the full model list .