इसे छोड़कर कंटेंट पर जाएं

एजेंट कंप्यूटर एपीआई

इसे एपीआई प्लेग्राउंड में आज़माएं।

https://api.rebyte.ai/v1

प्रत्येक अनुरोध के लिए एक API_KEY हेडर की आवश्यकता होती है। अपनी कुंजी सेटिंग्स > एपीआई कुंजी से प्राप्त करें।

Terminal window
curl https://api.rebyte.ai/v1/tasks \
-H "API_KEY: rbk_your_key_here"

हेडर का नाम केस-संवेदी नहीं है। API_KEY, api-key, और x-api-key सभी काम करते हैं।


MethodPathDescription
POST/tasksCreate a task
GET/tasksList tasks
GET/tasks/:idGet task with status and prompt history
POST/tasks/:id/promptsSend a follow-up prompt
PATCH/tasks/:id/visibilityChange task visibility
DELETE/tasks/:idSoft-delete a task
GET/tasks/:id/eventsSSE stream of execution events
POST/filesGet a signed file upload URL
POST/webhooksRegister a webhook
GET/webhooksList webhooks
GET/webhooks/:idGet webhook details
DELETE/webhooks/:idDelete a webhook
सभी पाथ बेस यूआरएल (https://api.rebyte.ai/v1) के सापेक्ष हैं।

POST /tasks

एक नया कार्य बनाता है। डिफ़ॉल्ट रूप से, एक नया VM (एजेंट कंप्यूटर) प्रावधान करता है। इसके बजाय किसी मौजूदा वर्कस्पेस पर कार्य चलाने के लिए workspaceId पास करें — यह प्रावधान को छोड़ देता है और काफी तेज़ होता है।

कॉल तब तक ब्लॉक रहता है जब तक VM का प्रावधान नहीं हो जाता और पहला प्रॉम्प्ट सबमिट नहीं हो जाता।

अनुरोध बॉडी:

FieldTypeRequiredDescription
promptstringYesTask description (max 100,000 chars)
executorstringNoclaude (default), gemini, codex, opencode
modelstringNoModel tier for the executor. See Models.
workspaceIdstringNoUUID of an existing workspace to reuse
filesobject[]NoFiles from POST /files. Each: {"id": "...", "filename": "..."}
skillsstring[]NoSkill slugs (e.g., ["deep-research", "pdf"])
githubUrlstringNoGitHub repo in owner/repo format
branchNamestringNoBranch name (default: main)
Terminal window
curl -X POST https://api.rebyte.ai/v1/tasks \
-H "API_KEY: rbk_xxx" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Build a REST API with Express and add tests",
"executor": "claude",
"skills": ["deep-research"],
"githubUrl": "your-org/your-repo"
}'

प्रतिक्रिया (201):

{
"id": "550e8400-e29b-41d4-a716-446655440000",
"workspaceId": "660e8400-e29b-41d4-a716-446655440001",
"url": "https://app.rebyte.ai/run/550e8400-e29b-41d4-a716-446655440000",
"status": "running",
"createdAt": "2026-01-28T12:00:00.000Z"
}

उसी एजेंट कंप्यूटर पर अनुवर्ती कार्य बनाने के लिए प्रतिक्रिया से workspaceId सहेजें:

Terminal window
# First task -- provisions a new VM
RESP=$(curl -s -X POST https://api.rebyte.ai/v1/tasks \
-H "API_KEY: rbk_xxx" -H "Content-Type: application/json" \
-d '{"prompt": "Set up the project"}')
WS_ID=$(echo $RESP | jq -r '.workspaceId')
# Second task -- reuses the same VM (much faster)
curl -s -X POST https://api.rebyte.ai/v1/tasks \
-H "API_KEY: rbk_xxx" -H "Content-Type: application/json" \
-d "{\"prompt\": \"Now add tests\", \"workspaceId\": \"$WS_ID\"}"

उपलब्ध मॉडल निष्पादक पर निर्भर करते हैं:

ExecutorAvailable ModelsDefault
claudeclaude-sonnet-4.6, claude-opus-4.6, gemini-3.1-pro, gpt-5.3-codex, gpt-5.4, minimax-m2.7, kimi-k2.5, glm-5, gemini-3-flashclaude-sonnet-4.6
codexgpt-5.4, gpt-5.3-codexgpt-5.4
geminiauto-gemini-3 (auto-routes between flash and pro)auto-gemini-3
opencodeSame as claudegemini-3.1-pro

