Create compression
Shorten a context and prompt into one prompt to send to another model.
Authentication
AuthorizationBearer
Your production key sent as a bearer token.
Request
This endpoint expects an object.
model
Compression model ID, for example scaledown/compress.
context
Background text to compress. Can't be blank.
prompt
The question or instruction the context should be shortened for. Can't be blank.
rate
auto, or the share of tokens to remove, between 0 and 1.
vendor
Optional execution vendor pin.
customer
Optional customer UUID to scope the key, budget, and usage to.
Response
Successful Response
model
Model that answered.
vendor
Vendor that served the request.
compressed_prompt
The context, shortened to what’s relevant to prompt. Send it with your prompt to the next model.
usage
Token usage for a compression request. Input is the original tokens.
object
original_tokens
Tokens before compression.
compressed_tokens
Tokens in compressed_prompt.
compression_ratio
compressed_tokens divided by original_tokens.
Errors
422
Unprocessable Entity Error