Skip to main content

IdeGYM Server API (1.0.0)

Download OpenAPI specification:Download

In-pod FastAPI server exposing tools (bash, file ops) and reward endpoints. Mounted under the /api prefix in the running container.

Execute Bash Script

Request Body schema: application/json
required
command
required
string (Command)

Command to execute as a bash script

Cwd (string) or Cwd (null) (Cwd)

Working directory for the command. Defaults to the server's project directory. A relative path is resolved against it.

object (Env)

Environment variables added to the command's environment, overriding inherited ones. Prefer this over writing 'export' lines into the script: the values never enter the command text, so they are not logged with it.

User (string) or User (null) (User)

Run the command as this user. Needs the server to run as root or to have passwordless sudo, as the server image does; leave unset to run as the server's own user.

timeout
number (Timeout)
Default: 600

Timeout for the command execution in seconds

graceful_termination_timeout
number (Graceful Termination Timeout)
Default: 2

Timeout in seconds for graceful process termination

Max Output Bytes (integer) or Max Output Bytes (null) (Max Output Bytes)
Default: 1048576

Maximum retained bytes for each output stream; null retains complete output

strip_output
boolean (Strip Output)
Default: false

Trim leading and trailing whitespace from stdout and stderr. Off by default so that output is byte-for-byte what the command wrote; undecodable bytes are still replaced.

Responses

Request samples

Content type
application/json
{
  • "command": "string",
  • "cwd": "/home/appuser/work",
  • "env": {
    },
  • "user": "devuser",
  • "timeout": 600,
  • "graceful_termination_timeout": 2,
  • "max_output_bytes": 1048576,
  • "strip_output": false
}

Response samples

Content type
application/json
null

Create File

Request Body schema: application/json
required
file_path
required
string (File Path)
content
required
string (Content)

Responses

Request samples

Content type
application/json
{
  • "file_path": "string",
  • "content": "string"
}

Response samples

Content type
application/json
null

Replace Lines

Request Body schema: application/json
required
file_path
required
string (File Path)
start_line
required
integer (Start Line) >= 0
end_line
required
integer (End Line) >= 0
new_content
required
string (New Content)

Responses

Request samples

Content type
application/json
{
  • "file_path": "string",
  • "start_line": 0,
  • "end_line": 0,
  • "new_content": "string"
}

Response samples

Content type
application/json
null

Patch File

Request Body schema: application/json
required
file_path
required
string (File Path)
patch
required
string (Patch)

Responses

Request samples

Content type
application/json
{
  • "file_path": "string",
  • "patch": "string"
}

Response samples

Content type
application/json
null

Upload File Chunk

Write one base64 chunk into a file, so binary survives the JSON forwarding path.

Request Body schema: application/json
required
file_path
required
string (File Path)
content_base64
required
string (Content Base64)

Base64-encoded bytes to write at 'offset'

offset
integer (Offset) >= 0
Default: 0

Byte offset in the file at which to write this chunk

truncate
boolean (Truncate)
Default: true

Cut the file off at the end of this chunk once it is written, so a re-upload cannot leave the tail of a longer previous file behind. Set false for out-of-order writes.

Responses

Request samples

Content type
application/json
{
  • "file_path": "string",
  • "content_base64": "string",
  • "offset": 0,
  • "truncate": true
}

Response samples

Content type
application/json
{
  • "file_path": "string",
  • "bytes_written": 0,
  • "size": 0
}

Download File Chunk

Read one base64 chunk of a file, so binary survives the JSON forwarding path.

Request Body schema: application/json
required
file_path
required
string (File Path)
offset
integer (Offset) >= 0
Default: 0

Byte offset in the file to read from

length
integer (Length) >= 1
Default: 1048576

Maximum number of raw bytes to read

Responses

Request samples

Content type
application/json
{
  • "file_path": "string",
  • "offset": 0,
  • "length": 1048576
}

Response samples

Content type
application/json
{
  • "file_path": "string",
  • "offset": 0,
  • "content_base64": "string",
  • "bytes_read": 0,
  • "size": 0,
  • "eof": true
}

Compilation Reward

Request Body schema: application/json
required
compilation_script
string (Compilation Script)
Default: "./gradlew assemble"
timeout
number (Timeout)
Default: 600

Timeout for the compilation in seconds

graceful_termination_timeout
number (Graceful Termination Timeout)
Default: 2

Timeout in seconds for graceful process termination

Responses

Request samples

Content type
application/json
{
  • "compilation_script": "./gradlew assemble",
  • "timeout": 600,
  • "graceful_termination_timeout": 2
}

Response samples

Content type
application/json
null

Setup Reward

Request Body schema: application/json
required
setup_check_script
string (Setup Check Script)
Default: "true"
timeout
number (Timeout)
Default: 600

Timeout for the setup in seconds

graceful_termination_timeout
number (Graceful Termination Timeout)
Default: 2

Timeout in seconds for graceful process termination

Responses

Request samples

Content type
application/json
{
  • "setup_check_script": "true",
  • "timeout": 600,
  • "graceful_termination_timeout": 2
}

Response samples

Content type
application/json
null

Unit Test Reward

Request Body schema: application/json
required
test_script
string (Test Script)
Default: "python -m pytest --junitxml=test-results.xml"
timeout
number (Timeout)
Default: 600

Timeout for the test in seconds

graceful_termination_timeout
number (Graceful Termination Timeout)
Default: 2

Timeout in seconds for graceful process termination

Responses

Request samples

Content type
application/json
{
  • "test_script": "python -m pytest --junitxml=test-results.xml",
  • "timeout": 600,
  • "graceful_termination_timeout": 2
}

Response samples

Content type
application/json
null