Intermediate25 minModule 3 of 3

OpenAI Migration Guide

Migrate an existing OpenAI application to Skytells. Often just two lines of code — then unlock 27+ additional models on a unified API.

What you'll be able to do after this module

Migrate any OpenAI-powered application to Skytells — preserving all existing code — and unlock access to TrueFusion, Google Veo, FLUX, BeatFusion, and more through the exact same API interface.


Why migrate?

api.openai.com/v1 api.skytells.ai/v1 Your App OpenAI only Your App Skytells API TrueFusion • BeatFusionLipFusion • Mera GoogleVeo 3.1 • Imagen 4 OpenAIgpt-4o • dall-e-3 Black Forest LabsFLUX.2 Pro
BenefitDetail
Same SDK, more models27+ models from multiple providers via one API
One invoiceUnified billing for all providers
Native image/video/audioTrueFusion, BeatFusion, LipFusion — no OpenAI equivalent
Edge gatewayLower latency (Business/Enterprise)

The two-line migration

If you use the official openai SDK, changing to Skytells takes exactly two lines:

# Before
from openai import OpenAI
client = OpenAI(api_key=os.environ["OPENAI_API_KEY"])

# After (change 2 values)
from openai import OpenAI
client = OpenAI(
    api_key=os.environ["SKYTELLS_API_KEY"],   # ← new key
    base_url="https://api.skytells.ai/v1",   # ← new URL
)

# Everything below this line is identical — no other changes needed
response = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "Hello!"}],
)

Model mapping

Skytells accepts OpenAI model names directly. You can also switch to Skytells-native or third-party equivalents:

Your current OpenAI modelKeep as-isUpgrade toWhy upgrade
gpt-4o✓ Works
gpt-4-turbo✓ Works
dall-e-3✓ Workstruefusion-proHigher quality, lower cost
dall-e-2✓ WorkstruefusionFaster, cheaper
text-embedding-ada-002✓ Works
whisper-1✓ Works
truefusion-ultraNo OpenAI equivalent
veo-3.1No OpenAI equivalent (Google)
flux-2-proNo OpenAI equivalent (BFL)
beatfusion-2.0No OpenAI equivalent (music)

Testing the migration

Before migrating production, validate with a quick test:

import os
from openai import OpenAI

# Test Skytells compatibility
client = OpenAI(
    api_key=os.environ["SKYTELLS_API_KEY"],
    base_url="https://api.skytells.ai/v1",
)

# 1. Chat completions
chat = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "Say 'migration successful' in one sentence."}],
)
print("Chat:", chat.choices[0].message.content)

# 2. Image generation (via Skytells predictions API)
image = client.images.generate(
    model="truefusion-pro",
    prompt="A simple geometric shape on white background",
    n=1,
    size="1024x1024",
)
print("Image:", image.data[0].url)

print("✓ Migration successful")

Using the native Skytells SDK

After migration, consider switching to the native Skytells SDK for Skytells-specific features (image/video/audio models, webhooks, prediction management):

# openai SDK (works, but limited to OpenAI-compatible features)
from openai import OpenAI
client = OpenAI(api_key=..., base_url="https://api.skytells.ai/v1")

# Native Skytells SDK (recommended for full feature access)
import skytells
client = skytells.Client(api_key=os.environ["SKYTELLS_API_KEY"])

# Skytells-specific features only available via native SDK:
prediction = client.predictions.create(
    model="truefusion-video-pro",   # video — not available via openai SDK
    input={"prompt": "Ocean waves", "duration_seconds": 10},
    webhook="https://yourapp.com/webhooks",  # webhook support
)

Using Skytells in LangChain

LangChain apps can switch to Skytells by changing the OpenAI provider's base URL:

from langchain_openai import ChatOpenAI

# Just change base_url and api_key
llm = ChatOpenAI(
    model="gpt-4o",
    api_key=os.environ["SKYTELLS_API_KEY"],
    base_url="https://api.skytells.ai/v1",
)

# Chain works exactly the same
from langchain_core.prompts import ChatPromptTemplate

prompt = ChatPromptTemplate.from_messages([
    ("system", "You are a helpful assistant."),
    ("user", "{input}"),
])

chain = prompt | llm
result = chain.invoke({"input": "Summarize the benefits of AI image generation."})
print(result.content)

Migration checklist


Summary

Migration is a 2-line change. After that:

  • Keep using OpenAI model names as-is — they're fully compatible
  • Add Skytells-native models (truefusion-pro, beatfusion-2.0, veo-3.1) for capabilities OpenAI doesn't offer
  • Switch to the native SDK when you need webhooks, video, or audio

Next steps:

On this page