Read an image
const url = 'https://api.prismlet.com/v1/images/example';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.prismlet.com/v1/images/example \ --header 'Authorization: Bearer <token>'Returns the bytes of an image this account stored, by the 64 hex characters of its image: ref. The content type is the stored image type. A result keeps an image: ref only when its prism stores input in full, and an image no result refers to is deleted by a daily sweep.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”Responses
Section titled “ Responses ”The image.
No API key, or one that is unknown or revoked.
Every error has this body, in JSON, whatever format asked for.
object
object
validation_failed, bad_request, unauthorized, not_found, conflict, input_not_stored or internal_error.
What went wrong, in words. A validation message names the failing paths and never repeats a value sent. Unknown fields lists the keys sent.
Examples
No Authorization header
{ "error": { "code": "unauthorized", "message": "Authentication required" }}Unknown or revoked key
{ "error": { "code": "unauthorized", "message": "Invalid API key" }}No image with this hash in this account.
Every error has this body, in JSON, whatever format asked for.
object
object
validation_failed, bad_request, unauthorized, not_found, conflict, input_not_stored or internal_error.
What went wrong, in words. A validation message names the failing paths and never repeats a value sent. Unknown fields lists the keys sent.
Examples
Unknown image
{ "error": { "code": "not_found", "message": "Image not found" }}The key made more calls this minute than its limit, 600 by default. Nothing was sent to the model and nothing was saved. Wait the seconds in Retry-After, then repeat the call.
Every error has this body, in JSON, whatever format asked for.
object
object
validation_failed, bad_request, unauthorized, not_found, conflict, input_not_stored or internal_error.
What went wrong, in words. A validation message names the failing paths and never repeats a value sent. Unknown fields lists the keys sent.
Examples
Too many calls
{ "error": { "code": "rate_limited", "message": "This API key made too many calls this minute. Wait the seconds in Retry-After, then repeat the call." }}Headers
Section titled “Headers”Seconds until the key’s minute ends and it can call again.
A bug on our side. The message is always the same.
Every error has this body, in JSON, whatever format asked for.
object
object
validation_failed, bad_request, unauthorized, not_found, conflict, input_not_stored or internal_error.
What went wrong, in words. A validation message names the failing paths and never repeats a value sent. Unknown fields lists the keys sent.
Examples
Unexpected error
{ "error": { "code": "internal_error", "message": "Internal server error" }}