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

# Quickstart

> Remove your first background in under 2 minutes

## 1. Get Your API Key

<Steps>
  <Step title="Create an Account">
    Go to [dash.poof.bg](https://dash.poof.bg) and sign up with your email, Google, GitHub, GitLab or Microsoft.
  </Step>

  <Step title="Copy Your API Key">
    Your API key is displayed on the dashboard. It starts with `pk_`.
  </Step>

  <Step title="Keep It Secret">
    Treat your API key like a password. Never commit it to version control or expose it in client-side code.
  </Step>
</Steps>

## 2. Make Your First Request

Choose your preferred method:

<Tabs>
  <Tab title="cURL">
    ```bash theme={null}
    curl -X POST https://api.poof.bg/v1/remove \
      -H "x-api-key: pk_your_api_key" \
      -F "image_file=@input.jpg" \
      -o output.png
    ```
  </Tab>

  <Tab title="Python">
    Install the SDK:

    ```bash theme={null}
    pip install poofbg
    ```

    Remove a background:

    ```python theme={null}
    from poof import Poof

    client = Poof(api_key="pk_your_api_key")

    # From a file
    result = client.remove_background("input.jpg")
    result.save("output.png")

    # From bytes
    with open("input.jpg", "rb") as f:
        result = client.remove_background(f.read())
        result.save("output.png")
    ```
  </Tab>

  <Tab title="TypeScript">
    Install the SDK:

    ```bash theme={null}
    npm install @poof-bg/js
    ```

    Remove a background:

    ```typescript theme={null}
    import { Poof } from '@poof-bg/js';
    import fs from 'fs/promises';

    const poof = new Poof({ apiKey: 'pk_your_api_key' });

    const result = await poof.removeBackground('input.jpg');
    await fs.writeFile('output.png', Buffer.from(result.data));
    ```
  </Tab>
</Tabs>

## 3. See the Result

Your output file now contains the image with the background removed:

| Before | After |
| - | - |
| Original photo with background | Transparent PNG, background removed |

<Check>
  **Success!** You've made your first background removal request.
</Check>

## What's Next?

<CardGroup cols={2}>
  <Card title="Customize Output" icon="sliders" href="/api-reference/remove-background">
    Learn about formats, sizes, and background colors
  </Card>

  <Card title="Check Usage" icon="chart-line" href="/api-reference/account">
    Monitor your credit usage via the API
  </Card>

  <Card title="Handle Errors" icon="triangle-exclamation" href="/errors/list">
    Implement robust error handling
  </Card>

  <Card title="Explore Integrations" icon="puzzle-piece" href="/integrations/overview">
    Use our official SDKs and integrations
  </Card>
</CardGroup>

## Common Options

Here are some popular parameter combinations:

```bash theme={null}
# Get a JPEG with white background
curl -X POST https://api.poof.bg/v1/remove \
  -H "x-api-key: YOUR_API_KEY" \
  -F "image_file=@photo.jpg" \
  -F "format=jpg" \
  -F "channels=rgb" \
  -F "bg_color=#ffffff" \
  -o result.jpg

# Get a small preview (faster; every successful request costs 1 credit regardless of size)
curl -X POST https://api.poof.bg/v1/remove \
  -H "x-api-key: YOUR_API_KEY" \
  -F "image_file=@photo.jpg" \
  -F "size=preview" \
  -o preview.png

# Crop to subject bounds
curl -X POST https://api.poof.bg/v1/remove \
  -H "x-api-key: YOUR_API_KEY" \
  -F "image_file=@photo.jpg" \
  -F "crop=true" \
  -o cropped.png

# Get just the grayscale alpha mask
curl -X POST https://api.poof.bg/v1/remove \
  -H "x-api-key: YOUR_API_KEY" \
  -F "image_file=@photo.jpg" \
  -F "channels=alpha" \
  -o mask.png
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.