Create a sandbox
curl --request POST \
--url https://sparkles.dev/api/public/v1/sandboxes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"repos": [
{
"fullName": "<string>",
"ref": "<string>"
}
],
"prompt": "<string>",
"model": "<string>",
"title": "<string>",
"toolApprovalMode": "auto",
"metadata": {}
}
'import requests
url = "https://sparkles.dev/api/public/v1/sandboxes"
payload = {
"repos": [
{
"fullName": "<string>",
"ref": "<string>"
}
],
"prompt": "<string>",
"model": "<string>",
"title": "<string>",
"toolApprovalMode": "auto",
"metadata": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
repos: [{fullName: '<string>', ref: '<string>'}],
prompt: '<string>',
model: '<string>',
title: '<string>',
toolApprovalMode: 'auto',
metadata: {}
})
};
fetch('https://sparkles.dev/api/public/v1/sandboxes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sparkles.dev/api/public/v1/sandboxes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'repos' => [
[
'fullName' => '<string>',
'ref' => '<string>'
]
],
'prompt' => '<string>',
'model' => '<string>',
'title' => '<string>',
'toolApprovalMode' => 'auto',
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sparkles.dev/api/public/v1/sandboxes"
payload := strings.NewReader("{\n \"repos\": [\n {\n \"fullName\": \"<string>\",\n \"ref\": \"<string>\"\n }\n ],\n \"prompt\": \"<string>\",\n \"model\": \"<string>\",\n \"title\": \"<string>\",\n \"toolApprovalMode\": \"auto\",\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sparkles.dev/api/public/v1/sandboxes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"repos\": [\n {\n \"fullName\": \"<string>\",\n \"ref\": \"<string>\"\n }\n ],\n \"prompt\": \"<string>\",\n \"model\": \"<string>\",\n \"title\": \"<string>\",\n \"toolApprovalMode\": \"auto\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sparkles.dev/api/public/v1/sandboxes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"repos\": [\n {\n \"fullName\": \"<string>\",\n \"ref\": \"<string>\"\n }\n ],\n \"prompt\": \"<string>\",\n \"model\": \"<string>\",\n \"title\": \"<string>\",\n \"toolApprovalMode\": \"auto\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"worktreeId": "<string>",
"object": "sandbox",
"status": "queued",
"title": "<string>",
"repos": [
{
"fullName": "<string>",
"ref": "<string>"
}
],
"model": "<string>",
"agentRuntime": "opencode",
"turn": {
"active": true
},
"usage": {
"llmRequestCount": 4503599627370495,
"costMicroUsd": 4503599627370495,
"creditsChargedMicros": 4503599627370495
},
"metadata": {},
"error": "<string>",
"createdAt": "<string>",
"startedAt": "<string>",
"completedAt": "<string>",
"links": {
"self": "<string>",
"events": "<string>",
"messages": "<string>"
}
}{
"id": "<string>",
"worktreeId": "<string>",
"object": "sandbox",
"status": "queued",
"title": "<string>",
"repos": [
{
"fullName": "<string>",
"ref": "<string>"
}
],
"model": "<string>",
"agentRuntime": "opencode",
"turn": {
"active": true
},
"usage": {
"llmRequestCount": 4503599627370495,
"costMicroUsd": 4503599627370495,
"creditsChargedMicros": 4503599627370495
},
"metadata": {},
"error": "<string>",
"createdAt": "<string>",
"startedAt": "<string>",
"completedAt": "<string>",
"links": {
"self": "<string>",
"events": "<string>",
"messages": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Create a sandbox
Creates an asynchronously booting sandbox. An identical Idempotency-Key retry returns the same sandbox; changed request fields return 409.
POST
/
api
/
public
/
v1
/
sandboxes
Create a sandbox
curl --request POST \
--url https://sparkles.dev/api/public/v1/sandboxes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"repos": [
{
"fullName": "<string>",
"ref": "<string>"
}
],
"prompt": "<string>",
"model": "<string>",
"title": "<string>",
"toolApprovalMode": "auto",
"metadata": {}
}
'import requests
url = "https://sparkles.dev/api/public/v1/sandboxes"
payload = {
"repos": [
{
"fullName": "<string>",
"ref": "<string>"
}
],
"prompt": "<string>",
"model": "<string>",
"title": "<string>",
"toolApprovalMode": "auto",
"metadata": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
repos: [{fullName: '<string>', ref: '<string>'}],
prompt: '<string>',
model: '<string>',
title: '<string>',
toolApprovalMode: 'auto',
metadata: {}
})
};
fetch('https://sparkles.dev/api/public/v1/sandboxes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sparkles.dev/api/public/v1/sandboxes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'repos' => [
[
'fullName' => '<string>',
'ref' => '<string>'
]
],
'prompt' => '<string>',
'model' => '<string>',
'title' => '<string>',
'toolApprovalMode' => 'auto',
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sparkles.dev/api/public/v1/sandboxes"
payload := strings.NewReader("{\n \"repos\": [\n {\n \"fullName\": \"<string>\",\n \"ref\": \"<string>\"\n }\n ],\n \"prompt\": \"<string>\",\n \"model\": \"<string>\",\n \"title\": \"<string>\",\n \"toolApprovalMode\": \"auto\",\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sparkles.dev/api/public/v1/sandboxes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"repos\": [\n {\n \"fullName\": \"<string>\",\n \"ref\": \"<string>\"\n }\n ],\n \"prompt\": \"<string>\",\n \"model\": \"<string>\",\n \"title\": \"<string>\",\n \"toolApprovalMode\": \"auto\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sparkles.dev/api/public/v1/sandboxes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"repos\": [\n {\n \"fullName\": \"<string>\",\n \"ref\": \"<string>\"\n }\n ],\n \"prompt\": \"<string>\",\n \"model\": \"<string>\",\n \"title\": \"<string>\",\n \"toolApprovalMode\": \"auto\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"worktreeId": "<string>",
"object": "sandbox",
"status": "queued",
"title": "<string>",
"repos": [
{
"fullName": "<string>",
"ref": "<string>"
}
],
"model": "<string>",
"agentRuntime": "opencode",
"turn": {
"active": true
},
"usage": {
"llmRequestCount": 4503599627370495,
"costMicroUsd": 4503599627370495,
"creditsChargedMicros": 4503599627370495
},
"metadata": {},
"error": "<string>",
"createdAt": "<string>",
"startedAt": "<string>",
"completedAt": "<string>",
"links": {
"self": "<string>",
"events": "<string>",
"messages": "<string>"
}
}{
"id": "<string>",
"worktreeId": "<string>",
"object": "sandbox",
"status": "queued",
"title": "<string>",
"repos": [
{
"fullName": "<string>",
"ref": "<string>"
}
],
"model": "<string>",
"agentRuntime": "opencode",
"turn": {
"active": true
},
"usage": {
"llmRequestCount": 4503599627370495,
"costMicroUsd": 4503599627370495,
"creditsChargedMicros": 4503599627370495
},
"metadata": {},
"error": "<string>",
"createdAt": "<string>",
"startedAt": "<string>",
"completedAt": "<string>",
"links": {
"self": "<string>",
"events": "<string>",
"messages": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Authorizations
Long-lived opaque API key minted by an approved user at /api. The secret is shown once, stored only as a SHA-256 digest, and disabled immediately when either the key or its API access grant is revoked.
Headers
Required string length:
1 - 255Body
application/json
Minimum array length:
1Show child attributes
Show child attributes
Required string length:
1 - 60000Required string length:
1 - 200Available options:
none, low, medium, high, xhigh, max, ultra, ultracode Required string length:
1 - 120Available options:
auto, prompt Show child attributes
Show child attributes
Response
An identical sandbox creation was already accepted
Pattern:
^c_[a-z2-9]{12}$Minimum string length:
1Allowed value:
"sandbox"Available options:
queued, creating, running, succeeded, failed, terminating, terminated Show child attributes
Show child attributes
Available options:
opencode, codex, claude, grok Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes