Skip to content

Quickstart

This page sends one request, reads the response, and shows where to go next. You only need an HTTP client.

1. Check the service

curl https://api.trusttyped.com/health
{"status": "ok", "default_model": "trusttyped-v1.0.0",
 "calls_enabled": true, "allow_hosts": ["*"]}

default_model is the model your requests use unless they set model. calls_enabled tells you whether tool calls are allowed on this deployment.

2. Send a document and a schema

curl https://api.trusttyped.com/v1/typed \
  -H "Content-Type: application/json" \
  -d '{
    "context": "Sunrise Cafe. Fried Rice 25000, Iced Tea 8000. Total 33000. Paid in cash.",
    "schema": {
      "merchant": {"type": "string", "extract": true, "instruction": "Store name"},
      "total":    {"type": "number", "integer": true, "instruction": "Final total"},
      "paid":     {"type": "bool", "instruction": "Was it paid?"},
      "category": {"enum": ["food", "transport", "other"], "instruction": "Category"}
    }
  }'
import requests

resp = requests.post("https://api.trusttyped.com/v1/typed", json={
    "context": "Sunrise Cafe. Fried Rice 25000, Iced Tea 8000. Total 33000. Paid in cash.",
    "schema": {
        "merchant": {"type": "string", "extract": True, "instruction": "Store name"},
        "total":    {"type": "number", "integer": True, "instruction": "Final total"},
        "paid":     {"type": "bool", "instruction": "Was it paid?"},
        "category": {"enum": ["food", "transport", "other"], "instruction": "Category"},
    },
}, timeout=120)
resp.raise_for_status()
data = resp.json()
print(data["result"])
const resp = await fetch("https://api.trusttyped.com/v1/typed", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    context: "Sunrise Cafe. Fried Rice 25000, Iced Tea 8000. Total 33000. Paid in cash.",
    schema: {
      merchant: { type: "string", extract: true, instruction: "Store name" },
      total:    { type: "number", integer: true, instruction: "Final total" },
      paid:     { type: "bool", instruction: "Was it paid?" },
      category: { enum: ["food", "transport", "other"], instruction: "Category" },
    },
  }),
});
const data = await resp.json();
console.log(data.result);

3. Read the response

A real response (trimmed):

{
  "result": {"merchant": "Sunrise Cafe", "total": 33000, "paid": true, "category": "food"},
  "mode": "text",
  "steps": 6,
  "seconds": 4.164,
  "model": "trusttyped-v1.0.0",
  "confidence": {"merchant": 1.0, "total": 1.0, "paid": 0.9998, "category": 1.0},
  "needs_review": [],
  "rejected": null,
  "trace": [],
  "provenance": {"library_version": "0.3.2", "model_revision": "7479749d…",
                 "schema_hash": "sha256:ed33…", "context_hash": "sha256:d8a5…"}
}
Field What to do with it
result The values, one per schema field, in the types you asked for.
needs_review Fields a human should check before you rely on them. Empty = all confident.
confidence Per field, 0–1. See Confidence and review.
rejected Set when a rule stopped the request (for example "number must have 16 digits").
trace Every rule, API call and computation that ran, for debugging and audit.
provenance What produced the result (model revision, hashes of the input), for audit.

The full list is in the response object.

4. Next steps

Playground

The deployment also serves an interactive playground at /ui/ with ready-made presets for every feature on this site.