{"openapi": "3.1.0", "info": {"title": "OnlineCompiler.io API", "version": "2026-10-24", "summary": "Run code in a sandbox, judge it against test cases, and read limits and usage.", "description": "Execute source code in isolated, network-less sandboxes in dozens of languages and get stdout, stderr, exit code, time and memory back as JSON. This file describes the native REST API: synchronous runs, asynchronous runs with a callback, judging a program against test cases, the compiler list, execution limits, usage and health.\n\n**Authentication.** Create an API key (type API) in the dashboard at https://api.onlinecompiler.io/compilers/api-keys/ and send the bare key in the `Authorization` header, for example `Authorization: YOUR_API_KEY`. A `Bearer ` prefix is not accepted on this API. Widget keys cannot call it. `GET /api/compilers/`, `GET /api/limits/` and `GET /api/health/` need no key.\n\nPaths are written with a trailing slash; every path except `/api/files/{file_id}/` also works without it.\n\n**Limits.** Per-run limits (memory, CPUs, timeout, output size, file counts) and your plan's allowance and rate limits change over time and are not repeated here: read `GET /api/limits/` for the defaults and `GET /api/usage/` for your account. A refusal for a limit answers HTTP 429 with `{\"error\": \"...\"}` and nothing runs or is counted.\n\n**Compatible APIs.** Existing clients can also talk to OnlineCompiler.io through compatibility layers that are not part of this description: Judge0 CE (https://onlinecompiler.io/docs/judge0), Piston v2 (https://onlinecompiler.io/docs/piston) and Jobe for Moodle CodeRunner (https://onlinecompiler.io/docs/jobe). The MCP server and WebSocket widget are documented at https://onlinecompiler.io/docs.\n\nFull documentation: https://onlinecompiler.io/docs", "termsOfService": "https://onlinecompiler.io/terms", "contact": {"name": "OnlineCompiler.io", "url": "https://onlinecompiler.io/contact"}}, "servers": [{"url": "https://api.onlinecompiler.io", "description": "Production"}], "externalDocs": {"description": "OnlineCompiler.io documentation", "url": "https://onlinecompiler.io/docs"}, "webhooks": {"runResult": {"post": {"operationId": "runResultCallback", "tags": ["Run"], "summary": "Result of a finished asynchronous run", "description": "OnlineCompiler.io POSTs this JSON to the callback URL configured on your API key when a run queued with /api/run-code/ finishes. Any 2xx response acknowledges it; other outcomes are retried a few times.", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CallbackBody"}}}}, "responses": {"200": {"description": "Acknowledged. Any 2xx status counts."}}}}}, "tags": [{"name": "Run", "description": "Run one program."}, {"name": "Judge", "description": "Run one program against many tests and score it."}, {"name": "Reference", "description": "Compilers, limits and health. No API key needed."}, {"name": "Account", "description": "Usage and stored files of the calling key's account."}], "paths": {"/api/run-code-sync/": {"post": {"operationId": "runCodeSync", "tags": ["Run"], "summary": "Run code and wait for the result", "description": "Runs the program and returns when it ends, within the sandbox timeout. Answers 429 when your account's runs at once or the host's sandboxes are all busy; retry shortly. A program that fails (non-zero exit, timeout, compile error) is still HTTP 200: read `status` and `exit_code`.", "security": [{"ApiKey": []}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RunRequest"}, "examples": {"python": {"summary": "Python with stdin", "value": {"compiler": "python-3.14", "code": "name = input()\nprint(f\"Hello, {name}!\")", "input": "World"}}, "inputFile": {"summary": "A CSV in, using files", "value": {"compiler": "python-3.14", "code": "print(open('sales.csv').read())", "files": [{"name": "sales.csv", "content": "region,amount\nnorth,10\n"}]}}}}}}, "responses": {"200": {"description": "The run finished, successfully or not.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RunResult"}, "example": {"output": "Hello, World!\n", "error": "", "status": "success", "exit_code": 0, "signal": null, "truncated": false, "time": "0.0248", "total": "0.0330", "memory": "8192", "files": [], "files_truncated": false, "time_limit": 30}}}}, "400": {"$ref": "#/components/responses/BadRequest"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/InvalidKey"}, "429": {"$ref": "#/components/responses/RateLimited"}}}}, "/api/run-code/": {"post": {"operationId": "runCodeAsync", "tags": ["Run"], "summary": "Queue a run and receive the result by callback", "description": "Admits the run and answers 202 at once with a queue id. When it finishes, the result is POSTed as JSON (shape `CallbackBody`, see the `runResult` webhook) to the callback URL set on the API key in the dashboard; the callback carries no id, so pass `extra_params` to correlate it. The key must have a callback URL, which must be a public http(s) address without credentials; redirects are not followed. A failed delivery is retried a few times. Use `/api/run-code-sync/` when you can wait for the result instead.", "security": [{"ApiKey": []}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AsyncRunRequest"}, "example": {"compiler": "python-3.14", "code": "print(sum(range(10)))", "extra_params": {"job": "abc123"}}}}}, "responses": {"202": {"description": "Admitted and queued.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Queued"}, "example": {"status": "queued", "id": 42}}}}, "400": {"$ref": "#/components/responses/BadRequest"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/InvalidKey"}, "429": {"$ref": "#/components/responses/RateLimited"}, "503": {"$ref": "#/components/responses/Unavailable"}}}}, "/api/run-tests/": {"post": {"operationId": "runTests", "tags": ["Judge"], "summary": "Run a program against test cases and score it", "description": "Runs one program against a list of tests, each in its own fresh sandbox, and answers with a verdict per test, an overall verdict and a score from 0 to 100. Always waits for the result. Each test counts as one run against the monthly allowance and the per-minute and pending limits, and the number of tests is capped by your plan (see `GET /api/usage/`, `pending_submissions`). The request has a time budget, so many tests with a long `time_limit` are refused with 400 and the largest `time_limit` that fits. Hidden and skipped tests return only `verdict` and `hidden`.", "security": [{"ApiKey": []}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RunTestsRequest"}, "example": {"compiler": "python-3.14", "code": "a, b = map(int, input().split())\nprint(a + b)", "tests": [{"input": "1 2\n", "expected_output": "3\n"}, {"input": "5 7\n", "expected_output": "12\n", "hidden": true, "weight": 2}], "scoring": "weighted"}}}}, "responses": {"200": {"description": "Every test that could start has run. Check `verdict`: `incomplete` means some tests were skipped by the start cut-off; retry.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RunTestsResponse"}, "example": {"verdict": "accepted", "score": 100, "passed": 2, "total": 2, "time_limit": 2, "compile_error": null, "tests": [{"verdict": "accepted", "hidden": false, "time": "0.0213", "memory": "9000", "exit_code": 0, "signal": null, "output": "3\n", "error": "", "truncated": false, "files": [], "files_truncated": false}, {"verdict": "accepted", "hidden": true}]}}}}, "400": {"$ref": "#/components/responses/BadRequest"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/InvalidKey"}, "429": {"$ref": "#/components/responses/RateLimited"}}}}, "/api/compilers/": {"get": {"operationId": "listCompilers", "tags": ["Reference"], "summary": "List the compilers and their ids", "description": "The current compiler ids, with display names and, for Python, the preinstalled packages. No API key needed. Use an id as `compiler` in the run endpoints.", "security": [], "responses": {"200": {"description": "The compilers.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompilerList"}, "example": {"compilers": [{"id": "python-3.14", "name": "Python", "packages": [{"name": "numpy", "version": "2.5.4"}]}, {"id": "gcc-15", "name": "C"}]}}}}}}}, "/api/limits/": {"get": {"operationId": "getLimits", "tags": ["Reference"], "summary": "Execution limits and default account limits", "description": "Per-run limits and the default (Free) account limits. File sizes are in bytes. No API key needed. An account on a paid plan has higher account limits: see `GET /api/usage/`.", "security": [], "responses": {"200": {"description": "The limits.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Limits"}}}}}}}, "/api/usage/": {"get": {"operationId": "getUsage", "tags": ["Account"], "summary": "This month's runs and the limits that apply to the calling key", "description": "Counts runs of the calling key's account in the current calendar month (UTC), with the account's limits and, separately, the calling key's own count and monthly limit.", "security": [{"ApiKey": []}], "responses": {"200": {"description": "Usage and limits.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Usage"}, "example": {"month": "2026-10", "submissions": 1520, "monthly_limit": 100000, "remaining": 98480, "resets_at": "2026-11-01T00:00:00Z", "submissions_per_minute": 30, "pending_submissions": 8, "running_submissions": 2, "key": {"submissions": 1200, "monthly_limit": 5000, "remaining": 3800}}}}}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/InvalidKey"}}}}, "/api/health/": {"get": {"operationId": "getHealth", "tags": ["Reference"], "summary": "Whether a run gets through right now", "description": "Checks the database and sends a one-line program through the job queue into a real sandbox. Answers 200 when every check is ok and 503 otherwise. The report is shared and reused for a minute, so `checked_at` can be up to a minute old; calling it costs no runs. Not cacheable. No API key needed.", "security": [], "responses": {"200": {"description": "Every check is ok.", "headers": {"Cache-Control": {"schema": {"type": "string"}, "description": "no-store"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Health"}, "example": {"status": "ok", "checked_at": "2026-10-24T10:41:07.512345+00:00", "checks": {"database": "ok", "queue": "ok", "sandbox": "ok"}, "run_seconds": 0.84}}}}, "503": {"description": "At least one check failed.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Health"}, "example": {"status": "down", "checked_at": "2026-10-24T10:41:07.512345+00:00", "checks": {"database": "ok", "queue": "timeout", "sandbox": "unknown"}, "run_seconds": null}}}}}}}, "/api/files/{file_id}/": {"get": {"operationId": "downloadFile", "tags": ["Account"], "summary": "Download a stored output file", "description": "Serves an output file a run stored, to any API key of the account that ran it. The `url` of an entry in a run's `files` is this path. Files are kept for a limited time (see `GET /api/limits/`, `file_retention_days`). Other accounts, expired files and files that were never stored answer 404. The trailing slash is required on this path.", "security": [{"ApiKey": []}], "parameters": [{"name": "file_id", "in": "path", "required": true, "schema": {"type": "integer"}, "description": "The number at the end of a file's `url`."}], "responses": {"200": {"description": "The file's bytes, as an attachment, with the MIME type the run reported.", "headers": {"Content-Disposition": {"schema": {"type": "string"}, "description": "attachment; filename*=UTF-8''<name>"}}, "content": {"application/octet-stream": {"schema": {"type": "string", "format": "binary"}}}}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"description": "Unknown key, or the file is not found (not yours, expired, or never stored).", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"key": {"summary": "Unknown key", "value": {"error": "Invalid or inactive API key"}}, "file": {"summary": "No such file", "value": {"error": "File not found"}}}}}}}}}}, "components": {"securitySchemes": {"ApiKey": {"type": "apiKey", "in": "header", "name": "Authorization", "description": "Your API key (key type API) from https://api.onlinecompiler.io/compilers/api-keys/, sent as the bare value of the Authorization header. Do not add a Bearer prefix. A key may be restricted to an origin in the dashboard."}}, "schemas": {"Error": {"type": "object", "required": ["error"], "properties": {"error": {"type": "string", "description": "A human-readable reason."}}}, "CompilerId": {"type": "string", "description": "A compiler id from GET /api/compilers/. Retired ids (the dotnet-*-9 ids, now dotnet-*-10) are still accepted and run on their successor, but are not listed.", "examples": ["python-3.14", "gcc-15", "nodejs-24"], "enum": ["python-3.14", "python-3.14-pandas2", "duckdb-1.5", "gcc-15", "g++-15", "openjdk-25", "dotnet-csharp-10", "dotnet-fsharp-10", "php-8.5", "ruby-4.0", "haskell-9.12", "go-1.26", "rust-1.93", "typescript-deno", "nodejs-24", "sqlite-3", "bash-5.2", "gfortran-15", "dotnet-vbnet-10", "kotlin-2.4", "r-4.6", "swift-6.4", "gnucobol-3.2", "perl-5.44", "julia-1.13", "fpc-3.2", "octave-11", "nasm-3", "lua-5.5", "ocaml-5.4", "sbcl-2.6", "erlang-29", "elixir-1.20", "swipl-10", "ldc-1.43", "fbc-1.10", "dart-3.13", "clojure-1.12", "groovy-6.0", "scala-3.10", "zig-0.17", "nim-2.2", "crystal-1.22", "gnat-15", "powershell-7.6", "racket-9.3", "clang-objc-21"]}, "InputFile": {"type": "object", "required": ["name", "content"], "properties": {"name": {"type": "string", "maxLength": 100, "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$", "description": "A plain file name. It cannot be input, run.sh, build, build.tar or go-trim.txt, its part before the first dot cannot be code, and names in one request must differ."}, "content": {"type": "string", "description": "The file's content: UTF-8 text without NUL characters, or base64 when encoding is base64."}, "encoding": {"type": "string", "enum": ["utf8", "base64"], "default": "utf8"}}, "description": "A file placed in the program's working directory."}, "OutputFile": {"type": "object", "required": ["name", "mime", "size", "content_base64", "url"], "properties": {"name": {"type": "string"}, "mime": {"type": "string"}, "size": {"type": "integer", "description": "Bytes."}, "content_base64": {"type": "string", "description": "The file's bytes, base64 encoded."}, "url": {"type": ["string", "null"], "format": "uri", "description": "Where the account that ran it can fetch the file again with its API key (GET /api/files/{file_id}/). Null when the file was not stored, always in run-tests results."}}}, "RunRequest": {"type": "object", "required": ["compiler", "code"], "properties": {"compiler": {"$ref": "#/components/schemas/CompilerId"}, "code": {"type": "string", "minLength": 1, "description": "Source code: UTF-8 without NUL characters, at most 100,000 bytes (see GET /api/limits/, code_kb)."}, "input": {"type": "string", "default": "", "description": "Standard input for the program: UTF-8 without NUL characters, at most 100,000 bytes. For SQL runs the script reads it with readfile('input') (SQLite) or read_text('input') (DuckDB)."}, "time_limit": {"type": "number", "exclusiveMinimum": 0, "maximum": 30, "description": "Seconds the program may run, above 0 and at most the sandbox timeout. The run stops at it with exit code 124. Compilation before the run does not count, but Java, Groovy and F# get a start-up allowance on top. Without it the run gets what is left of the sandbox timeout."}, "files": {"type": "array", "maxItems": 8, "items": {"$ref": "#/components/schemas/InputFile"}, "description": "Input files for the program, at most 1,000,000 bytes in total once decoded (see GET /api/limits/)."}}}, "AsyncRunRequest": {"allOf": [{"$ref": "#/components/schemas/RunRequest"}, {"type": "object", "properties": {"extra_params": {"type": "object", "additionalProperties": true, "description": "A JSON object of your own data, at most 8 KB, returned unchanged in the callback."}}}]}, "Queued": {"type": "object", "required": ["status", "id"], "properties": {"status": {"type": "string", "const": "queued"}, "id": {"type": "integer", "description": "The queue id of the run."}}}, "RunResult": {"type": "object", "required": ["output", "error", "status", "exit_code", "signal", "truncated", "time", "total", "memory", "files", "files_truncated", "time_limit"], "properties": {"output": {"type": "string", "description": "Standard output, cut at the output cap (see GET /api/limits/). NUL and invalid UTF-8 bytes come back as U+FFFD."}, "error": {"type": "string", "description": "Standard error, or compiler errors. Same cap and encoding as output."}, "status": {"type": "string", "enum": ["success", "error"], "description": "success when exit_code is 0, error otherwise."}, "exit_code": {"type": "integer", "description": "The process exit code. 0 is success; 124 means the time limit was exceeded; 137 (signal 9) the memory limit; 153 (signal 25) an output flood; 71 too many processes; -1 means the run failed on our side."}, "signal": {"type": ["integer", "null"], "description": "The signal number when the program was killed by one (exit_code minus 128), otherwise null."}, "truncated": {"type": "boolean", "description": "True when output or error went over the cap and was cut."}, "time": {"type": "string", "description": "Wall time of the run command in seconds, as a decimal string. Includes compilation for languages that compile as they run."}, "total": {"type": "string", "description": "Wall time of the whole script in seconds, including separate compilation, excluding container start-up. A decimal string."}, "memory": {"type": "string", "description": "Memory use in KB, as a decimal string. Informational: it counts library files the program maps."}, "files": {"type": "array", "items": {"$ref": "#/components/schemas/OutputFile"}, "description": "Files the program wrote to the directory named by the OUTPUT_DIR environment variable. An empty list when there are none."}, "files_truncated": {"type": "boolean", "description": "True when some output files were left out (too many, too large, or of a type that is not returned)."}, "time_limit": {"type": "number", "description": "The time limit the run had, in seconds: the time_limit you sent, or the sandbox maximum without one."}}}, "CallbackBody": {"type": "object", "required": ["output", "error", "status", "exit_code", "signal", "truncated", "time", "total", "memory", "files", "files_truncated", "time_limit", "extra_params"], "properties": {"output": {"type": "string", "description": "Standard output, cut at the output cap (see GET /api/limits/). NUL and invalid UTF-8 bytes come back as U+FFFD."}, "error": {"type": "string", "description": "Standard error, or compiler errors. Same cap and encoding as output."}, "status": {"type": "string", "enum": ["success", "error"], "description": "success when exit_code is 0, error otherwise."}, "exit_code": {"type": "integer", "description": "The process exit code. 0 is success; 124 means the time limit was exceeded; 137 (signal 9) the memory limit; 153 (signal 25) an output flood; 71 too many processes; -1 means the run failed on our side."}, "signal": {"type": ["integer", "null"], "description": "The signal number when the program was killed by one (exit_code minus 128), otherwise null."}, "truncated": {"type": "boolean", "description": "True when output or error went over the cap and was cut."}, "time": {"type": "string", "description": "Wall time of the run command in seconds, as a decimal string. Includes compilation for languages that compile as they run."}, "total": {"type": "string", "description": "Wall time of the whole script in seconds, including separate compilation, excluding container start-up. A decimal string."}, "memory": {"type": "string", "description": "Memory use in KB, as a decimal string. Informational: it counts library files the program maps."}, "files": {"type": "array", "items": {"$ref": "#/components/schemas/OutputFile"}, "description": "Files the program wrote to the directory named by the OUTPUT_DIR environment variable. An empty list when there are none."}, "files_truncated": {"type": "boolean", "description": "True when some output files were left out (too many, too large, or of a type that is not returned)."}, "time_limit": {"type": "number", "description": "The time limit the run had, in seconds: the time_limit you sent, or the sandbox maximum without one."}, "extra_params": {"type": "object", "additionalProperties": true, "description": "The extra_params of the request, unchanged ({} when none)."}}}, "Test": {"type": "object", "required": ["expected_output"], "properties": {"input": {"type": "string", "default": "", "description": "Standard input for this test, at most 100,000 bytes."}, "expected_output": {"type": "string", "description": "What the program should print: UTF-8 without NUL, at most 64 KB. Stderr is never compared."}, "hidden": {"type": "boolean", "default": false, "description": "A hidden test returns only its verdict."}, "weight": {"type": "number", "exclusiveMinimum": 0, "default": 1, "description": "Counts only for weighted scoring."}}}, "Verdict": {"type": "string", "enum": ["internal_error", "compilation_error", "time_limit_exceeded", "memory_limit_exceeded", "output_limit_exceeded", "runtime_error", "wrong_answer", "accepted", "skipped"], "description": "internal_error: we could not run the test. compilation_error: compiling failed. time_limit_exceeded: exit code 124 or past the limit plus any start-up allowance. memory_limit_exceeded: killed at the memory limit. output_limit_exceeded: signal 25, or stdout was cut. runtime_error: any other non-zero exit or signal. wrong_answer: exit 0 and the checker rejects the output. accepted: exit 0 and the checker accepts it. skipped: the test never started."}, "OverallVerdict": {"type": "string", "enum": ["internal_error", "compilation_error", "time_limit_exceeded", "memory_limit_exceeded", "output_limit_exceeded", "runtime_error", "wrong_answer", "accepted", "incomplete"], "description": "accepted when every test is; otherwise the verdict of the first test (in your order) that failed. incomplete when tests were skipped by the start cut-off and none failed; retry the request."}, "Checker": {"type": "string", "enum": ["trim", "exact", "tokens", "float", "rows"], "default": "trim", "description": "How output is compared. trim: strip trailing whitespace per line and trailing blank lines, then compare. exact: byte for byte. tokens: compare whitespace-separated tokens. float: as tokens, numbers within tolerance. rows: as an unordered set of lines, fields split at | , or tab, numbers within tolerance."}, "Scoring": {"type": "string", "enum": ["all_or_nothing", "percent", "weighted"], "default": "all_or_nothing", "description": "all_or_nothing: 100 when every test is accepted, else 0. percent: share of accepted tests. weighted: share of accepted weight."}, "RunTestsRequest": {"type": "object", "required": ["compiler", "code", "tests"], "properties": {"compiler": {"$ref": "#/components/schemas/CompilerId"}, "code": {"type": "string", "minLength": 1, "description": "Source code, at most 100,000 bytes. Compiled in every test, or once per request for some compiled languages when there are more tests than run at once."}, "tests": {"type": "array", "minItems": 1, "items": {"$ref": "#/components/schemas/Test"}, "description": "The tests, from 1 up to your plan's pending-submissions limit. Inputs and expected outputs together may hold at most 1 MB."}, "time_limit": {"type": "number", "exclusiveMinimum": 0, "maximum": 30, "default": 2, "description": "Seconds each test may run. Java, Groovy and F# get a start-up allowance on top."}, "files": {"type": "array", "maxItems": 8, "items": {"$ref": "#/components/schemas/InputFile"}, "description": "Input files shared by every test; each test's sandbox gets its own copy."}, "checker": {"$ref": "#/components/schemas/Checker"}, "tolerance": {"type": "number", "minimum": 0, "maximum": 1, "default": 1e-06, "description": "For the float and rows checkers: two numbers match when they differ by at most tolerance times the larger of 1 and the expected value."}, "scoring": {"$ref": "#/components/schemas/Scoring"}, "stop_on_failure": {"type": "boolean", "description": "Stop starting tests after the first one that is not accepted. Defaults to true with all_or_nothing scoring and false otherwise."}}}, "TestResult": {"type": "object", "required": ["verdict", "hidden"], "properties": {"verdict": {"$ref": "#/components/schemas/Verdict"}, "hidden": {"type": "boolean"}, "time": {"type": "string"}, "memory": {"type": "string"}, "exit_code": {"type": "integer"}, "signal": {"type": ["integer", "null"]}, "output": {"type": "string", "description": "The first 4096 characters of stdout."}, "error": {"type": "string", "description": "The first 4096 characters of stderr."}, "truncated": {"type": "boolean", "description": "True when output or error was cut."}, "files": {"type": "array", "items": {"$ref": "#/components/schemas/OutputFile"}}, "files_truncated": {"type": "boolean"}}, "description": "Hidden tests and tests that did not run carry only verdict and hidden. A visible test that ran also has time, memory, exit_code, signal, output, error, truncated, files and files_truncated."}, "RunTestsResponse": {"type": "object", "required": ["verdict", "score", "passed", "total", "time_limit", "compile_error", "tests"], "properties": {"verdict": {"$ref": "#/components/schemas/OverallVerdict"}, "score": {"type": "number", "minimum": 0, "maximum": 100, "description": "0 to 100, rounded to 2 decimals. Skipped tests count as not accepted."}, "passed": {"type": "integer", "description": "Tests accepted."}, "total": {"type": "integer", "description": "Tests sent."}, "time_limit": {"type": "number", "description": "The time limit used, in seconds, without any start-up allowance."}, "compile_error": {"type": ["string", "null"], "description": "The compiler output (first 4096 characters) when the code failed to compile and at least one test is visible; otherwise null."}, "tests": {"type": "array", "items": {"$ref": "#/components/schemas/TestResult"}, "description": "One entry per test, in the order sent."}}}, "CompilerList": {"type": "object", "required": ["compilers"], "properties": {"compilers": {"type": "array", "items": {"type": "object", "required": ["id", "name"], "properties": {"id": {"$ref": "#/components/schemas/CompilerId"}, "name": {"type": "string", "description": "The language's display name."}, "packages": {"type": "array", "items": {"type": "object", "required": ["name", "version"], "properties": {"name": {"type": "string"}, "version": {"type": "string"}}}, "description": "Preinstalled packages, present for compilers that ship some."}}}}}}, "Limits": {"type": "object", "properties": {"memory_mb": {"type": "integer"}, "cpus": {"type": "integer"}, "timeout_seconds": {"type": "integer"}, "processes": {"type": "integer"}, "code_kb": {"type": "integer"}, "input_kb": {"type": "integer"}, "output_kb": {"type": "integer", "description": "Cap per stream (stdout, stderr)."}, "submissions_per_minute": {"type": "integer"}, "pending_submissions": {"type": "integer"}, "running_submissions": {"type": "integer"}, "submissions_per_month": {"type": "integer"}, "input_files": {"type": "integer"}, "input_files_bytes": {"type": "integer"}, "output_files": {"type": "integer"}, "output_files_bytes": {"type": "integer"}, "run_tests_files_bytes": {"type": "integer"}, "file_retention_days": {"type": "integer"}, "file_quota_bytes": {"type": "integer"}}, "required": ["memory_mb", "cpus", "timeout_seconds", "processes", "code_kb", "input_kb", "output_kb", "submissions_per_minute", "pending_submissions", "running_submissions", "submissions_per_month", "input_files", "input_files_bytes", "output_files", "output_files_bytes", "run_tests_files_bytes", "file_retention_days", "file_quota_bytes"], "description": "Defaults for a Free account; sizes in bytes where the name says bytes."}, "Usage": {"type": "object", "required": ["month", "submissions", "monthly_limit", "remaining", "resets_at", "submissions_per_minute", "pending_submissions", "running_submissions"], "properties": {"month": {"type": "string", "pattern": "^[0-9]{4}-[0-9]{2}$", "description": "The calendar month (UTC) being counted."}, "submissions": {"type": "integer", "description": "Runs this month by the account. Each test of run-tests is one run."}, "monthly_limit": {"type": "integer"}, "remaining": {"type": "integer"}, "resets_at": {"type": "string", "format": "date-time"}, "submissions_per_minute": {"type": "integer"}, "pending_submissions": {"type": "integer"}, "running_submissions": {"type": "integer"}, "key": {"type": "object", "required": ["submissions", "monthly_limit", "remaining"], "properties": {"submissions": {"type": "integer", "description": "Runs this month through the calling key."}, "monthly_limit": {"type": ["integer", "null"], "description": "The key's own monthly cap, null when it has none."}, "remaining": {"type": ["integer", "null"], "description": "Null when the key has no cap."}}, "description": "The calling key's own count and limit."}}}, "Health": {"type": "object", "required": ["status", "checked_at", "checks", "run_seconds"], "properties": {"status": {"type": "string", "enum": ["ok", "down"]}, "checked_at": {"type": "string", "format": "date-time"}, "checks": {"type": "object", "required": ["database", "queue", "sandbox"], "properties": {"database": {"type": "string", "description": "ok or unreachable."}, "queue": {"type": "string", "description": "ok, unreachable, timeout (no run within 20 seconds) or checking."}, "sandbox": {"type": "string", "description": "ok, busy, failed or unknown."}}}, "run_seconds": {"type": ["number", "null"], "description": "How long the check's one-line program took, null when it did not run."}}}}, "responses": {"BadRequest": {"description": "The request is invalid and nothing ran or was counted: not a JSON object, a missing or bad field, an unsupported compiler, a bad file, an over-budget run-tests request, or (for /api/run-code/) a key with no usable callback URL.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"compiler": {"summary": "Unknown compiler", "value": {"error": "Unsupported or missing compiler"}}, "code": {"summary": "No code", "value": {"error": "Missing code field"}}, "json": {"summary": "Not JSON", "value": {"error": "Invalid JSON body"}}, "time_limit": {"summary": "Bad time limit", "value": {"error": "time_limit must be a number of seconds above 0 and at most 30"}}, "tests": {"summary": "run-tests without tests", "value": {"error": "tests must be a list of 1 to 8 tests on this plan"}}, "callback": {"summary": "No callback URL on the key (/api/run-code/)", "value": {"error": "This API key has no callback URL configured. Set one in your dashboard, or use /api/run-code-sync/ instead."}}}}}}, "Forbidden": {"description": "The Authorization header is missing, the key is not an API key (for example a widget key), or the request comes from an origin the key does not allow.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"missing": {"summary": "No header", "value": {"error": "Missing Authorization header"}}, "type": {"summary": "Wrong key type", "value": {"error": "This key is not authorized for the REST API"}}, "origin": {"summary": "Origin restriction", "value": {"error": "Request origin not allowed for this API key"}}}}}}, "InvalidKey": {"description": "No active API key matches the Authorization header (unknown, deleted or deactivated).", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "example": {"error": "Invalid or inactive API key"}}}}, "RateLimited": {"description": "A limit was reached or the sandboxes are busy. Nothing ran and nothing was counted. A spent monthly allowance or key cap will not clear until the month resets; the other causes clear shortly, so retry with backoff. Where a paid plan raises the limit, the message names it with a link.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"month": {"summary": "Monthly allowance spent", "value": {"error": "Monthly submission limit of 100,000 reached. It resets on 1 November 2026 (UTC)."}}, "key": {"summary": "The key's own cap spent", "value": {"error": "Monthly limit of 5,000 submissions for this API key reached. It resets on 1 November 2026 (UTC)."}}, "rate": {"summary": "Per-minute rate", "value": {"error": "Submission rate limit exceeded. Try again shortly."}}, "pending": {"summary": "Too many pending", "value": {"error": "Too many pending submissions for this account."}}, "account": {"summary": "The account's runs at once are busy", "value": {"error": "Too many runs in progress for this account (limit 2 at once). Please try again shortly."}}, "host": {"summary": "The host's sandboxes are busy", "value": {"error": "Too many concurrent requests. Please try again shortly."}}}}}}, "Unavailable": {"description": "The run could not be queued or its input files could not be stored. It is not counted; retry later.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"queue": {"summary": "Queue down", "value": {"error": "Execution queue unavailable"}}, "files": {"summary": "Files not stored", "value": {"error": "Could not store input files"}}}}}}}}}