All plans are🏷️30% OFFfor a limited time!www.safeframe.dev
safeframe
Cloud Microservices

Image Enhancer & Super-Resolution Documentation

Complete API reference, integration examples, authentication guidelines, and response structures.

Overview

State-of-the-art neural upscaling and restoration API. Enhance clarity, eliminate compression artifacts, and upscale images up to 8x resolution with low inference latency.

Endpoint
POST /v1/enhance
· Base URL:https://api.safeframe.dev

Authentication

Authenticate every HTTP request using the custom X-API-Key header:

X-API-Key: nsk_live_xxxxxxxxxxxxxxxxxxxxxxxx

Do not expose your private key in client-side applications. Proxy requests through your backend service or Edge Workers.

Code Examples

Multi-Language SDKs
cURL — request
curl -X POST "https://api.safeframe.dev/v1/enhance" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: nsk_live_xxxxxxxxxxxxxxxxxxxxxxxx" \
  -d '{
    "image": "data:image/jpeg;base64,/9j/4AAQSkZJRg...",
    "detection_point": true
  }'
200 — response
{
  "success": true,
  "issafe": false,
  "message": "NSFW content detected: FEMALE_BREAST_EXPOSED",
  "detections": [
    {
      "label": "FEMALE_BREAST_EXPOSED",
      "score": 0.94,
      "box": [120, 85, 210, 160],
      "top_left": [120, 85],
      "bottom_right": [330, 245]
    }
  ]
}

Service Specification

# Image Enhancer API Neural super-resolution image upscaling and restoration. Restore blurry portraits, enhance e-commerce product photos, and eliminate noise. ## Authentication Pass your universal API key in the `X-API-Key` header: ```http X-API-Key: sk_live_... ``` ## Endpoint `POST /v1/enhance` ### Request Body (JSON) | Field | Type | Description | |---|---|---| | `image` | string | Base64-encoded image string or public image URL | | `scale` | string | `"2x"`, `"4x"`, or `"8x"` (default: `"4x"`) | | `face_enhance` | boolean | Enable neural face restoration | | `denoise` | boolean | Eliminate compression artifacts |

Status & Error Responses

400 Bad Request
Input payload is empty, missing, or malformed.
{
  "detail": {
    "success": false,
    "error": "invalid_payload",
    "message": "Invalid request payload"
  }
}
401 Unauthorized
The X-API-Key header is missing or the key is not recognised.
{
  "detail": {
    "success": false,
    "error": "missing_api_key",
    "message": "X-API-Key header is required"
  }
}
402 Payment Required
No active subscription for this service.
{
  "detail": {
    "success": false,
    "error": "subscription_required",
    "message": "An active subscription is required to access this service"
  }
}
403 Forbidden
The key was revoked or has expired.
{
  "detail": {
    "success": false,
    "error": "api_key_expired",
    "message": "API key has expired or is revoked"
  }
}
429 Too Many Requests
Monthly request quota or rate limit has been reached.
{
  "detail": {
    "success": false,
    "error": "rate_limit_reached",
    "message": "Monthly API request limit reached"
  }
}
500 Internal Error
Server error occurred while processing the request.
{
  "detail": {
    "success": false,
    "error": "internal_error",
    "message": "Internal processing error"
  }
}

Sample Response

Example payload structure returned by this service.

{
  "success": true,
  "issafe": false,
  "message": "NSFW content detected: FEMALE_BREAST_EXPOSED",
  "detections": [
    {
      "label": "FEMALE_BREAST_EXPOSED",
      "score": 0.94,
      "box": [
        120,
        85,
        210,
        160
      ],
      "top_left": [
        120,
        85
      ],
      "bottom_right": [
        330,
        245
      ]
    }
  ]
}
Ready to test?

Head over to the playground to upload your own files and inspect live bounding boxes and classifications.

Open Playground