POST
/
workspace
/
read-source-code
curl --request POST \
  --url http://localhost:4444/v1/workspace/read-source-code \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "path": "src/main.py",
  "range": null
}'
{
  "source_code": "<string>"
}

Authorizations

Authorization
string
header
required

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

Body

application/json
path
string
required

Path to the file, relative to the workspace root

Example:

"src/main.py"

range
object | null

Optional range within the file to read

Response

200
application/json
Source code retrieved successfully
source_code
string
required