Skip to main content
PUT
/
codegen
/
fastapply
/
{path}
Apply code edit
curl --request PUT \
  --url https://run.blaxel.ai/{workspace_id}/sandboxes/{sandbox_id}/codegen/fastapply/{path} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "codeEdit": "// Add world parameter\nfunction hello(world) {\n  console.log('\''Hello'\'', world);\n}",
  "model": "auto"
}'
{
  "message": "Code edit applied successfully",
  "originalContent": "function hello() {\n  console.log('Hello');\n}",
  "path": "src/main.js",
  "provider": "Relace",
  "success": true,
  "updatedContent": "function hello(world) {\n  console.log('Hello', world);\n}"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

path
string
required

Path to the file to edit (relative to workspace)

Body

application/json

Code edit request

codeEdit
string
required
Example:

"// Add world parameter\nfunction hello(world) {\n console.log('Hello', world);\n}"

model
string
Example:

"auto"

Response

Code edit applied successfully

message
string
Example:

"Code edit applied successfully"

originalContent
string
Example:

"function hello() {\n console.log('Hello');\n}"

path
string
Example:

"src/main.js"

provider
string
Example:

"Relace"

success
boolean
Example:

true

updatedContent
string
Example:

"function hello(world) {\n console.log('Hello', world);\n}"