BYOK (अपनी खुद की एपीआई कुंजी लाएं) के साथ, केवल निष्पादक के मूल प्रदाता मॉडल उपलब्ध हैं (उदाहरण के लिए, BYOK के साथ claude निष्पादक को केवल claude-sonnet-4.6 और claude-opus-4.6 मिलते हैं)।

कार्य सूचीबद्ध करें

Section titled “कार्य सूचीबद्ध करें”
GET /tasks?limit=50&offset=0

एपीआई के माध्यम से बनाए गए कार्यों को लौटाता है, जो निर्माण समय (नवीनतम पहले) के अनुसार क्रमबद्ध होते हैं।

ParamTypeDefaultDescription
limitnumber50Results per page (max 100)
offsetnumber0Pagination offset
Terminal window
curl "https://api.rebyte.ai/v1/tasks?limit=10" \
-H "API_KEY: rbk_xxx"

प्रतिक्रिया:

{
"data": [
{
"id": "550e8400-...",
"url": "https://app.rebyte.ai/run/550e8400-...",
"title": "Build REST API with Express",
"executor": "claude",
"model": "claude-sonnet-4.6",
"createdAt": "2026-01-28T12:00:00.000000+00:00",
"completedAt": "2026-01-28T12:05:00.000000+00:00"
}
],
"total": 42,
"limit": 10,
"offset": 0
}

कार्य प्राप्त करें

Section titled “कार्य प्राप्त करें”
GET /tasks/:id

प्रॉम्प्ट इतिहास और व्युत्पन्न स्थिति सहित पूर्ण कार्य विवरण लौटाता है।

Terminal window
curl https://api.rebyte.ai/v1/tasks/550e8400-... \
-H "API_KEY: rbk_xxx"

प्रतिक्रिया:

{
"id": "550e8400-...",
"url": "https://app.rebyte.ai/run/550e8400-...",
"status": "running",
"title": "Build REST API with Express",
"executor": "claude",
"model": "claude-sonnet-4.6",
"createdAt": "2026-01-28T12:00:00.000000+00:00",
"completedAt": null,
"prompts": [
{
"id": "660e8400-...",
"status": "running",
"submittedAt": "2026-01-28T12:05:00.000000+00:00",
"completedAt": null
},
{
"id": "550e8400-...",
"status": "succeeded",
"submittedAt": "2026-01-28T12:00:01.000000+00:00",
"completedAt": "2026-01-28T12:03:00.000000+00:00"
}
]
}

कार्य की स्थिति प्रॉम्प्ट अवस्थाओं से प्राप्त होती है:

StatusCondition
runningAny prompt is pending or running
completedAll prompts terminal, latest is succeeded
failedAll prompts terminal, latest is failed
canceledAll prompts terminal, latest is canceled
POST /tasks/:id/prompts

चल रहे या पूर्ण किए गए कार्य को अनुवर्ती प्रॉम्प्ट भेजें। यदि VM बंद हो जाता है, तो यह स्वचालित रूप से फिर से शुरू हो जाता है।

FieldTypeRequiredDescription
promptstringYesFollow-up prompt (max 100,000 chars)
skillsstring[]NoAdditional skill slugs for this prompt
Terminal window
curl -X POST https://api.rebyte.ai/v1/tasks/550e8400-.../prompts \
-H "API_KEY: rbk_xxx" \
-H "Content-Type: application/json" \
-d '{"prompt": "Now add authentication with JWT"}'

प्रतिक्रिया (201):

{
"promptId": "770f9500-..."
}

इवेंट स्ट्रीम करें (SSE)

Section titled “इवेंट स्ट्रीम करें (SSE)”
GET /tasks/:id/events

कार्य के नवीनतम प्रॉम्प्ट के लिए एक सर्वर-सेंट इवेंट स्ट्रीम खोलता है। इवेंट में एजेंट आउटपुट (stdout, stderr), टूल कॉल और पूर्णता संकेत शामिल हैं।

Terminal window
curl -N https://api.rebyte.ai/v1/tasks/550e8400-.../events \
-H "API_KEY: rbk_xxx"

