Answer one text
const url = 'https://api.prismlet.com/v1/prisms/support-routing/results?format=json';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"ref":"TCK-8812","fields":{"subject":"Charged twice this month","text":"Hi, I was billed twice for September. Please refund the second charge before Friday."},"idempotency_key":"tck-8812-1"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url 'https://api.prismlet.com/v1/prisms/support-routing/results?format=json' \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "ref": "TCK-8812", "fields": { "subject": "Charged twice this month", "text": "Hi, I was billed twice for September. Please refund the second charge before Friday." }, "idempotency_key": "tck-8812-1" }'Runs the prism on one text and waits for the answers. The response is the saved result, so there is nothing to poll. One call answers one text; for many texts, make one call each.
Send fields with exactly the field keys of the prism version. A prism whose only field is text also takes {"text": "..."}. The published version answers unless version names another; saving a new version in the app does not change it until someone publishes it. An archived prism answers 404.
With idempotency_key the call is safe to repeat. If a stored result already holds the key and succeeded, it comes back without calling the model, whatever the rest of the body says. If that result failed, the same key retries it and moves to the new result, with the stored fields, or with the fields in the body when the prism keeps no text. A key first used with another prism answers 409. Two first calls with the same key at the same moment may both be sent to the model, but only one result is saved and both calls get it.
When the model fails, the failed result is saved and returned on 502, in the format asked for. Each attempt to reach the model times out after 15 seconds by default. A 429 or 5xx from the model service gets one more attempt, and a timeout or a network error fails the call at once, so allow at least 30 seconds before giving up on a call.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”The prism’s slug or its id. The slug is set when the prism is created and does not follow renames. A value shaped like a UUID is read as the id. An unknown or archived prism answers 404.
Example
support-routingQuery Parameters
Section titled “Query Parameters”What the response body holds.
json: the result, with one answer per question.raw: the result, with the stored answers and every probability.csv,tsv: a header row and one row for the result.jsonl: one line holding the same row as a JSON object.
Defaults to json, also when sent empty. An unknown value answers 400. Errors are JSON in every format.
Request Bodyrequired
Section titled “Request Bodyrequired”Send exactly one of fields and text.
object
One value per field of the prism version, keyed by field key. Every key the version declares is required and no other key is accepted. Each value is at most 100,000 characters. A field the prism marks as an image takes a PNG, JPEG or WebP data URL (data:image/png;base64,...) or an image: ref from an earlier result instead. The body may then be up to 12 MiB, and the model of the account must read images. Together with the prism’s context, the call’s context and the longest question, the fields must fit an estimated 26,000 tokens, at four characters per token.
object
Shorthand for {"fields": {"text": "..."}}, accepted by a prism whose only field is text.
Background for this call only, such as the client’s billing guideline or policy. The model reads the prism’s context first, then a line Context for this call:, then this text. An empty or blank value is the same as leaving it out. At most 100,000 characters, and it counts toward the same token budget as the fields. It is saved with the result but not returned in any response or row.
Your own reference for the text, such as a ticket id. Returned with the result and in every row. It does not have to be unique. Leading and trailing whitespace is trimmed.
The prism version to answer with. Defaults to the published version.
Makes the call safe to repeat. Unique within the account, shared by API and app calls. Leading and trailing whitespace is trimmed.
Send exactly one of fields and text.
object
One value per field of the prism version, keyed by field key. Every key the version declares is required and no other key is accepted. Each value is at most 100,000 characters. A field the prism marks as an image takes a PNG, JPEG or WebP data URL (data:image/png;base64,...) or an image: ref from an earlier result instead. The body may then be up to 12 MiB, and the model of the account must read images. Together with the prism’s context, the call’s context and the longest question, the fields must fit an estimated 26,000 tokens, at four characters per token.
object
Shorthand for {"fields": {"text": "..."}}, accepted by a prism whose only field is text.
Background for this call only, such as the client’s billing guideline or policy. The model reads the prism’s context first, then a line Context for this call:, then this text. An empty or blank value is the same as leaving it out. At most 100,000 characters, and it counts toward the same token budget as the fields. It is saved with the result but not returned in any response or row.
Your own reference for the text, such as a ticket id. Returned with the result and in every row. It does not have to be unique. Leading and trailing whitespace is trimmed.
The prism version to answer with. Defaults to the published version.
Makes the call safe to repeat. Unique within the account, shared by API and app calls. Leading and trailing whitespace is trimmed.
Examples
Fields, with a reference and an idempotency key
{ "ref": "TCK-8812", "fields": { "subject": "Charged twice this month", "text": "Hi, I was billed twice for September. Please refund the second charge before Friday." }, "idempotency_key": "tck-8812-1"}The text shorthand, for a prism whose only field is text
{ "text": "Hi, I was billed twice for September. Please refund the second charge before Friday."}Responses
Section titled “ Responses ”The text was answered and saved, or the idempotency key matched a stored result that succeeded.
A result in the default json format. answers follows the questions of the published version, so publishing a version that removes a question changes what an old result returns. Yes / No labels keep the cutoffs the result was saved with.
object
The result id. Use it to read or retry the result.
The ref sent with the call, or null.
The prism’s slug.
The prism version that answered.
ok, or failed when the model gave no usable answer.
Why the result failed, in words. Null when status is ok.
How long the call to the model took, in milliseconds.
When the result was saved, ISO 8601 in UTC.
What Prismlet keeps of the text: full keeps the fields and context, fingerprint keeps only a keyed hash of them, none keeps nothing. Set per prism in the app. Unless it is full, the field columns of a row are empty and the result can’t be retried.
One entry per question of the published prism version, keyed by question key, in question order. Null when the result failed.
A result in raw format, with the stored answers and every probability. It never changes.
object
The result id. Use it to read or retry the result.
The ref sent with the call, or null.
The prism’s slug.
The prism version that answered.
ok, or failed when the model gave no usable answer.
Why the result failed, in words. Null when status is ok.
How long the call to the model took, in milliseconds.
When the result was saved, ISO 8601 in UTC.
What Prismlet keeps of the text: full keeps the fields and context, fingerprint keeps only a keyed hash of them, none keeps nothing. Set per prism in the app. Unless it is full, the field columns of a row are empty and the result can’t be retried.
The stored answer to every question, keyed by question key. Null when the result failed.
Examples
Answered, format=json
{ "id": "0192f5c1-7c1a-7b3e-9f55-3c1d2e4a5b6c", "ref": "TCK-8812", "prism": "support-routing", "version": 3, "status": "ok", "error": null, "took_ms": 640, "created_at": "2026-09-23T09:14:02.187Z", "input_storage": "full", "answers": { "team": "billing", "urgent": "yes", "tone": "annoyed" }}Answered, format=raw
{ "id": "0192f5c1-7c1a-7b3e-9f55-3c1d2e4a5b6c", "ref": "TCK-8812", "prism": "support-routing", "version": 3, "status": "ok", "error": null, "took_ms": 640, "created_at": "2026-09-23T09:14:02.187Z", "input_storage": "full", "answers": { "team": { "type": "choice", "value": "billing", "probabilities": { "billing": 0.91, "technical": 0.05, "other": 0.03, "insufficient_information": 0.01 }, "confidence": 0.88 }, "urgent": { "type": "yes_no", "probability": 0.83 }, "tone": { "type": "scale", "level": "annoyed", "probabilities": { "calm": 0.12, "annoyed": 0.71, "angry": 0.17 } } }}A header row, then one row. The columns are result_id, ref, version, status, error, created_at, input_storage, one per field of the published prism version, then one per question. The field cells are empty when the prism keeps no text. Cells hold option labels and Yes, No or Unsure. Lines end in CRLF. A cell holding a comma, a quote or a line break is quoted, with quotes doubled. An empty value is an empty cell.
Examples
Answered, format=csv
result_id,ref,version,status,error,created_at,input_storage,subject,text,team,urgent,tone0192f5c1-7c1a-7b3e-9f55-3c1d2e4a5b6c,TCK-8812,3,ok,,2026-09-23T09:14:02.187Z,full,Charged twice this month,"Hi, I was billed twice for September. Please refund the second charge before Friday.",Billing,Yes,AnnoyedThe csv columns, separated by tabs, with lines ending in LF. Tabs and line breaks inside a cell become spaces.
Examples
Answered, format=tsv
result_id ref version status error created_at input_storage subject text team urgent tone0192f5c1-7c1a-7b3e-9f55-3c1d2e4a5b6c TCK-8812 3 ok 2026-09-23T09:14:02.187Z full Charged twice this month Hi, I was billed twice for September. Please refund the second charge before Friday. Billing Yes AnnoyedOne line ending in LF, holding the csv row as a JSON object, with option keys and yes, no or unsure instead of labels, and all columns as objects.
Examples
Answered, format=jsonl
{"result_id":"0192f5c1-7c1a-7b3e-9f55-3c1d2e4a5b6c","ref":"TCK-8812","version":3,"status":"ok","error":null,"created_at":"2026-09-23T09:14:02.187Z","input_storage":"full","subject":"Charged twice this month","text":"Hi, I was billed twice for September. Please refund the second charge before Friday.","team":"billing","urgent":"yes","tone":"annoyed"}The request is invalid. Nothing was sent to the model and nothing was saved.
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
Missing field
{ "error": { "code": "validation_failed", "message": "Missing fields: subject" }}Unknown field
{ "error": { "code": "validation_failed", "message": "Unknown fields: body" }}Both fields and text
{ "error": { "code": "validation_failed", "message": "Invalid request: fields: send either fields or text" }}Field too long
{ "error": { "code": "validation_failed", "message": "Invalid request: fields.text: String must contain at most 100000 character(s)" }}Over the token budget
{ "error": { "code": "validation_failed", "message": "Request too large: about 27100 tokens of fields, context and the longest question, the limit is 26000" }}Model cannot read images
{ "error": { "code": "validation_failed", "message": "openrouter/typesafe/jev-1.13 cannot read images. Choose a model that reads images in Settings." }}Unknown image ref
{ "error": { "code": "validation_failed", "message": "photo: image not found" }}Unknown format
{ "error": { "code": "validation_failed", "message": "Invalid request: format: Expected 'json' | 'raw' | 'csv' | 'tsv' | 'jsonl'" }}Body is not valid JSON
{ "error": { "code": "bad_request", "message": "Malformed request" }}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" }}The prism does not exist in this account or is archived, or the version does not exist.
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 or archived prism
{ "error": { "code": "not_found", "message": "Prism not found" }}Unknown version
{ "error": { "code": "not_found", "message": "Prism version not found" }}The idempotency key was first used with another prism. When two first calls race with one key and different prisms, the one that loses gets this after its text was sent to the model.
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
Key used for another prism
{ "error": { "code": "conflict", "message": "This idempotency key was already used for another prism." }}The body is over 12 MiB.
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
Body too large
{ "error": { "code": "bad_request", "message": "Malformed request" }}The body has a content type the server does not parse. Send application/json.
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
Unsupported content type
{ "error": { "code": "bad_request", "message": "Malformed request" }}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" }}The model failed. The failed result is saved and returned with status set to failed, answers null and the error. Retry it, or repeat the call with the same idempotency key.
A result in the default json format. answers follows the questions of the published version, so publishing a version that removes a question changes what an old result returns. Yes / No labels keep the cutoffs the result was saved with.
object
The result id. Use it to read or retry the result.
The ref sent with the call, or null.
The prism’s slug.
The prism version that answered.
ok, or failed when the model gave no usable answer.
Why the result failed, in words. Null when status is ok.
How long the call to the model took, in milliseconds.
When the result was saved, ISO 8601 in UTC.
What Prismlet keeps of the text: full keeps the fields and context, fingerprint keeps only a keyed hash of them, none keeps nothing. Set per prism in the app. Unless it is full, the field columns of a row are empty and the result can’t be retried.
One entry per question of the published prism version, keyed by question key, in question order. Null when the result failed.
A result in raw format, with the stored answers and every probability. It never changes.
object
The result id. Use it to read or retry the result.
The ref sent with the call, or null.
The prism’s slug.
The prism version that answered.
ok, or failed when the model gave no usable answer.
Why the result failed, in words. Null when status is ok.
How long the call to the model took, in milliseconds.
When the result was saved, ISO 8601 in UTC.
What Prismlet keeps of the text: full keeps the fields and context, fingerprint keeps only a keyed hash of them, none keeps nothing. Set per prism in the app. Unless it is full, the field columns of a row are empty and the result can’t be retried.
The stored answer to every question, keyed by question key. Null when the result failed.
Examples
Model timed out, format=json
{ "id": "0192f5c3-2b4e-7d10-8a61-5e0f9c7d2a13", "ref": "TCK-8812", "prism": "support-routing", "version": 3, "status": "failed", "error": "The model took too long to answer, so we stopped after 15 seconds.", "took_ms": 15012, "created_at": "2026-09-23T09:15:40.502Z", "input_storage": "full", "answers": null}Model timed out, format=raw
{ "id": "0192f5c3-2b4e-7d10-8a61-5e0f9c7d2a13", "ref": "TCK-8812", "prism": "support-routing", "version": 3, "status": "failed", "error": "The model took too long to answer, so we stopped after 15 seconds.", "took_ms": 15012, "created_at": "2026-09-23T09:15:40.502Z", "input_storage": "full", "answers": null}A header row, then one row. The columns are result_id, ref, version, status, error, created_at, input_storage, one per field of the published prism version, then one per question. The field cells are empty when the prism keeps no text. Cells hold option labels and Yes, No or Unsure. Lines end in CRLF. A cell holding a comma, a quote or a line break is quoted, with quotes doubled. An empty value is an empty cell.
Examples
Model timed out, format=csv
result_id,ref,version,status,error,created_at,input_storage,subject,text,team,urgent,tone0192f5c3-2b4e-7d10-8a61-5e0f9c7d2a13,TCK-8812,3,failed,"The model took too long to answer, so we stopped after 15 seconds.",2026-09-23T09:15:40.502Z,full,Charged twice this month,"Hi, I was billed twice for September. Please refund the second charge before Friday.",,,The csv columns, separated by tabs, with lines ending in LF. Tabs and line breaks inside a cell become spaces.
Examples
Model timed out, format=tsv
result_id ref version status error created_at input_storage subject text team urgent tone0192f5c3-2b4e-7d10-8a61-5e0f9c7d2a13 TCK-8812 3 failed The model took too long to answer, so we stopped after 15 seconds. 2026-09-23T09:15:40.502Z full Charged twice this month Hi, I was billed twice for September. Please refund the second charge before Friday.One line ending in LF, holding the csv row as a JSON object, with option keys and yes, no or unsure instead of labels, and all columns as objects.
Examples
Model timed out, format=jsonl
{"result_id":"0192f5c3-2b4e-7d10-8a61-5e0f9c7d2a13","ref":"TCK-8812","version":3,"status":"failed","error":"The model took too long to answer, so we stopped after 15 seconds.","created_at":"2026-09-23T09:15:40.502Z","input_storage":"full","subject":"Charged twice this month","text":"Hi, I was billed twice for September. Please refund the second charge before Friday.","team":null,"urgent":null,"tone":null}