Skip to main content
The Compile API allows you to execute arbitrary code in a secure, sandboxed environment directly through Fermion’s backend. This is ideal for online coding exercises, testing snippets, or building coding playgrounds on your platform. You can send a POST request with your source code and configuration details, and the API returns the program’s output, error messages, and execution metadata, right inside your instructor dashboard.
Before you start, make sure Coding labs are enabled under Manage Features in your instructor dashboard. Learn how to enable features at Fermion here

Supported languages

Fermion currently supports the following runtimes for code execution:
  • C
  • C++
  • Java
  • Python
  • Node.js (JavaScript)
  • SQLite (3.48.0)
  • Go (1.19)
  • Rust (1.87)
  • .NET 8
  • MySQL 8
Each language runs in a secure, isolated container with seperate resources.

How does compile API work?

You can access compile API directly inside your instructor user dashboard by heading over to Coding labsCompile API. After accessing this section, you will be presented with the following two panes:

Write and Run Code

On the left side, you can write and edit your source code in the built-in editor using any of the supported languages. Simply choose the language from the dropdown and click Run code to execute it securely in Fermion’s sandboxed environment.

API Preview

On the right side, you can view the automatically generated cURL request: showing exactly how to call the Fermion Compile API programmatically.
After clicking Run code, you will see the execution results, including status, timing, memory usage, and program output. Example:

Example usage

Here’s a sample curl request to execute a C++ code to compute sum of two variables:
curl -X POST https://backend.codedamn.com/api/public/request-dsa-code-execution \
 -H 'content-type: application/json' \
 -H 'fermion-api-key: YOUR_API_KEY' \
 -d '{
 "data": [
  {
   "data": {
    "language": "Cpp",
    "runConfig": {},
    "sourceCodeAsBase64UrlEncoded": "I2luY2x1ZGUgPGlvc3RyZWFtPiAKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBtYWluKCkgewoJaW50IGEgPTQ7CglpbnQgYj01OwoJY291dDw8YStiOwoJcmV0dXJuIDA7Cn0"
   }
  }
 ]
}'

Next steps

To learn more about Fermion API, head over to the following sections for more in depth instructions on executing code over Fermion API.
I