Image Generation
Base URL: https://app.neuroflash.com/api/ds-prototypes
Image generation is not yet available in the Pay-As-You-Go plan. It is currently only accessible through subscription plans that include image generation credits.
Generate Text2Image
/Generate images from text prompts (text-to-image).
This endpoint mimics the fal.ai nano-banana API interface.
Request Body
promptstringYesThe text prompt to generate an image fromnum_imagesintegerNoThe number of images to generateaspect_ratiostringNoAspect ratio options for generated imagesoutput_formatstringNoOutput format options for generated imagesmodelobjectNoThe model to use for image generationlimit_generationsbooleanNoLimit the number of generations to 1Response
imagesarray<object>The generated images
urlstringThe URL where the file can be downloaded fromcontent_typestringThe mime type of the filefile_nameobjectThe name of the filefile_sizeobjectThe size of the file in byteswidthobjectThe width of the imageheightobjectThe height of the imageimage_idobjectThe unique ID of the image in storagedescriptionstringThe description of the generated imagespromptstringThe prompt used to generate the imagesdetailobjectOptional detail message (e.g., quota warnings)batch_idobjectBatch ID for grouping multiple images from one generationExample
- cURL
- Python
- Node.js
- Go
curl -X POST "https://app.neuroflash.com/api/ds-prototypes/" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "x-workspace-id: YOUR_WORKSPACE_ID" \
-H "Content-Type: application/json" \
-d '{
"prompt": "string",
"num_images": 1,
"aspect_ratio": "string",
"output_format": "string",
"model": {},
"limit_generations": false
}'
import requests
response = requests.post(
f"https://app.neuroflash.com/api/ds-prototypes/",
headers={"Authorization": f"Bearer {token}", "x-workspace-id": workspace_id, "Content-Type": "application/json"},
json={
"prompt": "string",
"num_images": 1,
"aspect_ratio": "string",
"output_format": "string",
"model": {},
"limit_generations": False
},
).json()
const response = await fetch(
`https://app.neuroflash.com/api/ds-prototypes/`,
{
method: "POST",
headers: {
Authorization: `Bearer ${token}`,
"x-workspace-id": workspaceId,
"Content-Type": "application/json",
},
body: JSON.stringify({
"prompt": "string",
"num_images": 1,
"aspect_ratio": "string",
"output_format": "string",
"model": {},
"limit_generations": false
}),
}
).then((r) => r.json());
body, _ := json.Marshal(map[string]any{
"prompt": "string",
"num_images": 1,
"aspect_ratio": "string",
"output_format": "string",
"model": map[string]any{},
"limit_generations": false,
})
req, _ := http.NewRequest("POST", "https://app.neuroflash.com/api/ds-prototypes/", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+token)
req.Header.Set("x-workspace-id", workspaceID)
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
Response:
{
"images": [
{
"url": "string",
"content_type": "string",
"file_name": {},
"file_size": {},
"width": {},
"height": {},
"image_id": {}
}
],
"description": "string",
"prompt": "string",
"detail": {},
"batch_id": {}
}
Generate Image2Image
/editGenerate images from existing images and prompts (image-to-image).
This endpoint mimics the fal.ai nano-banana edit API interface.
Request Body
promptstringYesThe prompt for image editingnum_imagesintegerNoThe number of images to generateaspect_ratiostringNoAspect ratio options with auto for image editingoutput_formatstringNoOutput format options for generated imagesmodelobjectNoThe model to use for image generationimage_urlsarray<string>YesRelative paths of source images, taken from the output_image_url field returned by the /history endpoint. Do not pass absolute URLs.limit_generationsbooleanNoLimit the number of generations to 1Response
imagesarray<object>The generated images
urlstringThe URL where the file can be downloaded fromcontent_typestringThe mime type of the filefile_nameobjectThe name of the filefile_sizeobjectThe size of the file in byteswidthobjectThe width of the imageheightobjectThe height of the imageimage_idobjectThe unique ID of the image in storagedescriptionstringThe description of the generated imagespromptstringThe prompt used to generate the imagesdetailobjectOptional detail message (e.g., quota warnings)batch_idobjectBatch ID for grouping multiple images from one generationExample
The image_urls field expects the relative path returned in output_image_url from the
/history endpoint — for example /api/ds-prototypes/image_generation/{image_id}/view.
Do not construct absolute URLs (e.g. https://app.neuroflash.com/api/...). The image service
resolves these paths internally and will return a 500 error if given an external URL.
Typical workflow:
- Generate an image with
POST /(text-to-image) - Retrieve its
output_image_urlfromGET /history - Pass that relative path in
image_urlstoPOST /edit
- cURL
- Python
- Node.js
- Go
curl -X POST "https://app.neuroflash.com/api/ds-prototypes/edit" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "x-workspace-id: YOUR_WORKSPACE_ID" \
-H "Content-Type: application/json" \
-d '{
"prompt": "string",
"num_images": 1,
"aspect_ratio": "string",
"output_format": "string",
"model": {},
"image_urls": ["/api/ds-prototypes/image_generation/YOUR_IMAGE_ID/view"],
"limit_generations": false
}'
import requests
response = requests.post(
f"https://app.neuroflash.com/api/ds-prototypes/edit",
headers={"Authorization": f"Bearer {token}", "x-workspace-id": workspace_id, "Content-Type": "application/json"},
json={
"prompt": "string",
"num_images": 1,
"aspect_ratio": "string",
"output_format": "string",
"model": {},
"image_urls": ["/api/ds-prototypes/image_generation/YOUR_IMAGE_ID/view"],
"limit_generations": False
},
).json()
const response = await fetch(
`https://app.neuroflash.com/api/ds-prototypes/edit`,
{
method: "POST",
headers: {
Authorization: `Bearer ${token}`,
"x-workspace-id": workspaceId,
"Content-Type": "application/json",
},
body: JSON.stringify({
"prompt": "string",
"num_images": 1,
"aspect_ratio": "string",
"output_format": "string",
"model": {},
"image_urls": ["/api/ds-prototypes/image_generation/YOUR_IMAGE_ID/view"],
"limit_generations": false
}),
}
).then((r) => r.json());
body, _ := json.Marshal(map[string]any{
"prompt": "string",
"num_images": 1,
"aspect_ratio": "string",
"output_format": "string",
"model": map[string]any{},
"image_urls": []any{"/api/ds-prototypes/image_generation/YOUR_IMAGE_ID/view"},
"limit_generations": false,
})
req, _ := http.NewRequest("POST", "https://app.neuroflash.com/api/ds-prototypes/edit", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+token)
req.Header.Set("x-workspace-id", workspaceID)
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
Response:
{
"images": [
{
"url": "string",
"content_type": "string",
"file_name": {},
"file_size": {},
"width": {},
"height": {},
"image_id": {}
}
],
"description": "string",
"prompt": "string",
"detail": {},
"batch_id": {}
}
Get Available Models
/modelsGet list of available image generation models.
Returns static list of configured models with allowed flag based on user permissions.
Example
- cURL
- Python
- Node.js
- Go
curl "https://app.neuroflash.com/api/ds-prototypes/models" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "x-workspace-id: YOUR_WORKSPACE_ID"
import requests
response = requests.get(
f"https://app.neuroflash.com/api/ds-prototypes/models",
headers={"Authorization": f"Bearer {token}", "x-workspace-id": workspace_id},
).json()
const response = await fetch(
`https://app.neuroflash.com/api/ds-prototypes/models`,
{ headers: { Authorization: `Bearer ${token}`, "x-workspace-id": workspaceId } }
).then((r) => r.json());
req, _ := http.NewRequest("GET", "https://app.neuroflash.com/api/ds-prototypes/models", nil)
req.Header.Set("Authorization", "Bearer "+token)
req.Header.Set("x-workspace-id", workspaceID)
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
Response:
[
{
"id": "string",
"name": "string",
"provider": "string",
"description": "string",
"capabilities": [
"string"
],
"max_images": 0,
"aspect_ratios": [
"string"
],
"output_formats": [
"string"
],
"allowed": false,
"order": 0
}
]
Get Generation History
/historyGet image generation history for the authenticated user's workspace.
Args: model: Optional filter by model name (e.g., "nano-banana") limit: Maximum number of results (default 100, max 1000) offset: Offset for pagination (default 0)
Returns: List of generation history entries
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
model | string | — | |
limit | integer | 100 | |
offset | integer | 0 |
Example
- cURL
- Python
- Node.js
- Go
curl "https://app.neuroflash.com/api/ds-prototypes/history" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "x-workspace-id: YOUR_WORKSPACE_ID"
import requests
response = requests.get(
f"https://app.neuroflash.com/api/ds-prototypes/history",
headers={"Authorization": f"Bearer {token}", "x-workspace-id": workspace_id},
).json()
const response = await fetch(
`https://app.neuroflash.com/api/ds-prototypes/history`,
{ headers: { Authorization: `Bearer ${token}`, "x-workspace-id": workspaceId } }
).then((r) => r.json());
req, _ := http.NewRequest("GET", "https://app.neuroflash.com/api/ds-prototypes/history", nil)
req.Header.Set("Authorization", "Bearer "+token)
req.Header.Set("x-workspace-id", workspaceID)
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
Response:
[
{
"output_image_id": "string",
"batch_id": "string",
"user_id": 0,
"workspace_id": "string",
"prompt": "string",
"model": "string",
"parameters": {},
"input_images": {},
"output_image_url": "/api/ds-prototypes/image_generation/b64b61f6-a7d2-4fa0-9f88-289dae46c41f/view",
"output_image_width": {},
"output_image_height": {},
"output_image_size": {},
"created_at": "2024-01-15T10:30:00Z"
}
]
Get Generation By Id
/history/{image_id}Get a specific generation by its image ID.
Args: image_id: The output image ID (also the generation ID)
Returns: Generation history entry
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
image_id | string | Yes |
Response
output_image_idstringbatch_idstringuser_idintegerworkspace_idstringpromptstringmodelstringparametersobjectinput_imagesobjectoutput_image_urlobjectoutput_image_widthobjectoutput_image_heightobjectoutput_image_sizeobjectcreated_atstringExample
- cURL
- Python
- Node.js
- Go
curl "https://app.neuroflash.com/api/ds-prototypes/history/{image_id}" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "x-workspace-id: YOUR_WORKSPACE_ID"
import requests
response = requests.get(
f"https://app.neuroflash.com/api/ds-prototypes/history/{image_id}",
headers={"Authorization": f"Bearer {token}", "x-workspace-id": workspace_id},
).json()
const response = await fetch(
`https://app.neuroflash.com/api/ds-prototypes/history/${imageId}`,
{ headers: { Authorization: `Bearer ${token}`, "x-workspace-id": workspaceId } }
).then((r) => r.json());
req, _ := http.NewRequest("GET", "https://app.neuroflash.com/api/ds-prototypes/history/"+imageID+"", nil)
req.Header.Set("Authorization", "Bearer "+token)
req.Header.Set("x-workspace-id", workspaceID)
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
Response:
{
"output_image_id": "string",
"batch_id": "string",
"user_id": 0,
"workspace_id": "string",
"prompt": "string",
"model": "string",
"parameters": {},
"input_images": {},
"output_image_url": {},
"output_image_width": {},
"output_image_height": {},
"output_image_size": {},
"created_at": "2024-01-15T10:30:00Z"
}
Delete Generation
/history/{image_id}Delete a generation and its associated image from storage.
Args: image_id: The output image ID (generation ID) to delete
Returns: Success message
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
image_id | string | Yes |
Example
- cURL
- Python
- Node.js
- Go
curl -X DELETE "https://app.neuroflash.com/api/ds-prototypes/history/{image_id}" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "x-workspace-id: YOUR_WORKSPACE_ID"
import requests
requests.delete(
f"https://app.neuroflash.com/api/ds-prototypes/history/{image_id}",
headers={"Authorization": f"Bearer {token}", "x-workspace-id": workspace_id},
)
await fetch(
`https://app.neuroflash.com/api/ds-prototypes/history/${imageId}`,
{
method: "DELETE",
headers: { Authorization: `Bearer ${token}`, "x-workspace-id": workspaceId },
}
);
req, _ := http.NewRequest("DELETE", "https://app.neuroflash.com/api/ds-prototypes/history/"+imageID+"", nil)
req.Header.Set("Authorization", "Bearer "+token)
req.Header.Set("x-workspace-id", workspaceID)
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
Response:
{}