Skip to main content

Images

Base URL: https://app.neuroflash.com/api/image-service

Upload an image into the workspace

POST/v1/workspaces/{workspaceId}/images

Creates an image in the workspace from the supplied URL or data URI. The returned id can be passed as input to image-edit-tasks or image-upscale-tasks.

Path Parameters

ParameterTypeRequiredDescription
workspaceIdstringYes

Request Body

FieldTypeRequiredDescription
imageUrlstringYesHTTP(S) URL of the image to fetch, or an inline data: URI.

Response

FieldTypeDescription
idstringUnique image ID (also the GCS object key).
generationIdstringGroups every image produced by one generation request. Multiple rows can share the same generationId when a request asked for more than one image.
workspaceIdstringOwning workspace ID.
createdByUserIdstringGateway user ID of the image creator.
promptstringPrompt that produced the image (empty for upscales).
modelstringModel used to produce the image.
parametersobjectGeneration parameters (aspect ratio, format, etc.).
inputImageIdsobjectIDs of any input images supplied for image2image / upscale.
imageWidthobjectImage width in pixels.
imageHeightobjectImage height in pixels.
imageSizeobjectImage file size in bytes.
createdAtstringCreation timestamp in UTC.
updatedAtstringLast update timestamp in UTC.
_linksobject
contentstringWorkspace-scoped URL that returns the image binary.

Example

curl -X POST "https://app.neuroflash.com/api/image-service/v1/workspaces/{workspace_id}/images" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"imageUrl": "string"
}'

Response:

{
"id": "string",
"generationId": "string",
"workspaceId": "string",
"createdByUserId": "string",
"prompt": "string",
"model": "string",
"parameters": {},
"inputImageIds": {},
"imageWidth": {},
"imageHeight": {},
"imageSize": {},
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z",
"_links": {
"content": "string"
}
}

List images in a workspace (paginated)

GET/v1/workspaces/{workspaceId}/images

Returns images that belong to the given workspace, newest first. Use createdByUserId to filter to a specific creator. Standard page/size pagination is applied.

Path Parameters

ParameterTypeRequiredDescription
workspaceIdstringYes

Query Parameters

ParameterTypeDefaultDescription
pageinteger11-based page number
sizeinteger50Items per page (max 200)
generationIdstringFilter to images produced by a specific generation request (useful for fetching all N outputs of one POST/PUT call).
modelIdstringFilter to images produced by this model id.

Response

FieldTypeDescription
pageobject
sizeintegerNumber of elements requested per page.
totalElementsintegerTotal number of matching elements.
totalPagesintegerTotal number of pages.
currentPageinteger1-based index of the returned page.
dataarray<object>
idstringUnique image ID (also the GCS object key).
generationIdstringGroups every image produced by one generation request. Multiple rows can share the same generationId when a request asked for more than one image.
workspaceIdstringOwning workspace ID.
createdByUserIdstringGateway user ID of the image creator.
promptstringPrompt that produced the image (empty for upscales).
modelstringModel used to produce the image.
parametersobjectGeneration parameters (aspect ratio, format, etc.).
inputImageIdsobjectIDs of any input images supplied for image2image / upscale.
imageWidthobjectImage width in pixels.
imageHeightobjectImage height in pixels.
imageSizeobjectImage file size in bytes.
createdAtstringCreation timestamp in UTC.
updatedAtstringLast update timestamp in UTC.
_linksobject
contentstringWorkspace-scoped URL that returns the image binary.

Example

curl "https://app.neuroflash.com/api/image-service/v1/workspaces/{workspace_id}/images" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Response:

{
"page": {
"size": 0,
"totalElements": 0,
"totalPages": 0,
"currentPage": 0
},
"data": [
{
"id": "string",
"generationId": "string",
"workspaceId": "string",
"createdByUserId": "string",
"prompt": "string",
"model": "string",
"parameters": {},
"inputImageIds": {},
"imageWidth": {},
"imageHeight": {},
"imageSize": {},
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z",
"_links": {
"content": "string"
}
}
]
}

Get a single image's metadata

GET/v1/workspaces/{workspaceId}/images/{imageId}

Path Parameters

ParameterTypeRequiredDescription
workspaceIdstringYes
imageIdstringYes

Response

FieldTypeDescription
idstringUnique image ID (also the GCS object key).
generationIdstringGroups every image produced by one generation request. Multiple rows can share the same generationId when a request asked for more than one image.
workspaceIdstringOwning workspace ID.
createdByUserIdstringGateway user ID of the image creator.
promptstringPrompt that produced the image (empty for upscales).
modelstringModel used to produce the image.
parametersobjectGeneration parameters (aspect ratio, format, etc.).
inputImageIdsobjectIDs of any input images supplied for image2image / upscale.
imageWidthobjectImage width in pixels.
imageHeightobjectImage height in pixels.
imageSizeobjectImage file size in bytes.
createdAtstringCreation timestamp in UTC.
updatedAtstringLast update timestamp in UTC.
_linksobject
contentstringWorkspace-scoped URL that returns the image binary.

Example

curl "https://app.neuroflash.com/api/image-service/v1/workspaces/{workspace_id}/images/{image_id}" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Response:

{
"id": "string",
"generationId": "string",
"workspaceId": "string",
"createdByUserId": "string",
"prompt": "string",
"model": "string",
"parameters": {},
"inputImageIds": {},
"imageWidth": {},
"imageHeight": {},
"imageSize": {},
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z",
"_links": {
"content": "string"
}
}

Delete an image

DELETE/v1/workspaces/{workspaceId}/images/{imageId}

Only the owner of the image (createdByUserId) or a user with the NF_ADMIN, NF_CUSTOMER_SUPPORT, or ADMIN_SERVICE role can delete an image.

Path Parameters

ParameterTypeRequiredDescription
workspaceIdstringYes
imageIdstringYes

Example

curl -X DELETE "https://app.neuroflash.com/api/image-service/v1/workspaces/{workspace_id}/images/{image_id}" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"