Some facts in a picture are hard for a general model, such as how old a person looks or whether an image generator made the photo. A booster is a model trained for exactly one such reading. It reads the request's images first, and its reading is added to what DecisionNode reads. DecisionNode still answers every question itself, in the shapes you asked for.
- Human Age (
age). Estimates a person's age from a face in the picture, using the agemin.com age estimation model, ranked #1 by NIST for Child Online Safety (ages 13 to 16) on true positive rate. View the NIST report card · NIST results. - AI-generated (
ai_generated). Whether a picture was made by an image generator, and which kind, using Trinity, the state-of-the-art AI image detection model from detector24.ai. - Face detection (
face_detection). Finds the faces in a picture: how many it shows and where each one is, with a box and a confidence per face, from Bynn's face detection model. - Face recognition (
face_recognition). Matches the faces in a picture against a collection: one of your own, enrolled through the API or the console, or the public celebrities collection. Each match carries a score and the item's reference, with your label or the public figure's name, and never a picture. - OCR (
ocr). The text a picture shows, read by Bynn OCR: all of it by default, or what a prompt asks for, such as a formula in LaTeX, a table in HTML or Markdown, or the fields of a JSON schema. Full support for English and Chinese; other languages need a prompt that names them. - Depth Vision (
bynn_depth). Distance in meters to what's in the picture: the nearest obstacle straight ahead, seven directions from left to right, and a grid of up to 16 by 16 cells. - Segment Vision (
bynn_segment). Finds what you name in words in the picture: each match's outline, box and centre, and with depth on, its distance and size in meters. - Knowledge (
knowledge). Applies your own documents: the passages of one of your knowledge bases that fit the request are read with it as facts and rules, and cited in the answer's evidence.
| Booster | Reads | Adds to the decision | Per picture | Time budget |
|---|---|---|---|---|
age | A picture of a person | How old the person is, with a range and a confidence. The largest face in the picture is read. | $0.024 | 2 s, up to 5 s |
ai_generated | Any picture | How likely the picture was made by an image generator, which generator most likely when it reads as generated, and whether the file carries trusted Content Credentials (C2PA) and who signed them. | $0.006 | 5 s, up to 6 s |
face_detection | Any picture | How many faces the picture shows and where, a box and a confidence for each. A picture with no face reads 0 faces. | $0.001 | 2 s, up to 5 s |
face_recognition | A picture of a person | Which faces in the picture match the collection the request names: for each, a box, a score and the matched item's reference, with your label or the public figure's name. A match is evidence, never an answer. | $0.001 for your own collection and $0.001 for celebrities | 2 s, up to 5 s |
ocr | Any picture | The picture's text, whole, in the format the prompt asks for. | $0.0015 | 12 s, up to 12 s |
bynn_depth | Any picture | How far away things are, in meters: straight ahead, in seven directions and cell by cell. | free | 800 ms, up to 5 s |
bynn_segment | Any picture | Where the things you name are: each one's outline, box and centre, and with depth on, how far away and how large it is. | $0.001 | 1.5 s, up to 5 s |
knowledge | One of your knowledge bases, no picture | The passages of your policies, manuals and instructions that apply to this request, pinned ones always, each cited by its document and position. | $0.001 a request | 800 ms, up to 5 s |
Add a booster to a request#
List the boosters by name in a top-level boosters array, beside images and questions: "boosters": ["age", "ai_generated"]. Each one reads every image of the request.
curl https://api.decisionnode.com/v1/decide \
-H "Authorization: Bearer $DECISIONNODE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "decisionnode",
"state": {
"account": {
"id": "acc_8812",
"product": "wine delivery",
"country": "SE"
}
},
"images": [
{
"id": "selfie",
"url": "https://files.example.com/signups/8812/selfie.jpg"
}
],
"boosters": ["age", "ai_generated"],
"questions": {
"adult": {
"type": "truth",
"instructions": "Is the person in `selfie` 18 or older?"
},
"real_photo": {
"type": "truth",
"instructions": "Is `selfie` a real photograph, not an AI-generated picture?"
}
}
}'- Up to 4 boosters a request, each named once.
nulland[]mean no boosters. - Boosters belong to the request, not to a question. Every question sees every reading, so say in each question which image it is about, by its
id. - Every image form works:
data,urlandupload_id. A booster reads exactly the bytes the decision reads. - A request without
boostersis answered exactly as before: nothing is added to it and nothing extra is billed.
Options#
Write a booster as an object instead of its name when it should read only some images, or when the request must not run without it. Below, age reads only the selfie and ai_generated reads both pictures and must answer: 3 booster calls, $0.036.
{
"images": [
{
"id": "selfie",
"url": "https://files.example.com/signups/8812/selfie.jpg"
},
{
"id": "document",
"url": "https://files.example.com/signups/8812/document.jpg"
}
],
"boosters": [
{
"name": "age",
"images": ["selfie"]
},
{ "name": "ai_generated", "require": true }
]
}A booster object
namestringrequired- The booster's name:
age,ai_generated,face_detection,face_recognition,ocr,bynn_depth,bynn_segmentorknowledge. A bare string such as"age"is the same as{"name": "age"}. imagesarray of image idsdefaultevery image- The
ids of the request's images this booster reads. Leave it out to read them all. Naming fewer images costs fewer booster calls. timeout_msintegerdefaultthe booster's budget- This booster's time budget for this request, in milliseconds, from 100 to its ceiling in the table above. Longer lets a slow picture finish; shorter keeps a fast request fast. Outside that range, or not an integer, the request is a
422and nothing runs. See Time. requirebooleandefaultfalsetrue: if this booster fails or runs out of time, the request fails with529booster_unavailable, which you retry.false: the decision runs without that reading, andevidencesays why.optionsobject- Settings of a booster that takes any, listed under Settings. Another key, or a key on a booster that takes none, is a
400.
Settings#
Some boosters take settings, in the booster object's options:
ocrprompt: what to read and how to write it, at most 2,000 characters; left out,"Text Recognition:". See Steering OCR with its prompt.face_recognitioncollection: required, the collection to search:celebrities, or theidof one of your own collections.face_recognitionthreshold: a number from 0 to 1; a face scored below it is no match. Left out, 0.5.bynn_depthgrid_size: the grid's cells per side, a whole number from 2 to 16; left out, 8. See Distances with Depth Vision.bynn_segmentprompt: required, what to find in words: a phrase, or a list of 1 to 4 phrases of at most 120 characters each; andmax_instances,min_score,polygon_pointsanddepth. See Finding things with Segment Vision.
{
"boosters": [
{
"name": "ocr",
"options": { "prompt": "Table Recognition:" }
}
]
}What comes back#
The answers keep their shapes. The body gains evidence, one entry per booster you named, in your order, and usage gains two counts. The response also carries the x-decisionnode-boosters header.
{
"model": "decisionnode-main-0.9.1-rc1",
"answers": {
"adult": { "type": "truth", "truth": 0.97 },
"real_photo": { "type": "truth", "truth": 0.96 }
},
"evidence": {
"age": {
"version": "age-v3",
"status": "ok",
"latency_ms": 188,
"billed_calls": 1,
"results": [
{
"image": "selfie",
"age_years": 34,
"low": 29,
"high": 39,
"confidence": 0.88,
"faces": 1
}
]
},
"ai_generated": {
"version": "ai_generated-v2",
"status": "ok",
"latency_ms": 342,
"billed_calls": 1,
"results": [
{
"image": "selfie",
"generated": 0.03,
"confidence": 0.94,
"method": "inference",
"top_generator": null,
"c2pa_signer": null
}
]
}
},
"usage": {
"input_tokens": 1121,
"output_tokens": 0,
"booster_tokens": 46,
"boosters": 2,
"cost": {
"usd": 0.03009633,
"model_usd": 0.00009633,
"boosters_usd": 0.03,
"free_tier": false
}
}
}evidence.<booster>
versionstring- The version of the booster that read, such as
age-v3. Log it with the decision. statusstringok,timeout,error,skipped. See When a booster cannot read.latency_msinteger- How long the booster took.
billed_callsinteger- The calls of this booster billed on this request: one per image it read with status
ok, every time a request uses it; 0 only for a booster that timed out, failed or was skipped, a picture it could not decode, and a refused request. Times the booster's price, it is what the booster cost. resultsarray- One entry per picture, named by
image. Onok, each carries the booster's fields, or"readable": falsefor a picture it could not decode. Ontimeoutorerror, one bare{"image": id}per picture it was meant to read. Onskipped, empty.
body = response.json()
for name, entry in body.get("evidence", {}).items():
if entry["status"] != "ok":
log.warning("booster %s: %s", name, entry["status"]) # decided without it
for reading in entry["results"]:
save_reading(decision_id, name, entry["version"], reading)| Booster | Fields |
|---|---|
age | age_years, low, high, confidence, faces |
ai_generated | generated, confidence, method, top_generator, c2pa_signer, c2pa |
face_detection | faces, detections |
face_recognition | faces, collection_name, matches |
ocr | text, truncated |
bynn_depth | ahead, directions, ground, grid_rows, grid_cols, grid, depth_min, depth_max, depth_median, width, height |
bynn_segment | prompts, instances, depth_source, assumed_hfov_deg, width, height |
knowledge | collection, collection_name, corpus, query, budget, scope, warnings, passages, omitted, pending_items, search, truncated |
age reads the largest face in a picture: age_years with a likely range from low to high, a confidence, and faces, how many faces it found. A picture with no face comes back with faces 0 and no age. ai_generated gives generated, the probability that an image generator made the picture, and method: inference when it read the pixels, c2pa when the file's trusted Content Credentials declare it generated or edited by AI, which overrides the pixels and names the signer in c2pa_signer. top_generator names the likeliest generator only when a reading from the pixels says likely generated; a photograph like the selfie above reads null. Credentials that validate but are not trusted add "c2pa": "untrusted" and change nothing else. Every field and value is on the API reference.
face_detection gives faces, how many faces it found, and detections, one box and confidence per face, most confident first, at most 64; faces still counts them all. The list is always there, [] when it is empty.
face_recognition searches up to 64 faces a picture, the most certain first, each one the detector is at least 0.7 sure of and at least 1,000 square pixels in size. It gives faces, the faces it searched, and matches, one box, score, collection, collection_name and reference per face that matches an item of the collection, best first, at most 64, with label for your own item that has one and name for a public figure. A match's collection_name is your collection's name (its col_ id when it has none) or a public collection's id, and a search of your own collection carries it on the picture's result too. The model reads it, so a question can name the collection: "Is this person in our staff collection?" works on a collection named staff. It is present only on a reading from a worker on the dn-evidence-4 format, so read it as optional. matches is always there, [] when nothing matched. How collections are made and searched is on Collections.
- More than 1,024 faces in one picture fail a
face_recognitionsearch: the booster'sstatusiserrorand nothing is billed. - A search that cannot finish in its time, such as one of a very large collection whose search index is not ready yet, is the booster's
timeoutorerror, unbilled. Withrequire: trueeither is a529. - A
face_recognitionreading is never reused: it is not kept in the cache of readings, and a request that names it is never answered from the cache of repeated requests.
ocr gives text, the picture's text in the format the prompt asks for, and truncated. The whole reading goes to the model as evidence, so a dense page adds many input tokens. When the readings would not fit the request's context, the model reads them cut at their end and truncated is true; text in the response stays whole. ocr reads pictures (JPEG, PNG or WebP), not PDF files: send a document's pages as images. The model answers no open question such as "what is the total?": when you need the words themselves, read text from evidence, and ask the model the decision.
{
"image": "lobby",
"faces": 2,
"detections": [
{
"box": { "x1": 412, "y1": 188, "x2": 538, "y2": 352 },
"confidence": 0.98
},
{
"box": { "x1": 901, "y1": 240, "x2": 987, "y2": 351 },
"confidence": 0.91
}
]
}Boxes#
A booster's box has the corners x1, y1 (top left) and x2, y2 (bottom right), as a box answer writes them. They are whole pixels of the picture as you sent it, after its EXIF orientation, clamped to its edges. When every point and box question of the request asks for units: "normalized", they are fractions of the width and the height with 4 decimals. A request with no point or box question gets pixels, and so does one where any of them asks for pixels, so a booster's box and the model's own always share units. See Points and boxes.
| Field | What it counts |
|---|---|
usage.boosters | The booster calls billed for this request: one per booster and image read |
usage.booster_tokens | The part of input_tokens the readings take, counted once per request |
Steering OCR with its prompt#
ocr, Bynn OCR, has one control: its prompt. There is no separate format option. The prompt says what to read and how to write it, and the reading's text comes back in that form. A prompt is at most 2,000 characters, and a request without one reads with "Text Recognition:": all the visible text, plain.
Document parsing#
| Prompt | Output | For |
|---|---|---|
"Text Recognition:" (the default) | Plain text | General OCR: all the visible text, with no formatting |
"Formula Recognition:" | LaTeX | Formulas and equations |
"Table Recognition:" | HTML or Markdown | Tables, keeping their rows, columns and structure |
{
"boosters": [
{
"name": "ocr",
"options": { "prompt": "Table Recognition:" }
}
]
}Information extraction#
Put a JSON schema in the prompt, the fields you want with empty values, and the reading's text is that JSON with the fields filled in from the picture; a field it cannot find is left out. A plain instruction that names the fields works the same way. In the request the schema is a string, so its quotes are escaped.
{
"id_number": "",
"last_name": "",
"first_name": "",
"date_of_birth": "",
"address": { "street": "", "city": "", "postal_code": "", "country": "" },
"dates": { "issue": "", "expiry": "" },
"sex": ""
}{
"boosters": [
{
"name": "ocr",
"options": {
"prompt": "Extract as JSON with fields: store, date, items, total"
}
}
]
}- Name exactly the fields you need. Every field asked for is read and written into the evidence, so a short list keeps the reading small and the decision's input with it.
- The reading is evidence text, not a typed answer. The decision reads it as text. A client that parses
textitself should validate it as it would any outside input: it may not be valid JSON, and a field may be missing or empty. For a decision about the document, ask the model a question; for the values themselves, readtextfromevidence.
Controlling the output#
- The prompt is the only control. There is no option for a format, a language or a length: say what you want in the prompt.
- The built-in task prompts are the most predictable. A prompt of your own is more flexible, but may add formatting of its own, such as Markdown around a table or a code fence around JSON. When it does, switch to the built-in prompt that matches the content.
- Languages. English and Chinese are read in full; for another language, name the language in the prompt.
- Limits. A prompt is at most 2,000 characters, longer is a
400api_usage_error. A reading holds at most 128 KiB of text, and a request's readings at most 1 MiB; past either, the booster'serror(see Room for readings). Bynn OCR has a time budget of 12 s, so give a request naming it a client timeout of 30 seconds per attempt and do not retry it after a timeout.
Distances with Depth Vision#
bynn_depth reads how far away things are in a picture, in meters, for robots, drones and other machines that move: the nearest obstacle straight ahead, the same in seven directions, and a grid of the whole picture. Name it like the other boosters, with grid_size in options for a grid other than 8 by 8. It is free (a picture it cannot decode is never billed). Its time budget is 800 ms, up to 5 s with timeout_ms.
- Straight ahead.
aheadis the nearest obstacle in the middle third of the picture's width, read at a low percentile so one noisy pixel does not count;nullwhen there is none, such as open space or sky. - Seven directions.
directionsis the same reading in seven equal vertical strips of the picture, left to right, each meters ornull. - The floor is left out. The floor or ground in front of a forward camera is always the nearest surface, so when one is found it is left out of
aheadanddirections, andgroundistrue. Withgroundfalse, none was found and they include everything. - The grid.
gridisgrid_sizerows ofgrid_sizecells, row by row from the top left of the picture turned upright, each cell the median distance of its part of the picture.depth_min,depth_maxanddepth_mediansum up the whole picture. - Meters to two decimals. Every distance is in meters, from 0 to 1,000. The model reads the reading as evidence; a larger grid gives it more to read, about 300 input tokens at 8 by 8 and over 1,000 at 16 by 16.
Finding things with Segment Vision#
bynn_segment finds what you name in words in a picture, such as a landing pad, a gate or a person, and for each match gives its outline, box and centre, and with depth on, how far away it is and how large, in meters. Name it with prompt in options. It costs $0.001 a picture read, one call per picture read with depth on or off (a picture it cannot decode is never billed). Its time budget is 1.5 s, up to 5 s with timeout_ms.
{
"boosters": [
{
"name": "bynn_segment",
"options": {
"prompt": ["landing pad", "person"],
"max_instances": 8,
"min_score": 0.25,
"polygon_points": 24,
"depth": true
}
}
]
}| Option | Values | Default |
|---|---|---|
prompt | Required. A phrase, or a list of 1 to 4 phrases of at most 120 characters each. | and control characters become spaces, white space folds to one space, the ends are trimmed, and empty phrases and repeats (whatever their case) are dropped | None, it is required |
max_instances | At most this many found in a picture, 1 to 16 | 8 |
min_score | A match scored below it is left out, 0 to 1 | 0.25 |
polygon_points | Points in each outline, 3 to 64 | 24 |
depth | true or false: distances and sizes in meters | true |
Its reading, per picture
width, heightinteger- The picture's size in pixels, turned upright.
promptsarray- The phrases searched for, cleaned as above.
instancesarray- What was found, best score first, at most
max_instances;[]when nothing is.labelstring- The phrase it matched.
scorenumber- How well it matches, 0 to 1.
boxarray[x1, y1, x2, y2], from its top left to its bottom right.polygonarray- Its outline,
[[x, y], ...], at mostpolygon_pointspoints. areanumber- Its share of the picture, 0 to 1.
centroidarray[x, y], the middle of its outline.openingobject or null- The largest hole it encloses, such as a gate's, a doorway's or a ring's:
polygon,centroid,width,height,offset([dx, dy]from the box's centre, -1 to 1) andarea;nullwhen it has none. depthobject or null- Meters along the camera's axis:
medianinside the outline,opening_medianinside the opening andopening_rim_medianon its rim, eachnullwhen there is none;nullwith depth off. size_mobject or null- Meters:
width,height, andopening(nullor itswidthandheight), sizes that assume the field of view inassumed_hfov_deg;nullwith depth off.
depth_sourcestring or null"bynn_depth"when the distances were read;nullwith depth off or unavailable.assumed_hfov_degnumber- The horizontal field of view the sizes in meters assume, in degrees: 65.
- Fractions of the picture. Every coordinate, box and outline is a fraction from 0 to 1 of the picture's width (x) and height (y), measured from its top left after its EXIF orientation, so it holds at any resolution.
- Distances and sizes in meters.
depthis meters along the camera's axis, from 0 to 1,000;size_mturns the outline into meters at that distance, assuming a 65-degree horizontal field of view, so a wider or narrower lens reads larger or smaller. - One call per picture, depth or not, and a picture with nothing found is a reading like any other. An undecodable picture is
{"image", "readable": false}, never billed. - Room for readings. Outlines take room, so a request that names
bynn_segmentmay carry up to 1 MiB of readings together; see Room for readings.
Writing the prompt#
- Describe what it looks like. A descriptive phrase matches better than a short one: "purple octagonal frame on a pole" finds what "purple gate" misses. Name its colour, its shape and what it stands on.
- Up to four things at once. Each phrase is searched for on its own, and each match's
labelsays which phrase it matched; a phrase with no match simply has none. - Gates and doorways for now. They often come back as one filled shape, frame and inside together, so
openingisnullanddepthreads what lies beyond. The outline's centre still marks the middle of the gate. - Raise
min_scoreto be strict, lower it to find more. Below it a match is left out; start from the default, 0.25, and a better phrase usually helps more than a lower score.
Segment Vision's refusals#
| Status | When | x-decisionnode-error, after boosters[<i>]: |
|---|---|---|
400 api_usage_error | No prompt (no options at all included) | "options": 'prompt' is required |
400 api_usage_error | A prompt left empty once cleaned | "options": 'prompt' must name something to find |
400 api_usage_error | A prompt that is not a string or a list of 1 to 4 strings of at most 120 characters | "options": 'prompt' must be a string, or an array of 1 to 4 strings, each of at most 120 characters |
400 api_usage_error | A max_instances out of its range | "options": 'max_instances' must be an integer from 1 to 16 |
400 api_usage_error | A min_score out of its range | "options": 'min_score' must be a number from 0 to 1 |
400 api_usage_error | A polygon_points out of its range | "options": 'polygon_points' must be an integer from 3 to 64 |
400 api_usage_error | A depth that is not true or false | "options": 'depth' must be true or false |
400 api_usage_error | Any other key in options | "options": '<key>' is not an option |
529 booster_unavailable | No server that reads it is ready right now; with Retry-After | The body's message: "The booster 'bynn_segment' failed." |
Every 400 body is "Invalid request.", the reason in x-decisionnode-error; nothing runs and nothing is billed. The other settings are judged in the order you send them, the prompt after them. Retry a 529 after Retry-After.
Your own documents with Knowledge#
knowledge reads no picture: it finds the passages of your own documents that apply to the request (its questions and state) in one of your knowledge bases, and the model applies them as facts and rules. Pinned documents always come with it. It takes the object form, since options.collection is required; images or videos on it are 400 booster_input_mismatch. Its reading is one result, not one per picture, with every passage cited by document, heading and byte offsets. It costs $0.001 a request, whatever it reads. Options, citations, budget and require: Knowledge in a decision.
{
"name": "knowledge",
"require": true,
"options": {
"collection": "col_3f6c1a9e0b2d4c7f8a1e5d9b2c4f6a80",
"scope": "M-42",
"top_k": 4
}
}How the model uses a reading#
The readings are written after your state as short, fixed sentences, one per booster and image, each naming the picture by its number and id. The model reads them with the state, the images and the questions, as evidence. They are counted once per request, however many questions you ask, and their tokens are in usage.input_tokens and usage.booster_tokens.
- A reading is evidence, not an answer. DecisionNode answers every question itself and may weigh a reading against what the picture and the state show.
- Ask the question the reading informs. An age reading helps "Is the person in
selfie18 or older?" It does not answer it for you: your threshold ontruthdoes. - Keep the reading for your records.
evidencenames the booster version that read, so a decision can be explained later.
When a booster cannot read#
| Status | What happened | The decision | Billed |
|---|---|---|---|
ok | The booster read every picture; results has one reading per picture | Runs with the readings | Per picture read; not a picture it could not decode |
timeout | No answer within the booster's time budget; results lists one {"image": id} per picture it was meant to read | Runs without it; with require: true the request is a 529 | No: billed_calls 0 |
error | The booster failed, or its readings did not fit the request's room for readings; results lists the pictures as for a timeout | Runs without it; with require: true the request is a 529 | No: billed_calls 0 |
skipped | None of the request's images is one this booster reads; results is empty | Runs without it | No |
A booster that did not run still tells the model so, in its own line, so what the model read and what evidence says always agree. Within an ok booster, these readings say a picture gave nothing:
{ "image": "selfie", "faces": 0 }- No face (Human Age):
faces0 and no age. It is billed like any reading: the booster looked. - No face (Face detection):
faces0 anddetections[], a reading billed like any other. - No match (Face recognition):
matches[], a reading billed like any other. - No text (OCR): an empty
text, a reading billed like any other. - Nothing ahead (Depth Vision):
aheadnull, andnullin each clear direction, a reading billed like any other. - Nothing found (Segment Vision):
instances[], a reading counted like any other. - Not decodable:
"readable": false, a picture the booster could not decode. It is not billed. - Timed out or failed: the booster's
statussays so,resultsnames each picture it was meant to read with nothing else, andbilled_callsis 0.
Room for readings#
A request's readings take at most 256 KiB together, or 1 MiB when the request names ocr, face_recognition or bynn_segment; one ocr reading takes at most 128 KiB of text. Boosters are fitted in the order you list them. A booster whose readings would not fit, or an ocr page that reads longer, is that booster's error for every picture it read: results names each picture with nothing else, billed_calls is 0, and the decision runs with the readings that fit. With require: true it is a 529. Send fewer or smaller pages per request when a page of dense text comes back this way.
Time#
Each booster has a time budget: 2 s for age, 5 s for ai_generated, 2 s for face_detection, 2 s for face_recognition, 12 s for ocr, 800 ms for bynn_depth, 1.5 s for bynn_segment and 800 ms for knowledge. The boosters of a request run side by side, before the model. They add their longest budget to the request, plus up to 2.2 s for reading the pictures, within the request's own deadline: a request without ocr gives its boosters 6 s of its 8 s, and a request naming ocr starts the model's 8 s once the readings are ready. A budget holds for uploads and inline pictures; a picture sent by url spends its download time from the 6 s. latency_ms and the x-decisionnode-boosters header say what each one took.
Set a budget per request with timeout_ms on the booster object, from 100 ms to the booster's ceiling: 2 s up to 5 s for age, 5 s up to 6 s for ai_generated, 2 s up to 5 s for face_detection, 2 s up to 5 s for face_recognition, 12 s up to 12 s for ocr, 800 ms up to 5 s for bynn_depth, 1.5 s up to 5 s for bynn_segment and 800 ms up to 5 s for knowledge. A booster that runs out of its budget is a timeout, not billed, and with require: true the request is a 529 booster_unavailable. Batch lines take timeout_ms too.
{
"boosters": [
{ "name": "age", "timeout_ms": 4000 },
"ai_generated"
]
}x-decisionnode-boosters: age=ok:212,ai_generated=timeout:800One entry per booster, in your order: its name, its status and its time in milliseconds. The header is on every response of a request that named boosters, errors included, so a 529 tells you which booster failed.
What a booster costs#
cost = input tokens × model price
+ sum of billed_calls × booster price
- input tokens
usage.input_tokens, the readings included- billed_calls
evidence.<name>.billed_calls: one per image that booster read with statusok- booster price
- that booster's price per call:
age(Human Age) $0.024,ai_generated(AI-generated) $0.006,face_detection(Face detection) $0.001,face_recognition(Face recognition) $0.001 on your own collection and $0.001 oncelebrities,ocr(OCR) $0.0015,bynn_depth(Depth Vision) free,bynn_segment(Segment Vision) $0.001 andknowledge(Knowledge) $0.001 a request
- Priced per call, by booster:
age(Human Age) $0.024,ai_generated(AI-generated) $0.006,face_detection(Face detection) $0.001,face_recognition(Face recognition) $0.001 on your own collection and $0.001 oncelebrities,ocr(OCR) $0.0015,bynn_depth(Depth Vision) free,bynn_segment(Segment Vision) $0.001 andknowledge(Knowledge) $0.001 a request, drawn from your prepaid balance with the request's tokens. The first sample makes 2 calls, one of each booster on the one picture: $0.030. - A booster that timed out or failed is free, and so is a picture a booster could not decode (
"readable": false). A reading that finds nothing, such as a picture with no face, is billed. - A reading's tokens are input tokens at the model's price, in
usage.booster_tokens. An OCR reading of a dense page is many of them. - Billed every time a request uses a reading, the same picture in a later request included: there is no discount for a picture read before. A picture your workspace sent within the last hour (or, for an upload, while the upload lives) may be answered from your workspace's cache of readings, faster and billed the same. The cache is never shared with another workspace and is not used under zero retention, and
face_recognitionreadings never enter it. - A request the safety check refuses bills no booster call and carries no
evidence. The check reads the request as you sent it, anocrprompt included. - A
529after boosters ran bills the calls that read, since they happened, and your retry's readings are billed again. A402comes before any booster runs.
Booster spend shows under its own heading on the console's Usage page. Every price is on Pricing and billing.
Turning a booster off#
Every booster is on for a new workspace. An Owner or Admin can turn one off, or back on, on the console's Boosters page; other roles see the switches. A request that names a booster that is off gets 403 booster_not_enabled. A booster DecisionNode has turned off for your workspace shows as locked; write to us to change it.
Where boosters work#
| Where | Boosters |
|---|---|
POST /v1/decide | Yes |
| Batch jobs | Yes: each line takes boosters as a live request does, billed the same way |
| Fine-tuned models | Yes, as on their base model |
| Sessions | No: boosters on a session's open is 400 api_usage_error "boosters are not available on sessions" |
Errors#
A boosted request has five errors of its own: booster_unavailable (529, retry it), booster_not_enabled (403), and booster_unknown, booster_input_mismatch and a malformed array's api_usage_error (400, fix the request).
| Status | Type | When | What to do |
|---|---|---|---|
400 | api_usage_error | boosters is not an array, has more than 4 entries, names a booster twice, holds an entry that is neither a name nor an object with name, an object with a key other than name, images, timeout_ms, require and options, or has a key in options the booster does not take, a face_recognition entry without options.collection (the bare name included) or with one that is not a string, a threshold outside 0 to 1, a prompt that is not a string of at most 2,000 characters, a bynn_depth grid_size that is not a whole number from 2 to 16 ("options": 'grid_size' must be an integer from 2 to 16), a bynn_segment entry without options.prompt or with a prompt or setting out of its range (the sentences under Segment Vision's refusals). x-decisionnode-error says which | Fix the array |
400 | booster_unknown | A name that is not a booster | Use a name from the table above |
400 | booster_input_mismatch | A booster that reads images on a request without any, or an images entry that is not an image of the request | Add the image, or fix the id |
402 | insufficient_credit | The balance is empty; no booster ran | Add credit, then retry |
422 | a detail list | A timeout_ms that is not an integer from 100 to the booster's ceiling: int_type, greater_than_equal or less_than_equal at ["body", "boosters", <i>, "timeout_ms"], "Input should be an integer from 100 to <max>". Nothing runs and nothing is billed | Fix the budget |
403 | booster_not_enabled | The booster is off for your workspace | Turn it on under Boosters, or leave it out |
404 | collection_not_found | face_recognition names a collection that is not yours and not public | Fix the id |
400 | collection_type_mismatch | face_recognition names a collection that is not a face collection | Name a face collection |
400 | collection_type_mismatch | knowledge names a collection that is not a knowledge base | Name a knowledge base |
409 | knowledge_collection_empty | knowledge with require: true on a knowledge base with no document ready or processing | Add a document; see Knowledge in a decision |
529 | booster_unavailable | A booster with require: true failed or ran out of time | Wait Retry-After, then retry; the SDKs do |
{
"detail": {
"error_type": "booster_not_enabled",
"message": "The booster 'age' is not enabled for this workspace."
}
}What a booster never does#
- It never answers a question, however sure it is, and never adds a question or an answer.
- It never changes a request without boosters: the same request gets the same answer it got before boosters existed.
- It never decides what the safety check refuses. The safety check judges the request as you sent it, an
ocrprompt included, never a reading, except thelabels of your own items that aface_recognitionsearch matched, which are your own text. - It never keeps your images. The bytes are read for the call and not stored or logged; the request log records which boosters ran, their status and their time, never their readings. A reading itself stays only in your workspace's cache of readings, for at most an hour, and not under zero retention.
- It never reads more than the request's images: the same images, in the same workspace, under the same retention, at most 16 a request.