Documentation Index
Fetch the complete documentation index at: https://docs.samuraiapi.in/llms.txt
Use this file to discover all available pages before exploring further.
Image Generation
Create an image from a text prompt using various state-of-the-art models. Our API is fully compatible with the OpenAI Image Generation schema.Endpoint
Request Body
The model ID to use for image generation.Available models include:
flux-schnell(Fast, high quality)flux-1.1-pro(Professional grade)dall-e-3(OpenAI’s latest)ideogram-v3(Excellent for text in images)imagen-3(Google’s latest)
A text description of the desired image(s). The maximum length is 1000 characters.
The number of images to generate. Must be between 1 and 10.
The size of the generated images. Options:
256x256, 512x512, 1024x1024.The format in which the generated images are returned. Must be one of
url or b64_json.A unique identifier for the end-user, for abuse monitoring.
Response
Unix timestamp of when the generation was created
An array of image objects. Each object contains:
url(string): The URL of the generated image (ifresponse_formatisurl)b64_json(string): The base64-encoded JSON of the generated image (ifresponse_formatisb64_json)revised_prompt(string): The prompt as revised by the model (if applicable)
Examples
Error Responses
| Status | Error Type | Description |
|---|---|---|
| 400 | invalid_request_error | Missing required field or invalid parameter |
| 401 | authentication_error | Invalid API key |
| 404 | not_found_error | Model not found |
| 429 | rate_limit_error | Rate limit exceeded |
| 500 | server_error | Internal server error |