> For the complete documentation index, see [llms.txt](https://docs.dapta.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.dapta.ai/flow-studio/ai-nodes/caching-and-savings.md). Agents can also search and read this documentation through its [MCP server](https://docs.dapta.ai/~gitbook/mcp).

# Caching and Savings

How cached input lowers the cost of AI node runs on Gemini and OpenAI, why Claude has no caching yet, and practical ways to spend fewer Dapta credits.

An AI node on **Dapta AI** is priced by the tokens the model reads and writes (see [AI node credits](https://docs.dapta.ai/flow-studio/ai-nodes/credits.md)). This page explains the discount you get when the provider reuses part of your prompt, and the settings that save the most credits.

***

## What caching is

Many flows send almost the same prompt on every run: the same instructions and examples, followed by a different record each time. Google and OpenAI keep the beginning of a recent prompt for a short time. When a new run starts with exactly the same text, they reuse it instead of reading it again, and report those tokens as **cached**.

Dapta charges cached tokens at the model's **cached input** price, which is much lower than the regular input price: 10 times lower on most Gemini and GPT models, 20 times lower on GPT-6.1 Sol, GPT-6.1 Terra and Gemini 4 Argon, and 2 times lower on the GPT-OSS models. You see the cached tokens of each run under **Last run**, next to **Tokens in** and **Tokens out**, and in `usage.cached_tokens` when **Response detail** is **Answer + details**.

You don't turn caching on, and Dapta doesn't turn it on for you: the provider decides, on every run, whether part of the prompt can be reused.

| Lab               | Caching today  | When it happens                                                                                                                                                                                                      |
| ----------------- | -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Google Gemini** | Yes, automatic | When a run starts with the same text as a recent run and that text is long enough. Google sets the minimum per model, for example 2,048 tokens on Gemini 2.5 Flash and 4,096 on Gemini 3.8 Flash and Gemini 4 Argon. |
| **OpenAI**        | Yes, automatic | When the beginning of the prompt repeats and the prompt has at least 1,024 tokens (GPT-5.6 and later). OpenAI keeps it at least 30 minutes on those models.                                                          |
| **Claude**        | Not yet        | Anthropic only caches when the request asks for it, and the Claude node doesn't ask today. Every input token is priced at the regular input price.                                                                   |

{% hint style="info" %}
Caching applies to **Dapta AI** and to **your own credential** alike. On your own credential, the discount shows up on your provider's bill instead of in Dapta credits.
{% endhint %}

### What caching saves: an example

A flow that sends a 10,000-token prompt (fixed instructions and a reference document, then the record) and gets a 500-token answer:

| Model                 |   No cache | First 8,000 tokens cached |
| --------------------- | ---------: | ------------------------: |
| GPT-5.6 Terra         | 52 credits |                24 credits |
| Gemini 3.5 Flash-Lite |  9 credits |                 5 credits |

With the cache, GPT-5.6 Terra reads 2,000 tokens at 4,000 credits per million, 8,000 at 400 and writes 500 at 24,000: 23.2 credits, rounded up to 24.

***

## How to help the cache

* **Put what never changes first.** Write the instructions, rules and examples at the start of the prompt or in the **System instruction**, and insert the variables from previous steps (`{{message}}`, `{{contact}}`) at the end. The provider reuses text from the start of the prompt up to the point where it first changes.
* **Keep that first part identical.** A date, a record id or a name near the top changes on every run and breaks the reuse for everything after it.
* **Runs close together cache better.** A flow that processes a batch of records benefits more than one that runs once an hour.

***

## Ways to spend fewer credits

#### 1. Pick the lightest model that does the job

The model is the biggest lever. For a 4,000-token prompt and a 500-token answer:

| Model                                  | Credits per run |
| -------------------------------------- | --------------: |
| Gemini 2.5 Flash-Lite                  |               2 |
| GPT-6 Luna                             |               2 |
| GPT-5.6 Luna                           |               3 |
| Gemini 3.5 Flash-Lite (Gemini default) |               5 |
| Claude Haiku 5.5                       |               7 |
| GPT-6.1 Terra                          |              13 |
| Claude Sonnet 5.5 (Claude default)     |              26 |
| GPT-5.6 Terra (OpenAI default)         |              28 |
| Gemini 4 Argon                         |              52 |

Classifying, extracting fields and short summaries usually work well on the light models. Test your prompt on a light model with a few real records, and move up only if the answers aren't good enough.

#### 2. Keep prompts short and focused

Every input token is billed on every run. Send only the fields the model needs, not a whole record or a full conversation history, and don't repeat the same instruction twice.

#### 3. Ask for short answers, in JSON or Structured output

Answer tokens cost 4 to 8 times more than input tokens, depending on the model. Ask for exactly what the next step needs. With **Output** set to **JSON** or **Structured**, the model returns only the fields you define, ready to use, so you don't need a second AI step or a Code node to clean up a long text answer. **Max answer length** sets a hard ceiling.

#### 4. Use thinking only when the task needs it

**Thinking**, **Reasoning effort** and **Extended thinking** are billed as answer tokens. On GPT-5.6 Terra, 1,500 thinking tokens take the example above from 28 to 64 credits. Turn them on for complex reasoning, not for classification or extraction.

#### 5. Skip records that don't need AI

Put a condition before the AI node so it only runs on the records that need it, such as messages that are not empty, or leads that are not already classified.

#### 6. Run on your own credential

With **My own credential**, Google, OpenAI or Anthropic bill the usage to your own account, at their price, and the node doesn't use Dapta credits. The **Backup model** is not available on your own credential.

***

## Check what you spend

* **Last run** in each node shows the tokens and the credits of its latest run.
* With **Response detail** on **Answer + details**, log `costs.credits` and `usage` to a sheet to see which flows use the most.
* Your balance and usage are under **Billing**.

{% content-ref url="/pages/A08OVFljHFrN7OWyWAdV" %}
[AI Node Credits](https://docs.dapta.ai/flow-studio/ai-nodes/credits.md)
{% endcontent-ref %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.dapta.ai/flow-studio/ai-nodes/caching-and-savings.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
