Skip to content

Compatibility

This page lists the request forms the Inola API accepts besides POST /v1/infer: the routes of its earlier API and the forms of other APIs, kept so that existing clients and SDKs work without changes. New code uses POST /v1/infer; every example in this documentation does.

A request to any route below is served exactly as the equivalent POST /v1/infer request: the same API key and inference permission, the same models, versions, prices, limits and billing, the same response headers. Only the shape of the request and response body differs.

  • Errors have the usual form {"error": {"code", "message"}} with the codes of Error codes. The invalid_request messages name the fields of the route’s own form (threshold, not options.threshold).
  • Models. Each route serves only the models listed for it; another model returns 404 model_not_found.
  • The model field of the response names the exact version as one string: cordon-mini-2.2.1.
  • GET /v1/models is the same for every client.
routeformmodels
POST /v1/detectthe earlier detection API of Inolacordon-mini
POST /v1/decidethe System One form of the Jev APIdecider-mini
POST /v1/systemonethe same, at the path used by TypeSafe API clientsdecider-mini
POST /v1/chat/completionsthe OpenAI chat completions form, for a closed questiondecider-mini, cordon-mini

The flat detection form: the fields of input and options sit at the top level of the request, and the fields of the detector’s answer (output.answers.injection) at the top level of the response, under their earlier names.

field of /v1/detectfield of /v1/infer
model (name, optionally with version: cordon-mini-2.2.1)model (and version)
textinput.state (the route sends it as the earlier input.text)
thresholdoptions.threshold
question (optional, default ipi, also when null)input.questions.injection.instructions: a kind of detection; the answer keeps the flat fields below
Terminal window
curl -sS "https://api.inola.ai/v1/detect" \
-H "Authorization: Bearer $INOLA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "cordon-mini", "text": "Meeting notes, 14 October: the vendor contract renews on 1 March.", "threshold": 0.5}'
{
"id": "req_01JBXQ7M3T8K2V9R4N6PZC5HDA",
"is_injection": false,
"score": 0.01,
"threshold": 0.5,
"verdicts": {"fpr_1e-03": false, "fpr_1e-04": false},
"n_tokens": 16,
"model": "cordon-mini-2.2.1",
"latency_ms": 36
}
field of the responsefield of /v1/infer
is_injectionoutput.answers.injection.verdict
scoreoutput.answers.injection.noul
thresholdoutput.answers.injection.threshold
verdictsoutput.answers.injection.verdicts
idid
modelmodel and version, joined with -
n_tokensusage.input_tokens
latency_msusage.latency_ms

The equivalent call:

Terminal window
curl -sS "https://api.inola.ai/v1/infer" \
-H "Authorization: Bearer $INOLA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "cordon-mini", "input": {"state": "Meeting notes, 14 October: the vendor contract renews on 1 March."}, "options": {"threshold": 0.5}}'

The System One request of the Jev API, so that clients and SDKs built for it work after a change of the base URL. Both paths take the same body and return the same response. The whole request body becomes input of the /v1/infer request: state, questions and the other fields of the form.

field of /v1/decidefield of /v1/infer
model (decider-mini, optionally with version)model (and version)
stateinput.state
questionsinput.questions
other fields of the formthe same fields in input
field of the responsefield of /v1/infer
the result fields of the form (answers and the rest)the same fields in output
idid
modelmodel and version, joined with -
usage.input_tokensusage.input_tokens
usage.output_tokensusage.output_tokens
latency_msusage.latency_ms

The equivalent call, with the state and questions of the request inside input:

Terminal window
curl -sS "https://api.inola.ai/v1/infer" \
-H "Authorization: Bearer $INOLA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "decider-mini", "input": {"state": "Order 1042: paid, shipped on 3 March, delivered on 5 March.", "questions": {"delivered": {"type": "noul", "instructions": "Has the order been delivered?", "criteria": {"true": "the order was delivered", "false": "the order was not delivered"}}}}}'

