POST /v1/systemone. Change the address, the API key and model, which names one of our models, such as kettei-core. The path, state and questions stay as they are. The model you name answers, and the response’s model names it.
Before and after
In these examples,JEV_BASE_URL is the base URL you call Jev on today.
answers.refund.noul is still the yes probability. choice still returns the winning option, probabilities and confidence. score still returns an expected level, a legend, probabilities and confidence.
OneHot’s own Python and TypeScript clients send the same request with systemone(), and translate it with systemone_translate() (systemoneTranslate() in TypeScript). Python’s systemone() sends only state, questions and model, so it can’t send assets, and TypeScript’s input type has no assets either. With a client, put images in a content array or in image nodes (Images).
Migration checklist
- Create a OneHot API key. In the console, create a key and store it as
SQWISH_API_KEY. It is shown once. - Change the base URL. Point the client at
https://api.sqwish.ai. The path staysPOST /v1/systemone. - Swap the key. Send
Authorization: Bearerwith the OneHot key. - Keep the Jev body.
stateandquestionsstay as they are, withnoul,choiceandscore. - Name one of our models. Set
modeltokettei-fat,kettei-chuborkettei-core. The model you name is the one that answers. When it can’t answer, the request fails with an error that says why. No other model answers instead. - Compare a sample before you switch. Send the same questions to Jev and to OneHot. Look at the answers and at
confidenceon your own labels. - Add an idempotency key if you retry. With a key,
POST /v1/systemonekeeps a successful answer for 24 hours, and a replay doesn’t run or charge again. After a lost reply, resend the same key and the same body. An organisation with zero data retention keeps no answer, so there a retry runs again and is charged again. See when to retry and after a lost response. - Move to native decisions when you want them. Actions and abstention are on
POST /v1/decide. Translate once. Do not sendquestionsto/v1/decide.
What differs
Shape compatibility is not a promise of the same accuracy or latency. Compare on your labels before you point production here.
Compare before you switch
Send one sample to both. Keep the Jev path until the comparison looks right. To price the sample first,POST /v1/systemone/estimate takes the same body and quotes it without running a model.
Translate when you want native decisions
POST /v1/systemone/translate returns the /v1/decide request and notes on what changed. It runs no model, costs nothing and needs no key.
Add abstention only after you have compared the translated request on your own labels. Preserve outcome order. Jev
confidence is not native p_top, and neither is a measure of correctness.
Translate refuses a choice option named abstain with 422 reserved_outcome, because OneHot keeps abstain for a decision that chooses not to answer. Rename the option, then translate again.
Fields /v1/systemone doesn’t know are ignored, and five are refused (extra fields). A field from another provider’s API does not transfer on its own.
Images
/v1/systemone takes images inside state. kettei-fat and kettei-chub read them, and kettei-core reads text only. kettei-core answers a Jev model ID, so a request with images names kettei-fat or kettei-chub. The model reads exactly what the same request to /v1/decide shows it, and POST /v1/systemone/translate returns that request.
Images are base64 JPEG, PNG or WebP: a data: URL in an image part, and plain base64 in a node or an asset. URLs are not fetched. Put images in state, because a top-level images field is refused. Shrink a larger picture to the size the model reads, and send a photo as JPEG.
The limits, errors and billing are the ones on Images. usage gives images and image_tokens here too.
A request carries images in one of three forms.
A content array
Sendstate as a list of text parts and image_url parts. The text parts, joined by spaces, are the context. An anchor such as <image:1> or <image:2> stands where each image is.
Image nodes
Put image nodes anywhere in an object or arraystate. Each node is read where it stands, as its anchor.
An assets map
This is Jev’s own form. List each image once in a top-levelassets map, under a reference you choose. Then write the reference in state where the image goes.
- A reference that is a value of an object or array
stateis read as an image node there. - References in a
statethat is one string are read as a content array of its text and images. - Each use of a reference is an image of its own. A request takes up to 8 images.
- Each use is billed for the image’s tokens, so a reference used twice is billed twice. On
/v1/decide, an image is billed once, however many times its anchor appears. - Choose references that can’t occur in your text by accident, such as a new UUID for each image.
invalid_request when a reference is used nowhere, or stands inside a longer string of an object or array state. A reference in a question is refused too: images go in state here.
Multipart requests
A multipart request carries each image’s file as it is, a quarter smaller than base64. Jev’s SDKs send one when a request has images./v1/systemone takes it as multipart/form-data:
- The first part is named
requestand holds the request’s JSON. - Each image’s file is in a part of its own. Its asset in
assetsnames that part with"part": "<part name>". - Every part has a name of its own. Every part after
requestis the file of exactly one asset, with an image’s media type or none.
POST /v1/systemone/estimate and POST /v1/systemone/translate take multipart requests too.
A body that is not multipart data gets 400 invalid_multipart. A body that breaks these rules gets 422 invalid_request. Shrink each picture to fit here too.
Extra fields
/v1/systemone ignores fields it doesn’t know, at the top level and inside a question. So a client’s own additions change nothing. Sampling settings, metadata and a provider’s hints are examples. Five things are refused, each with its own code:
With
unknown_field, a typo is never answered as if the field were left out. Errors says what to do about each code.