Skip to main content
Routeway provides an OpenAI-compatible image generation endpoint that lets you create and edit images from text prompts.
POST https://api.routeway.ai/v1/images/generations

Quick Example

import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.routeway.ai/v1",
    api_key=os.getenv("ROUTEWAY_API_KEY"),
)

response = client.images.generate(
    model="gpt-image-1",
    prompt="A futuristic cityscape at sunset with flying cars",
    size="1024x1024",
    quality="auto",
    n=1,
)

print(response.data[0].url)

Response

The API returns an array of image objects. Depending on your response_format, each object contains either a URL or base64-encoded image data.
{
  "created": 1700000000,
  "data": [
    {
      "url": "https://...",
      "b64_json": null
    }
  ]
}

Common Parameters

ParameterTypeDescription
modelstringThe model to use (e.g. gpt-image-1).
promptstringA text description of the desired image.
nintegerNumber of images to generate (default: 1).
sizestringImage dimensions (e.g. 1024x1024, 1792x1024, 1024x1792).
qualitystringQuality level — auto, low, medium, or high.
response_formatstringurl or b64_json.

Learn More

Generating Images

Create images from text prompts with full control over size, quality, and format.

Editing Images

Modify existing images using text prompts and optional masks.