Ora
All documentation

Docs / Questions & answers

Your own output shape

Add output to a request: any JSON, with references in double braces. The response then carries it under output, filled in, next to the usual answers.

{
  "model": "ora-fin",
  "state": {
    "symbol": "NVDA",
    "stop": 150,
    "shares": 100
  },
  "questions": {
    "pnl": "=(C - stop) * shares",
    "above": {
      "type": "bool",
      "ask": "=C > stop"
    },
    "below": {
      "type": "bool",
      "ask": "=C < stop"
    },
    "belief": "=C > stop",
    "r": {
      "type": "choice",
      "criteria": {
        "bull": "=C > stop",
        "bear": "else"
      }
    }
  },
  "output": {
    "ticker": "{{symbol}}",
    "session": "{{as_of}}",
    "risk": {
      "pnl": "{{pnl}}",
      "stop": "{{stop}}",
      "ok": "{{above}}",
      "no": "{{below}}",
      "how_sure": "{{belief}}"
    },
    "list": [
      "{{r}}",
      "{{r.confidence}}",
      "{{r.bull}}"
    ],
    "text": "P&L {{pnl|round}} on {{symbol}}",
    "rule": "{{pnl.rule}}",
    "fixed": 5,
    "flag": true,
    "nil": null
  }
}

A real response (other fields left out):

{
  "output": {
    "ticker": "NVDA",
    "session": "2026-11-02",
    "risk": {
      "pnl": 5206,
      "stop": 150,
      "ok": true,
      "no": false,
      "how_sure": 0.9463
    },
    "list": [
      "bull",
      0.892,
      0.946
    ],
    "text": "P&L 5206.0 on NVDA",
    "rule": "(C - stop) * shares",
    "fixed": 5,
    "flag": true,
    "nil": null
  }
}

What a reference can name

ReferenceGives
{{pnl}}A question's answer: the number, the belief, the true or false, the chosen option or the score level.
{{pnl.rule}}, {{regime.confidence}}, {{regime.bull}}A field of the answer. On a choice, an option's name gives its probability.
{{stop}}, {{state.stop}}A field of your state. A = formula gives its result. A question with the same name wins over {{stop}}.
{{symbol}}, {{as_of}}, {{model}}, {{now}}, {{answers}}The symbol, the session, the model you called, the time, and every answer.
{{pnl|round}}, {{up|pct}}, {{up|json}}Two decimals, a percent, or the value as JSON text.

Types

A value that is exactly one reference keeps its JSON type: "{{pnl}}" is a number, "{{above}}" a true or false, and a missing value is null. A reference inside longer text becomes text, and a null there is empty.

A bad reference

Every reference is checked before anything runs. A name this request doesn't have, or a field its answer can't have, is a 422 with nothing billed:

{
  "detail": [
    {
      "loc": [
        "body",
        "output"
      ],
      "msg": "Unknown reference {{nope}}. This request has questions: pnl; state fields: symbol. Also: symbol, model, as_of, now, answers.",
      "type": "output_error"
    }
  ]
}

The template counts as input tokens, like the rest of what you send. It can be up to 16 KB. It runs on ora-fin; the pinned version ora-fin-0.1.1 ignores it.

Create an account Open the Playground Everything here also lives in the console, next to your keys and usage.