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.
What the routes share
Section titled “What the routes share”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. Theinvalid_requestmessages name the fields of the route’s own form (threshold, notoptions.threshold). - Models. Each route serves only the models listed for it; another model returns
404 model_not_found. - The
modelfield of the response names the exact version as one string:cordon-mini-2.2.1. GET /v1/modelsis the same for every client.
| route | form | models |
|---|---|---|
POST /v1/detect | the earlier detection API of Inola | cordon-mini |
POST /v1/decide | the System One form of the Jev API | decider-mini |
POST /v1/systemone | the same, at the path used by TypeSafe API clients | decider-mini |
POST /v1/chat/completions | the OpenAI chat completions form, for a closed question | decider-mini, cordon-mini |
POST /v1/detect
Section titled “POST /v1/detect”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/detect | field of /v1/infer |
|---|---|
model (name, optionally with version: cordon-mini-2.2.1) | model (and version) |
text | input.state (the route sends it as the earlier input.text) |
threshold | options.threshold |
question (optional, default ipi, also when null) | input.questions.injection.instructions: a kind of detection; the answer keeps the flat fields below |
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 response | field of /v1/infer |
|---|---|
is_injection | output.answers.injection.verdict |
score | output.answers.injection.noul |
threshold | output.answers.injection.threshold |
verdicts | output.answers.injection.verdicts |
id | id |
model | model and version, joined with - |
n_tokens | usage.input_tokens |
latency_ms | usage.latency_ms |
The equivalent call:
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}}'POST /v1/decide and POST /v1/systemone
Section titled “POST /v1/decide and POST /v1/systemone”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/decide | field of /v1/infer |
|---|---|
model (decider-mini, optionally with version) | model (and version) |
state | input.state |
questions | input.questions |
| other fields of the form | the same fields in input |
| field of the response | field of /v1/infer |
|---|---|
the result fields of the form (answers and the rest) | the same fields in output |
id | id |
model | model and version, joined with - |
usage.input_tokens | usage.input_tokens |
usage.output_tokens | usage.output_tokens |
latency_ms | usage.latency_ms |
The equivalent call, with the state and questions of the request inside input:
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"}}}}}'POST /v1/chat/completions
Section titled “POST /v1/chat/completions”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.
| request | equivalent in POST /v1/infer |
|---|---|
decider-mini: the system message, or without one the first line of the last user message | the question’s instructions |
decider-mini: the last user message | input.state |
decider-mini: no response_format | a noul question |
decider-mini: response_format.json_schema with one property — boolean, string with enum, integer 0..N (N up to 9), number 0..1 | a 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 message | input.state, kind of detection ipi |
| every question | asked with “don’t know” allowed (allow_unsure: true) |
| response | from the POST /v1/infer reply |
|---|---|
choices[0].message.content | without 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 |
inola | the 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_tokens | usage.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.
Batches
Section titled “Batches”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.
| model | fields of a flat body | route |
|---|---|---|
cordon-mini | model; 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-mini | model, 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/inferform after a flat one, or the other way round, is rejected at upload with its line number. A line is in thePOST /v1/inferform when itsurlis/v1/inferor, withouturl, whenbody.inputis an object. urlandendpoint. Both stay optional. A flat line may carry the route of its model asurl;endpointofPOST /v1/batchesmay be/v1/inferor that route, whatever the form of the lines. The batch object names the route of the file’s model from the table above inendpoint, whichever form the lines use.- Results of flat lines have the response form of the model’s route above: for
cordon-minithe form ofPOST /v1/detect, fordecider-minithe form ofPOST /v1/decide.modelnames the exact version as one string (cordon-mini-2.2.1), andinvalid_requesterrors 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}Next steps
Section titled “Next steps”- API reference —
POST /v1/inferand every other endpoint. - Quickstart — the first request in the main form.
- Changelog — when the examples moved to
POST /v1/infer.