# Tools.FAST API

**One API key. Every tool.**

Tools.FAST is a network of single-purpose file utilities. Each tool does one job and does it well. Your API key works across the entire network, drawing from a single credit wallet.

## The network

Base URL: `https://api.tools.fast`

| Tool | Path prefix | What it does |
|------|-------------|--------------|
| [**Convert.FAST**](https://convert.fast/api/docs) | `/convert` | File conversion: images, documents, audio, video, fonts, ebooks, archives. 200+ format pairs. |
| [**Compress.FAST**](https://compress.fast/api/docs) | `/compress` | File compression: images, PDFs, Word, PowerPoint. Lossy and lossless. |

More tools are coming. Your API key will work with all of them automatically.

## Unified API key

Every tool in the network authenticates with the same `X-Fast-Api-Key` header. Create one key at [accounts.tools.fast](https://accounts.tools.fast/account/login) and use it everywhere:

<!-- code-tabs:start default=curl -->
### cURL
```bash
# Convert a file
curl -X POST "https://api.tools.fast/convert" \
  -H "X-Fast-Api-Key: fast_prod_your_key_here" \
  -F "file=@photo.heic" \
  -F "targetFormat=jpg"

# Compress a file
curl -X POST "https://api.tools.fast/compress" \
  -H "X-Fast-Api-Key: fast_prod_your_key_here" \
  -F "file=@image.png"
```

### PowerShell
```powershell
# Convert a file
Invoke-RestMethod -Method Post "https://api.tools.fast/convert" `
  -Headers @{ "X-Fast-Api-Key" = "fast_prod_your_key_here" } `
  -Form @{ file = Get-Item "photo.heic"; targetFormat = "jpg" }

# Compress a file
Invoke-RestMethod -Method Post "https://api.tools.fast/compress" `
  -Headers @{ "X-Fast-Api-Key" = "fast_prod_your_key_here" } `
  -Form @{ file = Get-Item "image.png" }
```
<!-- code-tabs:end -->

## How it works

Every tool in the network follows the same async pattern:

1. **Submit** a file via `POST /{tool}` -- you get back a job ID
2. **Poll** the job status via `GET /{tool}/job/{id}` until it reaches `Succeeded`
3. **Download** the result via `GET /{tool}/job/{id}/download`

Credits are deducted at submission time. If a job fails, credits are automatically refunded.

### File retention

Output files are available for download for **1 hour** after job completion, then automatically deleted. Download your results promptly or re-submit the job.

## Quick examples

### Convert an image

<!-- code-tabs:start default=curl -->
### cURL
```bash
# Submit
JOB_ID=$(curl -sS -X POST "https://api.tools.fast/convert" \
  -H "X-Fast-Api-Key: $API_KEY" \
  -F "file=@photo.heic" \
  -F "targetFormat=jpg" | jq -r '.id')

# Poll until done
while true; do
  STATUS=$(curl -sS "https://api.tools.fast/convert/job/${JOB_ID}" \
    -H "X-Fast-Api-Key: $API_KEY" | jq -r '.status')
  [ "$STATUS" = "Succeeded" ] && break
  sleep 1
done

# Download
curl -sS "https://api.tools.fast/convert/job/${JOB_ID}/download" \
  -H "X-Fast-Api-Key: $API_KEY" -o photo.jpg
```

### PowerShell
```powershell
# Submit
$job = Invoke-RestMethod -Method Post "https://api.tools.fast/convert" `
  -Headers @{ "X-Fast-Api-Key" = $env:API_KEY } `
  -Form @{ file = Get-Item "photo.heic"; targetFormat = "jpg" }

# Poll until done
do {
  $status = Invoke-RestMethod "https://api.tools.fast/convert/job/$($job.id)" `
    -Headers @{ "X-Fast-Api-Key" = $env:API_KEY }
  Start-Sleep -Seconds 1
} while ($status.status -ne "Succeeded")

# Download
Invoke-RestMethod "https://api.tools.fast/convert/job/$($job.id)/download" `
  -Headers @{ "X-Fast-Api-Key" = $env:API_KEY } -OutFile "photo.jpg"
```
<!-- code-tabs:end -->

### Compress a PDF

<!-- code-tabs:start default=curl -->
### cURL
```bash
# Submit
JOB_ID=$(curl -sS -X POST "https://api.tools.fast/compress" \
  -H "X-Fast-Api-Key: $API_KEY" \
  -F "file=@report.pdf" | jq -r '.id')

# Poll until done
while true; do
  STATUS=$(curl -sS "https://api.tools.fast/compress/job/${JOB_ID}" \
    -H "X-Fast-Api-Key: $API_KEY" | jq -r '.status')
  [ "$STATUS" = "Succeeded" ] && break
  sleep 1
done

# Download
curl -sS "https://api.tools.fast/compress/job/${JOB_ID}/download" \
  -H "X-Fast-Api-Key: $API_KEY" -o report-compressed.pdf
```

### PowerShell
```powershell
# Submit
$job = Invoke-RestMethod -Method Post "https://api.tools.fast/compress" `
  -Headers @{ "X-Fast-Api-Key" = $env:API_KEY } `
  -Form @{ file = Get-Item "report.pdf" }

# Poll until done
do {
  $status = Invoke-RestMethod "https://api.tools.fast/compress/job/$($job.id)" `
    -Headers @{ "X-Fast-Api-Key" = $env:API_KEY }
  Start-Sleep -Seconds 1
} while ($status.status -ne "Succeeded")

# Download
Invoke-RestMethod "https://api.tools.fast/compress/job/$($job.id)/download" `
  -Headers @{ "X-Fast-Api-Key" = $env:API_KEY } -OutFile "report-compressed.pdf"
```
<!-- code-tabs:end -->

### Check your credits

<!-- code-tabs:start default=curl -->
### cURL
```bash
curl -sS "https://api.tools.fast/convert/entitlements/me" \
  -H "X-Fast-Api-Key: $API_KEY"
```

### PowerShell
```powershell
Invoke-RestMethod "https://api.tools.fast/convert/entitlements/me" `
  -Headers @{ "X-Fast-Api-Key" = $env:API_KEY }
```
<!-- code-tabs:end -->

```json
{
  "planId": "pro",
  "planName": "Pro",
  "tier": "pro",
  "totalCredits": 12000
}
```

## Per-tool documentation

Each tool publishes its own detailed API reference with converter-specific options, schemas, and examples:

- [Convert.FAST API Docs](https://convert.fast/api/docs) -- All 200+ format pairs, conversion options, CLI wrapper
- [Compress.FAST API Docs](https://compress.fast/api/docs) -- Compression strategies, quality settings

## Get started

1. [Create your API key](https://accounts.tools.fast/account/login) at accounts.tools.fast
2. Follow the [Getting Started](getting-started.md) guide to make your first call
3. Read the [Authentication](authentication.md) guide for production setup
