freestyle-sandboxes 0.0.97 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -48
- package/index.cjs +4362 -0
- package/index.d.cts +9401 -0
- package/index.d.mts +9401 -0
- package/index.mjs +4348 -0
- package/package.json +16 -109
- package/dist/ai/inde.d.cts +0 -75
- package/dist/ai/inde.d.mts +0 -75
- package/dist/ai/index.cjs +0 -13
- package/dist/ai/index.d.cts +0 -75
- package/dist/ai/index.d.mts +0 -75
- package/dist/ai/index.mjs +0 -4
- package/dist/expo/inde.d.cts +0 -6
- package/dist/expo/inde.d.mts +0 -6
- package/dist/expo/index.cjs +0 -319
- package/dist/expo/index.d.cts +0 -6
- package/dist/expo/index.d.mts +0 -6
- package/dist/expo/index.mjs +0 -297
- package/dist/inde.d.cts +0 -373
- package/dist/inde.d.mts +0 -373
- package/dist/index-BKAG8L-o.mjs +0 -3061
- package/dist/index-DuOpIaWc.cjs +0 -3068
- package/dist/index.cjs +0 -1329
- package/dist/index.d-9H_wnIbz.d.ts +0 -4223
- package/dist/index.d.cts +0 -373
- package/dist/index.d.mts +0 -373
- package/dist/index.mjs +0 -1327
- package/dist/langgraph/inde.d.cts +0 -4180
- package/dist/langgraph/inde.d.mts +0 -4180
- package/dist/langgraph/index.cjs +0 -17155
- package/dist/langgraph/index.d.cts +0 -4180
- package/dist/langgraph/index.d.mts +0 -4180
- package/dist/langgraph/index.mjs +0 -17153
- package/dist/mastra/inde.d.cts +0 -2623
- package/dist/mastra/inde.d.mts +0 -2623
- package/dist/mastra/index.cjs +0 -55
- package/dist/mastra/index.d.cts +0 -2623
- package/dist/mastra/index.d.mts +0 -2623
- package/dist/mastra/index.mjs +0 -53
- package/dist/react/dev-server/index..d.cts +0 -33
- package/dist/react/dev-server/index..d.mts +0 -33
- package/dist/react/dev-server/index.cjs +0 -148
- package/dist/react/dev-server/index.d.cts +0 -33
- package/dist/react/dev-server/index.d.mts +0 -33
- package/dist/react/dev-server/index.mjs +0 -145
- package/dist/types.gen-CJa21P0C.d.ts +0 -1902
- package/dist/types.gen-DKjMRuu5.d.ts +0 -1898
- package/dist/utils/inde.d.cts +0 -10
- package/dist/utils/inde.d.mts +0 -10
- package/dist/utils/index.cjs +0 -100
- package/dist/utils/index.d.cts +0 -10
- package/dist/utils/index.d.mts +0 -10
- package/dist/utils/index.mjs +0 -75
- package/openapi/index.ts +0 -3
- package/openapi/sdk.gen.ts +0 -929
- package/openapi/types.gen.ts +0 -2234
- package/openapi-ts.config.ts +0 -7
- package/openapi.json +0 -1
- package/src/ai/index.ts +0 -164
- package/src/dev-server.ts +0 -95
- package/src/expo/_expo_internals.ts +0 -389
- package/src/expo/index.ts +0 -26
- package/src/index.ts +0 -1459
- package/src/langgraph/index.ts +0 -33
- package/src/mastra/index.ts +0 -38
- package/src/react/dev-server/index.tsx +0 -195
- package/src/react/dev-server/types.ts +0 -5
- package/src/utils/index.ts +0 -97
- package/tsconfig.json +0 -8
package/openapi-ts.config.ts
DELETED
package/openapi.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"openapi":"3.1.0","info":{"title":"Freestyle Sandboxes","description":"\nFreestyle Sandboxes lets you deploy your users or AIs code. **Get your API Key at [admin.freestyle.sh](https://admin.freestyle.sh)**\n\nThey are broken up into core 5 categories: [Web](#tag/web), [Execute](#tag/execute), [Cloudstate](#tag/cloudstate), [Git](#tag/git), and [Domains](#tag/domains).\n\n[Web](#tag/web): Send us the code for the website, we'll provision the certificates and get it hosted\n\n[Execute](#tag/execute): Send us a function, we'll run it and send you the output\n\n[Cloudstate](#tag/cloudstate): Our Opensource JavaScript Runtime used for cloud functions with persistent state\n\n[Domains](#tag/domains): Manage your domains, including verification and listing\n\n[Git](#tag/git): Manage your git repositories\n","contact":{"name":"Ben","email":"ben@freestyle.sh"},"license":{"name":"Closed Source"},"version":"0.1.0"},"servers":[{"url":"https://api.freestyle.sh","description":"Production"}],"paths":{"/cloudstate/v1/deploy":{"post":{"tags":["Cloudstate"],"summary":"Deploy Cloudstate Project","description":"Deploy a cloudstate project","operationId":"handle_deploy_cloudstate","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreestyleCloudstateDeployRequest"}}},"required":true},"responses":{"200":{"description":"successfully deployed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreestyleCloudstateDeploySuccessResponse"}}}},"500":{"description":"failed to deploy","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreestyleCloudstateDeployErrorResponse"}}}}}}},"/cloudstate/v1/projects/{id}/backup":{"get":{"tags":["Cloudstate"],"summary":"Get Backup of Cloudstate Project","description":"Get a backup of a cloudstate project","operationId":"handle_backup_cloudstate","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"successfully backed up","content":{"application/octet-stream":{"schema":{"type":"array","items":{"type":"integer","format":"int32","minimum":0}}}}},"500":{"description":"failed to backup"}}}},"/dns/v1/records":{"get":{"tags":["DNS"],"summary":"List DNS Records","operationId":"handle_list_records","parameters":[{"name":"domain","in":"query","required":true,"schema":{"type":"string"},"example":"example.com"}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListRecordsResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}}},"post":{"tags":["DNS"],"summary":"Create DNS Record","operationId":"handle_create_record","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRecordParams"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRecordResponse"}}}},"403":{"description":"Account does not own the domain","content":{"application/json":{"schema":{"type":"object","required":["domain","account_id"],"properties":{"domain":{"type":"string"},"account_id":{"type":"string"}}}}}},"500":{"description":"Error creating DNS record","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}}},"delete":{"tags":["DNS"],"summary":"Delete DNS Record","operationId":"handle_delete_record","parameters":[{"name":"domain","in":"query","required":true,"schema":{"type":"string"},"example":"example.com"},{"name":"record","in":"query","required":true,"schema":{"$ref":"#/components/schemas/DnsRecord"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteRecordResponse"}}}},"403":{"description":"Account does not own the domain","content":{"application/json":{"schema":{"type":"object","required":["domain","account_id"],"properties":{"domain":{"type":"string"},"account_id":{"type":"string"}}}}}},"500":{"description":"Error deleting DNS record","content":{"application/json":{"schema":{"type":"object","required":["domain","name"],"properties":{"domain":{"type":"string"},"name":{"type":"string"}}}}}}}}},"/domains/v1/certs/{domain}/wildcard":{"post":{"tags":["Certs","Domains"],"summary":"Provision a wildcard certificate","description":"Provisions a wildcard certificate for a verified domain\n\n\nThis speeds up deploys on all subdomains of the domain. In order to use it, you must add the following record to your DNS config:\n\n`_acme-challenge.yourdomain.com` NS `dns.freestyle.sh`","operationId":"handle_verify_wildcard","parameters":[{"name":"domain","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Domain verified","content":{"application/json":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"type":"string","example":"example.com"}}}}}},"400":{"description":"Failed to preverify domain","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}},"x-codeSamples":[{"label":"JS SDK","lang":"javascript","source":"import { FreestyleSandboxes } from 'freestyle-sandboxes';\n\nconst sandboxes = new FreestyleSandboxes({\n apiKey: 'your-api-key',\n});\n\nsandboxes.provisionWildcard('example.com').then((cert) => {\n console.log(cert);\n});"}]}},"/domains/v1/domains":{"get":{"tags":["Domains"],"summary":"List domains for an account","description":"This lists the domains that an account has verified ownership of. This includes the *.style.dev domains the account has claimed.","operationId":"handle_list_domains","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":["integer","null"],"format":"int64"}},{"name":"offset","in":"query","required":false,"schema":{"type":["integer","null"],"format":"int64"}},{"name":"implicitlyOwned","in":"query","required":false,"schema":{"type":["boolean","null"]}}],"responses":{"200":{"description":"List of domains","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","required":["domain","accountId","createdAt","id","verifiedDns","implicitlyOwned","deployToDomain","manageDns","deployToSubdomains"],"properties":{"domain":{"type":"string"},"accountId":{"type":"string","format":"uuid"},"createdAt":{"type":"string","format":"date-time"},"id":{"type":"string","format":"uuid"},"verifiedDns":{"type":"boolean"},"implicitlyOwned":{"type":"boolean"},"deployToDomain":{"type":"boolean"},"manageDns":{"type":"boolean"},"deployToSubdomains":{"type":"boolean"}}}}}}},"400":{"description":"Failed to get domains","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}},"x-codeSamples":[{"label":"JS SDK","lang":"javascript","source":"import { FreestyleSandboxes } from 'freestyle-sandboxes';\n\nconst sandboxes = new FreestyleSandboxes({\n apiKey: 'your-api-key',\n});\n\nsandboxes.listDomains().then((response) => {\n console.log(response);\n});"}]}},"/domains/v1/mappings":{"get":{"tags":["Domains"],"summary":"List Domain Mappings","description":"List domain mappings for any query based on exact domain or domain ownership (the domain ownership that gave the right to use the domain)","operationId":"handle_list_domain_mappings","parameters":[{"name":"offset","in":"query","required":false,"schema":{"type":["integer","null"],"format":"int64"}},{"name":"limit","in":"query","required":false,"schema":{"type":["integer","null"],"format":"int64"}},{"name":"domainOwnership","in":"query","required":false,"schema":{"type":["string","null"],"format":"uuid"}},{"name":"domain","in":"query","required":false,"schema":{"type":["string","null"]}}],"responses":{"200":{"description":"List of domain mappings","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/FreestyleSandboxDomainMapping"}}}}},"401":{"description":"Unauthorized"}}}},"/domains/v1/mappings/{domain}":{"post":{"tags":["Domains"],"summary":"Insert Domain Mapping","description":"This will unmap any other deployment to this domain","operationId":"handle_insert_domain_mapping","parameters":[{"name":"domain","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDomainMappingRequest"}}},"required":true},"responses":{"200":{"description":"Successfully mapped domain to deployment","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreestyleSandboxDomainMapping"}}}},"401":{"description":"You do not have permission to do this","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"422":{"description":"Failed to provision certificate","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"500":{"description":"Failed to insert ownership","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"502":{"description":"Failed to check permissions","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}}},"delete":{"tags":["Domains"],"summary":"Remove Domain Mapping","operationId":"handle_delete_domain_mapping","parameters":[{"name":"domain","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"401":{"description":"You do not have permission to do this","content":{"application/json":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"type":"string"}}}}}},"500":{"description":"Failed to insert ownership","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"502":{"description":"Failed to check permissions","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}}}},"/domains/v1/verifications":{"get":{"tags":["Domains"],"summary":"List domain verification requests for an account","description":"Lists domain verification requests for the current account.","operationId":"handle_list_domain_verification_requests","responses":{"200":{"description":"List of verification codes","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","required":["verificationCode","domain","createdAt"],"properties":{"verificationCode":{"type":"string"},"domain":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}}}}}}},"400":{"description":"Failed to get verification codes","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}},"x-codeSamples":[{"label":"JS SDK","lang":"javascript","source":"import { FreestyleSandboxes } from 'freestyle-sandboxes';\n\nconst sandboxes = new FreestyleSandboxes({\n apiKey: 'your-api-key',\n});\n\nsandboxes.listDomainVerificationRequests().then((response) => {\n console.log(response);\n});"}]},"put":{"tags":["Domains"],"summary":"Verify a domain verification request","description":"This checks a pre-existing verification request for a domain. To create a verification request, call the [create domain verification](/#tag/domains/POST/domains/v1/verifications) endpoint. This endpoint will check if the domain has a TXT record with the verification code. If it does, the domain will be verified.","operationId":"handle_verify_domain","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreestyleVerifyDomainRequest"}}},"required":true},"responses":{"200":{"description":"Domain verified","content":{"application/json":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"type":"string","example":"example.com"}}}}}},"400":{"description":"Failed to verify domain","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"404":{"description":"Domain verification request not found","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}},"x-codeSamples":[{"label":"JS SDK","lang":"javascript","source":"import { FreestyleSandboxes } from 'freestyle-sandboxes';\n\nconst api = new FreestyleSandboxes({\n apiKey: process.env.FREESTYLE_API_KEY!,\n});\n\napi\n .verifyDomain('example.com')\n .then((result) => {\n console.log('Successfully Verified Domain!');\n })\n .catch((error) => {\n console.error('Failed to verify domain: ', error);\n });"}]},"post":{"tags":["Domains"],"summary":"Create a domain verification request","description":"This creates a Freestyle Domain Verification Request. It returns a `verificationCode` for your domain. You need to place this code in a TXT record at `_freestyle_custom_hostname.thedomain.com`, then call the [verify domain](/#tag/domains/PUT/domains/v1/verifications) endpoint with the domain to verify it.","operationId":"handle_create_domain_verification","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreestyleDomainVerificationRequest"}}},"required":true},"responses":{"200":{"description":"Verification code created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainVerificationRequest"}}}},"400":{"description":"Failed to create verification code","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}},"x-codeSamples":[{"label":"JS SDK","lang":"javascript","source":"import { FreestyleSandboxes } from 'freestyle-sandboxes';\n\nconst api = new FreestyleSandboxes({\n apiKey: process.env.FREESTYLE_API_KEY!,\n});\n\napi.createDomainVerificationRequest('example.com').then((result) => {\n const verificationCode = result.verificationCode;\n // put this at a TXT record at _freestyle_custom_hostname.example.com\n});"}]},"delete":{"tags":["Domains"],"summary":"Delete a domain verification request","description":"This deletes a Freestyle Domain Verification Request. This does not remove the domain from the account if it has already been verified, however the verification code will no longer be valid.","operationId":"handle_delete_domain_verification","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreestyleDeleteDomainVerificationRequest"}}},"required":true},"responses":{"200":{"description":"Verification code created","content":{"application/json":{"schema":{"type":"object","required":["verificationCode","domain"],"properties":{"verificationCode":{"type":"string"},"domain":{"type":"string","example":"example.com"}}}}}},"400":{"description":"Failed to create verification code","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}}}},"/ephemeral/v1/dev-servers":{"post":{"tags":["Dev Servers"],"summary":"Request a Dev Server","operationId":"handle_ephemeral_dev_server","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DevServerRequest"}}},"required":true},"responses":{"200":{"description":"Successful","content":{"application/json":{"schema":{"type":"object","required":["url","isNew","devCommandRunning","installCommandRunning"],"properties":{"url":{"type":"string","deprecated":true},"isNew":{"type":"boolean"},"devCommandRunning":{"type":"boolean"},"installCommandRunning":{"type":"boolean"},"mcpEphemeralUrl":{"type":["string","null"]},"ephemeralUrl":{"type":["string","null"]},"vmId":{"type":["string","null"]},"baseId":{"type":["string","null"]}}}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerError"}}}}}}},"/ephemeral/v1/dev-servers/exec":{"post":{"tags":["Dev Servers"],"summary":"Execute a command on a Dev Server","operationId":"handle_exec_on_ephemeral_dev_server","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecRequest"}}},"required":true},"responses":{"200":{"description":"Successful","content":{"application/json":{"schema":{"type":"object","required":["id","isNew"],"properties":{"id":{"type":"string"},"isNew":{"type":"boolean"},"stdout":{"type":["array","null"],"items":{"type":"string"}},"stderr":{"type":["array","null"],"items":{"type":"string"}}}}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerError"}}}}}}},"/ephemeral/v1/dev-servers/files/{filepath}":{"put":{"tags":["Dev Servers"],"summary":"Write a file to a Dev Server","operationId":"handle_write_file_from_ephemeral_dev_server","parameters":[{"name":"filepath","in":"path","description":"The path to the file to read from the dev server","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful","content":{"application/json":{"schema":{"type":"object","required":["id","isNew"],"properties":{"id":{"type":"string"},"isNew":{"type":"boolean"}}}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerError"}}}}}},"post":{"tags":["Dev Servers"],"summary":"Read a file from a Dev Server","operationId":"handle_read_file_from_ephemeral_dev_server","parameters":[{"name":"filepath","in":"path","description":"The path to the file to read from the dev server","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful","content":{"application/json":{"schema":{"type":"object","required":["id","isNew","content"],"properties":{"id":{"type":"string"},"isNew":{"type":"boolean"},"content":{"oneOf":[{"type":"object","required":["content","encoding","kind"],"properties":{"content":{"type":"string"},"encoding":{"type":"string"},"kind":{"type":"string","enum":["file"]}}},{"type":"object","required":["files","kind"],"properties":{"files":{"type":"array","items":{"type":"string"}},"kind":{"type":"string","enum":["directory"]}}}]}}}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","required":["id","isNew"],"properties":{"id":{"type":"string"},"isNew":{"type":"boolean"}}}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerError"}}}}}}},"/ephemeral/v1/dev-servers/git/commit-push":{"post":{"tags":["Dev Servers"],"summary":"Commit and push changes to a Dev Server repository","operationId":"handle_git_commit_push","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GitCommitPushRequest"}}},"required":true},"responses":{"200":{"description":"Successful","content":{"application/json":{"schema":{"type":"object","required":["id","isNew"],"properties":{"id":{"type":"string"},"isNew":{"type":"boolean"}}}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerError"}}}}}}},"/ephemeral/v1/dev-servers/logs":{"get":{"tags":["Dev Servers"],"summary":"Get logs from the dev server (journalctl -u freestyle-run-dev)","operationId":"handle_dev_server_logs","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DevServerLogsRequest"}}},"required":true},"responses":{"200":{"description":"Successful","content":{"application/json":{"schema":{"type":"object","required":["logs"],"properties":{"logs":{"type":"array","items":{"type":"string"}}}}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerError"}}}}}}},"/ephemeral/v1/dev-servers/restart":{"post":{"tags":["Dev Servers"],"summary":"Restart the dev server (systemctl restart freestyle-run-dev)","operationId":"handle_dev_server_restart","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DevServerRestartRequest"}}},"required":true},"responses":{"200":{"description":"Successful","content":{"application/json":{"schema":{"type":"object","required":["restarted"],"properties":{"restarted":{"type":"boolean"}}}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerError"}}}}}}},"/ephemeral/v1/dev-servers/shutdown":{"post":{"tags":["Dev Servers"],"summary":"Shut down a dev server","operationId":"handle_shutdown_dev_server","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShutdownDevServerRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","message"],"properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerError"}}}}}}},"/ephemeral/v1/dev-servers/status":{"get":{"tags":["Dev Servers"],"summary":"Get the status of a Dev Server","operationId":"handle_dev_server_status","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DevServerStatusRequest"}}},"required":true},"responses":{"200":{"description":"Successful","content":{"application/json":{"schema":{"type":"object","required":["installing","devRunning"],"properties":{"installing":{"type":"boolean"},"devRunning":{"type":"boolean"}}}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerError"}}}}}}},"/ephemeral/v1/dev-servers/watch-files":{"post":{"tags":["Dev Servers"],"operationId":"handle_watch_dev_server_files","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DevServerWatchFilesRequest"}}},"required":true},"responses":{"200":{"description":"Stream of file events","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/execute/v1/deployments":{"get":{"tags":["Execute"],"summary":"List execute runs","description":"List execute runs.","operationId":"handle_list_execute_runs","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":["integer","null"],"minimum":0}},{"name":"offset","in":"query","required":false,"schema":{"type":["integer","null"],"minimum":0}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","required":["entries","total","offset"],"properties":{"entries":{"type":"array","items":{"$ref":"#/components/schemas/ExecuteLogEntry"}},"total":{"type":"integer","format":"int64","minimum":0},"offset":{"type":"integer","format":"int64","minimum":0}}}}}},"500":{"description":"","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}},"x-codeSamples":[{"label":"JS SDK","lang":"javascript","source":"import { FreestyleSandboxes } from 'freestyle-sandboxes';\n\nconst sandboxes = new FreestyleSandboxes({\n apiKey: 'your-api-key',\n});\n\nsandboxes.listExecuteRuns().then((runs) => {\n console.log(runs);\n});"}]}},"/execute/v1/deployments/{deployment}":{"get":{"tags":["Execute"],"summary":"Get information on execute run","description":"Get information on execute run","operationId":"handle_get_execute_run","parameters":[{"name":"deployment","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["metadata"],"properties":{"metadata":{"$ref":"#/components/schemas/ExecuteLogEntry"},"code":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/ExecuteRunInfo"}]}}}}}},"401":{"description":"Unauthorized access","content":{"application/json":{"schema":{"type":"object","description":"Unauthorized access","required":["message"],"properties":{"message":{"type":"string"}}}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","description":"Not found","required":["message"],"properties":{"message":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","description":"Internal server error","required":["message"],"properties":{"message":{"type":"string"}}}}}}},"x-codeSamples":[{"label":"JS SDK","lang":"javascript","source":"import { FreestyleSandboxes } from 'freestyle-sandboxes';\n\nconst sandboxes = new FreestyleSandboxes({\n apiKey: 'your-api-key',\n});\n\nsandboxes.getExecuteRun('123e4567-e89b-12d3-a456-426614174000').then((runs) => {\n console.log(runs);\n});"}]}},"/execute/v1/script":{"post":{"tags":["Execute"],"summary":"Execute Code","description":"Send a TypeScript or JavaScript module, get the result","operationId":"handle_execute_script","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreestyleExecuteScriptParams"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["result","logs"],"properties":{"result":{"description":"The return value of the default export of the script"},"logs":{"type":"array","items":{"$ref":"#/components/schemas/FreestyleJavaScriptLog"}}}}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"logs":{"type":["array","null"],"items":{"$ref":"#/components/schemas/FreestyleJavaScriptLog"}}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"logs":{"type":["array","null"],"items":{"$ref":"#/components/schemas/FreestyleJavaScriptLog"}}}}}}}},"x-codeSamples":[{"label":"JS SDK","lang":"javascript","source":"import { FreestyleSandboxes } from 'freestyle-sandboxes';\n\nconst sandboxes = new FreestyleSandboxes({\n apiKey: 'your-api-key',\n});\n\nsandboxes.executeScript(\n `export default () => {\n let set1 = [1, 2, 3, 4, 5];\n let set2 = [4, 5, 6, 7, 8];\n\n // find the sum of every value of each set multiplied by every value of the other set\n\n let sum = 0;\n for (let i = 0; i < set1.length; i++) {\n for (let j = 0; j < set2.length; j++) {\n sum += set1[i] * set2[j];\n }\n }\n\n return sum;\n};`\n);"},{"label":"Vercel AI SDK","lang":"javascript","source":"import { executeTool } from 'freestyle-sandboxes/ai';\nimport { generateText } from 'ai';\n\nconst codeExecutor = executeTool({\n apiKey: 'your-api-key',\n});\n\nconst { text, steps } = await generateText({\n model: yourModel,\n tools: {\n codeExecutor,\n },\n maxSteps: 2,\n prompt:\n 'What is the sum of every number between 1 and 12 multiplied by itself?',\n});"},{"label":"Mastra AI SDK","lang":"javascript","source":"import { executeTool } from 'freestyle-sandboxes/mastra';\n\nconst mastra = new Mastra();\n\nconst modelConfig: ModelConfig = {\n provider: 'OPEN_AI',\n name: 'gpt-4',\n};\n\nconst llm = mastra.LLM(modelConfig);\n\nconst response = await llm.generate(\n 'Calculate the sum of every number between 13 and 19 divided by the sum of every number between 8 and 13',\n {\n tools: {\n executor: executeTool({\n apiKey: process.env.FREESTYLE_API_KEY!,\n }),\n },\n }\n);\n\nconsole.log('Response Steps:', response.steps);\nconsole.log('Response:', response.text);"},{"label":"LangGraph AI SDK","lang":"javascript","source":"import { createReactAgent } from '@langchain/langgraph/prebuilt';\nimport { ChatOpenAI } from '@langchain/openai';\nimport { executeTool } from 'freestyle-sandboxes/langgraph';\n\nconst model = new ChatOpenAI({ model: 'gpt-4o' });\n\nconst agent = createReactAgent({\n llm: model,\n tools: [\n executeTool({\n apiKey: process.env.FREESTYLE_API_KEY,\n nodeModules: {\n resend: '4.0.1',\n },\n envVars: {\n RESEND_API_KEY: process.env.RESEND_API_KEY,\n },\n }),\n ],\n});\n\nconst result = await agent.invoke(\n {\n messages: [\n { role: 'user', content: 'What is the factorial of 13 divided by 55^2' },\n ],\n },\n { configurable: { thread_id: 42 } }\n);\nconsole.log(result.messages.at(-1)?.content);"},{"label":"Python SDK","lang":"python","source":"import freestyle\nimport os\n\nclient = freestyle.Freestyle(\n os.environ.get('FREESTYLE_API_KEY')\n)\n\ncodeExecutionResult = client.execute_script(\n \"\"\"\nimport Stripe from 'stripe';\nexport default async () => {\n\nconst stripe = new Stripe(process.env.STRIPE_API_KEY);\n\nconst paymentIntent = await stripe.paymentIntents.create({\n amount: 1099,\n currency: 'usd',\n payment_method_types: ['card'],\n});\n\nreturn paymentIntent;\n};\n \"\"\",\n freestyle.FreestyleExecuteScriptParamsConfiguration(\n env_vars={\"STRIPE_API_KEY\": os.environ.get(\"STRIPE_API_KEY\")},\n node_modules={\"stripe\": \"17.7.0\"},\n ),\n)\n\nprint('The payment intent created is:', codeExecutionResult)"},{"label":"Gemini Python SDK","lang":"python","source":"import google.genai as genai\nfrom google.genai import types\n\nimport os\nimport freestyle.gemini\n\nclient = genai.Client(api_key=os.environ.get(\"GENERATIVEAI_API_KEY\"))\n\n\n# model = genai.client.com(\"gemini-2.0-flash\")\ndefinition, runner = freestyle.gemini.execute_tool(\n os.environ.get(\"FREESTYLE_API_KEY\"),\n)\nchat = client.chats.create(\n model=\"gemini-2.0-flash\",\n config=types.GenerateContentConfigDict(\n tools=[definition],\n ),\n history=[],\n)\n\nresponse = chat.send_message(\n \"What is the sum of every number from 50 to 65 divided by 17\"\n).candidates[0]\ntool_result = runner(response.content)\n\nprint(\"Answer: \", tool_result)"},{"label":"OpenAI Python SDK","lang":"python","source":"import os\nimport openai\nimport freestyle.openai\n\nclient = openai.OpenAI(\n api_key=os.environ.get('OPENAI_API_KEY'),\n)\n\n\n(definition, runner) = freestyle.openai.execute_tool(\n os.environ.get('FREESTYLE_API_KEY'),\n)\n\nquery = 'What is the sum of every number from 50 to 65 divided by 17'\nmessages = [{'role': 'user', 'content': query}]\nprint('Question: ', query)\n\nres = client.chat.completions.create(\n model='gpt-4-turbo', messages=messages, tools=[definition]\n)\n\n\nresult = runner(res.choices[0].message)\n\nmessages.append(res.choices[0].message)\nif len(result) > 0:\n messages.extend(result)\n\nres = client.chat.completions.create(\n model='gpt-4-turbo',\n messages=messages,\n tools=[definition],\n)\n\nprint('Answer: ', res.choices[0].message.content)"}]}},"/git/v1/identity":{"get":{"tags":["Git"],"summary":"List Git identities","description":"List Git identities created by your account.","operationId":"handle_list_identities","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":["integer","null"],"format":"int64","minimum":0}},{"name":"offset","in":"query","required":false,"schema":{"type":["integer","null"],"format":"int64","minimum":0}},{"name":"includeManaged","in":"query","required":false,"schema":{"type":["boolean","null"]}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","required":["identities","offset","total"],"properties":{"identities":{"type":"array","items":{"$ref":"#/components/schemas/GitIdentity"}},"offset":{"type":"integer","format":"int64","minimum":0},"total":{"type":"integer","format":"int64","minimum":0}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}}},"post":{"tags":["Git"],"summary":"Create a Git identity","description":"Create a Git identity. This identity will be used to authenticate with the Git server.","operationId":"handle_create_identity","responses":{"200":{"description":"Identity created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GitIdentity"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}}}},"/git/v1/identity/{identity}":{"delete":{"tags":["Git"],"summary":"Delete a Git identity","description":"Delete a Git identity. This will revoke all permissions granted to this identity.","operationId":"handle_delete_identity","parameters":[{"name":"identity","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Identity deleted","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"404":{"description":"Identity not found","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}}}},"/git/v1/identity/{identity}/permissions":{"get":{"tags":["Git"],"summary":"List repository permissions for an identity","description":"List repository permissions for an identity. This will return a list of repositories that the identity has access to.","operationId":"handle_list_permissions","parameters":[{"name":"identity","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"limit","in":"query","description":"Maximum number of repositories to return","required":false,"schema":{"type":"integer","format":"int64","minimum":0}},{"name":"offset","in":"query","description":"Offset for the list of repositories","required":false,"schema":{"type":"integer","format":"int64","minimum":0}}],"responses":{"200":{"description":"Permission list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListPermissionResponseSuccess"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}}}},"/git/v1/identity/{identity}/permissions/{repo}":{"get":{"tags":["Git"],"summary":"Get the permission of an identity on a repository","description":"Get the permission of an identity on a repository. This will return the access level of the identity on the repository.","operationId":"handle_describe_permission","parameters":[{"name":"identity","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Permission info","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DescribePermissionResponseSuccess"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}}},"post":{"tags":["Git"],"summary":"Grant a permission to a Git identity","description":"Grant a permission to a Git identity on a repository","operationId":"handle_grant_permission","parameters":[{"name":"identity","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantPermissionRequest"}}},"required":true},"responses":{"200":{"description":"Permission granted successfully","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"404":{"description":"Repository not found","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}}},"delete":{"tags":["Git"],"summary":"Revoke permissions from a Git identity","description":"Revoke a permission to a Git identity on a repository","operationId":"handle_revoke_permission","parameters":[{"name":"identity","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Permission revoked successfully","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}}},"patch":{"tags":["Git"],"summary":"Update a permission for a Git identity","description":"Update a permission for a Git identity on a repository","operationId":"handle_update_permission","parameters":[{"name":"identity","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePermissionRequest"}}},"required":true},"responses":{"200":{"description":"Permission updated successfully","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}}}},"/git/v1/identity/{identity}/tokens":{"get":{"tags":["Git"],"summary":"List access tokens for a Git identity","description":"List access tokens for a Git identity","operationId":"handle_list_git_tokens","parameters":[{"name":"identity","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Token list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListGitTokensResponseSuccess"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}}},"post":{"tags":["Git"],"summary":"Create an access token for a Git identity","description":"Create an access token for a Git identity","operationId":"handle_create_git_token","parameters":[{"name":"identity","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Token created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedToken"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}}},"delete":{"tags":["Git"],"summary":"Revoke an access token for a Git identity","description":"Revoke an access token for a Git identity","operationId":"handle_revoke_git_token","parameters":[{"name":"identity","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokeGitTokenRequest"}}},"required":true},"responses":{"200":{"description":"Token revoked","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}}}},"/git/v1/repo":{"get":{"tags":["Git"],"summary":"List repositories","description":"List repositories with metadata.","operationId":"handle_list_repositories","parameters":[{"name":"limit","in":"query","description":"Maximum number of repositories to return","required":false,"schema":{"type":"integer","format":"int64","minimum":0}},{"name":"offset","in":"query","description":"Offset for the list of repositories","required":false,"schema":{"type":"integer","format":"int64","minimum":0}}],"responses":{"200":{"description":"List of repositories","content":{"application/json":{"schema":{"type":"object","required":["repositories","total","offset"],"properties":{"repositories":{"type":"array","items":{"$ref":"#/components/schemas/RepositoryMetadata"}},"total":{"type":"integer","format":"int64","minimum":0},"offset":{"type":"integer","format":"int64","minimum":0}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}}},"post":{"tags":["Git"],"summary":"Create a repository","description":"Create a repository. Once the repository is created, it will also be created on the Git server.\nThe repository name must be unique within your account.\n\nOnce created, you can then push your code to this repository.\n\nThe repo will be available at `git.freestyle.sh/{repo-id}`\n","operationId":"handle_create_repo","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":["string","null"],"description":"This name is not visible to users, and is only accessible to you via API and in the\ndashboard. Mostly useful for observability."},"public":{"type":"boolean","default":false},"defaultBranch":{"type":["string","null"],"description":"The default branch name for the repository. Defaults to \"main\" if not specified."},"source":{"$ref":"#/components/schemas/CreateRepoSource","description":"Fork from another Git repository. Cannot be used with `import`."},"import":{"$ref":"#/components/schemas/CreateRepoImport","description":"Import static content with an initial commit. Cannot be used with `source`."},"devServers":{"$ref":"#/components/schemas/DevServerConfiguration"}}}}},"required":true},"responses":{"200":{"description":"Repository created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRepositoryResponseSuccess"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}}}},"/git/v1/repo/{repo_id}/default-branch":{"get":{"tags":["Git"],"summary":"Get repository default branch","description":"Get the default branch name for a repository.","operationId":"handle_get_default_branch","parameters":[{"name":"repo_id","in":"path","description":"The repository ID","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetDefaultBranchResponse"}}}}}},"put":{"tags":["Git"],"summary":"Set repository default branch","description":"Set the default branch name for a repository. This will update the HEAD reference to point to the new default branch.","operationId":"handle_set_default_branch","parameters":[{"name":"repo_id","in":"path","description":"The repository ID","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetDefaultBranchRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetDefaultBranchResponse"}}}}}}},"/git/v1/repo/{repo_id}/dev-server-configuration":{"get":{"tags":["Git"],"summary":"Get dev server configuration","description":"Get the dev server configuration for a repository and branch.","operationId":"get_dev_server_configuration","parameters":[{"name":"repo_id","in":"path","description":"Repository ID","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"branch","in":"query","description":"Git branch name","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Dev server configuration","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DevServerConfiguration"}}}},"404":{"description":"Repository or configuration not found"},"500":{"description":"Internal server error"}}},"put":{"tags":["Git"],"summary":"Update dev server configuration","description":"Update the dev server configuration for a repository and branch.","operationId":"update_dev_server_configuration","parameters":[{"name":"repo_id","in":"path","description":"Repository ID","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDevServerConfigRequest"}}},"required":true},"responses":{"200":{"description":"Dev server configuration updated successfully"},"404":{"description":"Repository not found"},"500":{"description":"Internal server error"}}},"delete":{"tags":["Git"],"summary":"Delete dev server configuration","description":"Delete the dev server configuration for a repository and branch. If no branch is specified, deletes configuration for the default branch.","operationId":"delete_dev_server_configuration","parameters":[{"name":"repo_id","in":"path","description":"Repository ID","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"branch","in":"query","description":"Git branch name (optional, defaults to repository default branch)","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Dev server configuration deleted successfully"},"404":{"description":"Repository or configuration not found"},"500":{"description":"Internal server error"}}}},"/git/v1/repo/{repo_id}/github-sync":{"get":{"tags":["Git"],"summary":"Get GitHub sync configuration","description":"Get the GitHub sync configuration for a repository, if configured.","operationId":"get_github_sync","parameters":[{"name":"repo_id","in":"path","description":"Repository ID","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"GitHub sync configuration","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GithubSyncConfigResponse"}}}},"404":{"description":"Repository or sync configuration not found"},"500":{"description":"Internal server error"}}},"post":{"tags":["Git"],"summary":"Configure GitHub sync for repository","description":"Configure GitHub synchronization for an existing Freestyle repository. This links your Freestyle repository to a GitHub repository for automatic syncing. Requires the GitHub repository name in 'owner/repo' format.","operationId":"configure_github_sync","parameters":[{"name":"repo_id","in":"path","description":"Repository ID","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfigureGithubSyncRequest"}}},"required":true},"responses":{"200":{"description":"GitHub sync configured successfully"},"400":{"description":"Bad request"},"404":{"description":"Repository not found"},"500":{"description":"Internal server error"}}},"delete":{"tags":["Git"],"summary":"Remove GitHub sync configuration","description":"Remove GitHub sync configuration from a repository. This stops automatic syncing but doesn't affect the repository content.","operationId":"remove_github_sync","parameters":[{"name":"repo_id","in":"path","description":"Repository ID","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"GitHub sync configuration removed successfully"},"404":{"description":"Repository or sync configuration not found"},"500":{"description":"Internal server error"}}}},"/git/v1/repo/{repo}":{"get":{"tags":["Git"],"summary":"Get repository information","description":"Retrieve information about a specific repository, including its ID, name, and default branch.","operationId":"handle_get_repo_info","parameters":[{"name":"repo","in":"path","description":"The repository id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Repository information retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RepositoryInfoRaw"}}}},"400":{"description":"Invalid request"},"403":{"description":"Forbidden access to repository"},"404":{"description":"Repository not found"},"500":{"description":"Internal server error"}}},"delete":{"tags":["Git"],"summary":"Delete a repository","description":"Delete a repository. This is irreversible, and will also delete the repository on the Git server.","operationId":"handle_delete_repo","parameters":[{"name":"repo","in":"path","description":"The repository id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Repository deleted successfully","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"403":{"description":"User does not have permission to delete this repository","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"404":{"description":"Repository does not exist","content":{"application/json":{"schema":{"type":"object"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}}}},"/git/v1/repo/{repo}/contents/{path}":{"get":{"tags":["Git"],"summary":"Get the contents of a file or directory","description":"Get the contents of a file or directory in a repository","operationId":"handle_get_contents","parameters":[{"name":"ref","in":"query","description":"The git reference (branch name, commit SHA, etc.). Defaults to HEAD.","required":false,"schema":{"type":"string"}},{"name":"repo","in":"path","description":"The repository ID.","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"path","in":"path","description":"The path to the file or directory. Empty for root.","required":true,"schema":{"type":["string","null"]}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GitContents"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}}}},"/git/v1/repo/{repo}/git/blobs/{hash}":{"get":{"tags":["Git"],"summary":"Get a blob object","description":"Get a blob from the Git database. The contents will always be base64 encoded.","operationId":"handle_get_blob","parameters":[{"name":"repo","in":"path","description":"The repository id","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"hash","in":"path","description":"The object's hash","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Blob retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlobObject"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"404":{"description":"Blob not found","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}}}},"/git/v1/repo/{repo}/git/commits":{"get":{"tags":["Git"],"summary":"List commits for a repository","description":"List commits from the Git database for a specific repository and branch.","operationId":"handle_list_commits","parameters":[{"name":"repo","in":"path","description":"The repository id","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"branch","in":"query","description":"Branch name (defaults to HEAD)","required":false,"schema":{"type":["string","null"]},"example":"main"},{"name":"limit","in":"query","description":"Maximum number of commits to return (default: 50, max: 500)","required":false,"schema":{"type":["integer","null"],"minimum":0},"example":"50"},{"name":"offset","in":"query","description":"Number of commits to skip (default: 0)","required":false,"schema":{"type":["integer","null"],"minimum":0},"example":"0"}],"responses":{"200":{"description":"Commits retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommitList"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"404":{"description":"Repository or branch not found","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}}}},"/git/v1/repo/{repo}/git/commits/{hash}":{"get":{"tags":["Git"],"summary":"Get a commit object","description":"Get a commit from the Git database with detailed information.","operationId":"handle_get_commit","parameters":[{"name":"repo","in":"path","description":"The repository id","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"hash","in":"path","description":"The object's hash","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Commit retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommitObject"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"404":{"description":"Commit not found","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}}}},"/git/v1/repo/{repo}/git/refs/heads/{branch}":{"get":{"tags":["Git"],"summary":"Get a branch reference","description":"Get a reference to a branch in the Git repository. Returns the ref name and SHA of the branch.","operationId":"handle_get_ref_branch","parameters":[{"name":"repo","in":"path","description":"The repository id","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"branch","in":"path","description":"The branch's name","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Branch reference object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GitReference"}}}},"400":{"description":"Bad request"},"401":{"description":"Unauthorized","content":{"application/json":{}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"404":{"description":"Branch not found","content":{"application/json":{}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}}}},"/git/v1/repo/{repo}/git/refs/tags/{tag}":{"get":{"tags":["Git"],"summary":"Get a tag reference","description":"Get a reference to a tag in the Git repository. Returns the ref name and SHA of the tag.","operationId":"handle_get_ref_tag","parameters":[{"name":"repo","in":"path","description":"The repository id","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"tag","in":"path","description":"The tag's name","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Branch reference object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GitReference"}}}},"400":{"description":"Bad request"},"401":{"description":"Unauthorized","content":{"application/json":{}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"404":{"description":"Branch not found","content":{"application/json":{}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}}}},"/git/v1/repo/{repo}/git/tags/{hash}":{"get":{"tags":["Git"],"summary":"Get a tag object","description":"Get a tag from the Git database.","operationId":"handle_get_tag","parameters":[{"name":"repo","in":"path","description":"The repository id","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"hash","in":"path","description":"The object's hash","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Tag retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TagObject"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"404":{"description":"Tag not found","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}}}},"/git/v1/repo/{repo}/git/trees/{hash}":{"get":{"tags":["Git"],"summary":"Get a tree object","description":"Get a tree from the Git database with its entries.","operationId":"handle_get_tree","parameters":[{"name":"repo","in":"path","description":"The repository id","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"hash","in":"path","description":"The object's hash","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Tree retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TreeObject"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"404":{"description":"Tree not found","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}}}},"/git/v1/repo/{repo}/tarball":{"get":{"tags":["Git"],"summary":"Download a tarball of a repo.","description":"Download the contents of a repo as a tarball.","operationId":"handle_download_tarball","parameters":[{"name":"ref","in":"query","description":"The git reference (branch name, commit SHA, etc.). Defaults to HEAD.","required":false,"schema":{"type":"string"}},{"name":"repo","in":"path","description":"The repository id","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success (byte stream)","content":{"application/x-tar":{}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}}}},"/git/v1/repo/{repo}/trigger":{"get":{"tags":["Git"],"summary":"List git triggers for a repository","description":"List git triggers for the given repository.","operationId":"handle_list_git_triggers","parameters":[{"name":"repo","in":"path","description":"The repository id","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["triggers"],"properties":{"triggers":{"type":"array","items":{"$ref":"#/components/schemas/GitRepositoryTrigger"}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"403":{"description":"User does not have permission to access this repository","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"404":{"description":"Repository does not exist","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}}},"post":{"tags":["Git"],"summary":"Create a git trigger","description":"Create a git trigger for the given repository.","operationId":"handle_create_git_trigger","parameters":[{"name":"repo","in":"path","description":"The repository id","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["trigger","action"],"properties":{"trigger":{"oneOf":[{"type":"object","required":["event"],"properties":{"branches":{"type":["array","null"],"items":{"type":"string"}},"globs":{"type":["array","null"],"items":{"type":"string"}},"event":{"type":"string","enum":["push"]}}}]},"action":{"oneOf":[{"type":"object","required":["endpoint","action"],"properties":{"endpoint":{"type":"string"},"action":{"type":"string","enum":["webhook"]}}}]}}}}},"required":true},"responses":{"200":{"description":"Trigger created successfully","content":{"application/json":{"schema":{"type":"object","required":["triggerId"],"properties":{"triggerId":{"type":"string","format":"uuid"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"403":{"description":"User does not have permission to create a trigger on this repository","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"404":{"description":"Repository does not exist","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}}}},"/git/v1/repo/{repo}/trigger/{trigger}":{"delete":{"tags":["Git"],"summary":"Delete a git trigger","description":"Delete a git trigger. This is irreversible.","operationId":"handle_delete_git_trigger","parameters":[{"name":"repo","in":"path","description":"The repository id","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"trigger","in":"path","description":"The trigger id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Trigger deleted successfully","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"403":{"description":"User does not have permission to delete a trigger on this repository","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"404":{"description":"Trigger does not exist","content":{"application/json":{"schema":{"type":"object"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}}}},"/git/v1/repo/{repo}/zip":{"get":{"tags":["Git"],"summary":"Download a zip of a repo","description":"Download the contents of a repo as a zip.","operationId":"handle_download_zip","parameters":[{"name":"ref","in":"query","description":"The git reference (branch name, commit SHA, etc.). Defaults to HEAD.","required":false,"schema":{"type":"string"}},{"name":"repo","in":"path","description":"The repository id","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success (byte stream)","content":{"application/zip":{}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}}}},"/observability/v1/logs":{"get":{"tags":["Observability"],"summary":"Deployment Logs","description":"Get the logs for a deployment","operationId":"handle_get_logs","parameters":[{"name":"deploymentId","in":"query","required":false,"schema":{"type":["string","null"]}},{"name":"domain","in":"query","required":false,"schema":{"type":["string","null"]}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreestyleGetLogsResponse"}}}}},"x-codeSamples":[{"label":"JS SDK","lang":"javascript","source":"import { FreestyleSandboxes } from 'freestyle-sandboxes';\n\nconst sandboxes = new FreestyleSandboxes({\n apiKey: 'your-api-key',\n});\n\nsandboxes.getLogs({\n deploymentId: 'deployment-id',\n}).then((response) => {\n console.log(response);\n});"}]}},"/v1/vms":{"get":{"tags":["VM"],"description":"List VMs","operationId":"list_vms","responses":{}},"post":{"tags":["VM"],"description":"Create VM","operationId":"create_vm","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateVmRequest"}}},"required":true},"responses":{}}},"/v1/vms/{id}/resize":{"post":{"tags":["VM"],"description":"Resize VM","operationId":"resize_vm","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResizeVmRequest"}}},"required":true},"responses":{}}},"/v1/vms/{vm_id}":{"get":{"tags":["VM"],"description":"Get VM","operationId":"get_vm","parameters":[{"name":"vm_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{}},"delete":{"tags":["VM"],"description":"Delete VM","operationId":"delete_vm","parameters":[{"name":"vm_id","in":"path","description":"The ID of the VM to delete","required":true,"schema":{"type":"string"}}],"responses":{}}},"/v1/vms/{vm_id}/await":{"post":{"tags":["VM"],"description":"Wait for VM to stop","operationId":"wait_vm","parameters":[{"name":"vm_id","in":"path","description":"The ID of the VM to wait for","required":true,"schema":{"type":"string"}}],"responses":{}}},"/v1/vms/{vm_id}/exec-await":{"post":{"tags":["VM"],"description":"Execute command in VM and await result","operationId":"exec_await","parameters":[{"name":"vm_id","in":"path","description":"The ID of the VM to execute the command in","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecAwaitRequest"}}},"required":true},"responses":{}}},"/v1/vms/{vm_id}/files/{filepath}":{"get":{"tags":["VM"],"description":"Get file from VM","operationId":"get_file","parameters":[{"name":"vm_id","in":"path","description":"The ID of the VM to get the file from","required":true,"schema":{"type":"string"}},{"name":"filepath","in":"path","description":"The path of the file to get","required":true,"schema":{"type":"string"}}],"responses":{}},"put":{"tags":["VM"],"description":"Put file to VM","operationId":"put_file","parameters":[{"name":"vm_id","in":"path","description":"The ID of the VM to put the file to","required":true,"schema":{"type":"string"}},{"name":"filepath","in":"path","description":"The path of the file to put","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WriteFileRequest"}}},"required":true},"responses":{}}},"/v1/vms/{vm_id}/fork":{"post":{"tags":["VM"],"description":"Fork VM","operationId":"fork_vm","parameters":[{"name":"vm_id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForkVmRequest"}}},"required":true},"responses":{}}},"/v1/vms/{vm_id}/optimize":{"post":{"tags":["VM"],"description":"Suspends a VM and reallocates storage for more efficent copy.","operationId":"optimize_vm","parameters":[{"name":"vm_id","in":"path","description":"The ID of the VM to optimize","required":true,"schema":{"type":"string"}}],"responses":{}}},"/v1/vms/{vm_id}/start":{"post":{"tags":["VM"],"description":"Start VM","operationId":"start_vm","parameters":[{"name":"vm_id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartVmRequest"}}},"required":true},"responses":{}}},"/v1/vms/{vm_id}/stop":{"post":{"tags":["VM"],"description":"Stop VM","operationId":"stop_vm","parameters":[{"name":"vm_id","in":"path","description":"The ID of the VM to stop","required":true,"schema":{"type":"string"}}],"responses":{}}},"/v1/vms/{vm_id}/suspend":{"post":{"tags":["VM"],"description":"Suspend VM","operationId":"suspend_vm","parameters":[{"name":"vm_id","in":"path","description":"The ID of the VM to suspend","required":true,"schema":{"type":"string"}}],"responses":{}}},"/v1/vms/{vm_id}/terminals":{"get":{"tags":["VM"],"description":"List all terminal sessions for a VM","operationId":"list_terminals","parameters":[{"name":"vm_id","in":"path","description":"The ID of the VM","required":true,"schema":{"type":"string"}}],"responses":{}}},"/v1/vms/{vm_id}/terminals/{terminal_id}/logs":{"get":{"tags":["VM"],"description":"Get terminal logs as plain text array","operationId":"get_terminal_logs","parameters":[{"name":"vm_id","in":"path","description":"The ID of the VM","required":true,"schema":{"type":"string"}},{"name":"terminal_id","in":"path","description":"The ID of the terminal session","required":true,"schema":{"type":"string"}}],"responses":{}}},"/v1/vms/{vm_id}/terminals/{terminal_id}/xterm-256color":{"get":{"tags":["VM"],"description":"Get terminal output with xterm formatting","operationId":"get_terminal_xterm","parameters":[{"name":"vm_id","in":"path","description":"The ID of the VM","required":true,"schema":{"type":"string"}},{"name":"terminal_id","in":"path","description":"The ID of the terminal session","required":true,"schema":{"type":"string"}}],"responses":{}}},"/v1/vms/{vm_id}/watch-files":{"post":{"tags":["VM"],"description":"Watch VM Files","operationId":"watch_files","parameters":[{"name":"vm_id","in":"path","description":"The ID of the VM to watch files for","required":true,"schema":{"type":"string"}}],"responses":{}}},"/web/v1/deploy":{"post":{"tags":["Deprecated"],"summary":"Deploy a Website (v1)","description":"Deploy a website. Files is a map of file paths to file contents. Configuration is optional and contains additional information about the deployment.","operationId":"handle_deploy_web","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreestyleDeployWebPayload"}}},"required":true},"responses":{"200":{"description":"successfully deployed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreestyleDeployWebSuccessResponseV2"}}}},"400":{"description":"failed to deploy","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreestyleDeployWebErrorResponse"}}}}},"deprecated":true,"x-codeSamples":[{"label":"JS SDK","lang":"javascript","source":"import { FreestyleSandboxes } from 'freestyle-sandboxes';\nimport 'dotenv/config';\n\nconst api = new FreestyleSandboxes({\n apiKey: process.env.FREESTYLE_API_KEY!,\n});\n\napi\n .deployWeb({\n 'index.js': {\n content:`\n import http from 'node:http';\n console.log('starting server');\n\n const server = http.createServer(async(req, res) => {\n // wait 5 seconds before responding\n // await new Promise((resolve) => setTimeout(resolve, 5000));\n res.writeHead(200, { 'Content-Type': 'text/plain' });\n res.end('Welcome to New York its been waiting for you');\n });\n\n server.listen(3000, () => {\n console.log('Server is running at http://localhost:3000');\n });`,\n }})\n .then((result) => {\n console.log('Deployed website @ ', result.deploymentId);\n });\n"},{"label":"Vercel AI SDK","lang":"javascript","source":"import { deployWebTool } from 'freestyle-sandboxes/ai';\nimport { generateText } from 'ai';\n\nconst deployer = deployWebTool({\n apiKey: 'your-api-key',\n});\n\nconst { text, steps } = await generateText({\n model: yourModel,\n tools: {\n deployer,\n },\n maxSteps: 2,\n prompt:\n 'Deploy a website to subdomain.yourdomain.com that has all the lyrics to Sandstorm by Darude on the homepage',\n});"}]}},"/web/v1/deployment":{"post":{"tags":["Web"],"summary":"Deploy a Website","description":"Deploy a website. Files is a map of file paths to file contents. Configuration is optional and contains additional information about the deployment.","operationId":"handle_deploy_web_v2","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreestyleDeployWebPayloadV2"}}},"required":true},"responses":{"200":{"description":"successfully deployed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreestyleDeployWebSuccessResponseV2"}}}},"400":{"description":"No Entrypoint Found"},"403":{"description":"No Domain Ownership","content":{"application/json":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"type":"string"}}}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreestyleDeployWebErrorResponse"}}}}}}},"/web/v1/deployments":{"get":{"tags":["Web"],"summary":"List web deploys","description":"List web deploys.","operationId":"handle_list_web_deploys","parameters":[{"name":"limit","in":"query","description":"Maximum number of repositories to return","required":true,"schema":{"type":"integer","format":"int64","minimum":0}},{"name":"offset","in":"query","description":"Offset for the list of repositories","required":true,"schema":{"type":"integer","format":"int64","minimum":0}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","required":["entries","total","offset"],"properties":{"entries":{"type":"array","items":{"$ref":"#/components/schemas/DeploymentLogEntry"}},"total":{"type":"integer","format":"int64","minimum":0},"offset":{"type":"integer","format":"int64","minimum":0}}}}}},"500":{"description":"","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}},"x-codeSamples":[{"label":"JS SDK","lang":"javascript","source":"import { FreestyleSandboxes } from 'freestyle-sandboxes';\n\nconst sandboxes = new FreestyleSandboxes({\n apiKey: 'your-api-key',\n});\n\nsandboxes.listWebDeploys().then((response) => {\n console.log(response);\n});"}]}},"/web/v1/deployments/{deployment_id}":{"get":{"tags":["Web"],"summary":"Get information on web deploy","description":"Get information about a web deploy by its ID.","operationId":"handle_get_web_deploy_details","parameters":[{"name":"deployment_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{}}}},"components":{"schemas":{"AccessLevel":{"type":"string","enum":["read","write"]},"AccessTokenInfo":{"type":"object","required":["id"],"properties":{"id":{"type":"string","format":"uuid"}}},"AccessibleRepository":{"type":"object","description":"Identical to [`RepositoryInfo`], but with the permissions field added.","required":["id","accountId","permissions","visibility"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":["string","null"]},"accountId":{"type":"string","format":"uuid"},"permissions":{"$ref":"#/components/schemas/AccessLevel"},"visibility":{"$ref":"#/components/schemas/Visibility"}}},"Behavior":{"type":"string","default":"exact","enum":["regex","exact"]},"BlobEncoding":{"type":"string","description":"The encoding of a blob from the API. Always `base64`.","enum":["base64"]},"BlobObject":{"type":"object","description":"Blob object","required":["content","encoding","sha"],"properties":{"content":{"type":"string","description":"The content of the blob, base64 encoded."},"encoding":{"$ref":"#/components/schemas/BlobEncoding","description":"The encoding of the blob. Always `base64`."},"sha":{"type":"string","description":"The object's hash."}}},"BranchDetails":{"type":"object","required":["default","name"],"properties":{"default":{"type":"boolean"},"name":{"type":"string"},"target":{"type":["string","null"]}}},"CommitList":{"type":"object","required":["commits","count","offset","limit","total"],"properties":{"commits":{"type":"array","items":{"$ref":"#/components/schemas/CommitObject"},"description":"List of commits"},"count":{"type":"integer","description":"Number of commits returned in this page","minimum":0},"offset":{"type":"integer","description":"Number of commits skipped (offset)","minimum":0},"limit":{"type":"integer","description":"Maximum number of commits requested (limit)","minimum":0},"total":{"type":"integer","description":"Total number of commits available in the branch","minimum":0}}},"CommitObject":{"type":"object","description":"Commit object","required":["author","committer","message","tree","parents","sha"],"properties":{"author":{"$ref":"#/components/schemas/Signature","description":"The author of the commit"},"committer":{"$ref":"#/components/schemas/Signature","description":"The committer"},"message":{"type":"string","description":"The commit message"},"tree":{"$ref":"#/components/schemas/CommitTree","description":"The ID of the tree pointed to by this commit"},"parents":{"type":"array","items":{"$ref":"#/components/schemas/CommitParent"},"description":"Parent commit(s) of this commit"},"sha":{"type":"string","description":"The commit's hash ID"}}},"CommitParent":{"type":"object","required":["sha"],"properties":{"sha":{"type":"string","description":"The commit's hash ID"}}},"CommitTree":{"type":"object","required":["sha"],"properties":{"sha":{"type":"string","description":"The tree's hash ID"}}},"ConfigureGithubSyncRequest":{"type":"object","required":["githubRepoName"],"properties":{"githubRepoName":{"type":"string","description":"The GitHub repository name in \"owner/repo\" format"}}},"CreateDomainMappingRequest":{"type":"object","required":["deploymentId"],"properties":{"deploymentId":{"type":"string","format":"uuid"}}},"CreateRecordParams":{"type":"object","required":["domain","record"],"properties":{"domain":{"type":"string"},"record":{"$ref":"#/components/schemas/DnsRecordData"}}},"CreateRecordResponse":{"type":"object","required":["record"],"properties":{"record":{"$ref":"#/components/schemas/DnsRecord"}}},"CreateRepoImport":{"oneOf":[{"type":"object","title":"Files","required":["files","commitMessage","type"],"properties":{"files":{"type":"object","title":"Files","description":"A map of file names to their contents.","additionalProperties":{"type":"string"}},"commitMessage":{"type":"string"},"authorName":{"type":["string","null"]},"authorEmail":{"type":["string","null"]},"type":{"type":"string","enum":["files"]}}},{"type":"object","title":"Tar","required":["url","commitMessage","type"],"properties":{"url":{"type":"string","format":"uri"},"dir":{"type":["string","null"]},"commitMessage":{"type":"string"},"authorName":{"type":["string","null"]},"authorEmail":{"type":["string","null"]},"type":{"type":"string","enum":["tar"]}}},{"type":"object","title":"Zip","required":["url","commitMessage","type"],"properties":{"url":{"type":"string","format":"uri"},"dir":{"type":["string","null"]},"commitMessage":{"type":"string"},"authorName":{"type":["string","null"]},"authorEmail":{"type":["string","null"]},"type":{"type":"string","enum":["zip"]}}},{"type":"object","title":"Git","required":["url","commitMessage","type"],"properties":{"url":{"type":"string","format":"uri"},"branch":{"type":["string","null"]},"dir":{"type":["string","null"]},"commitMessage":{"type":"string"},"authorName":{"type":["string","null"]},"authorEmail":{"type":["string","null"]},"type":{"type":"string","enum":["git"]}}}]},"CreateRepoRequest":{"type":"object","properties":{"source":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/CreateRepoSource"}]},"import":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/CreateRepoImport"}]},"defaultBranch":{"type":["string","null"]}}},"CreateRepoSource":{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"uri"},"branch":{"type":["string","null"]},"depth":{"type":["integer","null"],"format":"int32"}}},"CreateRepositoryRequest":{"type":"object","properties":{"name":{"type":["string","null"],"description":"This name is not visible to users, and is only accessible to you via API and in the\ndashboard. Mostly useful for observability."},"public":{"type":"boolean","default":false},"defaultBranch":{"type":["string","null"],"description":"The default branch name for the repository. Defaults to \"main\" if not specified."},"source":{"$ref":"#/components/schemas/CreateRepoSource","description":"Fork from another Git repository. Cannot be used with `import`."},"import":{"$ref":"#/components/schemas/CreateRepoImport","description":"Import static content with an initial commit. Cannot be used with `source`."},"devServers":{"$ref":"#/components/schemas/DevServerConfiguration"}}},"CreateRepositoryResponseSuccess":{"type":"object","required":["repoId"],"properties":{"repoId":{"type":"string","format":"uuid"}}},"CreateVmRequest":{"type":"object","properties":{"idleTimeoutSeconds":{"type":["integer","null"],"format":"int64"},"ports":{"type":["array","null"],"items":{"$ref":"#/components/schemas/PortMapping"},"description":"Optional list of ports to expose externally. If not provided, port 3000\nwill be exposed on port 443 by default. Pass an empty array to disable\nexternal ports. Only ports 8081 and 443 can be configured externally for\nnow. Any target port is allowed.","example":[{"port":443,"targetPort":3000}]},"waitForReadySignal":{"type":["boolean","null"],"description":"Whether the api request should wait for the VM to be ready before\nreturning. By default, the VM is considered ready when the serial\nconsole is ready for login.","default":true,"example":true},"readySignalTimeoutSeconds":{"type":["integer","null"],"format":"int64","description":"How long to wait for the ready signal before timing out. Defaults to 120\nseconds if not provided."},"workdir":{"type":["string","null"],"description":"Optional working directory for the VM. File system and shell commands\nwill be executed in this directory."},"persistence":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/VmPersistence","description":"Persistence strategy for the VM. If not provided, defaults to 'sticky' with priority 5."}]}}},"CreatedToken":{"type":"object","required":["id","token"],"properties":{"id":{"type":"string","format":"uuid"},"token":{"type":"string"}}},"CustomBuildOptions":{"type":"object","properties":{"command":{"type":["string","null"]},"envVars":{"type":["object","null"],"additionalProperties":{"type":"string"},"propertyNames":{"type":"string"}},"outDir":{"type":["string","null"]}}},"DeleteRecordResponse":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}},"DeploymentBuildOptions":{"oneOf":[{"oneOf":[{"$ref":"#/components/schemas/CustomBuildOptions"}],"title":"Custom"},{"type":"boolean","title":"Enabled"}]},"DeploymentLogEntry":{"type":"object","required":["deploymentId","accountId","provisionedAt","timeout","state","domains","envVars"],"properties":{"deploymentId":{"type":"string","format":"uuid"},"accountId":{"type":"string","format":"uuid"},"provisionedAt":{"type":"string","format":"date-time"},"timeout":{"type":"string"},"state":{"$ref":"#/components/schemas/DeploymentState"},"deployedAt":{"type":["string","null"],"format":"date-time"},"domains":{"type":"array","items":{"type":"string"}},"envVars":{"type":"object","additionalProperties":{"type":"string"},"propertyNames":{"type":"string"}}}},"DeploymentSource":{"oneOf":[{"type":"object","title":"Files","required":["files","kind"],"properties":{"files":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/FreestyleFile"},"propertyNames":{"type":"string"}},"kind":{"type":"string","enum":["files"]}}},{"type":"object","title":"Tar","required":["url","kind"],"properties":{"url":{"type":"string"},"kind":{"type":"string","enum":["tar"]}}},{"type":"object","title":"Git","description":"`dir` is the Directory to deploy from. If not provided, the root of the repository will be used.","required":["url","kind"],"properties":{"url":{"type":"string"},"branch":{"type":["string","null"],"example":"main"},"dir":{"type":["string","null"],"example":"dist"},"kind":{"type":"string","enum":["git"]}}}]},"DeploymentState":{"type":"string","enum":["provisioning","deployed","failed"]},"DescribePermissionResponseSuccess":{"type":"object","required":["identity","repo"],"properties":{"identity":{"type":"string","format":"uuid"},"repo":{"type":"string","format":"uuid"},"accessLevel":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/AccessLevel"}]}}},"DevServer":{"oneOf":[{"type":"object","required":["repoId","kind"],"properties":{"repoId":{"type":"string","format":"uuid"},"gitRef":{"type":["string","null"]},"kind":{"type":"string","enum":["repo"]}}}]},"DevServerConfiguration":{"type":"object","properties":{"devCommand":{"type":["string","null"],"example":"npm run dev"},"installCommand":{"type":["string","null"],"example":"npm install"},"timeout":{"type":["integer","null"],"format":"int32","example":30},"envVars":{"type":["object","null"],"additionalProperties":{"type":"string"},"propertyNames":{"type":"string"},"example":{"RESEND_API_KEY":"re_123456789"}},"ports":{"type":["array","null"],"items":{"$ref":"#/components/schemas/PortConfig"},"example":[{"externalPort":443,"targetPort":3000}]},"preset":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/DevServerPreset"}]}}},"DevServerLogsRequest":{"type":"object","required":["devServer"],"properties":{"devServer":{"$ref":"#/components/schemas/DevServer"},"count":{"type":["integer","null"],"description":"Number of log lines to return per page (default 200)","minimum":0},"page":{"type":["integer","null"],"description":"1-based page index. page=1 returns the most recent lines (default 1)","minimum":0}}},"DevServerPreset":{"type":"string","default":"auto","enum":["auto","nextJs","vite","expo"]},"DevServerRequest":{"allOf":[{"$ref":"#/components/schemas/DevServerConfiguration"},{"type":"object","properties":{"repoId":{"type":["string","null"]},"computeClass":{"type":["string","null"],"default":"high","example":"low"},"domain":{"type":["string","null"],"deprecated":true},"repo":{"type":["string","null"],"deprecated":true},"gitRef":{"type":["string","null"]},"preDevCommandOnce":{"type":["string","null"]},"baseId":{"type":["string","null"],"deprecated":true}}}]},"DevServerRestartRequest":{"type":"object","required":["devServer"],"properties":{"devServer":{"$ref":"#/components/schemas/DevServer"}}},"DevServerStatusRequest":{"type":"object","required":["devServer"],"properties":{"devServer":{"$ref":"#/components/schemas/DevServer"}}},"DevServerWatchFilesRequest":{"type":"object","required":["devServer"],"properties":{"devServer":{"$ref":"#/components/schemas/DevServer"}}},"DnsRecord":{"type":"object","required":["kind","name","value","ttl","managed"],"properties":{"kind":{"$ref":"#/components/schemas/DnsRecordKind"},"name":{"type":"string"},"value":{"type":"string"},"ttl":{"type":"string"},"priority":{"type":["integer","null"],"format":"int32","minimum":0},"managed":{"type":"boolean"}}},"DnsRecordData":{"type":"object","required":["kind","name","value"],"properties":{"kind":{"$ref":"#/components/schemas/DnsRecordKind"},"name":{"type":"string"},"value":{"type":"string"},"ttl":{"type":["string","null"]},"priority":{"type":["integer","null"],"format":"int32","minimum":0}}},"DnsRecordKind":{"type":"string","enum":["A","AAAA","CNAME","TXT","NS"]},"DomainVerificationRequest":{"type":"object","required":["id","domain","accountId","verificationCode","createdAt"],"properties":{"id":{"type":"string","format":"uuid","example":"1234-5678-9012-3456"},"domain":{"type":"string","example":"example.com"},"accountId":{"type":"string","format":"uuid","example":"1234-5678-9012-3456"},"verificationCode":{"type":"string","example":"freestyle-verification-v1-1234-5678-9012-3456"},"createdAt":{"type":"string","format":"date-time","example":"1234567890"}}},"ExecAwaitRequest":{"type":"object","required":["command"],"properties":{"command":{"type":"string"},"terminal":{"type":["string","null"]}}},"ExecRequest":{"type":"object","required":["devServer","command","background"],"properties":{"devServer":{"$ref":"#/components/schemas/DevServer"},"command":{"type":"string"},"background":{"type":"boolean","description":"Spawn this command as a background process and return immediately"}}},"ExecuteLogEntry":{"type":"object","required":["deployment","accountId","provisionedAt","state","envVars"],"properties":{"deployment":{"type":"string","format":"uuid"},"accountId":{"type":"string","format":"uuid"},"provisionedAt":{"type":"string","format":"date-time"},"startedAt":{"type":["string","null"],"format":"date-time"},"duration":{"type":["string","null"]},"state":{"$ref":"#/components/schemas/ExecuteRunState"},"envVars":{"type":"object","additionalProperties":{"type":"string"},"propertyNames":{"type":"string"}}}},"ExecuteRunInfo":{"type":"object","required":["code","nodeModules"],"properties":{"code":{"type":"string"},"nodeModules":{"type":"object","additionalProperties":{"type":"string"},"propertyNames":{"type":"string"}}}},"ExecuteRunState":{"type":"string","enum":["starting","running","complete"]},"FileReadContent":{"oneOf":[{"type":"object","required":["content","encoding","kind"],"properties":{"content":{"type":"string"},"encoding":{"type":"string"},"kind":{"type":"string","enum":["file"]}}},{"type":"object","required":["files","kind"],"properties":{"files":{"type":"array","items":{"type":"string"}},"kind":{"type":"string","enum":["directory"]}}}]},"ForkVmRequest":{"type":"object","properties":{"idleTimeoutSeconds":{"type":["integer","null"],"format":"int64"},"ports":{"type":["array","null"],"items":{"$ref":"#/components/schemas/PortMapping"},"description":"Optional list of ports to expose externally. If not provided, port 3000\nwill be exposed on port 443 by default. Pass an empty array to disable\nexternal ports. Only ports 8081 and 443 can be configured externally for\nnow. Any target port is allowed.","example":[{"port":443,"targetPort":3000}]},"readySignalTimeoutSeconds":{"type":["integer","null"],"format":"int64","description":"Whether the api request should wait for the VM to be ready before\nreturning. By default, the VM is considered ready when the serial\nconsole is ready for login.","default":true,"example":true},"waitForReadySignal":{"type":["boolean","null"],"description":"How long to wait for the ready signal before timing out. Defaults to 120\nseconds if not provided."},"workdir":{"type":["string","null"],"description":"Optional working directory for the VM. File system and shell commands\nwill be executed in this directory."},"persistence":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/VmPersistence","description":"Persistence strategy for the VM. If not provided, defaults to 'sticky' with priority 5."}]}}},"FreestyleCloudstateDeployConfiguration":{"type":"object","properties":{"domains":{"type":["array","null"],"items":{"type":"string"},"description":"ID of the project to deploy, if not provided will create a new project","default":null},"envVars":{"type":"object","description":"The environment variables that the cloudstate deploy can access","default":{},"additionalProperties":{"type":"string"},"propertyNames":{"type":"string"}},"cloudstateDatabaseId":{"type":["string","null"],"format":"uuid","default":null}}},"FreestyleCloudstateDeployErrorResponse":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}},"FreestyleCloudstateDeployRequest":{"type":"object","required":["classes"],"properties":{"classes":{"type":"string"},"config":{"$ref":"#/components/schemas/FreestyleCloudstateDeployConfiguration"}}},"FreestyleCloudstateDeploySuccessResponse":{"type":"object","required":["deploymentId","cloudstateDatabaseId"],"properties":{"deploymentId":{"type":"string","format":"uuid"},"cloudstateDatabaseId":{"type":"string","format":"uuid"}}},"FreestyleDeleteDomainVerificationRequest":{"type":"object","required":["domain","verificationCode"],"properties":{"domain":{"type":"string","description":"The domain to create a verification code for","example":"example.com"},"verificationCode":{"type":"string","description":"The verification code"}}},"FreestyleDeployWebConfiguration":{"type":"object","properties":{"entrypoint":{"type":["string","null"],"description":"The entrypoint file for the website, if none is provided, we will try to automatically detect it.","default":null,"examples":["index.js","server.ts","dist/main.js"]},"domains":{"type":["array","null"],"items":{"type":"string"},"description":"The custom domains for the website, eg. [\\\"subdomain.yourwebsite.com\\\"]. You may include a single *.style.dev domain here.","example":["subdomain.yourdomain.com"],"default":null},"projectId":{"type":["string","null"],"description":"Project ID was our original way of tracking deployments together, it is now deprecated and will be removed in the future. Please use the domains field to specify the domains for your project.","default":null,"deprecated":true},"nodeModules":{"type":["object","null"],"description":"Node Modules to install for the website, a map of package names to versions, e.g. { \\\"express\\\": \\\"4.17.1\\\" }. If this and a package-lock.json are provided, the package-lock.json, bun.lockb, pnpm-lock.yaml, or yarn.lock is also provided, the versions here will override the versions in those lock files.","default":null,"additionalProperties":{"type":"string"},"propertyNames":{"type":"string"},"example":{"resend":"4.0.1"}},"envVars":{"type":["object","null"],"description":"The environment variables that the website can access\ne.g. { \\\"RESEND_API_KEY\\\": \\\"re_123456789\\\" }","default":null,"additionalProperties":{"type":"string"},"propertyNames":{"type":"string"},"example":{"RESEND_API_KEY":"re_123456789"}},"serverStartCheck":{"type":"boolean","default":false},"networkPermissions":{"type":["array","null"],"items":{"$ref":"#/components/schemas/FreestyleNetworkPermission"},"default":null},"build":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/DeploymentBuildOptions"}],"default":null},"timeout":{"type":["integer","null"],"format":"int64","description":"Timeout for the deployment in seconds. If not provided, the default is 10 seconds.","default":null,"example":"15","minimum":0},"await":{"type":["boolean","null"],"description":"Whether to wait for the deployment to finish before returning. Defaults to true.","default":true}}},"FreestyleDeployWebErrorResponse":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}},"FreestyleDeployWebPayload":{"type":"object","required":["files"],"properties":{"files":{"type":"object","description":"The files to deploy, a map of file paths to file contents, e.g. { \\\"index.js\\\": {\\\"content\\\": \\\"your main\\\", \\\"encoding\\\": \\\"utf-8\\\"}, \\\"file2.js\\\": {\\\"content\\\": \\\"your helper\\\" } }\n\n**Do not include node modules in this bundle, they will not work**. Instead, includes a package-lock.json, bun.lockb, pnpm-lock.yaml, or yarn.lock, the node modules for the project will be installed from that lock file, or use the node_modules field in the configuration to specify the node modules to install.","additionalProperties":{"$ref":"#/components/schemas/FreestyleFile"},"propertyNames":{"type":"string"},"example":{"index.js":{"content":"import http from 'node:http';\\n// import { resolver } from './file2.js';\\n\\nconsole.log('starting server');\\n\\nconst server = http.createServer(async(req, res) => {\\n // wait 5 seconds before responding\\n // await new Promise((resolve) => setTimeout(resolve, 5000));\\n res.writeHead(200, { 'Content-Type': 'text/plain' });\\n res.end('Welcome to New York its been waiting for you');\\n});\\n\\nserver.listen(3000, () => {\\n console.log('Server is running at http://localhost:3000');\\n});"}}},"config":{"$ref":"#/components/schemas/FreestyleDeployWebConfiguration"}}},"FreestyleDeployWebPayloadV2":{"type":"object","required":["source"],"properties":{"source":{"$ref":"#/components/schemas/DeploymentSource","description":"The files to deploy, a map of file paths to file contents, e.g. { \\\"index.js\\\": {\\\"content\\\": \\\"your main\\\", \\\"encoding\\\": \\\"utf-8\\\"}, \\\"file2.js\\\": {\\\"content\\\": \\\"your helper\\\" } }\n\n**Do not include node modules in this bundle, they will not work**. Instead, includes a package-lock.json, bun.lockb, pnpm-lock.yaml, or yarn.lock, the node modules for the project will be installed from that lock file, or use the node_modules field in the configuration to specify the node modules to install."},"config":{"$ref":"#/components/schemas/FreestyleDeployWebConfiguration"}}},"FreestyleDeployWebSuccessResponseV2":{"oneOf":[{"type":"object","required":["deploymentId","projectId","entrypoint"],"properties":{"deploymentId":{"type":"string","format":"uuid"},"projectId":{"type":"string","format":"uuid","deprecated":true},"domains":{"type":["array","null"],"items":{"type":"string"}},"entrypoint":{"type":"string","description":"The entrypoint file for the website. If not specified we try to automatically detect it."}}},{"type":"object","required":["deploymentId"],"properties":{"deploymentId":{"type":"string","format":"uuid"}}}]},"FreestyleDomainVerificationRequest":{"type":"object","required":["domain"],"properties":{"domain":{"type":"string","description":"The domain to create a verification code for","example":"example.com"}}},"FreestyleExecuteScriptParams":{"type":"object","required":["script"],"properties":{"script":{"type":"string","description":"The JavaScript or TypeScript script to execute","example":"export default () => {\n // get the value of the factorials of the numbers from 1 to 10 combined\n const a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];\n\n function factorial(n) {\n if (n === 0) {\n return 1;\n }\n return n * factorial(n - 1);\n }\n\n const b = a.map(factorial);\n\n return b.reduce((a, b) => a + b);\n};\n"},"config":{"$ref":"#/components/schemas/FreestyleExecuteScriptParamsConfiguration"}}},"FreestyleExecuteScriptParamsConfiguration":{"type":"object","properties":{"envVars":{"type":"object","description":"The environment variables to set for the script","default":{},"additionalProperties":{"type":"string"},"propertyNames":{"type":"string"},"example":{"RESEND_API_KEY":"re_123456789"}},"nodeModules":{"type":"object","description":"The node modules to install for the script","default":{},"additionalProperties":{"type":"string"},"propertyNames":{"type":"string"},"example":{"resend":"4.0.1"}},"tags":{"type":"array","items":{"type":"string"},"description":"Tags for you to organize your scripts, useful for tracking what you're running","example":["email"],"default":[]},"timeout":{"type":["integer","null"],"format":"int32","description":"The script timeout","default":null,"minimum":0},"peerDependencyResolution":{"type":"boolean","description":"If false, we'll not resolve peer dependencies for the packages given, this can speed up execute performance, but will break packages with peers unless the peers are manually specified.","default":true},"networkPermissions":{"type":["array","null"],"items":{"$ref":"#/components/schemas/FreestyleNetworkPermission"},"default":null},"customHeaders":{"type":"object","description":"These headers will be added to every fetch request made through the script","default":{},"additionalProperties":{"type":"string"},"propertyNames":{"type":"string"}},"proxy":{"type":["string","null"],"description":"Proxy all outgoing requests through this URL","default":null,"example":"https://aproxyyouown.com"}}},"FreestyleExecuteScriptResultSuccess":{"type":"object","required":["result","logs"],"properties":{"result":{"description":"The return value of the default export of the script"},"logs":{"type":"array","items":{"$ref":"#/components/schemas/FreestyleJavaScriptLog"}}}},"FreestyleFile":{"type":"object","required":["content"],"properties":{"content":{"type":"string","description":"The content of the file"},"encoding":{"type":"string","description":"The encoding of the file. Either **utf-8** or **base64**"}}},"FreestyleGetLogsResponse":{"type":"object","required":["logs"],"properties":{"logs":{"type":"array","items":{"$ref":"#/components/schemas/FreestyleLogResponseObject"}}}},"FreestyleJavaScriptLog":{"type":"object","required":["message","type"],"properties":{"message":{"type":"string","description":"The log message","example":"I'm a log!"},"type":{"type":"string","description":"The log level","example":"log"}}},"FreestyleLogResponseObject":{"type":"object","required":["message","timestamp"],"properties":{"message":{"type":"string"},"timestamp":{"type":"string"}}},"FreestyleNetworkPermission":{"oneOf":[{"allOf":[{"$ref":"#/components/schemas/NetworkPermissionData"},{"type":"object","required":["action"],"properties":{"action":{"type":"string","enum":["allow"]}}}]},{"allOf":[{"$ref":"#/components/schemas/NetworkPermissionData"},{"type":"object","required":["action"],"properties":{"action":{"type":"string","enum":["deny"]}}}]}]},"FreestyleSandboxDomainMapping":{"type":"object","required":["id","domain","deploymentId","ownershipId","createdAt"],"properties":{"id":{"type":"string","format":"uuid"},"domain":{"type":"string"},"deploymentId":{"type":"string","format":"uuid"},"ownershipId":{"type":"string","format":"uuid"},"createdAt":{"type":"string","format":"date-time"}}},"FreestyleVerifyDomainRequest":{"oneOf":[{"type":"object","required":["domain"],"properties":{"domain":{"type":"string","example":"example.com"}}},{"type":"object","required":["id"],"properties":{"id":{"type":"string","format":"uuid","example":"1234-5678-9012-3456"}}}],"description":"Verify a domain verification request, can either be done for a domain, or for a specific request"},"GetDefaultBranchResponse":{"type":"object","required":["defaultBranch"],"properties":{"defaultBranch":{"type":"string"}}},"GitCommitPushRequest":{"type":"object","required":["devServer","message"],"properties":{"devServer":{"$ref":"#/components/schemas/DevServer"},"message":{"type":"string"}}},"GitContents":{"oneOf":[{"type":"object","title":"File","required":["name","path","sha","size","content","type"],"properties":{"name":{"type":"string"},"path":{"type":"string"},"sha":{"type":"string","description":"The hash / object ID of the file."},"size":{"type":"integer","format":"int64","minimum":0},"content":{"type":"string","description":"Base64-encoded content."},"type":{"type":"string","enum":["file"]}}},{"type":"object","title":"Directory","required":["name","path","sha","entries","type"],"properties":{"name":{"type":"string"},"path":{"type":"string"},"sha":{"type":"string","description":"The hash / object ID of the directory."},"entries":{"type":"array","items":{"$ref":"#/components/schemas/GitContentsDirEntryItem"}},"type":{"type":"string","enum":["dir"]}}}]},"GitContentsDirEntryItem":{"oneOf":[{"type":"object","title":"File Entry","required":["name","path","sha","size","type"],"properties":{"name":{"type":"string"},"path":{"type":"string"},"sha":{"type":"string","description":"The hash / object ID of the file."},"size":{"type":"integer","format":"int64","minimum":0},"type":{"type":"string","enum":["file"]}}},{"type":"object","title":"Directory Entry","description":"Directory","required":["name","path","sha","entries","type"],"properties":{"name":{"type":"string"},"path":{"type":"string"},"sha":{"type":"string","description":"The hash / object ID of the directory."},"entries":{"type":"array","items":{"oneOf":[{"type":"object","title":"File Entry"},{"type":"object","title":"Dir Entry (recursive)"}]}},"type":{"type":"string","enum":["dir"]}}}]},"GitIdentity":{"type":"object","required":["id","managed"],"properties":{"id":{"type":"string","format":"uuid"},"managed":{"type":"boolean"}}},"GitReference":{"type":"object","description":"A reference to a Git object","required":["name","sha"],"properties":{"name":{"type":"string","description":"The name of the ref (e.g., \"refs/heads/main\" or \"refs/tags/v1.0.0\")"},"sha":{"type":"string","description":"The SHA-1 hash of the Git object this reference points to"}}},"GitRepositoryTrigger":{"type":"object","required":["repositoryId","trigger","action","managed","id","createdAt"],"properties":{"repositoryId":{"type":"string","format":"uuid"},"trigger":{"oneOf":[{"type":"object","required":["event"],"properties":{"branches":{"type":["array","null"],"items":{"type":"string"}},"globs":{"type":["array","null"],"items":{"type":"string"}},"event":{"type":"string","enum":["push"]}}}]},"action":{"oneOf":[{"type":"object","required":["endpoint","action"],"properties":{"endpoint":{"type":"string"},"action":{"type":"string","enum":["webhook"]}}}]},"managed":{"type":"boolean"},"id":{"type":"string","format":"uuid"},"createdAt":{"type":"string","format":"date-time"}}},"GitTrigger":{"oneOf":[{"type":"object","required":["event"],"properties":{"branches":{"type":["array","null"],"items":{"type":"string"}},"globs":{"type":["array","null"],"items":{"type":"string"}},"event":{"type":"string","enum":["push"]}}}]},"GitTriggerAction":{"oneOf":[{"type":"object","required":["endpoint","action"],"properties":{"endpoint":{"type":"string"},"action":{"type":"string","enum":["webhook"]}}}]},"GithubRepoSyncConfig":{"type":"object","required":["freestyleRepoId","accountId","installationId","githubRepoId","githubRepoName","createdAt"],"properties":{"freestyleRepoId":{"type":"string","format":"uuid"},"accountId":{"type":"string","format":"uuid"},"installationId":{"type":"integer","format":"int64"},"githubRepoId":{"type":"integer","format":"int64"},"githubRepoName":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}}},"GithubSyncConfigResponse":{"type":"object","required":["githubRepoName"],"properties":{"githubRepoName":{"type":"string"}}},"GrantPermissionRequest":{"type":"object","required":["permission"],"properties":{"permission":{"$ref":"#/components/schemas/AccessLevel"}}},"InternalServerError":{"type":"string"},"ListGitTokensResponseSuccess":{"type":"object","required":["tokens"],"properties":{"tokens":{"type":"array","items":{"$ref":"#/components/schemas/AccessTokenInfo"}}}},"ListPermissionResponseSuccess":{"type":"object","required":["repositories"],"properties":{"repositories":{"type":"array","items":{"$ref":"#/components/schemas/AccessibleRepository"}}}},"ListRecordsResponse":{"type":"object","required":["records"],"properties":{"records":{"type":"array","items":{"$ref":"#/components/schemas/DnsRecord"}}}},"NetworkPermissionData":{"type":"object","required":["query"],"properties":{"query":{"type":"string"},"behavior":{"$ref":"#/components/schemas/Behavior"}}},"PortConfig":{"type":"object","required":["port","targetPort"],"properties":{"port":{"type":"integer","format":"int32","minimum":0},"targetPort":{"type":"integer","format":"int32","minimum":0}}},"PortMapping":{"type":"object","required":["port","targetPort"],"properties":{"port":{"type":"integer","format":"int32"},"targetPort":{"type":"integer","format":"int32"}}},"ReadFileEphemeralDevServerResponses":{"oneOf":[{"type":"object","required":["id","isNew","content"],"properties":{"id":{"type":"string"},"isNew":{"type":"boolean"},"content":{"oneOf":[{"type":"object","required":["content","encoding","kind"],"properties":{"content":{"type":"string"},"encoding":{"type":"string"},"kind":{"type":"string","enum":["file"]}}},{"type":"object","required":["files","kind"],"properties":{"files":{"type":"array","items":{"type":"string"}},"kind":{"type":"string","enum":["directory"]}}}]}}},{"type":"object","required":["id","isNew"],"properties":{"id":{"type":"string"},"isNew":{"type":"boolean"}}},{"$ref":"#/components/schemas/InternalServerError"}]},"RepositoryInfoRaw":{"type":"object","required":["id","accountId","visibility","defaultBranch"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":["string","null"],"examples":["my-repo"]},"accountId":{"type":"string","format":"uuid"},"visibility":{"$ref":"#/components/schemas/Visibility"},"defaultBranch":{"type":"string"}}},"RepositoryMetadata":{"type":"object","required":["branches","tags","defaultBranch"],"properties":{"branches":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/BranchDetails"},"propertyNames":{"type":"string"}},"tags":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/TagDetails"},"propertyNames":{"type":"string"}},"defaultBranch":{"type":"string"}}},"ResizeVmRequest":{"type":"object","required":["sizeMb"],"properties":{"sizeMb":{"type":"integer","format":"int64","minimum":0}}},"RevokeGitTokenRequest":{"type":"object","required":["tokenId"],"properties":{"tokenId":{"type":"string","format":"uuid"}}},"SetDefaultBranchRequest":{"type":"object","required":["defaultBranch"],"properties":{"defaultBranch":{"type":"string"}}},"SetDefaultBranchResponse":{"type":"object"},"ShutdownDevServerRequest":{"type":"object","required":["devServer"],"properties":{"devServer":{"$ref":"#/components/schemas/DevServer","description":"The dev server to shutdown"}}},"Signature":{"type":"object","required":["date","name","email"],"properties":{"date":{"type":"string","format":"date-time","description":"The date marker for this signature"},"name":{"type":"string"},"email":{"type":"string"}}},"StartVmRequest":{"type":"object","properties":{"idleTimeoutSeconds":{"type":["integer","null"],"format":"int64"},"readySignalTimeoutSeconds":{"type":["integer","null"],"format":"int64"},"waitForReadySignal":{"type":["boolean","null"]}}},"TagDetails":{"type":"object","required":["name","target"],"properties":{"name":{"type":"string"},"target":{"type":"string"},"message":{"type":["string","null"]}}},"TagObject":{"type":"object","description":"Tag object","required":["name","target","sha"],"properties":{"name":{"type":"string","description":"The tag name"},"tagger":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/Signature","description":"The tagger who created the tag"}]},"message":{"type":["string","null"],"description":"The tag message"},"target":{"$ref":"#/components/schemas/TagTarget","description":"The object this tag points to"},"sha":{"type":"string","description":"The tag's hash ID"}}},"TagTarget":{"type":"object","required":["sha"],"properties":{"sha":{"type":"string","description":"The target object's hash ID"}}},"TreeEntry":{"oneOf":[{"type":"object","title":"Blob","required":["path","sha","type"],"properties":{"path":{"type":"string"},"sha":{"type":"string"},"type":{"type":"string","enum":["blob"]}}},{"type":"object","title":"Tree","required":["path","sha","type"],"properties":{"path":{"type":"string"},"sha":{"type":"string"},"type":{"type":"string","enum":["tree"]}}}]},"TreeObject":{"type":"object","description":"Tree object","required":["tree","sha"],"properties":{"tree":{"type":"array","items":{"$ref":"#/components/schemas/TreeEntry"},"description":"The tree's entries"},"sha":{"type":"string","description":"The tree's hash ID"}}},"UpdateDevServerConfigRequest":{"allOf":[{"$ref":"#/components/schemas/DevServerConfiguration"},{"type":"object","properties":{"branch":{"type":["string","null"]}}}]},"UpdatePermissionRequest":{"type":"object","required":["permission"],"properties":{"permission":{"$ref":"#/components/schemas/AccessLevel"}}},"Visibility":{"type":"string","enum":["public","private"]},"VmPersistence":{"oneOf":[{"type":"object","description":"When your storage quota is reached, the least recently used VMs will be\ndeleted.","required":["type"],"properties":{"priority":{"type":["integer","null"],"format":"int32","description":"Priority for eviction when storage quota is reached. Higher values\nmean the VM is less likely to be evicted. Range is 0-10, default is\n5.","default":5,"maximum":10,"minimum":0},"type":{"type":"string","enum":["sticky"]}}},{"type":"object","description":"The VM will be deleted after the idle timeout. It's not guaranteed that\nthe VM will be deleted immediately.","required":["type"],"properties":{"type":{"type":"string","enum":["ephemeral"]}}},{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["persistent"]}}}]},"WriteFileRequest":{"type":"object","required":["content"],"properties":{"content":{"type":"string"}}}},"responses":{"FreestyleExecuteScriptResultSuccess":{"description":"","content":{"application/json":{"schema":{"type":"object","required":["result","logs"],"properties":{"result":{"description":"The return value of the default export of the script"},"logs":{"type":"array","items":{"$ref":"#/components/schemas/FreestyleJavaScriptLog"}}}}}}}},"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}}},"tags":[{"name":"Web","description":"APIs for deploying websites. We handle node modules caching, scaling, certificates and the whole end to end process. Send the code using the [deploy](#tag/web/POST/web/v1/deploy) endpoint, and you'll get a full hosted website back. Works with any TypeScript or JavaScript codebase."},{"name":"Execute","description":"APIs for running code. Send the code using the [execute](#tag/execute/POST/execute/v1/execute) endpoint, and you'll get the output back. Works with any TypeScript or JavaScript code + handles any node modules and environment variables you want."},{"name":"Cloudstate","description":"APIs for running cloud functions with persistent state. [Cloudstate](https://github.com/freestyle-sh/cloudstate/) is an opensource, durable JavaScript runtime maintained by the Freestyle Team."},{"name":"Domains","description":"APIs for managing domains. This is only relevant when you want to start to deploy to custom domains. \nPlease read [this guide](https://github.com/freestyle-sh/sandbox_sdks/blob/main/docs/custom_domains.md) to understand how deployments work with custom domains."},{"name":"Git","description":"APIs for managing git repositories and accessing git objects like commits, trees, blobs, tags, and refs."},{"name":"Observability","description":"APIs for observability."},{"name":"DNS","description":"APIs for managing DNS records."}]}
|