# Reduce token usage in the OpenAI Agents SDK

> OpenAI Responses and Agents SDK already does one of the fixes for you, and 5 settings cut more. Agent type: building my own agent. From Use Fewer Tokens, by StackOne.

Last checked: 30 Nov 2026, against the vendor's own pages.

## What OpenAI Responses and Agents SDK already does
- **Prompt caching**: Long, repeated prefixes are cached automatically; keep the prefix stable. ([source](https://developers.openai.com/api/docs/guides/prompt-caching), read 30 Nov 2026)

## Settings that cut more in OpenAI Responses and Agents SDK
- **Load tools when needed**: defer_loading on your tools with the tool search tool (gpt-5.4 and later). ([source](https://developers.openai.com/api/docs/guides/tools-tool-search), read 30 Nov 2026)
- **Turn off tools you don't use**: tool_filter on the MCP server, with cache_tools_list. ([source](https://openai.github.io/openai-agents-python/mcp), read 30 Nov 2026)
- **Let the agent run code over results**: The programmatic_tool_calling tool, with allowed_callers: ["programmatic"] on your tools. ([source](https://developers.openai.com/api/docs/guides/tools-programmatic-tool-calling), read 30 Nov 2026)
- **Clear old tool results**: context_management: [{ type: "compaction", compact_threshold }] on Responses requests. ([source](https://developers.openai.com/api/docs/guides/compaction), read 30 Nov 2026)
- **Lower the effort setting**: reasoning.effort: "low" for routine calls; lower effort favors speed and fewer tokens. ([source](https://developers.openai.com/api/docs/guides/reasoning), read 30 Nov 2026)

## With StackOne
- **Deep Query**: Data Sync on the list action, then list_tickets_s1query({ filter, source, aggs })
- **Load tools when needed**: Add https://mcp.stackone.com/mcp; Advanced Tool Search is on by default
- **Ask for fewer fields**: source on any _s1query call, listing only the fields the answer uses
- **Keep live questions live**: Keep the live action next to the _s1query tool
- **Tool Policies**: Tool Policies on the project

## Other techniques for your own agent
- [Cap tool output](https://usefewertokens.com/techniques/output-caps/): fits. Reshape results with toModelOutput in the Vercel AI SDK.
- [Read web pages as text](https://usefewertokens.com/techniques/browser-snapshots/): fits. Text snapshots, or filtered web search and fetch on the Claude API.
- [Run side tasks on a smaller model](https://usefewertokens.com/techniques/smaller-subagents/): fits. Route side tasks to a smaller model.
- [Batch scheduled jobs](https://usefewertokens.com/techniques/batch/): fits. Message Batches API, 50% off.
- [Keep instruction files short](https://usefewertokens.com/techniques/instruction-files/): partly. Keep the system prompt short.
- [Measure what fills the window](https://usefewertokens.com/techniques/audit-commands/): partly. Log input tokens per request.

## Links
- Optimizer set to OpenAI Responses and Agents SDK: https://usefewertokens.com/harnesses/openai/
- How to reduce AI agent token usage: https://www.stackone.com/blog/reduce-ai-agent-token-usage/
