Skip to navigation

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.
modelstringRequired

Compression model ID, for example scaledown/compress.

contextstringRequired
Background text to compress. Can't be blank.
promptstringRequired
The question or instruction the context should be shortened for. Can't be blank.
rate"auto" or doubleOptionalDefaults to auto

auto, or the share of tokens to remove, between 0 and 1.

vendorstring or nullOptional
Optional execution vendor pin.
customerstring or nullOptional
Optional customer UUID to scope the key, budget, and usage to.

Response

Successful Response
modelstring
Model that answered.
vendorstring
Vendor that served the request.
compressed_promptstring

The context, shortened to what’s relevant to prompt. Send it with your prompt to the next model.

usageobject
Token usage for a compression request. Input is the original tokens.
object"compression"OptionalDefaults to compression
original_tokensinteger or nullOptional
Tokens before compression.
compressed_tokensinteger or nullOptional

Tokens in compressed_prompt.

compression_ratiodouble or nullOptional

compressed_tokens divided by original_tokens.

Errors

422
Unprocessable Entity Error