LogosType and the cost of tokens that coding agents write The ThinkIac project reported a 42% reduction in source-writing tokens after migrating one module from JavaScript to its declarative LogosType language, which derives tool parameter and return types from the function signature instead of requiring agents to generate verbose JSDoc metadata. Because output tokens cost five times uncached input tokens on OpenAI and Claude APIs, the project estimates a 5,000-token JavaScript generation would drop to about 2,900 tokens, saving roughly $0.076 per generation on GPT-6.2 Astra after subtracting $0.008 for the 1,000 instruction tokens needed to teach the model the syntax. When a coding agent reads a test log, the log counts as input. When the agent writes a tool definition into a file, the code counts as output. On the APIs below, an output token costs five times as much as an uncached input token. Several token-saving tools for Claude Code, Codex, and other agent harnesses focus on input. RTK filters terminal output, Context Mode indexes tool results for targeted retrieval, and Headroom compresses data such as logs and JSON before it reaches the model. RTK https://github.com/rtk-ai/rtk · Context Mode https://github.com/mksglu/context-mode · Headroom https://github.com/headroomlabs-ai/headroom Caveman works on a different part of the bill. It steers the agent toward shorter messages during the task and in the final response. Any effect on internal reasoning tokens needs to be measured for the model and workload in use. Caveman https://github.com/JuliusBrussee/caveman Standard API rates in US dollars per million tokens, using uncached input and short-context rates where applicable. OpenAI API pricing https://developers.openai.com/api/docs/pricing · Claude API pricing https://platform.claude.com/docs/en/about-claude/pricing | Model | Input | Output | Output / input | |---|---|---|---| | GPT-6.2 Astra | $8 | $40 | 5× | | GPT-6.2 Sol | $2 | $10 | 5× | | GPT-6.1 Terra | $1 | $5 | 5× | | Claude Fable 5.2 | $8 | $40 | 5× | | Claude Opus 5.5 | $4 | $20 | 5× | When an agent writes a package with several tools, each declaration adds to the cost of generating the package. Some of those tokens describe the tool's contract, including its name, parameters, and return type. A language can put that information directly in the declaration. Here's a Celsius-to-Fahrenheit tool using ThinkIac's JavaScript convention. An exported function handles the call, and JSDoc carries the registration metadata. / @register tool toFahrenheit @description Converts Celsius to Fahrenheit @param {number} celsius - Temperature in degrees Celsius @returns {number} / export function toFahrenheit { celsius } { return celsius 9 / 5 + 32 } LogosType is a declarative resource language based on CoffeeScript 2. In a host with a tool provider, the same tool can be written in an index.type file. php tool toFahrenheit = celsius: number : number - @description "Converts Celsius to Fahrenheit" @param celsius - Temperature in degrees Celsius celsius 9 / 5 + 32 The tool declaration identifies the resource, and the compiler derives the parameter and return types from the signature. The directives carry the descriptions. The compiler emits JavaScript and metadata that the host can use to register the tool. That shortens the source the agent has to generate. LogosType compiler documentation https://github.com/ThinkIac/LogosType api-do-compilador The ThinkIac project reported a 42% reduction in source-writing tokens when it migrated one module from JavaScript to LogosType. The percentage describes that module's source. The calculation below applies it to an illustrative generation size. The model needs instructions for writing .type files. If those instructions add 1,000 uncached input tokens across a task, they cost $0.008 on GPT-6.2 Astra. The break-even point is 200 output tokens saved . Suppose the JavaScript version would take 5,000 output tokens. Applying the observed 42% reduction brings the estimate to 2,900 tokens. The 2,100 output tokens saved are worth $0.084 on Astra. Subtract the $0.008 for instructions and the estimated saving is $0.076 for that generation. OpenAI API pricing https://developers.openai.com/api/docs/pricing · Claude API pricing https://platform.claude.com/docs/en/about-claude/pricing A small edit can fall below the break-even point. Generating several resources gives the agent more code over which to spread the instruction cost. For an end-to-end comparison, count instructions resent across model calls, code read back into context, and tokens spent on corrections. LogosType was created for ThinkIac , a runtime for composable agents. ThinkIac is where the language is used to declare package resources, with providers supplied by the host. The compiler can also be used independently. Another host can compile .type files, read their declarations, and supply its own providers. LogosType https://github.com/ThinkIac/LogosType · ThinkIac https://github.com/ThinkIac/ThinkIac This article was drafted and translated using AI from a brief and technical feedback supplied by the ThinkIac project.