Skip to main content
A Jev client keeps working on 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

  1. Create a OneHot API key. In the console, create a key and store it as SQWISH_API_KEY. It is shown once.
  2. Change the base URL. Point the client at https://api.sqwish.ai. The path stays POST /v1/systemone.
  3. Swap the key. Send Authorization: Bearer with the OneHot key.
  4. Keep the Jev body. state and questions stay as they are, with noul, choice and score.
  5. Name one of our models. Set model to kettei-fat, kettei-chub or kettei-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.
  6. Compare a sample before you switch. Send the same questions to Jev and to OneHot. Look at the answers and at confidence on your own labels.
  7. Add an idempotency key if you retry. With a key, POST /v1/systemone keeps 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.
  8. Move to native decisions when you want them. Actions and abstention are on POST /v1/decide. Translate once. Do not send questions to /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.
It returns:
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

Send state 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 array state. 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-level assets 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 state is read as an image node there.
  • References in a state that 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.
The request is refused with 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 request and holds the request’s JSON.
  • Each image’s file is in a part of its own. Its asset in assets names that part with "part": "<part name>".
  • Every part has a name of its own. Every part after request is 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.