Use this file to discover all available pages before exploring further.
Generate images from text prompts using FLUX.1, FLUX.2, Stable Diffusion, and Ideogram through a single API. One API key, one endpoint, eight model families — no GPU management.
FLUX Kontext models accept an existing image and a text instruction describing the edit. Pass a file path, URL, or base64 string as the image parameter.
from runcrate import Runcrateclient = Runcrate(api_key="rc_live_YOUR_API_KEY")# Edit an existing image with a text instructionedited = client.models.generate_image( model="black-forest-labs/FLUX.1-kontext-pro", prompt="Change the background to a tropical beach at sunset", image="./product-photo.png", # file path (auto base64-encoded))edited.data[0].save("product-beach.png")
The image field accepts three formats:
File path — "./photo.png" (auto-detected, read and base64-encoded)
URL — "https://..." (passed through as-is)
Base64 string — raw base64 data (passed through as-is)
const response = await fetch('/api/generate-image', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ prompt: 'A mountain landscape at golden hour', model: 'black-forest-labs/FLUX.1-schnell', aspectRatio: '16:9', }),});const { image } = await response.json();// image is a base64 string — render it in an <img> tag
The response includes either a url to the generated image or b64_json base64-encoded image data. The Runcrate SDKs provide a .save() helper that handles both formats automatically.
Image generation pricing varies by model. FLUX.1 Schnell starts at ~$0.003/image. Higher-quality models like FLUX.2 Pro cost more per generation. Check the Model Catalog for current per-model pricing.