Overview

Generate AI-powered images with ShuttleAI.
All endpoints are under https://api.shuttleai.com/v1/images/generations.
Authentication Required:
All endpoints require a Bearer token in the Authorization header.
Authorization: Bearer YOUR_API_KEY

Endpoints

Create Images

Generate one or more images from a text prompt. POST /generations Request:
POST https://api.shuttleai.com/v1/images/generations
Content-Type: application/json
Authorization: Bearer YOUR_API_KEY

{
  "prompt": "A futuristic cityscape at dusk with flying cars.",
  "model": "shuttle-image",
  "n": 1,
  "size": "1024x1024",
  "response_format": "url"
}
Response:
{
  "created": 1748796451,
  "data": [
    {
      "url": "https://cdn.shuttleai.com/cdn/23a5746f-a307-4565-967b-fe5457d2953d.png"
    }
  ]
}
Parameters:
ParameterTypeRequiredDescription
promptstringText prompt describing the image(s) to generate
modelstringModel to use. Only shuttle-image is supported (default)
nintegerNumber of images to generate. Min 1, Max 4 (default: 1)
sizestringImage dimensions. Allowed: “1024x1024”, “1792x1024”, “1024x1792” (default: “1024x1024”)
response_formatstringFormat of the returned data. Allowed: “url” (default) or “b64_json”

Pricing

SizeRequest Multiplier
1024x10241.0
1792x1024 / 1024x17921.5

Sample Code

from shuttleai import ShuttleAI


client = ShuttleAI()

response = client.images.generate(
    prompt="A serene sunset over a calm ocean with gentle waves",
    model="shuttle-image",
    n=1,
    size="1024x1024",
    response_format="url"
)

if response.data and response.data[0].url:
    print(f"Image generated successfully! URL: {response.data[0].url}")
    # Save the image to a file
    response.data[0].to_file("output_image.png")
    print("Image saved to output_image.png")
else:
    print("No image URL available.")