# Topaz Image Upscale Enhance and upscale images up to 4× with crisp, natural detail. - Model ID: `topaz/topaz-image-upscale/image-upscale` - Provider: Topaz Labs - Modality: image → image - Type: Image Upscale - Status: stable - Delivery: async - Output format: png ## Authentication Send your API key in the `X-API-Key` header. The same key reads the org balance at `GET https://api.dev.pika.art/billing/balance`, which is free to call and confirms the request can be paid for before you submit it. ## Endpoint ``` POST https://api.dev.pika.art/v1/media/topaz/topaz-image-upscale/image-upscale ``` ## Reference uploads To use a local file (image, audio, or video) as a model input, first request a presigned upload URL: `POST /v1/media/uploads` with the `X-API-Key` header and a JSON body `{ "content_type": "image/png", "size_bytes": 12345 }`, where `size_bytes` is the file's exact byte length. The response returns `upload_url` (temporary, valid for 5 minutes), `headers`, and `url` (the permanent Pika URL). PUT the file bytes to `upload_url` sending the returned `headers` verbatim — both `Content-Type` and `Content-Length` are signed, and storage returns a bare 403 if either is missing or differs. Then pass `url` into fields such as `image`, `image_url`, `end_image_url`, `image_urls`, `first_frame_image`, or `mask_image_url`. ## Generate `POST /v1/media/topaz/topaz-image-upscale/image-upscale` ```bash curl -X POST https://api.dev.pika.art/v1/media/topaz/topaz-image-upscale/image-upscale \ -H "X-API-Key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "image_url": "https://cdn.pika.art/v2/files/agent/d45537b3-7c9d-4d7e-99c4-af52f07b1599/topaz-rabbits-input.png", "upscale_factor": "x2", "model": "standard-v2" }' ``` ### Request body | Param | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `image_url` | string | yes | - | URL of the image to upscale. | | `upscale_factor` | enum | no | x2 | How much to enlarge the image: 2x, 3x, or 4x the original dimensions. | | `model` | enum | no | standard-v2 | Topaz enhancement model. Standard family (true-to-input upscaling): `standard-v2` (default, general purpose), `low-resolution-v2` (small/degraded sources), `cgi` (art and CGI), `high-fidelity-v2` (detail preservation), `text-refine` (text and shapes). Generative family (adds synthesized detail, priced higher): `redefine` (prompt-driven), `standard-max`, `wonder`, `wonder-3`, `wonder-3.5`. | | `output_format` | enum | no | - | Output image format; omitted keeps the provider default (jpeg). | | `crop_to_fill` | boolean | no | - | When the output aspect ratio differs, crop to fill the output dimensions instead of the default letterboxing. | | `subject_detection` | enum | no | - | Where enhancements are applied; omitted lets Topaz auto-configure. | | `face_enhancement` | boolean | no | - | Apply Topaz's face recovery model. When true, `face_enhancement_strength` and `face_enhancement_creativity` are required. Omitted lets Topaz auto-configure. | | `face_enhancement_strength` | number | no | - | Face recovery strength (requires face_enhancement=true). | | `face_enhancement_creativity` | number | no | - | Realistic (0) to creative (1) face recovery (requires face_enhancement=true). | | `sharpen` | number | no | - | Sharpening strength. | | `denoise` | number | no | - | Denoise strength. | | `fix_compression` | number | no | - | Compression-artifact removal strength (standard models only). | | `strength` | number | no | - | Overall model strength (standard models only); too high can look unrealistic. | | `prompt` | string | no | - | Describe the desired result for generative models (not wonder-3/wonder-3.5); descriptive statements work better than directives. Cannot be combined with autoprompt=true. | | `autoprompt` | boolean | no | - | Auto-generate the guidance prompt (generative models except wonder-3/wonder-3.5; replaces `prompt`). | | `creativity` | integer | no | - | Generative creativity 1-9 (generative models only); lower stays truest to the input. | | `texture` | integer | no | - | Generative texture detail 1-5 (generative models only); 1 at low creativity, 3 at higher. | | `detail` | boolean | no | - | Add post-render detail (generative models only). When true, `detail_strength` is required. | | `detail_strength` | number | no | - | Post-render detail strength (requires detail=true). | | `enhancement_strength` | enum | no | - | Enhancement level (wonder-3 and wonder-3.5 only); omitted lets Topaz auto-configure. | ### Accepted values | Param | Values | Default | | --- | --- | --- | | `upscale_factor` | `x2`, `x3`, `x4` | `x2` | | `model` | `standard-v2`, `low-resolution-v2`, `cgi`, `high-fidelity-v2`, `text-refine`, `redefine`, `standard-max`, `wonder`, `wonder-3`, `wonder-3.5` | `standard-v2` | | `output_format` | `jpeg`, `png` | — | | `subject_detection` | `all`, `foreground`, `background` | — | | `enhancement_strength` | `low`, `medium`, `high` | — | Returns a job object, not the final output — normally with status `queued`. Store the `id` and poll until a terminal state. A rejected submit (insufficient balance, rate limit, unpriceable input) still returns the job object, with status `failed` and `error` set. An `Idempotency-Key` replay returns the existing job in its current state — including `failed`, so retry a failure with a fresh key, never the same one. ### Response **200 OK · queued** ```json { "id": "media_8f3a2c91-5b7d-4e0a-9c26-31d4f2a8e6b0", "status": "queued" } ``` ## Poll status `GET /v1/media/jobs/{request_id}` ```bash curl https://api.dev.pika.art/v1/media/jobs/{request_id} \ -H "X-API-Key: YOUR_API_KEY" ``` Poll the job by id until it reaches a terminal state: `completed` or `failed`. ### The job object - `id` (string): Unique identifier for the job. - `status` (enum): One of `queued`, `running`, `completed`, `failed`. - `output` (object): Present once the job completes. - `media_type` (enum): `image`. - `output.images[].url` (string): URLs of the generated images. - `error` (object): Present if the job failed. `error.code` is the stable machine-readable value to branch on — one of `invalid_input`, `content_moderation`, `provider_error`, `provider_timeout`, `provider_unavailable`, `rate_limited`, `insufficient_balance`, `membership_required`, `cycle_limit_exceeded`, `admission_suspended`, `timed_out`, `internal`. Unrecognized values normalize to `provider_error`. `error.message` is diagnostic text and varies. ### Response **200 OK · running** ```json { "id": "media_8f3a2c91-5b7d-4e0a-9c26-31d4f2a8e6b0", "status": "running" } ``` **200 OK · completed** ```json { "id": "media_8f3a2c91-5b7d-4e0a-9c26-31d4f2a8e6b0", "status": "completed", "output": { "media_type": "image", "images": [ { "url": "https://api.dev.pika.art/v1/files/img_8f3a2c91.png", "content_type": "image/png" } ] } } ``` **200 OK · failed** ```json { "id": "media_8f3a2c91-5b7d-4e0a-9c26-31d4f2a8e6b0", "status": "failed", "error": { "code": "provider_error", "message": "upstream generation failed" } } ``` ## Get result `GET /v1/media/jobs/{request_id}/content` ```bash curl https://api.dev.pika.art/v1/media/jobs/{request_id}/content \ -H "X-API-Key: YOUR_API_KEY" ``` Once the job completes, fetch a download URL for the generated media. ### Response **200 OK · content URL** ```json { "url": "https://api.dev.pika.art/v1/files/img_8f3a2c91.png" } ``` ## Errors Errors use conventional HTTP status codes and always return JSON, in one of two shapes. Request-level errors (auth, unknown path, schema validation, idempotency conflict) are `{"message": "..."}`. Submit rejections that occur after the job row is created (insufficient balance, rate limit, unpriceable input, dispatch unavailable) return the full failed job envelope — branch on `error.code`, and retry with a fresh `Idempotency-Key`, since a failed job replays on its key. - 401 Unauthorized — The API key is missing or invalid. Body: `{"message":"Invalid API key"}` - 403 Forbidden — An inactive key is rejected with a `{"message"}` body. A submit that the org balance or postpaid cycle limit cannot cover is rejected after the job row exists and returns the failed job envelope. `GET /billing/balance` separates the two: a `200` means the key is active, so the rejection was the balance or the cycle limit. Body: `{"id":"media_8f3a2c91-5b7d-4e0a-9c26-31d4f2a8e6b0","status":"failed","error":{"code":"insufficient_balance","message":"Insufficient org balance"}}` - 404 Not Found — No job with that id exists in your org, or the media path names an unknown vendor/model/function. Body: `{"message":"media job not found"}` - 409 Conflict — The result was requested before the job completed, or an Idempotency-Key header was reused with a different body. Body: `{"message":"media job is not ready"}` - 422 Unprocessable Entity — The request body failed validation: an invalid enum value, a missing required field, a wrong type, or malformed JSON. The JSON message names the offending field. A schema-valid parameter combination that cannot be priced instead fails after job creation and returns the failed job envelope with error code `invalid_input`. Body: `{"message":"duration: Input should be less than or equal to 15"}` - 429 Too Many Requests — Org limit reached: requests per minute or day, or concurrent jobs. Returned as the failed job envelope; check the Retry-After header and retry with a fresh Idempotency-Key. Body: `{"id":"media_8f3a2c91-5b7d-4e0a-9c26-31d4f2a8e6b0","status":"failed","error":{"code":"rate_limited","message":"rate limit exceeded: rpm"}}` - 503 Service Unavailable — The model rail or a backend dependency is temporarily unavailable. Returned as the failed job envelope; retry with backoff and a fresh Idempotency-Key. Body: `{"id":"media_8f3a2c91-5b7d-4e0a-9c26-31d4f2a8e6b0","status":"failed","error":{"code":"provider_unavailable","message":"media dispatch unavailable"}}` ## Pricing - standard v2: $0.126 per image - low resolution v2: $0.126 per image - cgi: $0.126 per image - high fidelity v2: $0.126 per image - text refine: $0.126 per image - wonder 3: $0.378 per image - wonder 3.5: $0.378 per image - redefine: $0.756 per image - standard max: $0.756 per image - wonder: $0.756 per image Only successful generations are charged. Check the balance against this price before submitting: `GET https://api.dev.pika.art/billing/balance` returns `balance_micro_usd`, which is US dollars multiplied by 1,000,000, and `postpaid` when the org bills by invoice instead. For an active postpaid org, compare the price against `postpaid.cycle.remaining_micro_usd` rather than the prepaid balance. Report a shortfall to the user rather than submitting a request the balance cannot cover. --- Model page: https://dev.pika.art/models/topaz/topaz-image-upscale/image-upscale API index: https://dev.pika.art/llms.txt