> For the complete documentation index, see [llms.txt](https://docs.podtorrent.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.podtorrent.com/running-a-node/cached-prompts.md).

# Advertise cached prompts

If clients send the same long opening every time, you can keep it processed in your engine's prefix cache and tell the network. Requests that start with it then come to you first, and you do less work per request.

## 1. Get the prompt id

The id is the SHA-256 of the opening messages. Clients get it from `POST /v1/prompts` and share it with you, or the PodTorrent team can give it to you. You can also compute it yourself; the formula is in the [protocol spec](https://github.com/Munerate/podtorrent-agent/blob/main/spec/protocol-v0.md#cached-prompts).

## 2. Add it to your manifest

```json
{
  "id": "meta-llama/llama-3.3-70b",
  "slots": 32,
  "cached_prompts": [
    { "name": "support-bot-v3", "sha256": "9c1e…", "tokens": 1800 }
  ]
}
```

`name` is just a label for you. `tokens` is optional.

## 3. Warm your cache

Make sure your engine has prefix caching turned on, and send it the opening once so it's ready. How to do that depends on your engine.

## Billing

Cached input tokens are billed at your `per_mtok_in_cached` price. The count comes from your engine's `usage.prompt_tokens_details.cached_tokens`; if your engine doesn't report it, all input tokens are billed at the normal price.


---

# 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.podtorrent.com/running-a-node/cached-prompts.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.
