Zum Inhalt springen

Tasks API

Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.

POST /tasks

Creates 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:

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"
}'

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:

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\"}"

Available models depend on the executor. See Agent Harness for full details on executors and model routing.

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

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).


GET /tasks?limit=50&offset=0

Returns tasks created via the API, sorted by creation time (newest first).

ParamTypeDefaultDescription
limitnumber50Results per page (max 100)
offsetnumber0Pagination offset
Terminal window
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 /tasks/:id

Returns full task details including prompt history and derived status.

Terminal window
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:

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

Send a follow-up prompt to a running or completed task. If the VM is stopped, it is automatically resumed.

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"}'

Response (201):

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

POST /tasks/:id/cancel

Cancels all running and pending prompts for a task. Also sends a /cancel signal to the agent via gRPC (best-effort).

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

Response:

{
"id": "550e8400-...",
"status": "canceled",
"canceledPrompts": 1
}

GET /tasks/:id/events

Opens a Server-Sent Events stream for the task’s latest prompt. Events include agent output (stdout, stderr), tool calls, and completion signals.

Terminal window
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

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"}'

When set to public, the response includes a shareUrl for unauthenticated access.


DELETE /tasks/:id

Soft-deletes the task. Returns 204 No Content.

Terminal window
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.

POST /files
FieldTypeRequiredDescription
filenamestringYesFile name (max 255 chars)
contentTypestringNoMIME 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.

Terminal window
curl -X PUT "UPLOAD_URL_FROM_STEP_1" \
-H "Content-Type: application/octet-stream" \
--data-binary @data.csv

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.


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.

GET /workspaces/:id/artifacts

Lists all artifact files in a workspace.

Terminal window
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/..."
}
]
}
GET /workspaces/:id/artifacts/:filename

Downloads a single artifact file. Returns the file as a binary stream with Content-Disposition: attachment.

Terminal window
curl -o report.pdf \
https://api.rebyte.ai/v1/workspaces/660e8400-.../artifacts/report.pdf \
-H "API_KEY: rbk_xxx"
POST /workspaces/:id/artifacts

Upload files directly as multipart/form-data. Max 10 files, 10 MB each. Uses merge semantics — existing files with different names are preserved.

Terminal window
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"}
]
}
POST /workspaces/:id/artifacts/upload-url

For 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:

Terminal window
curl -X PUT "UPLOAD_URL" \
-H "Content-Type: text/csv" \
--data-binary @large-dataset.csv
DELETE /workspaces/:id/artifacts/:filename

Deletes a single artifact file. Returns 204 No Content.

Terminal window
curl -X DELETE \
https://api.rebyte.ai/v1/workspaces/660e8400-.../artifacts/report.pdf \
-H "API_KEY: rbk_xxx"
DELETE /workspaces/:id/artifacts

Deletes all artifact files in a workspace. Returns 204 No Content.


Complete example: create a task, poll until completion, then send a follow-up.

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"}'