Docs

Jobe-compatible API

Jobe's REST API at https://api.onlinecompiler.io/api/jobe/index.php/restapi, for Moodle's CodeRunner question type: CodeRunner sends students' code here instead of to a Jobe server you install and maintain.

Set up CodeRunner

  1. Get a free API key at your dashboard.
  2. In Moodle, open Site administration > Plugins > Question types > CodeRunner.
  3. Set Jobe server to https://api.onlinecompiler.io/api, with the https:// (without it, CodeRunner uses http).
  4. Set Jobe API key to your API key, save, and check an answer in any CodeRunner question.
GET /api/jobe/index.php/restapi/languages no key needed; a key that is sent is checked
POST /api/jobe/index.php/restapi/runs
PUT /api/jobe/index.php/restapi/files/{id}
HEAD /api/jobe/index.php/restapi/files/{id}

The key goes in X-API-KEY, as CodeRunner sends it. Requests and responses keep Jobe's shape, and errors come back as a JSON string.

Terminal
curl -X POST https://api.onlinecompiler.io/api/jobe/index.php/restapi/runs \
  -H "X-API-KEY: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "run_spec": {
      "language_id": "python3",
      "sourcecode": "print(input()[::-1])",
      "input": "hello\n",
      "parameters": { "cputime": 3 }
    }
  }'

Response (200)

Response
{
  "run_id": null,
  "outcome": 15,
  "cmpinfo": "",
  "stdout": "olleh\n",
  "stderr": ""
}

Language ids

Jobe's own ids, which CodeRunner's built-in question types use, run on these compilers. A custom question type can name any of the other 38 ids as its sandbox language.

language_idRuns on
cC (GCC 15)
cppC++ (G++ 15)
javaJava (OpenJDK 25)
nodejsJavaScript (Node.js 24)
octaveOctave (11)
pascalPascal (Free Pascal 3.2)
phpPHP (8.5)
python3Python (3.14)

Also: ada (Ada), bash (Bash), clojure (Clojure), cobol (COBOL), crystal (Crystal), csharp (C#), d (D), dart (Dart), duckdb (DuckDB), elixir (Elixir), erlang (Erlang), fortran (Fortran), freebasic (FreeBASIC), fsharp (F#), go (Go), groovy (Groovy), haskell (Haskell), julia (Julia), kotlin (Kotlin), lisp (Common Lisp), lua (Lua), nasm (Assembly), nim (Nim), objectivec (Objective-C), ocaml (OCaml), perl (Perl), powershell (PowerShell), prolog (Prolog), r (R), racket (Racket), ruby (Ruby), rust (Rust), scala (Scala), sqlite (SQL), swift (Swift), typescript (TypeScript), vbnet (Visual Basic), zig (Zig).

Outcomes and errors

  • 15 the program ran and exited cleanly; 11 compile error, with the compiler's messages in cmpinfo, which includes a syntax error in Python, Java or PHP as on Jobe; 12 runtime error (a non-zero exit or a signal); 13 time limit; 17 memory limit; 19 more than 16 processes at once, which CodeRunner shows as an illegal function call; 30 output over 64 KB; 20 an internal error on our side.
  • 21 (overload): your plan's per-minute, pending or at-once limit was reached, or the sandboxes were busy. Nothing ran and nothing was counted; the same run can be sent again shortly.
  • HTTP 401: the monthly allowance of your account or key is spent, which CodeRunner reports as a submission limit. 403: the key is missing, unknown or not a REST API key. 404: a file in file_list isn't stored, so CodeRunner uploads it and sends the run again. 400: a bad request, with the reason.

Differences from Jobe

  • Every run is a fresh gVisor sandbox with no network access and our limits: 512 MB of memory and at most 16 processes.
  • parameters.cputime stops the run, 5 seconds when it is absent as on Jobe, capped at 30 seconds. Compiling does not count, and Java (1 s), Groovy (1.5 s) and F# (2.5 s) get a start-up allowance on top. memorylimit, numprocs, streamsize and disklimit are accepted and ignored.
  • compileargs, linkargs and interpreterargs are ignored: programs compile with our commands. C compiles in GCC 15's default dialect rather than Jobe's -std=c99, and without -Werror. Compiler warnings arrive in stderr, and CodeRunner marks any stderr as an error, so warnings still fail an answer as they would on Jobe.
  • runargs are refused with a 400: programs get no command-line arguments.
  • sourcefilename is ignored. A Java file takes its public class's name, so CodeRunner's Java templates, which put the student's class before the test harness, run as on Jobe.
  • Each language runs in a sandbox of its own, so a template that calls another language's compiler from Python does not work: the Python sandbox has no gcc, javac or php. That includes CodeRunner's built-in multilanguage question type, which compiles the student's chosen language from a Python template.
  • A run's files follow the input file limits: up to 8 files and 1 MB, with plain names. Uploaded files are kept per account, up to the 200 most recently used and 50 MB.
  • Each run counts as one run toward your monthly allowance. Listing languages and uploading or checking files are free.

Why use a hosted Jobe? See CodeRunner without a Jobe server.

Questions

Do I still need a Jobe server?
No. Set CodeRunner's Jobe server to https://api.onlinecompiler.io/api and its Jobe API key to your OnlineCompiler.io API key, and CodeRunner sends its runs here.
Which question types work?
CodeRunner's built-in types use Jobe's language ids (c, cpp, java, nodejs, octave, pascal, php and python3), and all of them are served. A custom question type can also use any of 38 more ids, such as go, rust and kotlin.
What happens when a whole class checks answers at once?
Runs beyond your plan's per-minute or at-once limits get Jobe's overload outcome, which CodeRunner shows as a sandbox overload; checking again a moment later works. For timed exams with large classes, see pricing or ask us for higher limits.