Tasks API
Dette indhold er ikke tilgængeligt i dit sprog endnu.
Create Task
Section titled “Create Task”POST /tasksCreates a new task. By default, provisions a new VM (workspace). Pass workspaceId to run the task on an existing workspace instead — this skips provisioning and is significantly faster.
Request body:
| Field | Type | Required | Description |
|---|---|---|---|
prompt | string | Yes | Task description (max 100,000 chars) |
executor | string | No | claude (default), gemini, codex, opencode |
model | string | No | Model tier for the executor. See Models. |
workspaceId | string | No | UUID of an existing workspace to reuse |
files | object[] | No | Files from POST /files. Each: {"id": "...", "filename": "..."} |
skills | string[] | No | Skill slugs (e.g., ["deep-research", "pdf"]) |
githubUrl | string | No | GitHub repo in owner/repo format |
branchName | string | No | Branch name (default: main) |
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" }'Response (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"}Save the workspaceId from the response to create follow-on tasks on the same workspace:
# First task -- provisions a new VMRESP=$(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\"}"Models
Section titled “Models”Available models depend on the executor. See Agent Harness for full details on executors and model routing.
| Executor | Available Models | Default |
|---|---|---|
claude | claude-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-flash | claude-sonnet-4.6 |
codex | gpt-5.4, gpt-5.3-codex | gpt-5.4 |
gemini | auto-gemini-3 (auto-routes between flash and pro) | auto-gemini-3 |
opencode | Same as claude | gemini-3.1-pro |
With BYOK (bring your own API key), only the executor’s native provider models are available (e.g., claude executor with BYOK only gets claude-sonnet-4.6 and claude-opus-4.6).
List Tasks
Section titled “List Tasks”GET /tasks?limit=50&offset=0Returns tasks created via the API, sorted by creation time (newest first).
| Param | Type | Default | Description |
|---|---|---|---|
limit | number | 50 | Results per page (max 100) |
offset | number | 0 | Pagination offset |
curl "https://api.rebyte.ai/v1/tasks?limit=10" \ -H "API_KEY: rbk_xxx"Response:
{ "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}Get Task
Section titled “Get Task”GET /tasks/:idReturns full task details including prompt history and derived status.
curl https://api.rebyte.ai/v1/tasks/550e8400-... \ -H "API_KEY: rbk_xxx"Response:
{ "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" } ]}Task status is derived from prompt states:
| Status | Condition |
|---|---|
running | Any prompt is pending or running |
completed | All prompts terminal, latest is succeeded |
failed | All prompts terminal, latest is failed |
canceled | All prompts terminal, latest is canceled |
Send Follow-Up
Section titled “Send Follow-Up”POST /tasks/:id/promptsSend a follow-up prompt to a running or completed task. If the VM is stopped, it is automatically resumed.
| Field | Type | Required | Description |
|---|---|---|---|
prompt | string | Yes | Follow-up prompt (max 100,000 chars) |
skills | string[] | No | Additional skill slugs for this prompt |
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"}'Response (201):
{ "promptId": "770f9500-..."}Cancel Task
Section titled “Cancel Task”POST /tasks/:id/cancelCancels all running and pending prompts for a task. Also sends a /cancel signal to the agent via gRPC (best-effort).
curl -X POST https://api.rebyte.ai/v1/tasks/550e8400-.../cancel \ -H "API_KEY: rbk_xxx"Response:
{ "id": "550e8400-...", "status": "canceled", "canceledPrompts": 1}Stream Events (SSE)
Section titled “Stream Events (SSE)”GET /tasks/:id/eventsOpens a Server-Sent Events stream for the task’s latest prompt. Events include agent output (stdout, stderr), tool calls, and completion signals.
curl -N https://api.rebyte.ai/v1/tasks/550e8400-.../events \ -H "API_KEY: rbk_xxx"The stream emits two event types:
event— execution events (agent output, tool calls)done— final event with completion status, then the stream closes
Change Visibility
Section titled “Change Visibility”PATCH /tasks/:id/visibility| Field | Type | Required | Description |
|---|---|---|---|
visibility | string | Yes | private, shared, or public |
| Level | Who can view |
|---|---|
private | Only the API key owner |
shared | All organization members (default) |
public | Anyone with the link (read-only) |
curl -X PATCH https://api.rebyte.ai/v1/tasks/550e8400-.../visibility \ -H "API_KEY: rbk_xxx" \ -H "Content-Type: application/json" \ -d '{"visibility": "public"}'When set to public, the response includes a shareUrl for unauthenticated access.
Delete Task
Section titled “Delete Task”DELETE /tasks/:idSoft-deletes the task. Returns 204 No Content.
curl -X DELETE https://api.rebyte.ai/v1/tasks/550e8400-... \ -H "API_KEY: rbk_xxx"Upload files to attach to tasks. Uses a two-step signed-URL flow.
Step 1: Get Upload URL
Section titled “Step 1: Get Upload URL”POST /files| Field | Type | Required | Description |
|---|---|---|---|
filename | string | Yes | File name (max 255 chars) |
contentType | string | No | MIME type (default: application/octet-stream) |
Response (201):
{ "id": "550e8400-...", "filename": "data.csv", "uploadUrl": "https://storage.googleapis.com/...", "maxFileSize": 52428800}The upload URL expires in 1 hour.
Step 2: Upload the File
Section titled “Step 2: Upload the File”curl -X PUT "UPLOAD_URL_FROM_STEP_1" \ -H "Content-Type: application/octet-stream" \ --data-binary @data.csvStep 3: Attach to Task
Section titled “Step 3: Attach to Task”Pass id and filename from Step 1 when creating a task:
{ "prompt": "Analyze the uploaded data", "files": [ {"id": "550e8400-...", "filename": "data.csv"} ]}Files are automatically copied into the task’s VM when execution begins.
Workspace Artifacts
Section titled “Workspace Artifacts”Manage files produced by tasks (reports, generated code, built binaries, etc.). Each workspace has its own artifact store.
Allowed file types: .pdf, .doc, .docx, .xls, .xlsx, .ppt, .pptx, .csv, .tsv, .rtf, .epub, .html, .htm, .zip, .gz, .tar, .tgz, .png, .jpg, .jpeg, .gif, .webp, .svg, .tiff, .tif, .bmp, .avif, .mp4, .webm, .mov, .avi, .mkv, .mp3, .wav, .ogg, .aac, .flac, .m4a.
List Artifacts
Section titled “List Artifacts”GET /workspaces/:id/artifactsLists all artifact files in a workspace.
curl https://api.rebyte.ai/v1/workspaces/660e8400-.../artifacts \ -H "API_KEY: rbk_xxx"Response:
{ "data": [ { "name": "report.pdf", "size": 245120, "contentType": "application/pdf", "downloadUrl": "https://storage.googleapis.com/..." } ]}Download Artifact
Section titled “Download Artifact”GET /workspaces/:id/artifacts/:filenameDownloads a single artifact file. Returns the file as a binary stream with Content-Disposition: attachment.
curl -o report.pdf \ https://api.rebyte.ai/v1/workspaces/660e8400-.../artifacts/report.pdf \ -H "API_KEY: rbk_xxx"Upload Artifacts (Direct)
Section titled “Upload Artifacts (Direct)”POST /workspaces/:id/artifactsUpload files directly as multipart/form-data. Max 10 files, 10 MB each. Uses merge semantics — existing files with different names are preserved.
curl -X POST https://api.rebyte.ai/v1/workspaces/660e8400-.../artifacts \ -H "API_KEY: rbk_xxx" \ -F "files=@report.pdf" \ -F "files=@data.csv"Response (201):
{ "uploaded": [ {"name": "report.pdf", "size": 245120, "contentType": "application/pdf"}, {"name": "data.csv", "size": 1024, "contentType": "text/csv"} ]}Upload Artifacts (Signed URL)
Section titled “Upload Artifacts (Signed URL)”POST /workspaces/:id/artifacts/upload-urlFor large files, request signed upload URLs and upload directly to cloud storage. Max 50 files per request.
Request body:
{ "files": [ {"name": "large-dataset.csv", "contentType": "text/csv"}, {"name": "model.zip"} ]}Response:
{ "files": [ { "name": "large-dataset.csv", "uploadUrl": "https://storage.googleapis.com/...", "expiresAt": "2026-01-28T13:00:00.000Z" } ]}Upload URLs expire in 15 minutes. Upload via PUT:
curl -X PUT "UPLOAD_URL" \ -H "Content-Type: text/csv" \ --data-binary @large-dataset.csvDelete Artifact
Section titled “Delete Artifact”DELETE /workspaces/:id/artifacts/:filenameDeletes a single artifact file. Returns 204 No Content.
curl -X DELETE \ https://api.rebyte.ai/v1/workspaces/660e8400-.../artifacts/report.pdf \ -H "API_KEY: rbk_xxx"Delete All Artifacts
Section titled “Delete All Artifacts”DELETE /workspaces/:id/artifactsDeletes all artifact files in a workspace. Returns 204 No Content.
Polling Example
Section titled “Polling Example”Complete example: create a task, poll until completion, then send a follow-up.
# Create taskTASK_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 donewhile 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 5done
# Send a follow-upcurl -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"}'