Images
Base URL: https://app.neuroflash.com/api/image-service
Upload an image into the workspace
POST
/v1/workspaces/{workspaceId}/imagesCreates 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
| Parameter | Type | Required | Description |
|---|---|---|---|
workspaceId | string | Yes |
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
- Python
- Node.js
- Go
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"
}'
import requests
response = requests.post(
f"https://app.neuroflash.com/api/image-service/v1/workspaces/{workspace_id}/images",
headers={"Authorization": f"Bearer {token}", "Content-Type": "application/json"},
json={
"imageUrl": "string"
},
).json()
const response = await fetch(
`https://app.neuroflash.com/api/image-service/v1/workspaces/${workspaceId}/images`,
{
method: "POST",
headers: {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"imageUrl": "string"
}),
}
).then((r) => r.json());
body, _ := json.Marshal(map[string]any{
"imageUrl": "string",
})
req, _ := http.NewRequest("POST", "https://app.neuroflash.com/api/image-service/v1/workspaces/"+workspaceID+"/images", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+token)
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
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}/imagesReturns 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
| Parameter | Type | Required | Description |
|---|---|---|---|
workspaceId | string | Yes |
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
page | integer | 1 | 1-based page number |
size | integer | 50 | Items per page (max 200) |
generationId | string | — | Filter to images produced by a specific generation request (useful for fetching all N outputs of one POST/PUT call). |
modelId | string | — | Filter 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
- Python
- Node.js
- Go
curl "https://app.neuroflash.com/api/image-service/v1/workspaces/{workspace_id}/images" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
import requests
response = requests.get(
f"https://app.neuroflash.com/api/image-service/v1/workspaces/{workspace_id}/images",
headers={"Authorization": f"Bearer {token}"},
).json()
const response = await fetch(
`https://app.neuroflash.com/api/image-service/v1/workspaces/${workspaceId}/images`,
{ headers: { Authorization: `Bearer ${token}` } }
).then((r) => r.json());
req, _ := http.NewRequest("GET", "https://app.neuroflash.com/api/image-service/v1/workspaces/"+workspaceID+"/images", nil)
req.Header.Set("Authorization", "Bearer "+token)
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
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
| Parameter | Type | Required | Description |
|---|---|---|---|
workspaceId | string | Yes | |
imageId | string | Yes |
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
- Python
- Node.js
- Go
curl "https://app.neuroflash.com/api/image-service/v1/workspaces/{workspace_id}/images/{image_id}" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
import requests
response = requests.get(
f"https://app.neuroflash.com/api/image-service/v1/workspaces/{workspace_id}/images/{image_id}",
headers={"Authorization": f"Bearer {token}"},
).json()
const response = await fetch(
`https://app.neuroflash.com/api/image-service/v1/workspaces/${workspaceId}/images/${imageId}`,
{ headers: { Authorization: `Bearer ${token}` } }
).then((r) => r.json());
req, _ := http.NewRequest("GET", "https://app.neuroflash.com/api/image-service/v1/workspaces/"+workspaceID+"/images/"+imageID+"", nil)
req.Header.Set("Authorization", "Bearer "+token)
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
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
| Parameter | Type | Required | Description |
|---|---|---|---|
workspaceId | string | Yes | |
imageId | string | Yes |
Example
- cURL
- Python
- Node.js
- Go
curl -X DELETE "https://app.neuroflash.com/api/image-service/v1/workspaces/{workspace_id}/images/{image_id}" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
import requests
requests.delete(
f"https://app.neuroflash.com/api/image-service/v1/workspaces/{workspace_id}/images/{image_id}",
headers={"Authorization": f"Bearer {token}"},
)
await fetch(
`https://app.neuroflash.com/api/image-service/v1/workspaces/${workspaceId}/images/${imageId}`,
{
method: "DELETE",
headers: { Authorization: `Bearer ${token}` },
}
);
req, _ := http.NewRequest("DELETE", "https://app.neuroflash.com/api/image-service/v1/workspaces/"+workspaceID+"/images/"+imageID+"", nil)
req.Header.Set("Authorization", "Bearer "+token)
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()