> ## Documentation Index
> Fetch the complete documentation index at: https://docs.scaledown.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

# Getting Started with ScaleDown: Your AI Cost Optimization Guide

**ScaleDown Team** • March 13, 2025 • 10 min read

ScaleDown is a context engineering platform that intelligently compresses AI prompts while preserving semantic integrity and reducing hallucinations. Our research-backed compression algorithms analyze prompt components—from reasoning chains to code contexts—and apply targeted optimization techniques that maintain output quality while dramatically reducing token consumption.

<img src="https://mintcdn.com/scaledown/VPd3dSQc9WuZYAwm/pictures/banner.png?fit=max&auto=format&n=VPd3dSQc9WuZYAwm&q=85&s=367c05f71d0be11acbe22d46206cffd5" alt="banner" width="842" height="356" data-path="pictures/banner.png" />

### Our Technology Stack:

1. Reasoning Module Optimization: Dynamic model merging based on query difficulty
2. Code Context Compression: AST-based semantic filtering for programming tasks
3. Multimodal Audio Processing: Semantic tokenization for audio-visual applications
4. Benchmark-Driven Validation: Rigorous quality preservation across evaluation frameworks

***

## What is ScaleDown?

ScaleDown is an intelligent prompt compression service that reduces your AI token usage while preserving the semantic meaning of your prompts. Think of it as a smart compression tool for your AI conversations. You get the same quality responses while paying significantly less.

***

## Before You Start

To use ScaleDown, you'll need:

* An API key
* Basic knowledge of making API calls
* Your existing AI prompts that you want to optimize

Ready to get your API key? [Contact our sales team](https://blog.scaledown.ai/blog/getting-started).

***

## Your First ScaleDown Request

### Step 1: Set Up Your Request

Here's how to make your first API call to compress a prompt.

<Tabs>
  <Tab title="Python" icon="python">
    ```python theme={null}
    import requests
    import json

    # ScaleDown API endpoint
    url = "[https://api.scaledown.xyz/compress/raw/](https://api.scaledown.xyz/compress/raw/)"

    # Your headers (replace YOUR_API_KEY with your actual key)
    headers = {
        'x-api-key': 'YOUR_API_KEY',
        'Content-Type': 'application/json'
    }
    ```
  </Tab>

  <Tab title="TypeScript" icon="typescript">
    ```typescript theme={null}
    // ScaleDown API endpoint
    const url = "[https://api.scaledown.xyz/compress/raw/](https://api.scaledown.xyz/compress/raw/)";

    // Your headers (replace YOUR_API_KEY with your actual key)
    const headers = {
        'x-api-key': 'YOUR_API_KEY',
        'Content-Type': 'application/json'
    };
    ```
  </Tab>

  <Tab title="JavaScript" icon="javascript">
    ```javascript theme={null}
    // ScaleDown API endpoint
    const url = "[https://api.scaledown.xyz/compress/raw/](https://api.scaledown.xyz/compress/raw/)";

    // Your headers (replace YOUR_API_KEY with your actual key)
    const headers = {
        'x-api-key': 'YOUR_API_KEY',
        'Content-Type': 'application/json'
    };
    ```
  </Tab>
</Tabs>

### Step 2: Configure Your Compression

Separate your context from your main prompt and set the compression rate to `"auto"` for the best results.

<Tabs>
  <Tab title="Python" icon="python">
    ```python theme={null}
    payload = {
        "context": "Context about your specific topic or instructions here",
        "prompt": "Your actual query or question here",
        "model": "gpt-4o",
        "scaledown": {
            "rate": "auto" # Automatic compression rate optimization
        }
    }
    ```
  </Tab>

  <Tab title="TypeScript" icon="typescript">
    ```typescript theme={null}
    interface CompressRequest {
        context: string;
        prompt: string;
        model: string;
        scaledown: {
            rate: string;
        };
    }

    const payload: CompressRequest = {
        context: "Context about your specific topic or instructions here",
        prompt: "Your actual query or question here",
        model: "gpt-4o",
        scaledown: {
            rate: "auto" // Automatic compression rate optimization
        }
    };
    ```
  </Tab>

  <Tab title="JavaScript" icon="javascript">
    ```javascript theme={null}
    const payload = {
        context: "Context about your specific topic or instructions here",
        prompt: "Your actual query or question here",
        model: "gpt-4o",
        scaledown: {
            rate: "auto" // Automatic compression rate optimization
        }
    };
    ```
  </Tab>
</Tabs>

### Step 3: Make the Request

With your request set up and configured, you can now execute the API call.

<Tabs>
  <Tab title="Python" icon="python">
    ```python theme={null}
    response = requests.post(url, headers=headers, data=json.dumps(payload))
    result = response.json()

    print(result)
    ```
  </Tab>

  <Tab title="TypeScript" icon="typescript">
    ```typescript theme={null}
    // Assuming you're using a fetch-like library (e.g., node-fetch)
    const response = await fetch(url, {
        method: 'POST',
        headers: headers,
        body: JSON.stringify(payload)
    });
    const result = await response.json();

    console.log(result);
    ```
  </Tab>

  <Tab title="JavaScript" icon="javascript">
    ```javascript theme={null}
    // Using Fetch API in a browser or Node.js environment
    fetch(url, {
        method: 'POST',
        headers: headers,
        body: JSON.stringify(payload)
    })
    .then(response => response.json())
    .then(result => {
        console.log(result);
    })
    .catch(error => console.error('Error:', error));
    ```
  </Tab>
</Tabs>

That's it! Your prompt is now compressed and ready to be used with your AI model.

***

## Understanding the Response Structure

The API response provides the compressed prompt along with useful metadata about the operation.

```json theme={null}
{
  "compressed_prompt": "Your optimized context here...",
  "model_used": "gpt-4o",
  "original_prompt_tokens": 150,
  "compressed_prompt_tokens": 65,
  "successful": true,
  "latency_ms": 2341,
  "request_metadata": {
    "compression_time_ms": 2341,
    "compression_rate": "auto",
    "prompt_length": 425,
    "compressed_prompt_length": 189
  }
}
```

### Supported Models

The `model` parameter in your request payload specifies the target AI model. Here are the currently supported models:

**Gemini**

* `gemini-2.5-flash`
* `gemini-2.5-pro`
* `gemini-2.5-flash-lite`
* `gemini-2.0-flash`

**OpenAI**

* `gpt-4o`
* `gpt-4o-mini`
