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?
| Benefit | Detail |
|---|---|
| Same SDK, more models | 27+ models from multiple providers via one API |
| One invoice | Unified billing for all providers |
| Native image/video/audio | TrueFusion, BeatFusion, LipFusion — no OpenAI equivalent |
| Edge gateway | Lower 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!"}],
)All existing API calls — chat.completions.create, images.generate, embeddings.create — work without any other changes. Your business logic is untouched.
Model mapping
Skytells accepts OpenAI model names directly. You can also switch to Skytells-native or third-party equivalents:
| Your current OpenAI model | Keep as-is | Upgrade to | Why upgrade |
|---|---|---|---|
gpt-4o | ✓ Works | — | — |
gpt-4-turbo | ✓ Works | — | — |
dall-e-3 | ✓ Works | truefusion-pro | Higher quality, lower cost |
dall-e-2 | ✓ Works | truefusion | Faster, cheaper |
text-embedding-ada-002 | ✓ Works | — | — |
whisper-1 | ✓ Works | — | — |
| — | — | truefusion-ultra | No OpenAI equivalent |
| — | — | veo-3.1 | No OpenAI equivalent (Google) |
| — | — | flux-2-pro | No OpenAI equivalent (BFL) |
| — | — | beatfusion-2.0 | No 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
)Use the openai SDK when you want to keep your existing code exactly as-is. Use the native @skytells/sdk / skytells Python SDK when you want to access video, audio, webhooks, and prediction management.
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
You've completed the SDK Mastery path. You can now use the Python SDK, TypeScript SDK, and migrate any existing OpenAI app — all in production-ready code.
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:
- Building Production Apps → — webhooks, rate limits, Edge API
- Image Generation → — prompt engineering and integration