Quickstart
Send your first request and see what Contextwaise removes. It takes about five minutes and one HTTP call.
Before you start#
You need a Contextwaise API key (keys open at launch) and an application that sends context to an LLM: retrieved documents, search results, tool output or memory. No SDK is required for the API; any HTTP client works.
Your first request#
Get an API key
API keys open at launch. Join the waitlist and we'll send yours first. A key starts with
sw_live_and is shown only once.Store it as an environment variable
Keep the key on the server, never in client-side code or in your repository.
.envSend the question and its context
Pass the user's question as
queryand each piece of context as a candidate. Give each candidate asourcelabel so the dashboard can break savings down by source.Send the returned context to your model
Use
contextin place of your original candidates when you build the prompt. Kept items come back in the order you sent them.
Read the response#
Every response carries the context to send and a report that explains each decision:
context: the items worth sending, in your order.report.tokens: input tokens before and after, and the share saved.report.items: every candidate with its relevancescore(0 to 3), whether it waskept, and thereason.
The same request appears in the dashboard under Requests, where you can open it and read every kept and removed item.
Using an agent framework?#
If your app runs an agent loop, in TypeScript or Python, the Agent SDK trims every tool result the moment it returns: one line for the Vercel AI SDK, one call per turn on the Anthropic and OpenAI SDKs, or one call per tool result in any loop.
Where to go next#
- RAG and retrieved context: wire it into your retrieval step.
- Conversations and prompt caching: the one rule for chat apps.
- API reference: every field of the request and the report.