SDKs
Use the official Skytells SDKs for type-safe, simplified access to all Skytells APIs.
Official SDKs
Skytells currently provides 3 official SDKs:
- TypeScript SDK for Node.js, browsers, and edge runtimes
- Python SDK for backend services and data workflows
- Swift SDK for iOS, macOS, tvOS, and watchOS
All official SDKs are designed to keep authentication, request handling, and model execution consistent across environments.
TypeScript SDK
Installation
npm install skytellspnpm add skytellsyarn add skytellsQuick Start
import { createClient } from 'skytells';
const client = createClient(process.env.SKYTELLS_API_KEY);
// List available models
const models = await client.listModels();
console.log(models);
// Create a prediction
const prediction = await client.predict({
model: 'skytells/truefusion',
input: { prompt: 'A mountain landscape at dawn' },
});
console.log(prediction.output);Automatic API Routing
One of the key advantages of the SDK is automatic routing. You don't need to choose between api.skytells.ai and edge.skytells.ai — the SDK picks the right endpoint based on the model and service:
// The SDK routes this to the correct endpoint automatically
const prediction = await client.predict({
model: 'skytells/truefusion',
input: { prompt: 'Hello world' },
});No need to manage base URLs or switch between endpoints manually.
Creating Predictions
const prediction = await client.predict({
model: 'skytells/truefusion',
input: {
prompt: 'A futuristic cityscape at sunset',
aspect_ratio: '16:9',
number_of_images: 3,
},
});
// Poll for completion
const result = await client.getPrediction(prediction.id);
console.log(result.status); // "succeeded"
console.log(result.output); // Array of image URLsListing Models
const models = await client.listModels();
for (const model of models) {
console.log(`${model.name} (${model.id}): ${model.description}`);
}Error Handling
import { createClient, SkytellsError } from 'skytells';
const client = createClient(process.env.SKYTELLS_API_KEY);
try {
const prediction = await client.predict({
model: 'skytells/truefusion',
input: { prompt: 'Hello' },
});
} catch (error) {
if (error instanceof SkytellsError) {
console.error(`API Error: ${error.message} (${error.status})`);
}
}SDK vs Direct API
| SDK | Direct API | |
|---|---|---|
| Authentication | Handled automatically | Manual x-api-key header |
| Routing | Auto-selects Standard or Edge | You choose the base URL |
| Type safety | Language-native SDK types and helpers | None (raw JSON) |
| Serialization | Automatic | Manual JSON parse/stringify |
| Error handling | Typed error classes | Raw HTTP status codes |
For most use cases, the SDK is the recommended way to interact with Skytells. Use the direct APIs when you need full control over the HTTP layer or are working in a language without an official SDK.
Full Documentation
Read the full guides and references for each SDK:
More SDKs
The .NET SDK is coming soon. In the meantime, you can use the APIs directly from any language.
How is this guide?