Skip to content
Get API key API key

Migrate from OpenAI

Point an application that already calls OpenAI at AI Foundation Services. Keep the SDK. Change the base URL, the API key, and the model id.

If your code uses the AzureOpenAI client, switch to the standard OpenAI client: Azure-style deployment URLs and the api-key header are not part of the AI Foundation Services API.

The move from the current AIFS endpoint to the New API is a separate guide: Migrate to the new API.

Terminal
export OPENAI_API_KEY="your_api_key_here"
export OPENAI_BASE_URL="https://llm-server.llmhub.t-systems.net/v2"
Python
from openai import OpenAI
client = OpenAI()
response = client.chat.completions.create(
model="gpt-oss-120b",
messages=[{"role": "user", "content": "Hello from AIFS"}],
)
print(response.choices[0].message.content)

The response text is response.choices[0].message.content.

Set OPENAI_BASE_URL and OPENAI_API_KEY. The chat body uses model and messages.

Model ids on AIFS can differ from OpenAI model ids. Recommended models lists the catalog. Deprecations lists retirement dates and replacements.

The API is OpenAI-compatible. Not every parameter exists on every model. Some models return HTTP 400 for the Responses API. Use the guide for the call you are migrating.

Authentication failures are HTTP 401 or 403. See Error codes.