स्ट्रीम दो इवेंट प्रकार उत्सर्जित करता है:

  • event — निष्पादन इवेंट (एजेंट आउटपुट, टूल कॉल)
  • done — पूर्णता स्थिति के साथ अंतिम इवेंट, फिर स्ट्रीम बंद हो जाती है
PATCH /tasks/:id/visibility
FieldTypeRequiredDescription
visibilitystringYesprivate, shared, or public
LevelWho can view
privateOnly the API key owner
sharedAll organization members (default)
publicAnyone with the link (read-only)
Terminal window
curl -X PATCH https://api.rebyte.ai/v1/tasks/550e8400-.../visibility \
-H "API_KEY: rbk_xxx" \
-H "Content-Type: application/json" \
-d '{"visibility": "public"}'

जब public पर सेट किया जाता है, तो प्रतिक्रिया में अप्रमाणित पहुंच के लिए एक shareUrl शामिल होता है।

DELETE /tasks/:id

कार्य को सॉफ्ट-डिलीट करता है। 204 No Content लौटाता है।

Terminal window
curl -X DELETE https://api.rebyte.ai/v1/tasks/550e8400-... \
-H "API_KEY: rbk_xxx"

कार्यों से संलग्न करने के लिए फ़ाइलें अपलोड करें। दो-चरणीय हस्ताक्षरित-यूआरएल प्रवाह का उपयोग करता है।

चरण 1: अपलोड यूआरएल प्राप्त करें

Section titled “चरण 1: अपलोड यूआरएल प्राप्त करें”
POST /files
FieldTypeRequiredDescription
filenamestringYesFile name (max 255 chars)
contentTypestringNoMIME type (default: application/octet-stream)

प्रतिक्रिया (201):

{
"id": "550e8400-...",
"filename": "data.csv",
"uploadUrl": "https://storage.googleapis.com/...",
"maxFileSize": 52428800
}

अपलोड यूआरएल 1 घंटे में समाप्त हो जाता है।

चरण 2: फ़ाइल अपलोड करें

Section titled “चरण 2: फ़ाइल अपलोड करें”
Terminal window
curl -X PUT "UPLOAD_URL_FROM_STEP_1" \
-H "Content-Type: application/octet-stream" \
--data-binary @data.csv

चरण 3: कार्य से संलग्न करें

Section titled “चरण 3: कार्य से संलग्न करें”

कार्य बनाते समय चरण 1 से id और filename पास करें:

{
"prompt": "Analyze the uploaded data",
"files": [
{"id": "550e8400-...", "filename": "data.csv"}
]
}

निष्पादन शुरू होने पर फ़ाइलें स्वचालित रूप से कार्य के VM में कॉपी हो जाती हैं।


कार्य इवेंट होने पर HTTP POST सूचनाएं प्राप्त करें। वेबहुक सार्वभौमिक हैं — वे आपके संगठन के सभी कार्यों के लिए सक्रिय होते हैं, चाहे वे एपीआई, यूआई, या किसी अन्य चैनल के माध्यम से बनाए गए हों।

EventFires when
task.createdA new task is created
task.runningThe agent starts executing
task.completedTask finishes successfully
task.failedTask fails
task.canceledTask is canceled by user
POST /webhooks
FieldTypeRequiredDescription
urlstringYesHTTPS endpoint URL
eventsstring[]YesEvents to subscribe to
descriptionstringNoHuman-readable label (max 500 chars)
secretstringNoPre-shared secret (max 500 chars). When set, included as X-Webhook-Secret header in every delivery.
Terminal window
# Webhook without secret
curl -X POST https://api.rebyte.ai/v1/webhooks \
-H "API_KEY: rbk_xxx" \
-H "Content-Type: application/json" \
-d '{
"url": "https://your-server.com/webhook",
"events": ["task.completed", "task.failed"]
}'
# Webhook with pre-shared secret
curl -X POST https://api.rebyte.ai/v1/webhooks \
-H "API_KEY: rbk_xxx" \
-H "Content-Type: application/json" \
-d '{
"url": "https://your-server.com/webhook",
"events": ["task.completed", "task.failed"],
"secret": "my-shared-secret-value"
}'

प्रतिक्रिया (201):

{
"id": "880e8400-...",
"url": "https://your-server.com/webhook",
"events": ["task.completed", "task.failed"],
"description": null,
"hasSecret": true,
"isActive": true,
"createdAt": "2026-01-28T12:00:00.000Z",
"lastTriggeredAt": null,
"failureCount": 0
}

