Understand the request
Recognize content type, declared task and structures that must remain intact.
Product
TrimLayer accepts source context and an optional task, protects required evidence, and returns optimized_context or the unchanged original. Your application controls the next model call.
The engine
The optimize API handles context only. It does not accept provider credentials or call a model on your behalf.
Recognize content type, declared task and structures that must remain intact.
Keep numbers, identifiers, instructions, code boundaries and required evidence outside lossy transforms.
Use task-scoped retrieval, verified transformations or exact recoverability according to policy.
Record the decision and return the original context when confidence or verification fails.
Structure aware
Text can be optimized without flattening the surrounding JSON, code or document structure.