---
title: JSON output
description: The fields of each line --json prints, for answered, not-sure and failed answers, and the answer and details of each of the ten functions.
goal: A developer or agent reading --json output finds what each field holds, for every status and every function.
reader: A developer or agent who parses thinkthen --json output, or the same answers from an SDK
kind: reference
verified: 2026-11-03
head:
  - tag: title
    content: "JSON output: every field --json prints"
---

# JSON output

With `--json`, ThinkThen prints one line of JSON for each text it judges. Each line says whether it answered, was not sure or failed, with the answer, its probability and its details; the SDKs return the same fields.

`jq .` spreads each line out so you can read it. A yes:

```sh
echo 'Please refund my order.' |
  thinkthen decide --json \
    'Does the customer request a refund?' | jq .
```

Output

```text
{
  "function": "decide",
  "position": 1,
  "source": {
    "question_identity": "5132ed9868967585162c6dbe9857c49aa3fabb369a607b921f7645bc225b8bf2",
    "backend": "systemone",
    "model": "jev-1.13.0"
  },
  "status": "answered",
  "answer": true,
  "probability": 0.99
}
```


## The fields on every line

| Field | What it holds |
| --- | --- |
| `function` | The function that answered, such as `decide`. |
| `position` | Where the text came in the input, counting from 1. |
| `id` | The `id` of the JSON line, when it has one. A string or a whole number, exactly as it was. |
| `source` | Which question was asked, and where. See below. |
| `status` | `answered`, `unsure` for not sure, or `failed`. |

`source` holds:

| Field | What it holds |
| --- | --- |
| `question_identity` | A fingerprint of the question. The same question asked the same way has the same fingerprint. |
| `backend` | The service that answered, such as `systemone`. |
| `model` | The model that answered. |
| `name` | The name from `--name`, when you gave one. |

## The fields for each status

**`answered`** adds `answer`, and `probability` and `detail` for the functions that have them.

**`unsure`** adds `probability`, which fell short of your bar for a sure answer, and `detail` for the functions that have it. It has no `answer`.

```sh
echo 'I was charged twice for one invoice.' |
  thinkthen decide --low 0.2 --high 0.8 --json \
    'Does the customer request a refund?' | jq .
```

Output

```text
{
  "function": "decide",
  "position": 1,
  "source": {
    "question_identity": "fee570dbf2ecad88b2e5569e5b2919263a04593aad817a9a77c2bd6504fb7235",
    "backend": "systemone",
    "model": "jev-1.13.0"
  },
  "status": "unsure",
  "probability": 0.7
}
```


Not sure: the chance of yes falls between the bars of 0.2 and 0.8.

**`failed`** adds `error`, with its `code` and `message`, and `http_status` when the service sent one. It has no `answer`. [Troubleshooting](/reference/troubleshooting/) lists each code.

```sh
echo '{"id":"a4"}' |
  thinkthen decide --from jsonl --field /text --json \
    'Does the customer request a refund?' | jq .
```

Output

```text
{
  "function": "decide",
  "position": 1,
  "id": "a4",
  "source": {
    "question_identity": "7cd1876e82c67b9664acdb9d3ffea1967cb0a1d895c05e75aa5702006c60036a",
    "backend": "systemone",
    "model": "jev-1.13.0"
  },
  "status": "failed",
  "error": {
    "code": "record.missing",
    "message": "the record holds nothing at /text"
  }
}
```

```text
thinkthen: record.missing: position 1 id a4 file -: the record holds nothing at /text
```


Failed: the line has no `text` field to judge.

## The answer and details of each function

| Function | `answer` | `detail` |
| --- | --- | --- |
| [decide](/functions/decide/) | `true` or `false` | none |
| [filter](/functions/filter/) | `true` or `false` | none |
| [choose](/functions/choose/) | One of your choices | `labels`: the chance of each choice |
| [tag](/functions/tag/) | A list of the labels that fit | `labels`: the chance of each label |
| [score](/functions/score/) | A number from 0 to 1 along your levels | `levels`: the chance of each level, in your order |
| [rank](/functions/rank/) | The text's place, counting from 1 | `levels`: the chance of each level, in your order |
| [find](/functions/find/) | The part that answers, as `text`, `start` and `end`, or `null` when none does | none |
| [recognize](/functions/recognize/) | A list of names, each with `text`, `start`, `end`, `kind` and `probability` | `names` and `pieces`: the chance of each kind for each name and piece |
| [relate](/functions/relate/) | A list of links, each with `source`, `relation`, `target` and `probability` | `names`, and `pairs`: the chance of each allowed link |
| [annotate](/functions/annotate/) | An object with one answer per question name | none |

`start` and `end` count characters from 0, and `end` is the position after the last character. In relate, `source` and `target` are names, each with `text`, `start`, `end` and `kind`, and `either` is `true` when the link can go either way.

Each answer inside annotate has the `function`, `status`, `answer`, `probability`, `detail` and `error` fields of its own function, without `position`, `id` or `source`.

## The extra fields from filter

filter adds two fields on the command line. `item` holds the text or JSON line it judged, and `kept` is `true` for a line it keeps.

## Next

[JSON Lines](/command-line/json-lines/) shows how to keep your own fields and add the answer with `--into`.
