API संदर्भ
API से models को सीधे call करें, या दोबारा इस्तेमाल होने वाले Agents बनाएं, उन्हें Sessions में run करें, और उन्हें Skills और MCP tools से जोड़ें।
Model inference ढूंढ रहे हैं?
Inference contracts (Chat Completions, Responses, Anthropic Messages, Gemini, Images और Seedance video) इस reference के Model inference सेक्शन में हैं। हर model के अपने fields और कीमतें Models catalog में उसके पेज पर हैं।
शुरुआत कहां से करें
| लक्ष्य | शुरुआत | आगे क्या होता है |
|---|---|---|
| दोबारा इस्तेमाल होने वाला व्यवहार तय करें | Agents | Agent configuration बनाएं और उसके versions रखें |
| Agent को सीधे run करें | Sessions | Input भेजें, events stream करें और history पढ़ें |
| Instruction bundles दोबारा इस्तेमाल करें | Skills | Versioned ZIP bundles upload करें और उन्हें Agents से जोड़ें |
| External tools call करें | MCP Connections | Agents के लिए remote HTTPS MCP servers register करें |
| External tools को authenticate करें | Secrets | MCP connections के लिए write-only Bearer tokens स्टोर करें |
संसाधन जीवनचक्र
Agent + version ─── direct ──→ Session ─→ events, items, turns
Agent ─ skills[] → Skill version Agent ─ mcp_connections[] → MCP connection ─ secret_id → Secret- Agent (
agt_) एक सेव किया गया, versioned configuration है; इसे बनाने से यह execute नहीं होता। - Session (
ses_) एक Agent version को run करता है और उसके Skills और MCP connections को freeze करता है। Session paths/v1/agents/sessionsके अंदर हैं। - Skill (
skl_) एक versioned instruction bundle है। MCP connection (mcp_) एक remote tool server register करता है, और Secret (sec_) उसका Bearer token स्टोर करता है।
Agents platform resources के नियम
Agents, Sessions, Skills, MCP connections और Secrets https://api.sandbase.ai/v1 के अंदर उपलब्ध हैं और ये नियम साझा करते हैं:
Authorization: BearerयाX-API-Keyसे authenticate करें। Authentication देखें।- Request bodies अधिकतम 1 MiB की strict JSON होती हैं; अनजान fields पर 400 लौटता है।
- MCP connections या Secrets बनाने वाले writes के लिए
Idempotency-Keyज़रूरी है। बाकी writes इसे स्वीकार करते हैं। - Optimistic concurrency
row_versionइस्तेमाल करती है: आख़िरी बार पढ़ा गया मान भेजें, और 409 मिलने पर फिर से पढ़ें। - Agents, Sessions, items, turns और Skills cursor pagination इस्तेमाल करते हैं (
limit,after,order; responses मेंhas_moreऔरlast_idहोते हैं)। Agent versions, attachments, MCP connections और Secrets offset pagination इस्तेमाल करते हैं (limit,offset; responses मेंtotalहोता है)। - Errors
{"error": {"type", "code", "param", "message"}}इस्तेमाल करते हैं। Agents platform errors देखें।
प्रमाणीकरण
SandBase API key को Bearer token के रूप में भेजें:
Authorization: Bearer sk-YOUR_KEYKey को एक opaque secret मानें, इसे server पर रखें, और कभी browser code या logs में शामिल न करें। Compatibility की जानकारी के लिए Authentication और public error envelopes के लिए Errors देखें।
Organization और usage
Platform resources उस organization के होते हैं जो API key से जुड़ा है। सपोर्टेड बैलेंस और हाल की execution history देखने के लिए Account API इस्तेमाल करें। जब तक यहां कोई public endpoint documented न हो, organization administration और billing management Console में ही होते हैं।
संदर्भ फ़ॉर्मेट
- उदाहरणों और response की जानकारी के लिए sidebar से operations ब्राउज़ करें।
- Machine-readable OpenAPI specification डाउनलोड करें।
- सटीक request fields के लिए Models catalog में model का पेज या APIs catalog में API का पेज खोलें।
अगले कदम
- Managed Agents में नए हैं: Build Agent
- Model को सीधे call करें: Chat Completions या Models catalog