Skip to main content

Code 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 majestic samurai standing on Mount Fuji at sunrise, watercolor style",
    size="1792x1024",    # Landscape
    quality="hd",        # Higher detail
    style="vivid",       # More dramatic
    n=1
)

print(response.data[0].url)
print(response.data[0].revised_prompt)  # DALL-E 3 may revise your prompt

Parameters

ParameterOptionsDescription
size1024x1024, 1792x1024, 1024x1792Square, landscape, or portrait
qualitystandard, hdhd has finer details. ~2× cost
stylevivid, naturalvivid = dramatic; natural = photorealistic
n1DALL-E 3 only supports n=1

Pricing

QualityPrice
1024x1024 standard$0.02/image
1024x1024 HD$0.04/image
1792x1024 standard$0.04/image
1792x1024 HD$0.08/image
Samurai AI pricing is 50% off the above OpenAI prices. You pay $0.01/image for standard 1024x1024.

Prompt Tips

  • Be descriptive: include style, mood, lighting, and composition
  • DALL-E 3 follows prompts closely — no need for magic keywords
  • Use revised_prompt in the response to see how DALL-E interpreted your prompt