Skip to main content

Provider capabilities

The table below summarizes gateway support for this endpoint by provider.
Legend:
  • Supported by Provider and Truefoundry
  • Provided by provider, but not by Truefoundry
  • Provider does not support this feature
ProviderVariation
OpenAI
Azure OpenAI
Bedrock
Vertex
Anthropic
Cohere
Gemini
Groq
Together-AI
xAI
DeepInfra
For every gateway endpoint and provider, see Supported APIs. TrueFoundry AI Gateway supports image variation capabilities that allow you to generate new versions of existing images while preserving the core visual elements and style. This feature is perfect for creating artistic variations, exploring different compositions, or generating multiple options from a single source image.

Supported Providers

  • OpenAI: Supports dall-e-2 model
  • AWS Bedrock: Supports amazon-nova-canvas model

Requirements

ProviderModelFormatSize LimitImage CountImage Requirements
OpenAIdall-e-2Square PNG< 4MB1 image onlyMust be square
AWS Bedrockamazon-nova-canvasPNG, JPEG-Upto 5 images-

Example Usage

The meaning of the parameters are present in the OpenAI API documentation. The AWS Bedrock specfic parameters are explained here
from openai import OpenAI

BASE_URL = "{GATEWAY_BASE_URL}"
API_KEY = "your-truefoundry-api-key"

# Configure OpenAI client with TrueFoundry settings
client = OpenAI(
    api_key=API_KEY,
    base_url=BASE_URL,
)

response = client.images.create_variation(
    model="openai-main/dall-e-2",
    image=open("source_image.png", "rb"),  # Source image for variation
    n=3,  # Number of variations to generate
    size="1024x1024"
)

print(response)

Response Format

The API returns an ImagesResponse object containing:
{
  "created": 1589478378,
  "data": [
    {
      "url": "https://..."
    },
    {
      "url": "https://..."
    },
    {
      "url": "https://..."
    }
  ]
}