---
title: Models
description: "Keep the complete model file: executable content and the questions that define its answers."
icon: box
---

## Keep the complete model

The response's `model` is a portable JSON object with two parts:

| Part | Purpose |
|---|---|
| `content` | Executable rules: named inputs, decision tables, expressions and reusable functions. |
| `questions` | The answer contract: which decisions to return, their question types and criteria. |

Keep **both parts** when saving or downloading a model. The [model format](/docs/resources/model-format)
describes `content`; [Questions](/docs/concepts/questions) describes the answer contract.

When you start with questions or a policy, AI drafts the rules. Inspect them and run boundary cases before
your application uses them. Validation checks the model's structure and types; your tests check whether
those rules implement the intended policy.

## Submit the model on every execution

Load the complete file and send it alongside `state`:

```js
const model = JSON.parse(await readFile("invoice-model.json", "utf8"));
const body = JSON.stringify({ model, state });
// POST body to /v1/systemone. See Call it from code for the complete client.
```

For the same executable rules and validated input values, the engine produces the same answers and rule
trace. Matching JSON skips generation and input extraction. System One input billing includes the complete
request, including the model.

A name, hash or receipt id is not a saved-model lookup key. Send the rules themselves, rather than asking
the service to retrieve them.

## Revise the rules without changing your running application

Send the current `content`, its `questions` as `output`, and a change prompt to
`POST /v1/systemtwo/models`. Save the returned complete `model` to a separate file.

Review the executable content and the answer contract. The question text is not a substitute for the
rules: submitting questions alone asks aityx to generate or reuse a model again. After a revision, keep and
submit the returned model to execute the revised rules.

Compare the same cases against both files before changing the definition your application sends.
You control deployment and rollback through your own files or repository. See
[Compare revised rules](/docs/guides/revise-and-replay).

## What the temporary cache does

Questions-based calls may reuse a generated model. Every such call uses System Two pricing, even on a
cache hit. The cache is disposable: eviction or a restart can cause a new generation. It does not pin
the rules or store your test cases and receipts.

Keep the complete model you reviewed for repeatable execution. The preview has no saved-model library or
server-managed version history. In the console, download the model before leaving the session and upload
it to continue later.
