Skip to main content

Endpoint

POST https://api.samuraiapi.in/v1/images/generations

Request Parameters

ParameterTypeRequiredDescription
modelstringImage model ID (see below)
promptstringText description of the image
nintegerNumber of images (1–10). Default: 1
sizestringImage dimensions (model-dependent)
qualitystring"standard" or "hd" (DALL-E 3 only)
stylestring"vivid" or "natural" (DALL-E 3 only)
response_formatstring"url" (default) or "b64_json"

Quick Example

from openai import OpenAI

client = OpenAI(
    api_key="sk-samurai-YOUR_KEY",
    base_url="https://api.samuraiapi.in/v1"
)

response = client.images.generate(
    model="dall-e-3",
    prompt="A futuristic samurai warrior in neon-lit Tokyo, cyberpunk style",
    size="1024x1024",
    quality="hd",
    n=1
)

print(response.data[0].url)

Available Models

ModelProviderSpeedQualityPrice
dall-e-3OpenAIMediumExcellent$0.02/img
dall-e-2OpenAIFastGood$0.005/img
black-forest-labs/flux-1.1-proFluxMediumOutstanding$0.02/img
black-forest-labs/flux-schnellFluxVery FastGood$0.003/img
stability-ai/sdxlStabilityFastGood$0.005/img

DALL-E 3

Best photorealism and prompt adherence.

Flux Models

Fastest generation with excellent quality.