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
| Parameter | Options | Description |
|---|
size | 1024x1024, 1792x1024, 1024x1792 | Square, landscape, or portrait |
quality | standard, hd | hd has finer details. ~2× cost |
style | vivid, natural | vivid = dramatic; natural = photorealistic |
n | 1 | DALL-E 3 only supports n=1 |
Pricing
| Quality | Price |
|---|
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