व्यवहार संबंधी नोट्स:

  • डुप्लिकेट यूआरएल: एक ही यूआरएल को दो बार पंजीकृत करने पर मौजूदा वेबहुक वापस आ जाता है (आइडम्पोटेंट)
  • सीमा: प्रति संगठन अधिकतम 3 वेबहुक। चौथा limit_exceeded लौटाता है।
  • गुप्त भंडारण: गुप्त मान किसी भी प्रतिक्रिया में कभी वापस नहीं किया जाता है। केवल hasSecret: true/false ही उजागर होता है।

वेबहुक सूचीबद्ध करें

Section titled “वेबहुक सूचीबद्ध करें”
GET /webhooks

आपके संगठन के सभी वेबहुक को स्थिति जानकारी (lastTriggeredAt, failureCount, isActive) के साथ लौटाता है। रहस्य कभी उजागर नहीं होते हैं।

वेबहुक प्राप्त करें

Section titled “वेबहुक प्राप्त करें”
GET /webhooks/:id
DELETE /webhooks/:id

204 No Content लौटाता है। हटाए गए वेबहुक तुरंत डिलीवरी प्राप्त करना बंद कर देते हैं।

जब कोई कार्य इवेंट वेबहुक के सब्सक्राइब किए गए इवेंट से मेल खाता है, तो Rebyte वेबहुक यूआरएल पर एक HTTP POST भेजता है।

पेलोड:

{
"event": "task.completed",
"taskId": "550e8400-e29b-41d4-a716-446655440000",
"timestamp": 1706443200,
"data": {
"status": "succeeded",
"taskUrl": "https://app.rebyte.ai/run/550e8400-...",
"result": "Created CSV file with 10 Hacker News posts..."
}
}
  • status — प्रॉम्प्ट स्थिति: pending (task.created), running (task.running), succeeded (task.completed), failed (task.failed), canceled (task.canceled)
  • taskUrl — Rebyte UI में कार्य का सीधा लिंक (हमेशा मौजूद)
  • result — अंतिम एआई आउटपुट टेक्स्ट (टर्मिनल इवेंट पर मौजूद: task.completed, task.failed, task.canceled; task.created और task.running पर अनुपस्थित)

प्रॉम्प्ट इतिहास सहित पूर्ण कार्य विवरण के लिए GET /tasks/:id कॉल करें।

डिलीवरी हेडर:

HeaderAlways presentDescription
Content-TypeYesapplication/json
X-Webhook-SignatureYesBase64-encoded RSA-SHA256 signature
X-Webhook-TimestampYesUnix timestamp (seconds)
X-Webhook-SecretOnly if secret configuredThe pre-shared secret value you set on creation

टाइमआउट: डिलीवरी 10 सेकंड के बाद टाइम आउट हो जाती है।

विफलता प्रबंधन:

  • डिलीवरी फायर-एंड-फॉरगेट है — विफलता पर कोई स्वचालित पुनः प्रयास नहीं होता है
  • गैर-2xx प्रतिक्रियाएं failureCount को बढ़ाती हैं
  • 10 लगातार विफलताओं के बाद, वेबहुक स्वचालित रूप से अक्षम हो जाता है (isActive: false)
  • सफल डिलीवरी failureCount को 0 पर रीसेट करती है

हस्ताक्षर सत्यापन

Section titled “हस्ताक्षर सत्यापन”

प्रत्येक डिलीवरी आपके संगठन के RSA-2048 कुंजी जोड़े के साथ हस्ताक्षरित होती है, भले ही एक पूर्व-साझा रहस्य कॉन्फ़िगर किया गया हो या नहीं।

यह कैसे काम करता है:

  1. Rebyte {timestamp}.{body} को जोड़ता है (उदाहरण के लिए, 1706443200.{"event":"task.completed",...})
  2. आपके संगठन की निजी कुंजी का उपयोग करके RSA-SHA256 के साथ स्ट्रिंग पर हस्ताक्षर करता है
  3. X-Webhook-Signature में base64-एन्कोडेड हस्ताक्षर भेजता है

अपनी सार्वजनिक कुंजी प्राप्त करें: सहायता से संपर्क करें या इसे Rebyte डैशबोर्ड से प्राप्त करें। RSA-2048 कुंजी जोड़ा पहले वेबहुक निर्माण पर स्वचालित रूप से उत्पन्न होता है और संगठन के लिए बना रहता है।

