मुफ़्त शुरू

PicassoIA API संदर्भ

एक आसान HTTP API की मदद से PicassoIA के इमेज और वीडियो मॉडल अपने ख़ुद के कोड से चलाएँ: एक प्रेडिक्शन बनाएँ, पूरा होने तक उसे पोल करें और नतीजा डाउनलोड करें।

  • बेस URLhttps://api.picassoia.com/v1
  • Infinite प्लान के साथ मुफ़्त
  • एक साथ प्रगति में ज़्यादा से ज़्यादा 5 प्रेडिक्शन

PicassoIA API की मदद से आप PicassoIA के इमेज और वीडियो मॉडल अपने ख़ुद के कोड से चला सकते हैं:

  1. आप किसी मॉडल के लिए एक प्रेडिक्शन बनाते हैं।
  2. प्रेडिक्शन पूरा होने तक आप उसे पोल करते हैं।
  3. आप आउटपुट URL पढ़ते हैं।
  • बेस URL: https://api.picassoia.com/v1
  • फ़ॉर्मेट: JSON रिक्वेस्ट और रिस्पॉन्स, UTF-8।
  • कीमत: API प्रेडिक्शन फ़िलहाल मुफ़्त हैं। इनमें कोई क्रेडिट खर्च नहीं होता।
  • कौन इस्तेमाल कर सकता है: Infinite प्लान वाले अकाउंट।

विषय-सूची

प्रमाणीकरण

हर रिक्वेस्ट के Authorization हेडर में एक API key होनी चाहिए:

Authorization: Bearer pia_sk_…
  • API key बनाना। picassoia.com पर अपने अकाउंट के API keys सेक्शन में जाकर keys बनाएँ।
    • पूरी key सिर्फ़ एक बार दिखाई जाती है, जब आप उसे बनाते हैं। उसे किसी सुरक्षित जगह पर सहेज लें।
    • एक अकाउंट में एक समय पर 2 keys हो सकती हैं। नई key के लिए जगह बनानी हो, तो उनमें से एक को रिवोक करें।
  • API key रिवोक करना। रिवोक की गई key तुरंत काम करना बंद कर देती है।
  • API keys सिर्फ़ सर्वर पर रखें। जिसके पास भी आपकी key है, वह आपके अकाउंट पर प्रेडिक्शन चला सकता है, इसलिए key कभी भी किसी वेब पेज या मोबाइल ऐप में न डालें। API कोई CORS हेडर नहीं भेजता, इसलिए ब्राउज़र इसे सीधे कॉल नहीं कर सकते।
  • प्लान में बदलाव। आपका प्लान बदलने पर भी keys बनी रहती हैं। Infinite प्लान के बिना प्रेडिक्शन बनाने की रिक्वेस्ट का जवाब 403 plan_required होता है। अपने प्रेडिक्शन पढ़ना, उनकी सूची देखना और उन्हें रद्द करना पहले की तरह काम करता रहता है।

त्वरित शुरुआत

1. एक प्रेडिक्शन बनाएँ:

bash
curl -s -X POST https://api.picassoia.com/v1/models/picassoia/picassoia-image/predictions \
  -H "Authorization: Bearer $PICASSOIA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input": {"prompt": "a lighthouse at sunset, oil painting", "aspect_ratio": "16:9"}}'

जवाब (201 Created) starting स्टेट में एक प्रेडिक्शन होता है:

json
{
  "id": "api_3f9c2b7e8d1a4c6f9e0b1a2c3d4e5f60",
  "model": "picassoia/picassoia-image",
  "input": {
    "prompt": "a lighthouse at sunset, oil painting",
    "aspect_ratio": "16:9",
    "num_outputs": 1,
    "output_format": "jpg",
    "output_quality": 80
  },
  "output": null,
  "error": null,
  "status": "starting",
  "created_at": "2026-10-01T09:30:00.000Z",
  "started_at": null,
  "completed_at": null,
  "metrics": { "predict_time": null },
  "urls": {
    "get": "https://api.picassoia.com/v1/predictions/api_3f9c2b7e8d1a4c6f9e0b1a2c3d4e5f60",
    "cancel": "https://api.picassoia.com/v1/predictions/api_3f9c2b7e8d1a4c6f9e0b1a2c3d4e5f60/cancel"
  },
  "eta": { "seconds": 12, "next_poll_in_seconds": 6 }
}

