Skip to content

Upload a reference image for the next run

POST
/api/reference-images
curl --request POST \
--url https://coggs.ai/api/reference-images \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: image/png' \
--data binary

Send the image as the raw body with its Content-Type (image/png, image/jpeg or image/webp, up to 3,750,000 bytes and 2,000 pixels on a side). The server measures the bytes and answers the ReferenceImage to pass as referenceImage when you create a run. Repeating identical bytes refreshes the same attachment. An unused upload expires after 24 hours.

string format: binary

The stored image description.

Media typeapplication/json
object
sha256
required
string
/^[0-9a-f]{64}$/
type
required
string
Allowed values: image/png image/jpeg image/webp
bytes
required
integer
>= 1 <= 3750000
width
required
integer
>= 1 <= 2000
height
required
integer
>= 1 <= 2000

Example

{
"type": "image/png"
}

Invalid request.

Sign-in required.

The image is over the byte limit.