> For the complete documentation index, see [llms.txt](https://docs.thetpa.ai/deai-tokenized-processing-architecture/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.thetpa.ai/deai-tokenized-processing-architecture/tpai-chain-full-architecture/how-an-ai-job-flows.md).

# How an AI job flows

An AI job touches the chain twice, once to check the rules and once to settle, while the AI work itself runs off chain.

<figure><img src="https://2937558112-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7bJZTBY9aHXlYfgnTW9F%2Fuploads%2FdomfH4XisPf2wWHyQWuo%2Fai-job-flow.png?alt=media" alt="AI job flow · 6 steps across 3 lanes"><figcaption><p>AI job flow · 6 steps across 3 lanes</p></figcaption></figure>

The result goes straight to the user; only the receipt and the payment go through the chain. When the GPU pool is busy, PING priority and the fair-share cap decide the order in step 2.

**Pre-paid sessions.** Users (or agents) fund a session balance on chain once; AI calls then run without waiting for the chain. Each call is metered by tokens and GPU time and paid from the session balance, and calls are settled on chain in batches with their receipts and the payment split. Unused balance returns to the user. \[Preferred]
