Zum Inhalt springen

Quickstart

Dieser Inhalt ist für v1.1.0. Geh zur neuesten Version, um die aktuellste Dokumentation zu bekommen.

Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.

Get up and running with AI Foundation Services in minutes. This guide walks you through installing the SDK, setting up authentication, and making your first API call.

AI Foundation Services uses an OpenAI-compatible API, so you can use the official OpenAI SDKs.

Terminal window
pip install openai

Get started immediately with a free trial key:

  1. Visit the API Key Portal
  2. Create an account and generate your API key
  3. Your trial key gives you access to all available models

For production workloads, purchase via the T-Cloud Marketplace.

Terminal window
export OPENAI_API_KEY="your_api_key_here"
export OPENAI_BASE_URL="https://llm-server.llmhub.t-systems.net/v2"
Terminal window
curl -X POST "$OPENAI_BASE_URL/chat/completions" \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "Llama-3.3-70B-Instruct",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "What is quantum computing in simple terms?"}
],
"temperature": 0.5,
"max_tokens": 150
}'
from openai import OpenAI
client = OpenAI()
texts = ["The quick brown fox jumps over the lazy dog", "Data science is fun!"]
result = client.embeddings.create(input=texts, model="jina-embeddings-v2-base-de")
print(f"Embedding dimension: {len(result.data[0].embedding)}")
print(f"Token usage: {result.usage}")
from openai import OpenAI
client = OpenAI()
response = client.chat.completions.create(
model="Qwen3-VL-30B-A3B-Instruct-FP8",
messages=[
{
"role": "user",
"content": [
{"type": "text", "text": "What's in this image?"},
{
"type": "image_url",
"image_url": {
"url": "https://images.unsplash.com/photo-1546069901-ba9599a7e63c?w=400"
},
},
],
}
],
max_tokens=300,
)
print(response.choices[0].message.content)