Docs
Get an API key
API reference›Decisions

Create Decision

POST /v1/systemone Models: Decisions View .md

Answer typed questions about a state with a decision ("System One") model, in TypeSafe's /v1/systemone shape, so clients written for TypeSafe work by changing their base URL and key.

A decision model scores non-Box questions. Box questions are sent separately to an image-capable localizer chat model.

Question types: noul (yes/no) answers noul, the probability of yes. choice picks one of 1 to 255 options and answers the most likely choice, every option's probabilities and a confidence. score rates on 1 to 10 ordered levels and answers score, the probability-weighted level (it can land between levels), with a legend, probabilities and confidence.

Confidence is 1 when the distribution is on one answer and 0 when it is spread evenly. For choice, it is (k * p_max - 1) / (k - 1). For score, it is TypeSafe's ordered-level formula: with m the first level index holding the maximum probability, 1 - sum(p_i * abs(i - m)) / (sum(abs(i - (n - 1) / 2)) / n), floored at 0. noul answers carry none; read noul itself.

Long inputs over the model's maximum input length are rejected with 400 and metadata.error_type: max_tokens_exceeded, never truncated.

Box: Requires images and has no criteria. Coordinates are fractions from the top-left, with null confidence. The localizer reads the images referenced by its instructions, or the sole image if none are referenced. With multiple images, each Box question must reference an image in its instructions. An absent target still produces a box.

Billing: decision input tokens are billed against the decision model. Box localizer prompt and completion tokens are billed against the localizer model; prompt tokens are included in usage.input_tokens.

Images: send them in assets with the TypeSafe-Danger-Zone-Images: true header, inline as base64 or as the multipart form TypeSafe's SDKs send (a part named request with the JSON body, then a part per image). The request shape is TypeSafe's: state, instructions, criteria and score legends keep the references and text you sent, and an image in a question's instructions or criteria is read for that question alone. TypeSafe calls images experimental. A model reads images when GET /v1/models lists image among its input_modalities, and at most as many per request as that input's supported_inputs.references.max says (1024 for clef-flash, 8 for clef-omni).

Audio and video: not TypeSafe's. A model that lists audio or video among its input_modalities (clef-omni: 8 clips and 4 videos a request) reads WAV or MP3 assets of type: audio and MP4 or WebM assets of type: video, with the same header, references and limits as images. A request with any audio or video is read as Clef-Omni was trained: every asset in one block before the state, each kind in the order its reference first appears, shared by every question, so a question's own image is read with the rest. A video's soundtrack is heard with it when every video has one; audio clips cannot be sent with videos that have soundtracks. The media's tokens are billed as input tokens.

Compression: a body may be sent compressed with Content-Encoding: zstd or gzip (one layer; a zstd window of at most 8 MiB), as TypeSafe's SDKs send bodies of 1 KiB or more. A body may be at most 32 MB, compressed and decompressed.

  • Content-Encoding string

    The body's compression, if any. One of zstd, gzip or x-gzip; no stacked encodings.

    zstdgzipx-gzipidentity
  • TypeSafe-Danger-Zone-Images string

    true to send images in assets, as TypeSafe requires; a request with assets without it is a 400.

    true

TypeSafe's /v1/systemone request. A request with images also sends assets and the TypeSafe-Danger-Zone-Images: true header, and goes to a model that reads images (its input_modalities in GET /v1/models list image).

  • model string required

    The decision model to use.

  • state string or object or array of any required

    What to decide about. A string, or structured data (an object or array), which the model reads as JSON.

    One of 3
    • string
    • object
    • array of any
  • questions object required

    A non-empty map of questions, by id. Each answer comes back under its question's id. Requests beyond 64 questions require the coordinated engine rollout that accepts them.

  • assets object

    Images (and, for a model that reads them, audio clips and videos), keyed by a reference of your choosing (a per-image UUID is a good one; at most 1,024 bytes, and 65,536 for all of them). Write the reference into state, a question's instructions or its criteria where the image belongs: a string that is exactly the reference is the image, and inside longer strings references are found left to right without overlap. Object keys are never read. Every asset must be referenced.

    Every use of a reference inserts its image at that location, including repeated uses of the same asset. An image in a question's instructions or criteria is read for that question alone; put an image several questions need in state.

    The images count toward the model's input and are billed as input tokens. The images together may be at most 32 MiB, and so may the expanded request: the state and questions with each image counted at every place it is referenced. assets itself is not counted, so an image sent inline in base64 counts the same as one sent as a multipart part.

    A model reads at most a set number of images per request, its image input's supported_inputs.references.max in GET /v1/models (1024 for clef-flash, 8 for clef-omni); a request with more is refused with 400. clef-omni reads at most 8 audio clips and 4 videos a request.

Fields as multipart/form-data
  • request object required

    TypeSafe's /v1/systemone request. A request with images also sends assets and the TypeSafe-Danger-Zone-Images: true header, and goes to a model that reads images (its input_modalities in GET /v1/models list image).

    4 fields
    • model string required

      The decision model to use.

    • state string or object or array of any required

      What to decide about. A string, or structured data (an object or array), which the model reads as JSON.

      One of 3
      • string
      • object
      • array of any
    • questions object required

      A non-empty map of questions, by id. Each answer comes back under its question's id. Requests beyond 64 questions require the coordinated engine rollout that accepts them.

    • assets object

      Images (and, for a model that reads them, audio clips and videos), keyed by a reference of your choosing (a per-image UUID is a good one; at most 1,024 bytes, and 65,536 for all of them). Write the reference into state, a question's instructions or its criteria where the image belongs: a string that is exactly the reference is the image, and inside longer strings references are found left to right without overlap. Object keys are never read. Every asset must be referenced.

      Every use of a reference inserts its image at that location, including repeated uses of the same asset. An image in a question's instructions or criteria is read for that question alone; put an image several questions need in state.

      The images count toward the model's input and are billed as input tokens. The images together may be at most 32 MiB, and so may the expanded request: the state and questions with each image counted at every place it is referenced. assets itself is not counted, so an image sent inline in base64 counts the same as one sent as a multipart part.

      A model reads at most a set number of images per request, its image input's supported_inputs.references.max in GET /v1/models (1024 for clef-flash, 8 for clef-omni); a request with more is refused with 400. clef-omni reads at most 8 audio clips and 4 videos a request.

OK

application/json · systemone-response-payload

3 fields
  • model string required
  • answers object required

    One answer per question, by question id.

  • usage object required
    2 fields
    • input_tokens integer

      The processed input tokens the model actually read, summed across every image-scoped read, the billed count.

    • output_tokens integer

      Always 0.

curl https://api.vultrinference.com/v1/systemone \
  -H "Authorization: Bearer $VULTR_INFERENCE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "clef",
    "state": {
      "ticket": "Everything is down and we have a demo at noon."
    },
    "questions": {
      "urgent": {
        "type": "noul",
        "instructions": "Does the customer need a reply within the hour?"
      },
      "department": {
        "type": "choice",
        "instructions": "Which team should handle this?",
        "criteria": {
          "billing": "invoices, payments, refunds",
          "technical": "bugs, outages, errors"
        }
      },
      "frustration": {
        "type": "score",
        "instructions": "How frustrated is the customer?",
        "criteria": [
          "Calm",
          "Frustrated",
          "Very angry"
        ]
      }
    }
  }'
Response · 200
{
    "model": "string",
    "answers": {},
    "usage": {
        "input_tokens": 0,
        "output_tokens": 0
    }
}