2. इसे पोल करें (हर कॉल के बीच eta.next_poll_in_seconds सेकंड रुकें), जब तक status succeeded, failed या canceled न हो जाए:

bash
curl -s https://api.picassoia.com/v1/predictions/api_3f9c2b7e8d1a4c6f9e0b1a2c3d4e5f60 \
  -H "Authorization: Bearer $PICASSOIA_API_KEY"

3. आउटपुट पढ़ें:

json
{
  "id": "api_3f9c2b7e8d1a4c6f9e0b1a2c3d4e5f60",
  "status": "succeeded",
  "output": ["https://…/lighthouse.jpg"],
  "metrics": { "predict_time": 6.4 },
  "eta": null
}

(बाकी फ़ील्ड यहाँ नहीं दिखाए गए हैं।)

Node.js (fetch)

js
const API = 'https://api.picassoia.com/v1'
const headers = {
  Authorization: `Bearer ${process.env.PICASSOIA_API_KEY}`,
  'Content-Type': 'application/json',
}
const sleep = (s) => new Promise((resolve) => setTimeout(resolve, s * 1000))

async function run(model, input) {
  const created = await fetch(`${API}/models/${model}/predictions`, {
    method: 'POST',
    headers,
    body: JSON.stringify({ input }),
  })
  let prediction = await created.json()
  if (!created.ok) throw new Error(`${prediction.code}: ${prediction.detail}`)

  while (!['succeeded', 'failed', 'canceled'].includes(prediction.status)) {
    await sleep(prediction.eta?.next_poll_in_seconds ?? 2)
    prediction = await (await fetch(prediction.urls.get, { headers })).json()
  }
  if (prediction.status !== 'succeeded') throw new Error(prediction.error ?? prediction.status)
  return prediction.output
}

const video = await run('picassoia/seedance-2.5-lite', {
  prompt: 'a paper boat sailing down a rainy street',
  duration: 5,
})
console.log(video) // "https://…/video.mp4"

Python (requests)

python
import os, time, requests

API = "https://api.picassoia.com/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['PICASSOIA_API_KEY']}"}

def run(model, input):
    response = requests.post(f"{API}/models/{model}/predictions", json={"input": input}, headers=HEADERS)
    prediction = response.json()
    if not response.ok:
        raise RuntimeError(f"{prediction['code']}: {prediction['detail']}")
    while prediction["status"] not in ("succeeded", "failed", "canceled"):
        time.sleep((prediction.get("eta") or {}).get("next_poll_in_seconds", 2))
        prediction = requests.get(prediction["urls"]["get"], headers=HEADERS).json()
    if prediction["status"] != "succeeded":
        raise RuntimeError(prediction["error"] or prediction["status"])
    return prediction["output"]

images = run("picassoia/picassoia-image-editor-pro", {
    "prompt": "put the cat from image 1 on the sofa from image 2",
    "images": ["https://example.com/cat.png", "https://example.com/sofa.jpg"],
})
print(images)  # ["https://…/result.webp"]

मॉडल

मॉडलयह क्या करता हैआउटपुट
picassoia/picassoia-imageटेक्स्ट से इमेज: एक प्रॉम्प्ट से 1 या 2 इमेजइमेज URL की सूची
picassoia/picassoia-image-editor-proप्रॉम्प्ट के अनुसार 1 से 4 इमेज को एडिट करता है या आपस में जोड़ता हैइमेज URL की सूची
picassoia/picassoia-videoटेक्स्ट या इमेज से वीडियो: 480p में 20 सेकंड तक, 720p में 10 सेकंड तक, 1080p में 5 सेकंड तकएक MP4 URL
picassoia/seedance-2.5-liteसिंक्रोनाइज़्ड ऑडियो के साथ टेक्स्ट या इमेज से वीडियो: 5, 10 या 15 सेकंड; वैकल्पिक अंतिम फ़्रेमएक MP4 URL

