Authenticate once
Send only your TrimLayer project key to the optimize endpoint.
Developer hub
Ask TrimLayer for a smaller verified context, then use that value in the model, RAG pipeline or agent you already own.
const result = await fetch("https://api.trimlayer.com/v1/context/optimize", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-TrimLayer-Key": process.env.TRIMLAYER_KEY!
},
body: JSON.stringify({
content: longSourceContext,
query: "Which conditions apply?",
domain: "auto"
})
}).then((response) => response.json());
// Use this in your own LLM, RAG or agent call.
const contextForNextStep = result.optimized_context;Quick integration
Send only your TrimLayer project key to the optimize endpoint.
Use optimized_context; protected results include the original unchanged.
Your application decides whether to send the result to a model, store it or retrieve exact evidence.