Content पर जाएं

Model या API capability run करें

POST/v1/run

Enabled SandBase model या API capability execute करें। Request fields हर capability के लिए अलग होते हैं; चुनी गई capability के schema के लिए SandBase वेबसाइट पर model या API reference पेज देखें।

Request body

stringmodelज़रूरी

Enabled logical model या API capability identifier।

वैकल्पिक<auto | sync | async | stream>mode

Execution mode का संकेत। `auto` चुनी गई capability का कॉन्फ़िगर किया गया डिफ़ॉल्ट इस्तेमाल करता है; दूसरे values के लिए capability का support ज़रूरी है।

वैकल्पिक<boolean>stream

चुनी गई capability सपोर्ट करे तो streaming output मांगें। `mode: stream` के बराबर।

वैकल्पिक<string>webhook_url

सपोर्टेड asynchronous image के लिए वैकल्पिक HTTPS callback

Execution और results ​

Synchronous capabilities मूल request में ही पूरा response लौटाती हैं। Asynchronous capabilities एक opaque id के साथ 202 Accepted लौटाती हैं; status terminal होने तक Get an asynchronous run को poll करें।

Capability के अपने request fields और output shapes चुने गए model या API operation के पेज पर दिए गए हैं। इन fields को JSON body के top level पर भेजें; इन्हें किसी input object में न लपेटें। यह न मानें कि हर capability एक जैसे parameters स्वीकार करती है।

वेबहुक कॉलबैक ​

webhook_url सिर्फ़ सपोर्टेड asynchronous image, video या audio tasks के लिए सेट करें। पूरा होने या विफल होने के बाद SandBase अंतिम run event को HTTPS endpoint पर भेजता है; callback सिर्फ़ delivery का संकेत है, GET /v1/run/{id} का विकल्प नहीं। प्रामाणिक status के लिए run endpoint को हमेशा poll करते रहें, और callback देर से आने या दोहराए जाने पर सुरक्षित रूप से retry करें। Synchronous model responses और provider-native endpoints इस callback field का इस्तेमाल नहीं करते।