Home / Blog / OpenAI

OpenAI · ChatGPT · GPT

How to save tokens on the OpenAI and ChatGPT API

You are billed for the text you send, not only the answer you wanted. Tokand sits in front of the OpenAI-compatible call, drops junk from the request, and leaves the model alone.

Where ChatGPT and GPT API bills actually come from

A short question is cheap. The bill grows when the same thread carries old tool output, repeated file dumps, and system text the model already saw. OpenAI prices input tokens and output tokens separately. Cutting input tokens is the lever that does not require a cheaper model. Official pricing is on the OpenAI pricing page.

What to change in the client

Point the OpenAI SDK at Tokand. The rest of the call stays the same: model name, messages, tools, and your own API relationship if you bring your own key.

baseURL: "https://api.tokand.com/v1"

Python is the same idea: construct OpenAI with that base URL. A one-off path is tokand(request, sender). Tokand shrinks the request. Your code still sends it. Tokand does not wrap the model client.

What stays the same

When a short prompt should skip the filter

A one-paragraph prompt with nothing to cut should pass through unchanged and record zero saved. A short question sitting on a fat tool trace should still go through Tokand. The gate is the size of the request, not the length of the sentence.

Related searches this page answers

Install steps: quickstart. ChatGPT setup: ChatGPT guide. Codex: Codex guide.