# Upscale a picture

`POST /v1/images/upscale` — The same picture, two or four times larger, its detail restored.

- Base URL: https://eroq.ai/v1
- Auth: `Authorization: Bearer eroq_sk_…` (create keys at https://eroq.ai/dashboard/keys)
- Credits: 6 credits ×2 · 8 credits ×4

eroq Upscale on a picture (our own GPUs, the diffusion upscaler of our clips): `scale` 2 (default) or 4, the long side capped at 4096 px — a picture already past it answers `400 already_sharp` before billing. The picture comes as for Remove background: a `file` part, or JSON `image` (`upload:<id>` / `creation:<id>`).

Same answer and timing as Remove background: the request holds while the GPU works (seconds when warm), else `202` with a job to poll on GET /v1/images/generations/{id}. A failure refunds itself. `tools["upscale"]` on GET /v1/engines says whether it is live.

The CDN serves pictures past 1600 px wide at 1600 px in browsers: the full-size file is the one in your library (download it from the studio, or read the creation with GET /v1/creations/{id}).

## POST /v1/images/upscale

The same picture, two or four times larger, its detail restored.

### Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `file` | file | no | The picture (multipart). Or send `image` instead. |
| `image` | string | no | A picture of yours: `upload:<id>` or `creation:<id>`. |
| `scale` | integer | no | `2` (default) or `4`. |
| `folder_id` | string | no | Library folder the result lands in — one of yours. |
| `private` | boolean | no | Keep nothing: the picture comes back inline, once. |

### Example request

```bash
curl https://eroq.ai/v1/images/upscale \
  -H "Authorization: Bearer $EROQ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "image": "creation:3f1c2b9a-…",
  "scale": 2
}'
```

```javascript
const res = await fetch('https://eroq.ai/v1/images/upscale', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.EROQ_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "image": "creation:3f1c2b9a-…",
    "scale": 2
  }),
})
console.log(await res.json())
```

```python
import os, requests

res = requests.post(
    "https://eroq.ai/v1/images/upscale",
    headers={"Authorization": f"Bearer {os.environ['EROQ_API_KEY']}"},
    json={
        "image": "creation:3f1c2b9a-…",
        "scale": 2
    },
)
print(res.json())
```

```go
package main

import (
	"fmt"
	"io"
	"net/http"
	"os"
	"strings"
)

func main() {
	body := strings.NewReader(`{
  "image": "creation:3f1c2b9a-…",
  "scale": 2
}`)

	req, _ := http.NewRequest("POST", "https://eroq.ai/v1/images/upscale", body)
	req.Header.Set("Authorization", "Bearer "+os.Getenv("EROQ_API_KEY"))
	req.Header.Set("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	out, _ := io.ReadAll(res.Body)
	fmt.Println(string(out))
}
```

### Response


```json
{
  "id": "8c2f0a91-…",
  "object": "image.generation",
  "created": 1763740800,
  "model": "eroq-upscale",
  "status": "succeeded",
  "generation_ms": 11800,
  "data": [{ "url": "https://cdn.eroq.ai/…/image.png?token=…&expires=…", "content_type": "image/png", "library_id": "…" }],
  "usage": { "credits_spent": 6, "credits_remaining": 971 }
}
```

---
Canonical: https://eroq.ai/docs/images-upscale · Index for agents: https://eroq.ai/llms.txt · OpenAPI: https://eroq.ai/openapi.json