हर मॉडल का सटीक स्कीमा JSON Schema के रूप में भी उपलब्ध है: GET /v1/models/{owner}/{name} input_schema (हर फ़ील्ड, उसकी सीमाओं और डिफ़ॉल्ट वैल्यू के साथ) और output_schema लौटाता है।

इनपुट के रूप में इमेज। इमेज फ़ील्ड में इन दोनों में से किसी भी तरह की वैल्यू दी जा सकती है:

  • एक https URL, जिस तक सार्वजनिक रूप से पहुँचा जा सके;
  • एक data URL: data:image/png;base64,…, या image/jpeg या image/webp भी, हर एक अधिकतम 5 MB का।

इमेज PNG, JPEG या WebP होनी चाहिए। PicassoIA हर इमेज की अपनी एक कॉपी सहेजता है, इसलिए प्रेडिक्शन के input में उसी कॉपी का URL दिखता है। कुछ सौ KB से बड़ी किसी भी फ़ाइल के लिए URL इस्तेमाल करें: पूरी रिक्वेस्ट बॉडी की सीमा 10 MB है।

अज्ञात फ़ील्ड अस्वीकार कर दिए जाते हैं, ताकि टाइपिंग की कोई गलती चुपचाप डिफ़ॉल्ट वैल्यू में न बदल जाए। जवाब 422 invalid_input होता है।

picassoia/picassoia-image

फ़ील्डटाइपडिफ़ॉल्टनोट्स
promptstring, 1–4000 कैरेक्टरज़रूरीइमेज में क्या दिखना चाहिए।
aspect_ratio1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:31:1
num_outputsinteger, 1–21कितनी इमेज बनानी हैं।
output_formatwebp, jpg, pngjpg
output_qualityinteger, 0–10080सिर्फ़ JPG और WebP के लिए।
seedintegerरैंडमकिसी नतीजे को दोबारा पाने के लिए इसे सेट करें।

आउटपुट: 1 या 2 इमेज URL की सूची।

picassoia/picassoia-image-editor-pro

फ़ील्डटाइपडिफ़ॉल्टनोट्स
promptstring, 1–4000 कैरेक्टरज़रूरीक्या एडिट करना है। इमेज का ज़िक्र "image 1", "image 2"… के रूप में करें।
images1–4 इमेज की सूची (https या data URL)ज़रूरीपहली इमेज मुख्य इमेज होती है।
aspect_ratiomatch_input_image, 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3match_input_imagematch_input_image पहली इमेज का अनुपात बनाए रखता है।
num_outputsinteger, 1–21
output_formatwebp, jpg, pngwebp
output_qualityinteger, 0–10095सिर्फ़ JPG और WebP के लिए।
seedintegerरैंडम

आउटपुट: 1 या 2 इमेज URL की सूची।

picassoia/picassoia-video

फ़ील्डटाइपडिफ़ॉल्टनोट्स
promptstring, 1–4000 कैरेक्टरज़रूरीवीडियो में क्या होता है।
imageइमेज (https या data URL)—शुरुआती फ़्रेम (इमेज से वीडियो)।
resolution480p, 720p, 1080p480p
durationinteger, सेकंड5480p पर 1–20, 720p पर 10 तक, 1080p पर 5 तक।
aspect_ratiomatch_input_image, 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3image होने पर match_input_image, न होने पर 16:9
save_audiobooleantrueजनरेट किया गया ऑडियो ट्रैक रखें।
seedintegerरैंडम
enhance_promptbooleantrueवीडियो जनरेट करने से पहले, बेहतर वीडियो के लिए PicassoIA प्रॉम्प्ट को दोबारा लिखता है। आपका अपना प्रॉम्प्ट input में ही रहता है।

