← Docs/Quick Start

Quick Start

Prerequisites

  • A registered UnionToken account
  • An API Key created

Step 1: Install SDK

pip install openai

Step 2: Get API Key

Log in to the Merchant Console and create a new API Key.

Step 3: Update base_url

Replace OpenAI's base URL with UnionToken:

base_url="https://api.uniontoken.ai/v1"

Step 4: Make Your First Call

from openai import OpenAI

client = OpenAI(
    base_url="https://api.uniontoken.ai/v1",
    api_key="utk_xxxxxxxx"  # Replace with your Key
)

response = client.chat.completions.create(
    model="gpt-5.4",
    messages=[{"role": "user", "content": "Hello"}]
)

print(response.choices[0].message.content)

Supported Models

Check the Model Marketplace for all available models — just change the model parameter to switch:

model="anthropic/claude-opus-4-6"  # Anthropic
model="openai/gpt-5.4"                 # OpenAI
model="google/gemini-3.1-pro"          # Google
model="deepseek/deepseek-v3.2.2"         # DeepSeek

Next Steps