Crystal Upscaler API Documentation
Image Request - Request Code
POST https://gateway.pixazo.ai/upscaler/v1/crystal-upscaler/generate HTTP/1.1
Content-Type: application/json
Cache-Control: no-cache
Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY
{
"image": "https://example.com/portrait.jpg",
"scale_factor": 4
} import requests
url = "https://gateway.pixazo.ai/upscaler/v1/crystal-upscaler/generate"
headers = {
"Content-Type": "application/json",
"Cache-Control": "no-cache",
"Ocp-Apim-Subscription-Key": "YOUR_SUBSCRIPTION_KEY"
}
data = {
"image": "https://example.com/portrait.jpg",
"scale_factor": 4
}
response = requests.post(url, json=data, headers=headers)
print(response.json()) const url = 'https://gateway.pixazo.ai/upscaler/v1/crystal-upscaler/generate';
const data = {
image: 'https://example.com/portrait.jpg',
scale_factor: 4
};
fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Cache-Control': 'no-cache',
'Ocp-Apim-Subscription-Key': 'YOUR_SUBSCRIPTION_KEY'
},
body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error)); curl -v -X POST "https://gateway.pixazo.ai/upscaler/v1/crystal-upscaler/generate" \
-H "Content-Type: application/json" \
-H "Cache-Control: no-cache" \
-H "Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY" \
--data-raw '{
"image": "https://example.com/portrait.jpg",
"scale_factor": 4
}' import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.time.Duration;
public class ApiClient {
public static void main(String[] args) throws Exception {
String url = "https://gateway.pixazo.ai/upscaler/v1/crystal-upscaler/generate";
String json = "{" + "\n" +
" \"image\": \"https://example.com/portrait.jpg\"," + "\n" +
" \"scale_factor\": 4" + "\n" +
"}";
HttpClient client = HttpClient.newBuilder()
.connectTimeout(Duration.ofSeconds(10))
.build();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url))
.header("Content-Type", "application/json")
.header("Cache-Control", "no-cache")
.header("Ocp-Apim-Subscription-Key", "YOUR_SUBSCRIPTION_KEY")
.POST(HttpRequest.BodyPublishers.ofString(json))
.build();
HttpResponse response = client.send(request,
HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
} <?php
$url = 'https://gateway.pixazo.ai/upscaler/v1/crystal-upscaler/generate';
$data = [
'image' => 'https://example.com/portrait.jpg',
'scale_factor' => 4
];
$json = json_encode($data);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json',
'Cache-Control: no-cache',
'Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY'
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?> Output
Successful API response:
{
"success": true,
"id": "abc123xyz789...",
"model": "philz1337x/crystal-upscaler",
"status": "starting"
} Request Body - Image Request
Parameters for /crystal-upscaler/generate:
| Parameter | Required | Type | Description |
|---|---|---|---|
| image | Yes | string | Input image URL to upscale. Must be publicly accessible (HTTPS recommended). |
| scale_factor | No | integer | Upscaling factor. Valid values: 2, 4, 6 or 8. |
| webhook | No | string | Callback URL for completion notification. POST request sent with results when complete. |
| webhook_events_filter | No | array | Events that trigger webhook. Valid values: ["*"] (all), ["completed"] (success/failure only). |
Example Request - Image Request
JSON
{
"image": "https://example.com/portrait.jpg",
"scale_factor": 4
} Response - Image Request
JSON
{
"success": true,
"id": "abc123xyz789...",
"model": "philz1337x/crystal-upscaler",
"status": "starting",
"input": {
"image": "https://example.com/portrait.jpg",
"scale_factor": 4
},
"created_at": "2025-10-22T08:00:00.000Z"
} Request Headers
| Header | Description |
|---|---|
| Content-Type | application/json |
| Cache-Control | no-cache |
| Ocp-Apim-Subscription-Key | Your subscription key for authentication |
Response Handling
The Crystal Upscaler returns specific HTTP status codes and response bodies to indicate the success or failure of a request. Developers should implement error handling in their applications to manage these responses effectively.
Common Status Codes and Responses
| Status Code | Description | Response Body |
|---|---|---|
| 200 | Success - The request was successfully processed. | { "success": true, ... } |
| 400 | Bad Request - The request contains invalid parameters or missing fields. | { "error": "Invalid request parameters" } |
| 401 | Unauthorized - The provided subscription key is missing or invalid. | { "error": "Invalid or missing authentication" } |
| 403 | Forbidden - The subscription does not have access to this API or action. | { "error": "Access denied for this operation" } |
| 404 | Not Found - The requested resource or endpoint could not be found. | { "error": "Endpoint not found" } |
| 429 | Too Many Requests - The request rate limit has been exceeded. | { "error": "Rate limit exceeded, please retry later" } |
| 500 | Internal Server Error - An unexpected error occurred on the server. | { "error": "An unexpected error occurred, please try again later" } |
Example Error Response
{
"error": "Invalid parameters"
} Crystal Upscaler API Pricing
| Output | Resolution | Price (USD) |
|---|---|---|
| 0 to 4 MP | All resolution | $0.07 |
| 4 to 8 MP | All resolution | $0.12 |
| 8 to 16 MP | - | $0.23 |
| 16 to 25+ MP | - | $0.45 |
Ready to generate Crystal Upscaler API assets?
Start with an API key, then automate your pipeline.