Skip to content

Image Generation

Generate images using SDXL Turbo and Stable Diffusion XL on distributed GPU nodes. OpenAI-compatible format.

Endpoint

POST /v1/images/generations

Authentication

Include your API key as a Bearer token or X-API-Key header. See Authentication.

Request body

ParameterTypeRequiredDescription
modelstringYesModel ID: sdxl-turbo
promptstringYesText description of the image to generate
nintegerNoNumber of images to generate (default: 1)
sizestringNoImage size, up to 1024x1024

Example

Python

from openai import OpenAI

client = OpenAI(
    base_url="https://api.ryvion.ai/v1",
    api_key="YOUR_KEY",
)

response = client.images.generate(
    model="sdxl-turbo",
    prompt="A futuristic city at sunset, digital art",
    n=1,
    size="1024x1024",
)
print(response.data[0].url)

curl

curl -X POST https://api.ryvion.ai/v1/images/generations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "sdxl-turbo",
    "prompt": "A futuristic city at sunset, digital art",
    "n": 1,
    "size": "1024x1024"
  }'

Response format

{
  "created": 1712345678,
  "data": [
    {
      "url": "https://..."
    }
  ]
}

The response contains a presigned URL for each generated image. URLs are temporary -- download or cache the images for long-term use.

Available models

ModelDescriptionSpeed
sdxl-turboSDXL Turbo for fast generationFast

Pricing

$0.03 CAD per image. 17x cheaper than DALL-E 3.

Notes

  • Maximum resolution: 1024x1024
  • Images are generated on GPU nodes in the Ryvion network
  • Each generation produces a cryptographic receipt proving execution details
  • Image URLs are presigned and will expire -- save images locally if you need them long-term