Bilder
Basis-URL: https://app.neuroflash.com/api/image-service
Bild in den Arbeitsbereich hochladenâ
POST
/v1/workspaces/{workspaceId}/imagesErstellt ein Bild im Arbeitsbereich aus der bereitgestellten URL oder dem Daten-URI. Die zurĂŒckgegebene id kann als Eingabe fĂŒr image-edit-tasks oder image-upscale-tasks ĂŒbergeben werden.
Pfadparameterâ
| Parameter | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
workspaceId | string | Ja |
Anfrage-Bodyâ
FeldTypErforderlichBeschreibung
imageUrlstringJaHTTP(S)-URL des abzurufenden Bildes oder ein Inline-data:-URIfileNamestringJaDateiname zum Herunterladen einschlieĂlich Erweiterung. Serverseitig bereinigt (Pfadkomponenten entfernt, alphanumerische Zeichen zu Bindestrichen zusammengefasst). Begrenzt auf 50 Zeichen.Antwortâ
FeldTypBeschreibung
idstringeindeutige UUIDgenerationIdstringGroups 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 IDcreatedByUserIdstringuserId of the account that created this imagepromptstringprompt that produced the image (empty for upscales or uploads)modelstringModell zur BildproduktionparametersobjectGenerierungsparameter (SeitenverhĂ€ltnis, Format usw.)inputImageIdsobjectIDs von Eingabebildern fĂŒr Bearbeitungs- oder HochskalierungsaufgabenfileNamestringBenutzerfreundlicher Dateiname (mit Erweiterung) geeignet fĂŒr Downloads. Uploads tragen den vom Benutzer angegebenen Namen; Generierungen erhalten einen LLM-abgeleiteten Slug; Bearbeitungen/Hochskalierungen ergĂ€nzen den Namen der Eingabe. Maximal 50 Zeichen.imageWidthobjectBildbreite in PixelnimageHeightobjectBildhöhe in PixelnimageSizeobjectBilddateigröĂe in BytescreatedAtstringErstellungszeitstempel als ISO 8601updatedAtstringZeitstempel der letzten Aktualisierung als ISO 8601shareKeystringHMAC-SchlĂŒssel zur Autorisierung des öffentlichen Freigabelinks dieses Bildes (als ?key= ĂŒbergeben)_linksobject
contentstringTemporĂ€re URL zur BilddateidownloadstringTemporĂ€re URL, die einen Dateidownload erzwingt (content-disposition: attachment)Beispielâ
- 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",
"fileName": "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",
"fileName": "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",
"fileName": "string"
}),
}
).then((r) => r.json());
body, _ := json.Marshal(map[string]any{
"imageUrl": "string",
"fileName": "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()
Antwort:
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"generationId": "string",
"workspaceId": "string",
"createdByUserId": "string",
"prompt": "string",
"model": "string",
"parameters": {},
"inputImageIds": {},
"fileName": "string",
"imageWidth": {},
"imageHeight": {},
"imageSize": {},
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z",
"shareKey": "string",
"_links": {
"content": "string",
"download": "string"
}
}
Bilder in einem Arbeitsbereich auflisten (paginiert)â
GET
/v1/workspaces/{workspaceId}/imagesGibt Bilder zurĂŒck, die vom authentifizierten Benutzer erstellt wurden, neueste zuerst.
Pfadparameterâ
| Parameter | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
workspaceId | string | Ja |
Abfrageparameterâ
| Parameter | Typ | Standard | Beschreibung |
|---|---|---|---|
page | integer | 1 | 1-basierte Seitennummer |
size | integer | 50 | Elemente pro Seite (max. 200) |
generationId | string | â | Filter fĂŒr Bilder, die durch eine bestimmte Generierungsanfrage erstellt wurden (nĂŒtzlich zum Abrufen aller N-Ausgaben eines POST/PUT-Aufrufs) |
modelId | string | â | Filter fĂŒr Bilder, die durch diese Modell-ID erstellt wurden |
Antwortâ
FeldTypBeschreibung
pageobject
sizeintegerAnzahl der pro Seite angeforderten ElementetotalElementsintegerGesamtzahl der ĂŒbereinstimmenden ElementetotalPagesintegerGesamtzahl der SeitencurrentPageinteger1-basierter Index der zurĂŒckgegebenen Seitedataarray<object>
idstringeindeutige UUIDgenerationIdstringGroups 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 IDcreatedByUserIdstringuserId of the account that created this imagepromptstringprompt that produced the image (empty for upscales or uploads)modelstringModell zur BildproduktionparametersobjectGenerierungsparameter (SeitenverhĂ€ltnis, Format usw.)inputImageIdsobjectIDs von Eingabebildern fĂŒr Bearbeitungs- oder HochskalierungsaufgabenfileNamestringBenutzerfreundlicher Dateiname (mit Erweiterung) geeignet fĂŒr Downloads. Uploads tragen den vom Benutzer angegebenen Namen; Generierungen erhalten einen LLM-abgeleiteten Slug; Bearbeitungen/Hochskalierungen ergĂ€nzen den Namen der Eingabe. Maximal 50 Zeichen.imageWidthobjectBildbreite in PixelnimageHeightobjectBildhöhe in PixelnimageSizeobjectBilddateigröĂe in BytescreatedAtstringErstellungszeitstempel als ISO 8601updatedAtstringZeitstempel der letzten Aktualisierung als ISO 8601shareKeystringHMAC-SchlĂŒssel zur Autorisierung des öffentlichen Freigabelinks dieses Bildes (als ?key= ĂŒbergeben)_linksobject
contentstringTemporĂ€re URL zur BilddateidownloadstringTemporĂ€re URL, die einen Dateidownload erzwingt (content-disposition: attachment)Beispielâ
- 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()
Antwort:
{
"page": {
"size": 0,
"totalElements": 0,
"totalPages": 0,
"currentPage": 0
},
"data": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"generationId": "string",
"workspaceId": "string",
"createdByUserId": "string",
"prompt": "string",
"model": "string",
"parameters": {},
"inputImageIds": {},
"fileName": "string",
"imageWidth": {},
"imageHeight": {},
"imageSize": {},
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z",
"shareKey": "string",
"_links": {
"content": "string",
"download": "string"
}
}
]
}
Metadaten eines einzelnen Bildes abrufenâ
GET
/v1/workspaces/{workspaceId}/images/{imageId}Pfadparameterâ
| Parameter | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
workspaceId | string | Ja | |
imageId | string | Ja |
Antwortâ
FeldTypBeschreibung
idstringeindeutige UUIDgenerationIdstringGroups 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 IDcreatedByUserIdstringuserId of the account that created this imagepromptstringprompt that produced the image (empty for upscales or uploads)modelstringModell zur BildproduktionparametersobjectGenerierungsparameter (SeitenverhĂ€ltnis, Format usw.)inputImageIdsobjectIDs von Eingabebildern fĂŒr Bearbeitungs- oder HochskalierungsaufgabenfileNamestringBenutzerfreundlicher Dateiname (mit Erweiterung) geeignet fĂŒr Downloads. Uploads tragen den vom Benutzer angegebenen Namen; Generierungen erhalten einen LLM-abgeleiteten Slug; Bearbeitungen/Hochskalierungen ergĂ€nzen den Namen der Eingabe. Maximal 50 Zeichen.imageWidthobjectBildbreite in PixelnimageHeightobjectBildhöhe in PixelnimageSizeobjectBilddateigröĂe in BytescreatedAtstringErstellungszeitstempel als ISO 8601updatedAtstringZeitstempel der letzten Aktualisierung als ISO 8601shareKeystringHMAC-SchlĂŒssel zur Autorisierung des öffentlichen Freigabelinks dieses Bildes (als ?key= ĂŒbergeben)_linksobject
contentstringTemporĂ€re URL zur BilddateidownloadstringTemporĂ€re URL, die einen Dateidownload erzwingt (content-disposition: attachment)Beispielâ
- 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()
Antwort:
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"generationId": "string",
"workspaceId": "string",
"createdByUserId": "string",
"prompt": "string",
"model": "string",
"parameters": {},
"inputImageIds": {},
"fileName": "string",
"imageWidth": {},
"imageHeight": {},
"imageSize": {},
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z",
"shareKey": "string",
"_links": {
"content": "string",
"download": "string"
}
}
Bild löschenâ
DELETE
/v1/workspaces/{workspaceId}/images/{imageId}Nur der EigentĂŒmer des Bildes (createdByUserId) oder ein Benutzer mit der Rolle NF_ADMIN, NF_CUSTOMER_SUPPORT oder ADMIN_SERVICE kann ein Bild löschen.
Pfadparameterâ
| Parameter | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
workspaceId | string | Ja | |
imageId | string | Ja |
Beispielâ
- 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()