PhotoGPT Developers

Upload an image

POST
/images/upload

Uploads a model input or auxiliary image for a model owned by the authenticated API user.

Authorization

BearerAuth
AuthorizationBearer <token>

Developer API key. Send as Authorization: Bearer <api_key>.

In: header

Request Body

Multipart image upload payload. data is a JSON string with modelID and type. Supported types: modelInput, auxiliaryType

TypeScript Definitions

Use the request body type in TypeScript.

Multipart image upload payload. data is a JSON string with modelID and type. Supported types: modelInput, auxiliaryType

data?string

JSON string containing image metadata. Example: {"modelID":"018f5f29-7c2b-7b4e-9a8c-4f8b4c2d1e0f","type":"modelInput"}.

file?file

Binary image file.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/images/upload" \  -H "Content-Type: application/json" \  -d '{}'
{  "result": {    "createdAt": "string",    "data": {      "property1": null,      "property2": null    },    "folderID": "string",    "id": "string",    "liked": true,    "modelID": "string",    "publicMediaID": "string",    "type": "string",    "updatedAt": "string",    "upscaledImageID": "string",    "upscaledImageURL": "string",    "url": "string"  },  "status": "OK"}
{  "err": "string",  "message": "string",  "result": null,  "status": "NOK"}
{  "err": "string",  "message": "string",  "result": null,  "status": "NOK"}
{  "err": "string",  "message": "string",  "result": null,  "status": "NOK"}
{  "err": "string",  "message": "string",  "result": null,  "status": "NOK"}