आउटपुट: एक MP4 URL (एक string)।

picassoia/seedance-2.5-lite

फ़ील्डटाइपडिफ़ॉल्टनोट्स
promptstring, 1–4000 कैरेक्टरज़रूरीवीडियो में क्या होता है।
imageइमेज (https या data URL)—शुरुआती फ़्रेम।
last_frame_imageइमेज (https या data URL)—अंतिम फ़्रेम। इसके साथ image भी ज़रूरी है।
resolution480p, 720p480p
duration5, 10 या 15 (सेकंड)5480p पर 15 तक, 720p पर 10 तक।
aspect_ratiomatch_input_image, 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3image होने पर match_input_image, न होने पर 16:9
save_audiobooleantrueसिंक्रोनाइज़्ड ऑडियो रखें।
seedintegerरैंडम
enhance_promptbooleantruepicassoia/picassoia-video की तरह।

आउटपुट: एक MP4 URL (एक string)।

एंडपॉइंट

मेथड और पाथयह क्या करता हैसफल होने पर
GET /v1/modelsमॉडल की सूची उनके स्कीमा के साथ देता है200 { "next": null, "previous": null, "results": [Model] }
GET /v1/models/{owner}/{name}एक मॉडल200 मॉडल
POST /v1/models/{owner}/{name}/predictionsएक प्रेडिक्शन बनाता है201 प्रेडिक्शन
GET /v1/predictions/{id}एक प्रेडिक्शन लौटाता है200 प्रेडिक्शन
POST /v1/predictions/{id}/cancelएक प्रेडिक्शन रद्द करता है200 प्रेडिक्शन
GET /v1/predictionsआपके प्रेडिक्शन की सूची देता है, सबसे नए पहले200 { "next", "previous", "results": [Prediction] }

मॉडल ऑब्जेक्ट

json
{
  "id": "picassoia/seedance-2.5-lite",
  "owner": "picassoia",
  "name": "seedance-2.5-lite",
  "title": "Seedance 2.5 Lite",
  "description": "Text or image to video with synchronized audio: …",
  "input_schema": { "type": "object", "properties": { "…": {} }, "required": ["prompt"], "additionalProperties": false },
  "output_schema": { "type": "string", "format": "uri" }
}

प्रेडिक्शन बनाना

POST /v1/models/{owner}/{name}/predictions, बॉडी { "input": { … } } के साथ।

  • मॉडल के जॉब स्वीकार करते ही API जवाब देता है, आमतौर पर कुछ ही सेकंड में, और उस समय प्रेडिक्शन starting स्टेट में होता है। API कभी भी नतीजे का इंतज़ार नहीं करता।
  • अगर प्रेडिक्शन तुरंत फ़ेल हो जाता है, तब भी जवाब 201 ही होता है, जिसमें प्रेडिक्शन failed स्टेट में और अपने error के साथ होता है। उदाहरण के लिए, ऐसा तब होता है जब सेफ़्टी फ़िल्टर इनपुट को अस्वीकार कर देता है।
  • अगर कोई प्रेडिक्शन नहीं बना, तो जवाब एक त्रुटि होता है: अमान्य इनपुट, ज़रूरी प्लान न होना, एक साथ प्रगति में बहुत ज़्यादा प्रेडिक्शन, सेवा उपलब्ध न होना।

प्रेडिक्शन की सूची

GET /v1/predictions आपकी सभी keys से बने API प्रेडिक्शन लौटाता है, हर पेज पर 50, सबसे नए पहले।

  • next अगले पेज का URL (…/v1/predictions?cursor=…) होता है, या आख़िरी पेज पर null।
  • previous हमेशा null होता है।
  • picassoia.com पर आपके डिलीट किए गए प्रेडिक्शन इसमें शामिल नहीं होते।

कोई भी प्रेडिक्शन आपकी किसी भी key से देखा जा सकता है, लेकिन किसी और को वह कभी नहीं दिखता।