सत्यापन उदाहरण (Node.js):

const crypto = require('crypto');
function verifyWebhook(rawBody, timestamp, signature, publicKey) {
const payload = `${timestamp}.${rawBody}`;
const verifier = crypto.createVerify('RSA-SHA256');
verifier.update(payload);
return verifier.verify(publicKey, signature, 'base64');
}
// In your webhook handler:
app.post('/webhook', (req, res) => {
const rawBody = req.body; // must be raw string, not parsed JSON
const timestamp = req.headers['x-webhook-timestamp'];
const signature = req.headers['x-webhook-signature'];
if (!verifyWebhook(rawBody, timestamp, signature, PUBLIC_KEY)) {
return res.status(401).send('Invalid signature');
}
const event = JSON.parse(rawBody);
console.log(`Task ${event.taskId}: ${event.event}`);
res.status(200).send('OK');
});

सत्यापन उदाहरण (Python):

from cryptography.hazmat.primitives import hashes, serialization
from cryptography.hazmat.primitives.asymmetric import padding
import base64
def verify_webhook(raw_body: str, timestamp: str, signature: str, public_key_pem: str) -> bool:
public_key = serialization.load_pem_public_key(public_key_pem.encode())
payload = f"{timestamp}.{raw_body}".encode()
try:
public_key.verify(
base64.b64decode(signature),
payload,
padding.PKCS1v15(),
hashes.SHA256()
)
return True
except Exception:
return False

वेबहुक दो स्वतंत्र सत्यापन विधियों का समर्थन करते हैं जिनका एक साथ उपयोग किया जा सकता है:

MethodHeaderHow it worksUse case
RSA signatureX-Webhook-SignatureCryptographic proof the payload came from RebyteTamper-proof verification
Pre-shared secretX-Webhook-SecretStatic string you set on creation, echoed back in every deliverySimple shared-secret check

RSA हस्ताक्षर हमेशा मौजूद होते हैं। पूर्व-साझा रहस्य वैकल्पिक है — यदि आप एक सरल सत्यापन पथ चाहते हैं तो वेबहुक बनाते समय इसे सेट करें।


पूर्ण उदाहरण: एक कार्य बनाएं, पूर्ण होने तक पोल करें, फिर एक अनुवर्ती भेजें।

Terminal window
# Create task
TASK_ID=$(curl -s -X POST https://api.rebyte.ai/v1/tasks \
-H "API_KEY: rbk_xxx" \
-H "Content-Type: application/json" \
-d '{"prompt": "Write a Python CLI that converts CSV to JSON"}' | jq -r '.id')
echo "Task: https://app.rebyte.ai/run/$TASK_ID"
# Poll until done
while true; do
STATUS=$(curl -s https://api.rebyte.ai/v1/tasks/$TASK_ID \
-H "API_KEY: rbk_xxx" | jq -r '.status')
echo "Status: $STATUS"
[[ "$STATUS" == "completed" || "$STATUS" == "failed" ]] && break
sleep 5
done
# Send a follow-up
curl -s -X POST https://api.rebyte.ai/v1/tasks/$TASK_ID/prompts \
-H "API_KEY: rbk_xxx" \
-H "Content-Type: application/json" \
-d '{"prompt": "Now add support for nested JSON objects"}'

सभी त्रुटियां इस संरचना का पालन करती हैं:

{
"error": {
"code": "validation_error",
"message": "Invalid request body"
}
}
CodeHTTP StatusDescription
missing_api_key401API_KEY header not provided
invalid_api_key401Invalid or expired API key
validation_error400Request body failed validation
not_found404Resource does not exist or is not accessible
limit_exceeded400Organization limit reached (e.g., max webhooks)
agent_disabled403The requested executor is disabled for this organization
internal_error500Server-side failure

एपीआई वर्तमान में प्रति-कुंजी दर सीमाओं को लागू नहीं करता है। प्रत्येक POST /tasks एक वास्तविक VM का प्रावधान करता है, इसलिए लागत उपयोग के साथ बढ़ती है। अनावश्यक अनुरोधों को कम करने के लिए आक्रामक पोलिंग के बजाय वेबहुक का उपयोग करें।