x402

Prompt Compress (x402)

Compress a prompt to be shorter while preserving semantic meaning. Specify target reduction percentage (10-70%).

get/x402/v2/prompt-compress

Request

  • Base URL: https://api.strale.io
  • URL: https://api.strale.io/x402/v2/prompt-compress
  • Auth: none required

Query parameters

prompt_textstring required
target_reduction_percentinteger

Default 30

Response

Success

original_tokensinteger
compressed_promptstring
compressed_tokensinteger
actual_reduction_percentinteger

Example response

{
  "original_tokens": 14,
  "removed_content": [
    "This is a test",
    "for"
  ],
  "compressed_prompt": "Automated capability testing input.",
  "compressed_tokens": 9,
  "preserved_instructions": [
    "Identify this as test input",
    "Recognize it's for automated capability testing"
  ],
  "actual_reduction_percent": 36
}

Changes

No recorded changes to this operation across all 1 revision of this API.