प्रेडिक्शन ऑब्जेक्ट

फ़ील्डटाइपनोट्स
idstringapi_ के बाद 32 hex कैरेक्टर।
modelstringवह मॉडल जिसे यह चलाता है।
inputobjectआपका इनपुट, डिफ़ॉल्ट वैल्यू लागू होने के बाद। इमेज फ़ील्ड PicassoIA की कॉपी की ओर इशारा करते हैं।
statusstringstarting, processing, succeeded, failed या canceled।
outputURL की सूची, एक URL, या nullsucceeded होने पर भरा जाता है; इसका रूप मॉडल के output_schema के अनुसार होता है।
errorstring या nullयह failed क्यों हुआ।
created_atISO 8601 या null
started_atISO 8601 या nullआमतौर पर null: नीचे status देखें।
completed_atISO 8601 या nullयह कब पूरा हुआ।
metrics.predict_timenumber या nullsucceeded होने के बाद, जनरेशन में लगे सेकंड।
urls.get, urls.cancelURLइसे कहाँ पोल करना है और कहाँ रद्द करना है।
etaobject या nullचलते समय: seconds, यानी अनुमानित बचे हुए सेकंड, और next_poll_in_seconds, यानी दोबारा कब पूछना है। पूरा होने के बाद null।

स्टेटस।

स्टेटसमतलब
startingस्वीकार हो गया है और कतार में इंतज़ार कर रहा है।
processingजनरेट हो रहा है।
succeededपूरा हुआ। output में नतीजा है।
failedबिना नतीजे के ख़त्म हुआ। error में कारण बताया गया है।
canceledपूरा होने से पहले रद्द कर दिया गया।

starting और processing के बीच का फ़र्क एक अनुमान है, जो प्रेडिक्शन बनते समय कतार में उसकी जगह के आधार पर लगाया जाता है। नया प्रेडिक्शन हमेशा starting होता है। आख़िरी तीन स्टेटस अंतिम हैं: इनमें से किसी एक में पहुँचा प्रेडिक्शन फिर कभी नहीं बदलता।

फ़ेल हुए प्रेडिक्शन की त्रुटियाँ। फ़ेल हुए प्रेडिक्शन का error इनमें से कोई एक मैसेज होता है:

  • सेफ़्टी फ़िल्टर ने इनपुट या आउटपुट को अस्वीकार कर दिया। मैसेज (SAFETY_CHECKER_PICASSO_FILTER_S4) पर ख़त्म होता है।
  • The prediction failed. You can try again.
  • The prediction timed out. You can try again. 3 घंटे के भीतर यह पूरा नहीं हुआ।

आउटपुट। आउटपुट URL PicassoIA पर होस्ट किए जाते हैं। जिन फ़ाइलों को आप रखना चाहते हैं, उन्हें डाउनलोड कर लें।

पोलिंग और ETA

eta.next_poll_in_seconds बताता है कि अगला पोल कब करना फ़ायदेमंद है:

  1. अनुमानित समय के आधे पर।
  2. जब अनुमानित समय पूरा हो जाए।
  3. उसके बाद हर 2 सेकंड में।

उदाहरण के लिए, अगर अनुमान 10 सेकंड का है: 5 सेकंड बाद पोल करें, फिर 10 सेकंड बाद, फिर हर 2 सेकंड में। इससे ज़्यादा तेज़ी से पोल करने पर नतीजा जल्दी नहीं मिलता।

रद्द करना

POST /v1/predictions/{id}/cancel:

अगर प्रेडिक्शन…क्या होता है
इमेज का है, कतार में है या जनरेट हो रहा हैरद्द हो जाता है। status: "canceled" के साथ 200 जवाब मिलता है।
वीडियो का है और अभी कतार में हैरद्द हो जाता है। status: "canceled" के साथ 200 जवाब मिलता है।
वीडियो का है और जनरेट होना शुरू हो चुका हैरद्द नहीं किया जा सकता: 409 not_cancelable। नतीजे के लिए इसे पोल करते रहें।
पहले ही पूरा हो चुका है200 जवाब मिलता है, जिसमें प्रेडिक्शन जैसा है वैसा ही लौटाया जाता है।

