compress which will return only the content for the agent to focus on.
Install
Usage
output is the completed tool output; goal is the agent’s overall task; focus is optional, output-specific guidance about what to preserve; and command is optional context only and is never executed. Skips, timeouts and API failures keep the original text. The SDK never runs or reruns tools.
You can optionally pass focus, command and signal to compress, or set timeoutMs when creating the client. result.usage contains local size, token and latency estimates. If you provide downstreamInputUsdPerMillionTokens, result.cost also estimates downstream input cost savings. These are estimates, not billing records.
Savings estimates
Pass a localsessionId to compression calls, then use getSavingsTotals(sessionId) for that session or getSavingsTotals() for the client-wide total. To include expected cached reuse, configure downstreamCachedInputUsdPerMillionTokens and pass estimatedCacheReadCount; the SDK reports uncached, cached and combined estimated savings. Session IDs and cache-read estimates are not sent to Everest.
request_id, timestamp, attempts and other bounded diagnostics may be present when the API supplies them. Their absence does not make a valid compression result fail.
Error-handling behavior
Whenresult.applied is false, result.text is the exact original output. Stable SDK failure reasons include sdk_authentication_failed, sdk_payload_too_large, sdk_timeout, sdk_cancelled, sdk_network_error, sdk_api_error and sdk_invalid_response. API skip reasons include below_threshold and raw_requested.
Keep EVEREST_API_KEY only on your trusted server. Do not put it in browser code, mobile apps, distributed CLIs, agent tool environments, source control or logs.
Using Everest directly with Codex instead of integrating a product? See the CLI guide.