Maton

TypeSafe AI

Access the TypeSafe AI API with managed authentication. Ask Jev, TypeSafe's System One model, typed questions about the text, records, or images you supply, and get back choices, scores, yes/no probabilities, and image boxes as typed data. Every evaluation is billed per input token, and the state you send goes to TypeSafe. All access runs through the Maton gateway and the maton CLI.

Permissions

Suggested read access

In the Console, Read limits the connection to these 1 read-only endpoints, plus deny rules for any write endpoint a broader rule would otherwise match. Endpoints Maton has found to return credentials, start jobs, or spend credits are left out; a few reads that can change state or return a secret depending on their parameters stay in, and their descriptions say how. It is a suggestion: the saved rules are exactly the ones you see, and you can change them with Custom. See Access policy.

Reference

Models

List Models

maton api '/typesafe-ai/v1/models'

Response:

{
  "models": [
    {
      "name": "jev-latest",
      "description": "The latest iteration of TypeSafe's System One Model: Jev",
      "release_date": "2026-10-22T02:00:00+00:00"
    },
    {
      "name": "jev-preview",
      "description": "Preview the next version of Jev before it gets promoted to jev-latest. Most of the time this is the same as jev-latest",
      "release_date": "2026-10-14T20:14:00+00:00"
    }
  ]
}

Lists the model names and aliases the account can pass as model. This call is not billed, so it is the one to make first to check the connection.

System One

Answer Questions

maton api '/typesafe-ai/v1/systemone' -X POST -H 'Content-Type: application/json' --input - <<'JSON'
{
  "model": "jev-latest",
  "state": "I was charged twice for my subscription this month. Please refund the extra charge.",
  "questions": {
    "billing": {"type": "noul", "instructions": "Is this message about billing?"},
    "tone": {
      "type": "choice",
      "instructions": "What is the tone of this message?",
      "criteria": {"calm": "Calm and polite", "angry": "Angry or hostile"}
    },
    "urgency": {
      "type": "score",
      "instructions": "How urgent is this message?",
      "criteria": ["Can wait", "Needs attention this week", "Needs attention today"]
    }
  }
}
JSON

Body fields:

  • model (string, required): A name or alias from v1/models, such as jev-latest. The response names the versioned model that answered (for example jev-1.14.0); aliases move when a new version ships, so pin a versioned name when results must stay stable.
  • state (string, object, or array, required): The content every question refers to. Prefer a JSON object with descriptive field names over a serialized string; questions can refer to a field by its path.
  • questions (object, required): At least one question, keyed by a name you choose; the answers come back under the same names.
    • noul: instructions (the statement or yes/no question), optional criteria with true and false describing what counts as each.
    • choice: instructions, criteria (required) mapping each option name to when it applies (an option without a description is read by its name).
    • score: instructions, criteria (required) as an ordered list of levels; the first level scores 0.
    • box: instructions naming what to locate in an image asset.
    • instructions and criteria values may also be objects or arrays for structured wording.
  • assets (object, optional): Images keyed by a placeholder string (a per-image UUID is recommended). Each asset is {"type": "image", "format": "png", "data_base64": "..."}; wherever the placeholder appears as or inside a string in the state or a question, the image is put there. Requires the TypeSafe-Danger-Zone-Images: true header.

Response (billing and tone from a live call; urgency from TypeSafe's documentation):

{
  "model": "jev-1.14.0",
  "answers": {
    "billing": {"type": "noul", "noul": 0.99},
    "tone": {
      "type": "choice",
      "choice": "calm",
      "confidence": 1.0,
      "probabilities": {"calm": 1.0, "angry": 0.0}
    },
    "urgency": {
      "type": "score",
      "score": 1.7,
      "confidence": 0.55,
      "legend": {"0": "Can wait", "1": "Needs attention this week", "2": "Needs attention today"},
      "probabilities": {"0": 0.1, "1": 0.1, "2": 0.8}
    }
  },
  "usage": {"input_tokens": 345, "output_tokens": 50}
}

Act on the probability, not on confidence: compare noul, or probabilities[choice] for a Choice, against thresholds the user chose, and give every outcome (including a Noul between the thresholds) a defined result in code. confidence summarizes uncertainty and is a signal for review, not the number to act on.

Locate Something in an Image

maton api '/typesafe-ai/v1/systemone' -X POST -H 'Content-Type: application/json' \
  -H 'TypeSafe-Danger-Zone-Images: true' \
  --input - <<'JSON'
{
  "model": "jev-latest",
  "state": "{image_id}",
  "questions": {
    "receipt_total": {"type": "box", "instructions": "Locate the total amount on the receipt."}
  },
  "assets": {
    "{image_id}": {"type": "image", "format": "png", "data_base64": "{base64_png}"}
  }
}
JSON

Response (from TypeSafe's documentation):

{
  "model": "jev-preview",
  "answers": {
    "receipt_total": {
      "type": "box",
      "box": {"top": 0.2, "bottom": 0.66, "left": 0.19, "right": 0.68},
      "confidence": null
    }
  },
  "usage": {"input_tokens": 285, "output_tokens": 20}
}

confidence is null when the model does not provide one.

Images can also be sent as multipart/form-data: a JSON part named request holding the body above, with each asset naming its image part in part instead of data_base64. Only images are supported.

Notes

  • Context limits: by default the state plus all questions must fit in 64k tokens, and the state plus any one question in 64k. The TypeSafe-Danger-Zone-Long-Context: true header raises both to 262k at the same price per token; it is slower and less accurate, so use it only when the state cannot be trimmed.
  • Request limits: the body is at most 32 MiB of UTF-8 JSON (no BOM) with at most 64 levels of nesting in state, instructions, and criteria, and only finite numbers. Content-Encoding: gzip or zstd (one layer) is accepted. There is no limit on the number of questions.
  • No pagination, streaming, async jobs, or webhooks. Every call returns its full answer synchronously.
  • Rate limits are set per organization in tokens and requests per second, and are shown only in the TypeSafe console. A 429 means a limit was hit: back off, honouring retry-after if present.
  • Errors: 400 {"detail": ...} (a body rule broken, or max_tokens_exceeded when the request is longer than the context limit), 401 (missing or invalid key, authentication_error), 413 (body over 32 MiB), 415 (an unsupported or doubled Content-Encoding), 422 (detail lists each invalid field with loc, msg, type), 429 (rate limit), 529 (TypeSafe is overloaded; retry after a short delay).
  • Each response carries an x-typesafe-request-id header; quote it when reporting a problem to TypeSafe.
  • Design the questions, then decide in code. Break a decision into the judgments it depends on (Noul, Choice, Score), keep all question wording and thresholds in one place, and keep arithmetic, dates, and exact lookups in code. TypeSafe's own agent skill covers these patterns in depth (see Resources).
  • Keys are created in the TypeSafe console at console.typesafe.ai/keys. Deleting or rotating a key there breaks the connection; reauthorize it with a new key.

Resources

On this page