रद्द किया गया प्रेडिक्शन आपके एक साथ प्रगति में रहने वाले 5 प्रेडिक्शन में अपनी जगह तुरंत खाली कर देता है।

त्रुटियाँ

त्रुटियाँ JSON problem details के रूप में आती हैं, और साथ में प्रोग्राम के लिए एक स्थिर code भी होता है:

json
{
  "title": "Too many predictions in progress",
  "detail": "This account can have up to 5 predictions queued or running at once, shared by its API keys and MCP connections, and 5 are. Wait for one to finish and try again.",
  "status": 429,
  "code": "concurrency_limit",
  "retry_after": 10,
  "limit": 5,
  "running": 5
}
HTTPcodeकब
400invalid_jsonबॉडी मान्य JSON नहीं है।
400invalid_cursorसूची का cursor API का दिया हुआ नहीं है।
401missing_api_keyAuthorization: Bearer … हेडर मौजूद नहीं है।
401invalid_api_keyAPI key गलत है या रिवोक की जा चुकी है।
403plan_requiredप्रेडिक्शन बनाने के लिए Infinite प्लान ज़रूरी है।
404not_foundऐसा कोई एंडपॉइंट नहीं है।
404model_not_foundAPI वह मॉडल उपलब्ध नहीं कराता।
404prediction_not_foundउस id का कोई प्रेडिक्शन आपके पास नहीं है।
405method_not_allowedएंडपॉइंट के लिए गलत मेथड (Allow हेडर देखें)।
409not_cancelableऐसा वीडियो जो पहले से जनरेट हो रहा है।
413payload_too_largeबॉडी 10 MB से बड़ी है।
422invalid_inputइनपुट मान्य नहीं है। नीचे invalid_fields देखें।
429concurrency_limit5 प्रेडिक्शन पहले से कतार में हैं या चल रहे हैं, जिनमें अकाउंट के MCP के ज़रिए चल रहे जनरेशन भी गिने जाते हैं। साथ में limit, running, retry_after और Retry-After हेडर भी मिलते हैं।
500internal_errorहमारी ओर से कुछ गड़बड़ हो गई। फिर से कोशिश करें।
502bad_gatewayAPI तक पहुँचा नहीं जा सका। फिर से कोशिश करें।
503service_unavailable, server_misconfiguredअस्थायी रूप से उपलब्ध नहीं। बाद में फिर से कोशिश करें; अगर Retry-After हेडर मौजूद हो, तो उसमें दिए गए सेकंड के बाद।

invalid_fields। 422 जवाब में हर गलत फ़ील्ड की सूची होती है:

json
{
  "title": "Input validation failed",
  "status": 422,
  "code": "invalid_input",
  "detail": "input.duration: At 720p the longest clip is 10 seconds.",
  "invalid_fields": [
    { "type": "invalid_value", "field": "input.duration", "description": "At 720p the longest clip is 10 seconds." }
  ]
}

सीमाएँ

सीमावैल्यू
एक साथ कतार में या चल रहे प्रेडिक्शनहर अकाउंट पर 5, उसकी सभी keys को मिलाकर, और यह सीमा MCP (ChatGPT, Claude, Supercomputer) के ज़रिए चलने वाले उसके जनरेशन के साथ साझा होती है। 6वें प्रेडिक्शन का जवाब 429 होता है।
हर अकाउंट पर API keys2
रिक्वेस्ट बॉडी10 MB
data URL के रूप में भेजी गई इमेजहर एक 5 MB
प्रॉम्प्ट4000 कैरेक्टर
picassoia-image-editor-pro के लिए इमेज1 से 4
कीमतमुफ़्त: API प्रेडिक्शन में कोई क्रेडिट खर्च नहीं होता