REST API v1
Stable

API Documentation

Professional REST API for AI photo processing. Upload images, specify prompts — get direct links to results.

Authentication

Authentication Required

To get an API key and test endpoints, you need to sign in to the website.

Sign Up

Bearer Token Authentication

All API requests must include an Authorization header with your API key:

Authorization: Bearer YOUR_API_KEY

Photo Processing Endpoint

POSThttps://painty.cc/api/v1/photo

Uploads an image and text prompt, processes through AI model, returns direct links to results.

Request Parameters

Content-Type: multipart/form-data

ParameterTypeRequiredDescription
promptstringYesText description of changes (e.g., "Make the background clean and bright")
imagefileYesImage file (formats: jpg, png, webp; max size: 10MB)

Success Response

Status: 200 OK

{
  "status": "ok",
  "data": {
    "jobId": 123,
    "originalUrl": "https://s3.twcstorage.ru/.../original.jpg",
    "resultUrls": [
      "https://s3.twcstorage.ru/.../result.jpg"
    ]
  }
}

Error Codes

CodeDescriptionSolution
400Bad RequestCheck required parameters are present
401UnauthorizedCheck your API key is correct
429Too Many RequestsRate limit exceeded, please wait
500Internal Server ErrorServer error, retry later

Rate Limits

File Size

Maximum image upload size: 10 MB

Formats

Supported formats: JPG, PNG, WebP, GIF

Timeout

Maximum processing time: 240 seconds

File Storage

Processing results stored for: 24 hours

Code Examples

cURL

curl -X POST 'https://painty.cc/api/v1/photo' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -F "prompt=Make the background clean and bright" \
  -F "image=@/path/to/photo.jpg"

JavaScript (fetch)

const formData = new FormData();
formData.append('prompt', 'Make the background clean and bright');
formData.append('image', fileInput.files[0]);

const response = await fetch('https://painty.cc/api/v1/photo', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
  },
  body: formData,
});

const data = await response.json();
console.log('Result:', data.data.resultUrls[0]);

Python (requests)

import requests

url = "https://painty.cc/api/v1/photo"
headers = {"Authorization": f"Bearer YOUR_API_KEY"}
files = {"image": open("photo.jpg", "rb")}
data = {"prompt": "Make the background clean and bright"}

response = requests.post(url, headers=headers, files=files, data=data)
result = response.json()
print(result["data"]["resultUrls"][0])