The OpenAI chat completions form, so that a closed step of a pipeline written for an OpenAI client changes only its base URL, key and model name; Replacing an OpenAI call has the examples. The models answer one closed question, they do not write text.

requestequivalent in POST /v1/infer
decider-mini: the system message, or without one the first line of the last user messagethe question’s instructions
decider-mini: the last user messageinput.state
decider-mini: no response_formata noul question
decider-mini: response_format.json_schema with one property — boolean, string with enum, integer 0..N (N up to 9), number 0..1a noul, choice (the enum values as options) or score question (levels 0..N, or 0, 0.25, 0.5, 0.75, 1) under the property’s name
cordon-mini: the last user message, or the last message when it is a tool messageinput.state, kind of detection ipi
every questionasked with “don’t know” allowed (allow_unsure: true)
responsefrom the POST /v1/infer reply
choices[0].message.contentwithout response_format: yes or no; with it: {"<property>": <value>} — the verdict (cordon-mini) or noul at 0.5, the choice, or the expected score on the property’s scale; "unsure" when “don’t know” is the most probable answer
inolathe answer’s fields (noul, probabilities, score, confidence, probabilities_with_unsure; threshold, verdict, verdicts for cordon-mini) and unsure (boolean)
usage.prompt_tokens, usage.completion_tokens, usage.total_tokensusage.input_tokens, usage.output_tokens and their sum
model<model>-<version>

stream: true returns server-sent events: one chat.completion.chunk with the answer, one with usage and empty choices when stream_options.include_usage is true, then data: [DONE]. tools, n above 1, logprobs, image or audio content, response_format of type json_object, a string property without enum and a schema with more than one property return 400 invalid_request with the reason. Sampling and bookkeeping fields (temperature, top_p, max_tokens, max_completion_tokens, seed, stop, presence_penalty, frequency_penalty, user, metadata) are accepted and do not change the answer. Batches take the POST /v1/infer form; chat completion lines in a batch file are not supported.

Batch lines are written in the POST /v1/infer form (Batches). The earlier flat form of the lines is still accepted, so files written for it work without changes: body holds the fields of the model’s earlier route at its top level, without the input and options envelope.

modelfields of a flat bodyroute
cordon-minimodel; text (a string; an empty one is answered as clean); threshold (optional, 0 to 1); question (optional, a detector question name, default ipi)/v1/detect
decider-minimodel, state, questions and the other fields of the System One form/v1/decide
{"custom_id": "doc-1", "body": {"model": "cordon-mini", "text": "Meeting notes, 14 October: the vendor contract renews on 1 March.", "threshold": 0.5}}
  • One form per file. A file mixes no forms: a line in the POST /v1/infer form after a flat one, or the other way round, is rejected at upload with its line number. A line is in the POST /v1/infer form when its url is /v1/infer or, without url, when body.input is an object.
  • url and endpoint. Both stay optional. A flat line may carry the route of its model as url; endpoint of POST /v1/batches may be /v1/infer or that route, whatever the form of the lines. The batch object names the route of the file’s model from the table above in endpoint, whichever form the lines use.
  • Results of flat lines have the response form of the model’s route above: for cordon-mini the form of POST /v1/detect, for decider-mini the form of POST /v1/decide. model names the exact version as one string (cordon-mini-2.2.1), and invalid_request errors of items name the flat fields (text, threshold).
{"id": "batch_01JBY3M8V0X2Z4B6D8F0H2K4N6:1", "custom_id": "doc-1", "response": {"status_code": 200, "body": {"is_injection": false, "score": 0.01, "threshold": 0.5, "verdicts": {"fpr_1e-03": false, "fpr_1e-04": false}}}, "error": null}
  • API reference — POST /v1/infer and every other endpoint.
  • Quickstart — the first request in the main form.
  • Changelog — when the examples moved to POST /v1/infer.