{"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, stored problems, looking up, deleting and sharing submissions, receipts, 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."}}}},"submissionFinished":{"post":{"operationId":"submissionFinishedWebhook","tags":["Judge"],"summary":"Signed result of an async run-tests submission","description":"OnlineCompiler.io POSTs this JSON once for each async submission to \/api\/run-tests\/ that has a callback URL (its `callback_url`, else the API key's callback URL), when the submission finishes or fails. Answer with any 2xx status within 10 seconds to acknowledge it. Anything else (another status, a redirect, which is never followed, no answer in time, or no connection) is retried: 11 attempts in all over about 24 hours, the retries spaced 1, 5, 15 and 30 minutes, then 1, 2, 4, 8, 4 and 4 hours apart, on a schedule timed from the first attempt so that a late one does not push back the rest. Delivery is at least once, so deduplicate on `X-OC-Delivery`, which stays the same on every retry of an event.\n\n**Verifying it.** Every attempt is signed afresh. Compute the hex HMAC-SHA256 of the string `\"{X-OC-Timestamp}.{raw body}\"`, keyed with your API key's whole webhook signing secret (`whsec_...`, shown with the key in the dashboard), and compare it in constant time with each `v1=` value in `X-OC-Signature`. For 24 hours after you rotate the secret there are two values, comma separated, one for each secret. Use the raw body bytes as received, before parsing the JSON, and reject a timestamp more than a few minutes old to stop replays.","parameters":[{"name":"X-OC-Event","in":"header","required":true,"description":"The event type.","schema":{"type":"string","const":"submission.finished"}},{"name":"X-OC-Delivery","in":"header","required":true,"description":"The event's id, the same on every retry of it and in the body's delivery. Deduplicate on it.","schema":{"type":"string","pattern":"^dlv_[A-Za-z0-9]{24}$"}},{"name":"X-OC-Timestamp","in":"header","required":true,"description":"When this attempt was sent, in Unix seconds. Part of the signed string; reject old ones.","schema":{"type":"string","pattern":"^[0-9]+$"}},{"name":"X-OC-Signature","in":"header","required":true,"description":"v1= and the hex HMAC-SHA256 of \"{X-OC-Timestamp}.{raw body}\" keyed with the API key's webhook signing secret. Two values, comma separated, while a rotated secret is still valid.","schema":{"type":"string","pattern":"^v1=[0-9a-f]{64}(,v1=[0-9a-f]{64})?$"}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/WebhookEvent"},"examples":{"finished":{"summary":"Judged","value":{"event":"submission.finished","delivery":"dlv_4Tg9Wc2Hx7Lp1Qz8Rb5Nk3Vm","submission":"sub_8f2Kq7LmT3xR9vWb1cYd4hNe","status":"finished","external_ref":null,"metadata":{"round":2},"rejudge_of":null,"result":{"verdict":"accepted","score":100,"passed":2,"total":2,"time_limit":2,"memory_limit":512,"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}],"summary":"1 of 1 sample test passed. 1 of 1 hidden test passed."},"receipt":{"receipt":"rcpt_7Hq2Zp4Wn8Ks1Ab6Ct3Dv5Ex","format":1,"submission":"sub_8f2Kq7LmT3xR9vWb1cYd4hNe","account":"acct_3k9Fj2Lq8Rt5Wm1Z","external_ref":null,"issued":"2026-11-03T09:14:22Z","compiler":{"id":"python-3.14","version":"3.14","image":"sha256:4be1c0de5f9a8b7c6d5e4f3a2b1c0d9e8f7a6b5c4d3e2f1a0b9c8d7e6f5a4b3c"},"code_sha256":"1332bda51cd9fb74c67db60c0768b9cc52baeded3afd11b1e109c576dc21de19","tests_sha256":"6f3cf616587cfec9ae5940a42e6fc9926971cd0395fdbfb1dc2e23bf698b89ea","files_sha256":null,"settings":{"checker":"trim","tolerance":1.0e-6,"scoring":"weighted","time_limit":2,"stop_on_failure":false},"verdict":"accepted","score":100,"passed":2,"total":2,"tests":[{"verdict":"accepted","hidden":false,"time":"0.0213"},{"verdict":"accepted","hidden":true}],"key_id":"oc-2026-11","signature":"FmOjS6fPFQu5DN7iDINespAyV3NDIDbyW5WHAgd6GcqMZfeeQdaEGXNbbESCaaeokq2CoJGjjc1aM4BhpOuCBQ=="},"error":null}},"failed":{"summary":"Could not be judged on our side","value":{"event":"submission.finished","delivery":"dlv_9Xc3Fv6Bn1Mq8Wr2Ts5Ly7Hd","submission":"sub_2Rk8Vn4Qw1Xz7Lm3Pt6Hy9Bc","status":"failed","external_ref":"attempt-55120","metadata":null,"rejudge_of":null,"result":null,"receipt":null,"error":"Internal error: judging failed. Send the submission again."}}}}}},"responses":{"200":{"description":"Acknowledged. Any 2xx status within 10 seconds counts; anything else is retried."}}}}},"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."},{"name":"Problems","description":"Stored problems: tests, checker and limits kept on the server, judged against by id."}],"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,"memory_limit":512}}}},"400":{"$ref":"#\/components\/responses\/BadRequest"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/InvalidKey"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/guest\/run-code\/":{"post":{"operationId":"runCodeGuest","tags":["Run"],"summary":"Run code without an API key (guest)","description":"Runs a program like `\/api\/run-code-sync\/`, with no API key, so you can try the API before signing up. A guest run takes only compiler, code, input (up to 64 KB) and time_limit (up to 5 seconds); each caller gets a few runs an hour (per IPv4 address or IPv6 \/64), and all guests together share a small allowance, so expect 429 with a Retry-After header when it is busy. The answer is the usual run result plus `guest`, with the runs left this hour and where to get a free key (100,000 runs a month). Build on an API key, not on this.","security":[],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/GuestRunRequest"},"example":{"compiler":"python-3.14","code":"print(sum(range(10)))"}}}},"responses":{"200":{"description":"The run finished, successfully or not.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/GuestRunResult"},"example":{"output":"45\n","error":"","status":"success","exit_code":0,"signal":null,"truncated":false,"time":"0.0213","total":"0.0291","memory":"8192","files":[],"files_truncated":false,"time_limit":5,"memory_limit":512,"guest":{"runs_left_this_hour":19,"runs_per_hour":20,"get_a_key":"https:\/\/api.onlinecompiler.io\/compilers\/api-keys\/?utm_source=guest-api"}}}}},"400":{"$ref":"#\/components\/responses\/BadRequest"},"429":{"$ref":"#\/components\/responses\/RateLimited"},"503":{"description":"Guest runs are switched off; use an API key.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}}}},"\/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. Waits for the result; with `async: true` or a `callback_url` it answers 202 at once instead and judges the submission in the background, in your account's queue (see the 202 response). 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`. Every request is stored as a submission: the response adds a plain-words `summary`, the `submission` id and a signed `receipt`. With an `Idempotency-Key` header, repeating a request answers with the original result instead of running again. With `suite`, a test pack's command runs over `files` in one sandbox instead: one run against your limits, synchronous only, answered with a named result per test (RunTestsSuiteResponse), and `suite.services` can start PostgreSQL beside the tests (Pro and above, and exam tiers); when no sandbox comes free in time it answers 429, nothing counted, so retry. A suite request ends within 60 seconds: it starts by 45 seconds after it arrived, or earlier when its time_limit and 3 seconds of overhead would end it past 60 seconds.","security":[{"ApiKey":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Makes retries safe. A request that repeats a key this account sent in the last 24 hours, with the same body, runs nothing and is not counted: it answers with the original result and the header Idempotent-Replayed: true, or with 202 and the submission's id and current status when the original is async or still running. Bodies are compared as JSON, so key order and whitespace do not matter. The same key with a different body answers 409. Output file contents are not kept, so in a replayed result each test that returned files has `files: []` and `files_truncated: true`. A request refused with 400 or 429, one that failed, or one whose result had tests skipped by the start cut-off, does not use up its key.","schema":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[ -~]+$"}}],"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. A result whose tests the start cut-off skipped does not keep its Idempotency-Key, so a retry with the same key runs again.","headers":{"Idempotent-Replayed":{"description":"true when this is the stored result of an earlier request with the same Idempotency-Key.","schema":{"type":"string","const":"true"}}},"content":{"application\/json":{"schema":{"oneOf":[{"$ref":"#\/components\/schemas\/RunTestsResponse"},{"$ref":"#\/components\/schemas\/RunTestsSuiteResponse"}]},"example":{"verdict":"accepted","score":100,"passed":2,"total":2,"time_limit":2,"memory_limit":512,"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}],"summary":"1 of 1 sample test passed. 1 of 1 hidden test passed.","submission":"sub_8f2Kq7LmT3xR9vWb1cYd4hNe","receipt":{"receipt":"rcpt_7Hq2Zp4Wn8Ks1Ab6Ct3Dv5Ex","format":1,"submission":"sub_8f2Kq7LmT3xR9vWb1cYd4hNe","account":"acct_3k9Fj2Lq8Rt5Wm1Z","external_ref":null,"issued":"2026-11-03T09:14:22Z","compiler":{"id":"python-3.14","version":"3.14","image":"sha256:4be1c0de5f9a8b7c6d5e4f3a2b1c0d9e8f7a6b5c4d3e2f1a0b9c8d7e6f5a4b3c"},"code_sha256":"1332bda51cd9fb74c67db60c0768b9cc52baeded3afd11b1e109c576dc21de19","tests_sha256":"6f3cf616587cfec9ae5940a42e6fc9926971cd0395fdbfb1dc2e23bf698b89ea","files_sha256":null,"settings":{"checker":"trim","tolerance":1.0e-6,"scoring":"weighted","time_limit":2,"stop_on_failure":false},"verdict":"accepted","score":100,"passed":2,"total":2,"tests":[{"verdict":"accepted","hidden":false,"time":"0.0213"},{"verdict":"accepted","hidden":true}],"key_id":"oc-2026-11","signature":"FmOjS6fPFQu5DN7iDINespAyV3NDIDbyW5WHAgd6GcqMZfeeQdaEGXNbbESCaaeokq2CoJGjjc1aM4BhpOuCBQ=="}}}}},"202":{"description":"With `async: true` or a `callback_url`: the submission is queued, and nothing has run or been counted yet. It starts after the submissions your account queued before it, once your per-minute and pending limits have room for all of its tests, and its tests are counted when it starts. An idempotent replay (the same Idempotency-Key with the same body) answers 202 in this shape too, with the header Idempotent-Replayed: true and the original submission's current status, when that submission is async or still running.","headers":{"Idempotent-Replayed":{"description":"true when this answers for an earlier request with the same Idempotency-Key.","schema":{"type":"string","const":"true"}}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SubmissionQueued"},"example":{"submission":"sub_8f2Kq7LmT3xR9vWb1cYd4hNe","status":"queued"}}}},"400":{"$ref":"#\/components\/responses\/BadRequest"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/InvalidKey"},"409":{"description":"The Idempotency-Key was sent in the last 24 hours with a different request body. Nothing ran and nothing was counted; use a new key for a new request.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"example":{"error":"Idempotency-Key was already used with a different request body"}}}},"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, Ruby and the test packs, the preinstalled packages. A test pack has `pack`: the presets run-tests' suite can run on it, and the services it may start (`suite.services`). `retired` maps each retired id to the id it now runs as. 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"},{"id":"nodejs-24-tests","name":"Node.js 24 (tests)","packages":[{"name":"jest","version":"30.5.2"}],"pack":{"version":"1.1","presets":["jest","mocha","node-test"],"default":"jest","services":["postgresql"]}}],"retired":{"dotnet-csharp-9":"dotnet-csharp-10"}}}}}}}},"\/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,"max_memory_mb":512,"max_processes":16,"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"}}}}}}}}},"\/api\/submissions\/":{"get":{"operationId":"listSubmissions","tags":["Judge"],"summary":"List submissions","description":"The calling account's submissions (and, through RapidAPI, only the calling consumer's), newest first, a page at a time, filtered by the query parameters, which all combine. Draft tests, reference checks and Submits under a test session made in the dashboard (your own tries) are not listed; each is still found by its id. Each entry is a summary; GET \/api\/submissions\/{submission_id}\/ returns one with its per-test results and receipt. A parameter this list does not take, one given twice, or an empty one answers 400. Both the slash and slashless forms of the path work.","security":[{"ApiKey":[]}],"parameters":[{"name":"ids","in":"query","required":false,"schema":{"type":"string"},"description":"Up to 100 submission ids, separated by commas. Without limit, the page holds every one of them. Ids that are not yours are simply absent from the answer."},{"name":"external_ref","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":200},"description":"Only submissions sent with this external_ref (exact match); for a widget session, the session's external_ref."},{"name":"problem","in":"query","required":false,"schema":{"type":"string"},"description":"Only submissions to this stored problem, by id or slug, any version. One that is not yours answers 404."},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["queued","running","finished","failed"]},"description":"Only submissions with this status."},{"name":"verdict","in":"query","required":false,"schema":{"$ref":"#\/components\/schemas\/OverallVerdict"},"description":"Only finished submissions with this overall verdict."},{"name":"since","in":"query","required":false,"schema":{"type":"string"},"description":"Only submissions created at or after this ISO 8601 date-time (UTC when it has no offset) or date (its midnight UTC), like 2026-11-03T09:00:00Z or 2026-11-03."},{"name":"until","in":"query","required":false,"schema":{"type":"string"},"description":"Only submissions created before this date-time or date, in the same form as since."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"description":"Submissions per page: 20 if left out, or with ids, as many as ids names."},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"},"description":"The next_cursor of the previous page, as it was."}],"responses":{"200":{"description":"A page of submissions.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SubmissionList"},"example":{"submissions":[{"submission":"sub_9fK2mQ7xL4pR8tV1wZ3yB6nC","status":"finished","created":"2026-11-03T09:14:22Z","finished":"2026-11-03T09:14:25Z","external_ref":"candidate-8841","metadata":{"round":2},"problem":{"id":"prob_7Hq2Zp4Wn8Ks1Ab6Ct3Dv5Ex","version":1},"mode":"all","rejudge_of":null,"verdict":"wrong_answer","score":50,"passed":1,"total":2,"error":null}],"next_cursor":"MjAyNi0xMS0wM1QwOToxNDoyMi41MTIwMDArMDA6MDB8c3ViXzlmSzJtUTd4TDRwUjh0VjF3WjN5QjZuQw"}}}},"400":{"description":"A query parameter is not valid; the message names it.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"example":{"error":"limit must be a whole number from 1 to 100"}}}},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"description":"Unknown key, or the problem parameter names no problem of yours.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"key":{"summary":"Unknown key","value":{"error":"Invalid or inactive API key"}},"problem":{"summary":"No such problem","value":{"error":"Problem not found"}}}}}}}}},"\/api\/submissions\/{submission_id}\/":{"get":{"operationId":"getSubmission","tags":["Judge"],"summary":"Look up a submission","description":"Returns a submission of the calling account (and, through RapidAPI, of the calling consumer): its status, and once it has finished its result and signed receipt. This is how to fetch the outcome of an async submission that was sent without a `callback_url`, or to read a webhook's event again. Hidden tests carry only `verdict` and `hidden`, as in the run-tests response. Output files are not kept, so a test that returned files lists none and has `files_truncated` true. Both the slash and slashless forms of the path work.","security":[{"ApiKey":[]}],"parameters":[{"name":"submission_id","in":"path","required":true,"schema":{"type":"string","pattern":"^sub_[A-Za-z0-9]{24}$"},"description":"The `submission` id a run-tests request answered with."}],"responses":{"200":{"description":"The submission.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Submission"}}}},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"description":"Unknown key, or the submission is not found. The same answer covers an id that is malformed, belongs to another account, or belongs to another RapidAPI consumer, so ids cannot be probed.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"key":{"summary":"Unknown key","value":{"error":"Invalid or inactive API key"}},"submission":{"summary":"No such submission","value":{"error":"Submission not found"}}}}}}}},"delete":{"operationId":"deleteSubmission","tags":["Judge"],"summary":"Delete a submission","description":"Deletes a submission that is queued, finished or failed, together with the code, input and output kept for its tests; its receipt stops being public. Runs already counted stay counted. A queued submission is deleted before it runs. A running submission answers 409: delete it once it has finished. Deleting frees the submission's `Idempotency-Key`, so the same request sent again with that key runs again.","security":[{"ApiKey":[]}],"parameters":[{"name":"submission_id","in":"path","required":true,"schema":{"type":"string","pattern":"^sub_[A-Za-z0-9]{24}$"},"description":"The `submission` id a run-tests request answered with."}],"responses":{"200":{"description":"Deleted.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SubmissionDeleted"}}}},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"description":"Unknown key, or the submission is not found. The same answer covers an id that is malformed, belongs to another account, or belongs to another RapidAPI consumer, so ids cannot be probed.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"key":{"summary":"Unknown key","value":{"error":"Invalid or inactive API key"}},"submission":{"summary":"No such submission","value":{"error":"Submission not found"}}}}}},"409":{"description":"The submission is running.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"example":{"error":"This submission is still running. Delete it once it has finished."}}}}}}},"\/api\/submissions\/{submission_id}\/share\/":{"post":{"operationId":"shareSubmission","tags":["Judge"],"summary":"Make a submission's receipt public","description":"Makes the submission's signed receipt readable by anyone at `GET \/api\/receipts\/{receipt_id}\/` and on the page at the returned `url`, until the submission is older than the plan's retention period (Free 90 days, Starter 365, Pro 730) or is deleted. Sharing publishes the receipt: the hashes and verdicts, the request's `external_ref` and an account reference, never the code, the tests, the outputs or the metadata. Anyone who has the link can read it, so use an opaque `external_ref` (an id of yours, not a name or an email address). Repeatable: sharing again returns the same answer. A submission without a receipt (still queued or running, failed, or finished while no signing key was available) answers 409.","security":[{"ApiKey":[]}],"parameters":[{"name":"submission_id","in":"path","required":true,"schema":{"type":"string","pattern":"^sub_[A-Za-z0-9]{24}$"},"description":"The `submission` id a run-tests request answered with."}],"responses":{"200":{"description":"The receipt is public.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SharedReceipt"}}}},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"description":"Unknown key, or the submission is not found. The same answer covers an id that is malformed, belongs to another account, or belongs to another RapidAPI consumer, so ids cannot be probed.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"key":{"summary":"Unknown key","value":{"error":"Invalid or inactive API key"}},"submission":{"summary":"No such submission","value":{"error":"Submission not found"}}}}}},"409":{"description":"The submission has no receipt yet.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"example":{"error":"This submission has no receipt yet."}}}}}}},"\/api\/receipts\/{receipt_id}\/":{"get":{"operationId":"getPublicReceipt","tags":["Reference"],"summary":"Read a shared receipt","description":"Returns the signed receipt of a submission whose owner shared it. No API key is needed, and the response carries nothing but the receipt. A shared receipt shows the request's `external_ref` and an account reference, so use an opaque `external_ref`; it never shows the code, the tests, the outputs or the metadata. Browsers may fetch it from any origin, and it may be cached for 5 minutes. A receipt that was never shared, was deleted, or is older than its owner's plan keeps submissions answers 404. To check the signature, use the keys at `\/.well-known\/receipt-keys.json`.","security":[],"parameters":[{"name":"receipt_id","in":"path","required":true,"schema":{"type":"string","pattern":"^rcpt_[A-Za-z0-9]{24}$"},"description":"The receipt's id, the `receipt` field of a receipt."}],"responses":{"200":{"description":"The receipt.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/PublicReceipt"}}}},"404":{"description":"Not shared, deleted, expired or unknown.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"example":{"error":"This receipt has expired or doesn't exist."}}}}}}},"\/.well-known\/receipt-keys.json":{"get":{"operationId":"getReceiptKeys","tags":["Reference"],"summary":"The public keys that sign receipts","description":"Lists the Ed25519 public keys receipts are signed with, each with the `key_id` a receipt names. Browsers may fetch it from any origin, and it may be cached for an hour.","security":[],"responses":{"200":{"description":"The keys.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ReceiptKeys"}}}}}}},"\/api\/problems\/":{"get":{"operationId":"listProblems","tags":["Problems"],"summary":"List your stored problems","description":"The account's problems, newest first, without their tests. Stored problems are not available through RapidAPI: a request through it answers 403.","security":[{"ApiKey":[]}],"responses":{"200":{"description":"The problems.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ProblemList"},"example":{"problems":[{"problem":"prob_7Hq2Zp4Wn8Ks1Ab6Ct3Dv5Ex","slug":"sum","title":"Sum of two numbers","status":"active","public":true,"version":1,"created":"2026-11-05T09:14:22Z","updated":"2026-11-05T09:20:05Z","check":{"version":1,"state":"published"}}]}}}},"403":{"description":"The Authorization header is missing, the key is not an API key, the origin is not allowed, or the request came through RapidAPI.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"missing":{"summary":"No header","value":{"error":"Missing Authorization header"}},"rapidapi":{"summary":"Through RapidAPI","value":{"error":"Stored problems are not available through RapidAPI."}}}}}},"404":{"description":"Unknown key, or the problem is not found. The same answer covers another account's problem and a ref of any other shape.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"key":{"summary":"Unknown key","value":{"error":"Invalid or inactive API key"}},"problem":{"summary":"No such problem","value":{"error":"Problem not found"}}}}}}}},"post":{"operationId":"createProblem","tags":["Problems"],"summary":"Create a stored problem","description":"Creates an active problem with a draft made of the fields you send. The draft is not judged against until you publish it (POST \/api\/problems\/{problem}\/publish). A problem counts toward your plan's problem limit while it is active (Free 25, Starter 250, Pro 2,500), and its test data and data files toward the plan's data limit (Free 100 MB, Starter 1,024 MB, Pro 5,120 MB). Test data is kept once per account and content, so an unchanged input shared by two versions is stored and counted once. A body over 4 MB answers 400 with a message that points to PUT \/api\/problems\/{problem}\/draft\/tests\/{position}\/. Stored problems are not available through RapidAPI: a request through it answers 403.","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/DraftRequest"},{"required":["title"]}]},"example":{"title":"Sum of two numbers","slug":"sum","public":true,"statement":"Read two integers and print their sum.","languages":["python-3.14"],"checker":"trim","scoring":"percent","time_limit":2,"tests":[{"name":"sample","input":"1 2\n","expected_output":"3\n","hidden":false},{"input":"5 7\n","expected_output":"12\n"}],"reference_solution":{"compiler":"python-3.14","code":"a, b = map(int, input().split())\nprint(a + b)"}}}}},"responses":{"201":{"description":"Created. The body is the problem as GET shows it, with each test's size and SHA-256 in place of its data.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ProblemChanged"}}}},"400":{"description":"The body is not valid: a bad field, no tests, more tests than the plan's pending limit, a driver without ##CODE##, a custom checker without a reference solution, or a body over 4 MB.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"example":{"error":"tests must be a list of 1 to 8 tests on this plan"}}}},"403":{"description":"The Authorization header is missing, the key is not an API key, the origin is not allowed, or the request came through RapidAPI. Also: the plan's problem limit or its test data and files limit is reached.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"missing":{"summary":"No header","value":{"error":"Missing Authorization header"}},"rapidapi":{"summary":"Through RapidAPI","value":{"error":"Stored problems are not available through RapidAPI."}}}}}},"404":{"description":"Unknown key, or the problem is not found. The same answer covers another account's problem and a ref of any other shape.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"key":{"summary":"Unknown key","value":{"error":"Invalid or inactive API key"}},"problem":{"summary":"No such problem","value":{"error":"Problem not found"}}}}}},"409":{"description":"Another of your problems has this slug.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"example":{"error":"Another of your problems has this slug."}}}}}}},"\/api\/problems\/{problem}\/":{"get":{"operationId":"getProblem","tags":["Problems"],"summary":"Read a problem","description":"Everything about the problem for its owner: the draft and the current version with every test's data (hidden tests included), and each version's reference check. Slashless paths work too. Stored problems are not available through RapidAPI: a request through it answers 403.","security":[{"ApiKey":[]}],"parameters":[{"name":"problem","in":"path","required":true,"schema":{"type":"string"},"description":"The problem's id (prob_ and 24 characters) or its slug. Another account's problem, and a ref of any other shape, answers 404."}],"responses":{"200":{"description":"The problem.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Problem"}}}},"403":{"description":"The Authorization header is missing, the key is not an API key, the origin is not allowed, or the request came through RapidAPI.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"missing":{"summary":"No header","value":{"error":"Missing Authorization header"}},"rapidapi":{"summary":"Through RapidAPI","value":{"error":"Stored problems are not available through RapidAPI."}}}}}},"404":{"description":"Unknown key, or the problem is not found. The same answer covers another account's problem and a ref of any other shape.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"key":{"summary":"Unknown key","value":{"error":"Invalid or inactive API key"}},"problem":{"summary":"No such problem","value":{"error":"Problem not found"}}}}}}}},"patch":{"operationId":"updateProblem","tags":["Problems"],"summary":"Change a problem's title, slug or public flag","description":"Send any of title, slug and public. An empty slug removes it. A slug another of your problems has answers 409. Changing these does not make a new version.","security":[{"ApiKey":[]}],"parameters":[{"name":"problem","in":"path","required":true,"schema":{"type":"string"},"description":"The problem's id (prob_ and 24 characters) or its slug. Another account's problem, and a ref of any other shape, answers 404."}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"slug":{"type":"string","pattern":"^([a-z0-9][a-z0-9-]{0,63})?$"},"public":{"type":"boolean"}}},"example":{"public":true}}}},"responses":{"200":{"description":"The problem, changed, with each test's size and SHA-256 in place of its data.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ProblemChanged"}}}},"400":{"description":"A field is not valid.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"example":{"error":"public must be true or false"}}}},"403":{"description":"The Authorization header is missing, the key is not an API key, the origin is not allowed, or the request came through RapidAPI.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"missing":{"summary":"No header","value":{"error":"Missing Authorization header"}},"rapidapi":{"summary":"Through RapidAPI","value":{"error":"Stored problems are not available through RapidAPI."}}}}}},"404":{"description":"Unknown key, or the problem is not found. The same answer covers another account's problem and a ref of any other shape.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"key":{"summary":"Unknown key","value":{"error":"Invalid or inactive API key"}},"problem":{"summary":"No such problem","value":{"error":"Problem not found"}}}}}},"409":{"description":"Another of your problems has this slug.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"example":{"error":"Another of your problems has this slug."}}}}}}},"\/api\/problems\/{problem}\/draft\/":{"put":{"operationId":"replaceDraft","tags":["Problems"],"summary":"Replace the draft","description":"Replaces the problem's draft with the body, which has the same fields as creating a problem. A body without `files` keeps the draft's files (else those of the version the draft starts from); `files: []` removes them. Test data no test uses any more, such as the old draft's, does not count against your plan's data limit, and is removed after a while. Refused with 400 while a version is being checked. A body over 4 MB answers 400 with a message that points to PUT \/api\/problems\/{problem}\/draft\/tests\/{position}\/.","security":[{"ApiKey":[]}],"parameters":[{"name":"problem","in":"path","required":true,"schema":{"type":"string"},"description":"The problem's id (prob_ and 24 characters) or its slug. Another account's problem, and a ref of any other shape, answers 404."}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/DraftRequest"},"example":{"title":"Sum of two numbers","slug":"sum","public":true,"statement":"Read two integers and print their sum.","languages":["python-3.14"],"checker":"trim","scoring":"percent","time_limit":2,"tests":[{"name":"sample","input":"1 2\n","expected_output":"3\n","hidden":false},{"input":"5 7\n","expected_output":"12\n"}],"reference_solution":{"compiler":"python-3.14","code":"a, b = map(int, input().split())\nprint(a + b)"}}}}},"responses":{"200":{"description":"The problem with its new draft, with each test's size and SHA-256 in place of its data.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ProblemChanged"}}}},"400":{"description":"The body is not valid, or a version is still being checked.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"example":{"error":"Version 2 is still being checked. Wait for it to finish before changing the draft."}}}},"403":{"description":"The Authorization header is missing, the key is not an API key, the origin is not allowed, or the request came through RapidAPI. Also: the plan's test data and files limit is reached.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"missing":{"summary":"No header","value":{"error":"Missing Authorization header"}},"rapidapi":{"summary":"Through RapidAPI","value":{"error":"Stored problems are not available through RapidAPI."}}}}}},"404":{"description":"Unknown key, or the problem is not found. The same answer covers another account's problem and a ref of any other shape.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"key":{"summary":"Unknown key","value":{"error":"Invalid or inactive API key"}},"problem":{"summary":"No such problem","value":{"error":"Problem not found"}}}}}}}}},"\/api\/problems\/{problem}\/draft\/tests\/{position}\/":{"put":{"operationId":"putDraftTestInput","tags":["Problems"],"summary":"Replace one draft test's input","description":"For an input too big for a request body. The body is the raw input, sent as text (Content-Type text\/plain): UTF-8 without NUL, at most 5 MB. Send it with a Content-Length header (a chunked upload is refused with 411). It replaces the input of test number `position` of the draft, which must already exist. The input it replaces stops counting against your plan's data limit when no other test uses it.","security":[{"ApiKey":[]}],"parameters":[{"name":"problem","in":"path","required":true,"schema":{"type":"string"},"description":"The problem's id (prob_ and 24 characters) or its slug. Another account's problem, and a ref of any other shape, answers 404."},{"name":"position","in":"path","required":true,"schema":{"type":"integer","minimum":1},"description":"The draft test's number, counting from 1."}],"requestBody":{"required":true,"content":{"text\/plain":{"schema":{"type":"string"}}}},"responses":{"200":{"description":"The problem with the changed draft, with each test's size and SHA-256 in place of its data.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ProblemChanged"}}}},"400":{"description":"No such test, or the problem has no draft (after a publish, or while a version is being checked); the input is over 5 MB, not UTF-8 or has a NUL; or the draft would pass 20 MB.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"test":{"summary":"No such test","value":{"error":"The draft has no test 3."}},"draft":{"summary":"No draft","value":{"error":"This problem has no draft. Create one with PUT \/api\/problems\/prob_7Hq2Zp4Wn8Ks1Ab6Ct3Dv5Ex\/draft first."}}}}}},"403":{"description":"The Authorization header is missing, the key is not an API key, the origin is not allowed, or the request came through RapidAPI. Also: the plan's test data and files limit is reached.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"missing":{"summary":"No header","value":{"error":"Missing Authorization header"}},"rapidapi":{"summary":"Through RapidAPI","value":{"error":"Stored problems are not available through RapidAPI."}}}}}},"404":{"description":"Unknown key, or the problem is not found. The same answer covers another account's problem and a ref of any other shape.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"key":{"summary":"Unknown key","value":{"error":"Invalid or inactive API key"}},"problem":{"summary":"No such problem","value":{"error":"Problem not found"}}}}}},"411":{"description":"No Content-Length header, as with a chunked upload. Nothing is changed.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"example":{"error":"Send the input with a Content-Length header."}}}}}}},"\/api\/problems\/{problem}\/draft\/files\/{name}\/":{"put":{"operationId":"putDraftFile","tags":["Problems"],"summary":"Add or replace one draft data file","description":"For a data file the tests read (a CSV, a database, a binary). The body is the raw file, sent as it is (any Content-Type): at most 5 MB. Send it with a Content-Length header (a chunked upload is refused with 411). It adds the file `name` to the draft, or replaces the one of that name, which must be in a draft already. A draft holds at most 8 files, 10 MB of files, and with its tests 20 MB; files count against your plan's data limit. Bytes you already store are reused without being counted twice.","security":[{"ApiKey":[]}],"parameters":[{"name":"problem","in":"path","required":true,"schema":{"type":"string"},"description":"The problem's id (prob_ and 24 characters) or its slug. Another account's problem, and a ref of any other shape, answers 404."},{"name":"name","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$","maxLength":100},"description":"The file's name: a plain file name (letters, digits, dots, hyphens and underscores), not input, run.sh, build, build.tar or go-trim.txt, and its part before the first dot not code."}],"requestBody":{"required":true,"content":{"application\/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"responses":{"200":{"description":"The problem with the changed draft, with each test's and file's size and SHA-256 in place of its data.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ProblemChanged"}}}},"400":{"description":"The name is not valid, or the problem has no draft (after a publish, or while a version is being checked); the file is over 5 MB; or the draft would pass 8 files, 10 MB of files or 20 MB with its tests.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"name":{"summary":"Reserved name","value":{"error":"name must be a plain file name of at most 100 letters, digits, dots, hyphens or underscores, and not input, run.sh, build, build.tar, go-trim.txt or code"}},"draft":{"summary":"No draft","value":{"error":"This problem has no draft. Create one with PUT \/api\/problems\/prob_7Hq2Zp4Wn8Ks1Ab6Ct3Dv5Ex\/draft first."}},"count":{"summary":"Too many files","value":{"error":"A draft may hold at most 8 files."}}}}}},"403":{"description":"The Authorization header is missing, the key is not an API key, the origin is not allowed, or the request came through RapidAPI. Also: the plan's test data and files limit is reached.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"missing":{"summary":"No header","value":{"error":"Missing Authorization header"}},"rapidapi":{"summary":"Through RapidAPI","value":{"error":"Stored problems are not available through RapidAPI."}}}}}},"404":{"description":"Unknown key, or the problem is not found. The same answer covers another account's problem and a ref of any other shape.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"key":{"summary":"Unknown key","value":{"error":"Invalid or inactive API key"}},"problem":{"summary":"No such problem","value":{"error":"Problem not found"}}}}}},"411":{"description":"No Content-Length header, as with a chunked upload. Nothing is changed.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"example":{"error":"Send the input with a Content-Length header."}}}}}},"delete":{"operationId":"deleteDraftFile","tags":["Problems"],"summary":"Remove one draft data file","description":"Removes the file `name` from the draft. Its bytes stop counting against your plan's data limit when no other test or file uses them.","security":[{"ApiKey":[]}],"parameters":[{"name":"problem","in":"path","required":true,"schema":{"type":"string"},"description":"The problem's id (prob_ and 24 characters) or its slug. Another account's problem, and a ref of any other shape, answers 404."},{"name":"name","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$","maxLength":100},"description":"The file's name: a plain file name (letters, digits, dots, hyphens and underscores), not input, run.sh, build, build.tar or go-trim.txt, and its part before the first dot not code."}],"responses":{"200":{"description":"The problem with the changed draft, with each test's and file's size and SHA-256 in place of its data.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ProblemChanged"}}}},"400":{"description":"The problem has no draft (after a publish, or while a version is being checked), or the name is not a valid file name.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"draft":{"summary":"No draft","value":{"error":"This problem has no draft. Create one with PUT \/api\/problems\/prob_7Hq2Zp4Wn8Ks1Ab6Ct3Dv5Ex\/draft first."}}}}}},"403":{"description":"The Authorization header is missing, the key is not an API key, the origin is not allowed, or the request came through RapidAPI.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"missing":{"summary":"No header","value":{"error":"Missing Authorization header"}},"rapidapi":{"summary":"Through RapidAPI","value":{"error":"Stored problems are not available through RapidAPI."}}}}}},"404":{"description":"Unknown key, the problem is not found (another account's problem and a ref of any other shape answer the same), or the draft has no file of that name.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"key":{"summary":"Unknown key","value":{"error":"Invalid or inactive API key"}},"problem":{"summary":"No such problem","value":{"error":"Problem not found"}},"file":{"summary":"No such file","value":{"error":"The draft has no file scores.db."}}}}}}}}},"\/api\/problems\/{problem}\/publish\/":{"post":{"operationId":"publishProblem","tags":["Problems"],"summary":"Publish the draft as the next version","description":"Numbers the draft and makes it a version. Without a reference solution it is published at once and becomes the current version (200, with a warning that the expected outputs were not checked). With one, the version is checking: its reference solution is queued as an async submission, run and counted like any other (one run for each test), and 202 gives the check's submission id. If it passes every test the version is published and becomes current; otherwise it is rejected and keeps its number, and GET \/api\/problems\/{problem} shows each test's verdict. The request body is not read. If the check rejects the version, its content becomes the draft again (unless the problem already has one), so you can fix it with PUT and publish again: the rejected version keeps its number and its test data, which counts toward your plan's data limit, since problems and versions are never deleted, only archived. When the check could not finish because of an error on our side, the version is rejected with a message that says so, and publishing again is all it takes. A draft whose tests could not finish within one submission's time in any of its languages on your plan is refused with 400. The check's own submission (GET \/api\/submissions\/{id}\/, by `check.submission`) has the per-test verdicts and any `checker_log`. An archived problem is not published (409): restore it first.","security":[{"ApiKey":[]}],"parameters":[{"name":"problem","in":"path","required":true,"schema":{"type":"string"},"description":"The problem's id (prob_ and 24 characters) or its slug. Another account's problem, and a ref of any other shape, answers 404."}],"responses":{"200":{"description":"Published at once.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/PublishResult"},"example":{"problem":"prob_7Hq2Zp4Wn8Ks1Ab6Ct3Dv5Ex","version":1,"state":"published","warnings":["No reference solution: the expected outputs were not checked."]}}}},"202":{"description":"The reference check is queued.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/PublishResult"},"example":{"problem":"prob_7Hq2Zp4Wn8Ks1Ab6Ct3Dv5Ex","version":2,"state":"checking","check":"sub_3k9Fj2Lq8Rt5Wm1Zn4Bc6DxY"}}}},"400":{"description":"The draft has more tests than your plan allows today, or its tests could take longer than one submission may run in every language it allows.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"tests":{"summary":"Too many tests for the plan","value":{"error":"The draft has 12 tests, more than the 8 this plan allows."}},"slow":{"summary":"Too slow in every allowed language","value":{"error":"This version's tests could take longer than the 60 seconds one submission may run in any allowed language on this plan. Lower its time limits or use fewer tests."}}}}}},"403":{"description":"The Authorization header is missing, the key is not an API key, the origin is not allowed, or the request came through RapidAPI.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"missing":{"summary":"No header","value":{"error":"Missing Authorization header"}},"rapidapi":{"summary":"Through RapidAPI","value":{"error":"Stored problems are not available through RapidAPI."}}}}}},"404":{"description":"Unknown key, or the problem is not found. The same answer covers another account's problem and a ref of any other shape.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"key":{"summary":"Unknown key","value":{"error":"Invalid or inactive API key"}},"problem":{"summary":"No such problem","value":{"error":"Problem not found"}}}}}},"409":{"description":"The problem is archived, a version is still being checked, or there is no draft.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"checking":{"value":{"error":"Version 2 is still being checked."}},"none":{"value":{"error":"There is no draft to publish."}},"archived":{"value":{"error":"This problem is archived. Restore it before publishing."}}}}}},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/problems\/{problem}\/archive\/":{"post":{"operationId":"archiveProblem","tags":["Problems"],"summary":"Archive a problem","description":"Stops new submissions (they answer 409) and frees one of your plan's problem slots. Versions, results and test data stay, and the data still counts toward your plan. Archiving twice is fine.","security":[{"ApiKey":[]}],"parameters":[{"name":"problem","in":"path","required":true,"schema":{"type":"string"},"description":"The problem's id (prob_ and 24 characters) or its slug. Another account's problem, and a ref of any other shape, answers 404."}],"responses":{"200":{"description":"The problem, archived, with each test's size and SHA-256 in place of its data.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ProblemChanged"}}}},"403":{"description":"The Authorization header is missing, the key is not an API key, the origin is not allowed, or the request came through RapidAPI.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"missing":{"summary":"No header","value":{"error":"Missing Authorization header"}},"rapidapi":{"summary":"Through RapidAPI","value":{"error":"Stored problems are not available through RapidAPI."}}}}}},"404":{"description":"Unknown key, or the problem is not found. The same answer covers another account's problem and a ref of any other shape.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"key":{"summary":"Unknown key","value":{"error":"Invalid or inactive API key"}},"problem":{"summary":"No such problem","value":{"error":"Problem not found"}}}}}}}}},"\/api\/problems\/{problem}\/restore\/":{"post":{"operationId":"restoreProblem","tags":["Problems"],"summary":"Restore an archived problem","description":"Makes an archived problem active again, if your plan has a free problem slot (otherwise 403). Restoring an active problem changes nothing.","security":[{"ApiKey":[]}],"parameters":[{"name":"problem","in":"path","required":true,"schema":{"type":"string"},"description":"The problem's id (prob_ and 24 characters) or its slug. Another account's problem, and a ref of any other shape, answers 404."}],"responses":{"200":{"description":"The problem, active, with each test's size and SHA-256 in place of its data.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ProblemChanged"}}}},"403":{"description":"The Authorization header is missing, the key is not an API key, the origin is not allowed, or the request came through RapidAPI. Also: the plan's problem limit is reached.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"missing":{"summary":"No header","value":{"error":"Missing Authorization header"}},"rapidapi":{"summary":"Through RapidAPI","value":{"error":"Stored problems are not available through RapidAPI."}}}}}},"404":{"description":"Unknown key, or the problem is not found. The same answer covers another account's problem and a ref of any other shape.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"key":{"summary":"Unknown key","value":{"error":"Invalid or inactive API key"}},"problem":{"summary":"No such problem","value":{"error":"Problem not found"}}}}}}}}},"\/api\/problems\/{problem}\/public\/":{"get":{"operationId":"getPublicProblem","tags":["Problems"],"summary":"Read a problem as a candidate sees it","description":"The current version without anything hidden: the statement, languages, starter code, the checker's name, scoring, limits and the visible tests, with only the count of the hidden ones. A public, active problem with a published version answers anyone who asks by its id with no key, as JSON readable from any origin and cacheable for a minute; the slug does not work here without a key. Anything else needs the owner's key, so a caller without it cannot tell a private problem from a missing one; with it the owner may preview a private or archived problem (409 before the first publish).","security":[{"ApiKey":[]},{}],"parameters":[{"name":"problem","in":"path","required":true,"schema":{"type":"string"},"description":"The problem's id (prob_ and 24 characters) or its slug. Another account's problem, and a ref of any other shape, answers 404."}],"responses":{"200":{"description":"The problem.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ProblemPublicView"}}}},"403":{"description":"The Authorization header is missing, the key is not an API key, the origin is not allowed, or the request came through RapidAPI.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"missing":{"summary":"No header","value":{"error":"Missing Authorization header"}},"rapidapi":{"summary":"Through RapidAPI","value":{"error":"Stored problems are not available through RapidAPI."}}}}}},"404":{"description":"Unknown key, or the problem is not found. The same answer covers another account's problem and a ref of any other shape.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"key":{"summary":"Unknown key","value":{"error":"Invalid or inactive API key"}},"problem":{"summary":"No such problem","value":{"error":"Problem not found"}}}}}},"409":{"description":"The problem has no published version yet (the owner's preview only).","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"example":{"error":"This problem has no published version yet."}}}}}}},"\/api\/problems\/{problem}\/submissions\/":{"post":{"operationId":"submitToProblem","tags":["Problems"],"summary":"Judge code against a stored problem","description":"Judges the code against the problem's current version and answers like POST \/api\/run-tests\/: synchronous, or 202 with `async: true` or a `callback_url`, with the same submissions, queue, webhooks, Idempotency-Key and signed receipts. Each judged test counts as one run; a custom checker's sandbox is not charged. The result adds `problem` and `version`. The receipt has a `problem` block, and the submission lookup returns `problem` and, for the owner, a custom checker's `checker_log`. For a problem with a custom checker send `async`: a synchronous request also waits for the checker's sandbox after the tests. Stored problems are not available through RapidAPI: a request through it answers 403.","security":[{"ApiKey":[]}],"parameters":[{"name":"problem","in":"path","required":true,"schema":{"type":"string"},"description":"The problem's id (prob_ and 24 characters) or its slug. Another account's problem, and a ref of any other shape, answers 404."},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[ -~]+$"},"description":"As on POST \/api\/run-tests\/. The problem is part of what the key was sent with: the same body sent to another problem answers 409."}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ProblemSubmissionRequest"},"example":{"compiler":"python-3.14","code":"a, b = map(int, input().split())\nprint(a + b)","mode":"all"}}}},"responses":{"200":{"description":"Judged. The body is the run-tests response with problem and version.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/RunTestsResponse"}}}},"202":{"description":"Queued, as for run-tests.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SubmissionQueued"}}}},"400":{"description":"The body is not valid, the compiler is not one of the problem's languages, the mode is unknown, tests is not a list of distinct test numbers of the version or is sent with samples, samples was asked of a problem with no visible test, or the problem's tests could take longer than a submission may run on this plan.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"example":{"error":"compiler must be one of python-3.14 for this problem"}}}},"403":{"description":"The Authorization header is missing, the key is not an API key, the origin is not allowed, or the request came through RapidAPI.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"missing":{"summary":"No header","value":{"error":"Missing Authorization header"}},"rapidapi":{"summary":"Through RapidAPI","value":{"error":"Stored problems are not available through RapidAPI."}}}}}},"404":{"description":"Unknown key, or the problem is not found. The same answer covers another account's problem and a ref of any other shape.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"key":{"summary":"Unknown key","value":{"error":"Invalid or inactive API key"}},"problem":{"summary":"No such problem","value":{"error":"Problem not found"}}}}}},"409":{"description":"The problem is archived or has no published version, or the Idempotency-Key was used with another body or problem.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"archived":{"value":{"error":"This problem is archived."}},"unpublished":{"value":{"error":"This problem has no published version yet."}}}}}},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/problems\/{problem}\/rejudge\/":{"post":{"operationId":"rejudgeProblem","tags":["Problems"],"summary":"Re-judge earlier submissions against a newer version","description":"After a problem's tests change, judges its earlier submissions again against a later published version: the current one, or the one `version` names. Candidates are the problem's finished submissions that ran every test (mode all), were judged against an earlier version and were made through the API or a widget session (not a dashboard test session), that are not re-judges themselves, were not re-judged against that version before, still have their code, and ran in a language that version allows. They are taken oldest first, up to 100 a call. With `submissions`, only those are taken: each must be a submission of this problem that ran every test through the API or a widget session, is not a re-judge, and was judged against an earlier version (else 400); one that is not finished yet, failed, was already re-judged against the version, lost its code or ran in a language the version does not allow is skipped with that reason. Each is queued as a new async submission under the calling key, with the same compiler and code (a hidden driver is taken out and the version's own put in), mode all, the original's external_ref and metadata, and `rejudge_of` naming the original, which keeps its own result. Its webhook goes to the original's callback URL only with `notify: true`, never to the key's own URL. Each re-judged test counts as one run, charged when it runs, like any async submission. Queueing stops at the first refusal of the account's queue, and `remaining` says how many candidates the call did not reach: call again once queued work has finished. A submission is never re-judged twice against one version, so sending the same call again is safe: what was queued before is skipped as already re-judged, naming its re-judge. Stored problems are not available through RapidAPI: a request through it answers 403.","security":[{"ApiKey":[]}],"parameters":[{"name":"problem","in":"path","required":true,"schema":{"type":"string"},"description":"The problem's id (prob_ and 24 characters) or its slug. Another account's problem, and a ref of any other shape, answers 404."}],"requestBody":{"required":false,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/RejudgeRequest"},"example":{"version":2,"notify":true}}}},"responses":{"202":{"description":"Queued what fitted. Each re-judge's result comes as for any async submission: GET \/api\/submissions\/{id}\/, and its webhook with notify.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/RejudgeResult"},"example":{"version":2,"queued":[{"submission":"sub_5Gh8Jk2Lm4Np6Qr8St1Uv3Wx","rejudge_of":"sub_8f2Kq7LmT3xR9vWb1cYd4hNe"}],"skipped":[{"submission":"sub_2Rk8Vn4Qw1Xz7Lm3Pt6Hy9Bc","reason":"language not allowed in version 2"},{"submission":"sub_6Tp3Yq9Wz2Lk5Mn8Bv1Cx4Rf","reason":"already re-judged against version 2","rejudge":"sub_9Hd2Kw7Pq4Zt1Xm6Rn3Lb8Vc"}],"remaining":0}}}},"400":{"description":"The body is not a JSON object or has another field; version is not the number of a published version of the problem; or submissions is not a list of at most 100 distinct submission ids, or names one that is not this problem's, did not run every test (mode samples or tests), is a draft test, reference check, dashboard test or re-judge, or was judged against that version or a later one.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"field":{"summary":"Another field","value":{"error":"Unknown field versions: a re-judge takes only version, submissions and notify"}},"version":{"summary":"Not a published version","value":{"error":"version must be the number of a published version of this problem"}},"above":{"summary":"A chosen submission judged against that version or a later one","value":{"error":"version must be above the version of every chosen submission: sub_8f2Kq7LmT3xR9vWb1cYd4hNe was judged against version 2"}},"foreign":{"summary":"Not this problem's","value":{"error":"sub_8f2Kq7LmT3xR9vWb1cYd4hNe is not a submission of this problem"}}}}}},"403":{"description":"The Authorization header is missing, the key is not an API key, the origin is not allowed, or the request came through RapidAPI.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"missing":{"summary":"No header","value":{"error":"Missing Authorization header"}},"rapidapi":{"summary":"Through RapidAPI","value":{"error":"Stored problems are not available through RapidAPI."}}}}}},"404":{"description":"Unknown key, or the problem is not found. The same answer covers another account's problem and a ref of any other shape.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"key":{"summary":"Unknown key","value":{"error":"Invalid or inactive API key"}},"problem":{"summary":"No such problem","value":{"error":"Problem not found"}}}}}},"409":{"description":"The problem is archived or has no published version.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"archived":{"value":{"error":"This problem is archived."}},"unpublished":{"value":{"error":"This problem has no published version yet."}}}}}},"429":{"description":"The account's queue had no room for even one re-judge: it is full, or the month's allowance or the key's cap cannot cover the tests together with those already queued. Nothing was queued. Call again once queued work has finished.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"example":{"error":"Too many queued submissions for this account (limit 80)."}}},"headers":{"Retry-After":{"$ref":"#\/components\/headers\/RetryAfter"}}}}}},"\/api\/problems\/{problem}\/sessions\/":{"post":{"operationId":"createProblemSession","tags":["Problems"],"summary":"Create a submit session","description":"Lets one candidate Submit to the problem's current published version from the embeddable widget (`data-problem` with `data-session`). Call this from your server, never from the browser: the answer holds the session token, which is shown once. The session is pinned to the version current now. Each Submit counts against `max_submits`; one refused after it was counted, or failed on our side, is given back. Submits judge every test, in your account's queue, and the signed webhook takes the result to your server; each Submit's signed receipt is shared (public by link, so the widget can link to it) unless you send `share_receipts: false`; read scores only from the webhook or `GET \/api\/submissions\/{submission_id}\/`, never from the browser. The candidate never sees hidden tests. A widget only opens problems of its own key's account, and widget keys are refused on this API.","security":[{"ApiKey":[]}],"parameters":[{"name":"problem","in":"path","required":true,"schema":{"type":"string"},"description":"The problem's id (prob_ and 24 characters) or its slug. Another account's problem, and a ref of any other shape, answers 404."}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ProblemSessionRequest"},"example":{"external_ref":"candidate-8841","max_submits":3,"expires_in":3600,"callback_url":"https:\/\/example.com\/hooks\/judge"}}}},"responses":{"201":{"description":"The session, with its token.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ProblemSessionCreated"},"example":{"session":"pss_Qm4Tn8Vx2Kb7Hc3Ld9Wz5Ey1","problem":"prob_7Hq2Zp4Wn8Ks1Ab6Ct3Dv5Ex","version":3,"external_ref":"candidate-8841","metadata":{"interview":"onsite-12"},"callback_url":"","max_submits":3,"share_receipts":true,"submits_used":0,"expires":"2026-11-05T15:00:00Z","revoked":null,"created":"2026-11-05T14:00:00Z","submissions":[],"token":"pst_Xc7Vn2Mb9Qa4Lk8Hd3Sf6Wt1Jr5Ze0Py"}}}},"400":{"description":"The body is not valid.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"example":{"error":"expires_in must be a whole number of seconds from 60 to 86400"}}}},"403":{"description":"The Authorization header is missing, the key is not an API key, the origin is not allowed, or the request came through RapidAPI.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"missing":{"summary":"No header","value":{"error":"Missing Authorization header"}},"rapidapi":{"summary":"Through RapidAPI","value":{"error":"Stored problems are not available through RapidAPI."}}}}}},"404":{"description":"Unknown key, or the problem is not found. The same answer covers another account's problem and a ref of any other shape.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"key":{"summary":"Unknown key","value":{"error":"Invalid or inactive API key"}},"problem":{"summary":"No such problem","value":{"error":"Problem not found"}}}}}},"409":{"description":"The problem is archived or has no published version.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"archived":{"value":{"error":"This problem is archived."}},"none":{"value":{"error":"This problem has no published version yet."}}}}}}}}},"\/api\/problems\/{problem}\/sessions\/{session}\/":{"get":{"operationId":"getProblemSession","tags":["Problems"],"summary":"Read a submit session","description":"The session, its Submits used and the ids of its submissions. It never holds the token.","security":[{"ApiKey":[]}],"parameters":[{"name":"problem","in":"path","required":true,"schema":{"type":"string"},"description":"The problem's id (prob_ and 24 characters) or its slug. Another account's problem, and a ref of any other shape, answers 404."},{"name":"session","in":"path","required":true,"schema":{"type":"string"},"description":"The session's id (pss_ and 24 characters). A session of another problem or account answers 404."}],"responses":{"200":{"description":"The session.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ProblemSession"},"example":{"session":"pss_Qm4Tn8Vx2Kb7Hc3Ld9Wz5Ey1","problem":"prob_7Hq2Zp4Wn8Ks1Ab6Ct3Dv5Ex","version":3,"external_ref":"candidate-8841","metadata":{"interview":"onsite-12"},"callback_url":"","max_submits":3,"share_receipts":true,"submits_used":0,"expires":"2026-11-05T15:00:00Z","revoked":null,"created":"2026-11-05T14:00:00Z","submissions":[]}}}},"403":{"description":"The Authorization header is missing, the key is not an API key, the origin is not allowed, or the request came through RapidAPI.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"missing":{"summary":"No header","value":{"error":"Missing Authorization header"}},"rapidapi":{"summary":"Through RapidAPI","value":{"error":"Stored problems are not available through RapidAPI."}}}}}},"404":{"description":"Unknown key, or the problem or session is not found.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"example":{"error":"Session not found"}}}}}},"delete":{"operationId":"revokeProblemSession","tags":["Problems"],"summary":"Revoke a submit session","description":"Ends the session now: its next Submit is refused. Submissions already made are judged as usual. The session stays readable, and revoking twice keeps the first time.","security":[{"ApiKey":[]}],"parameters":[{"name":"problem","in":"path","required":true,"schema":{"type":"string"},"description":"The problem's id (prob_ and 24 characters) or its slug. Another account's problem, and a ref of any other shape, answers 404."},{"name":"session","in":"path","required":true,"schema":{"type":"string"},"description":"The session's id (pss_ and 24 characters). A session of another problem or account answers 404."}],"responses":{"200":{"description":"The session, revoked.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ProblemSession"},"example":{"session":"pss_Qm4Tn8Vx2Kb7Hc3Ld9Wz5Ey1","problem":"prob_7Hq2Zp4Wn8Ks1Ab6Ct3Dv5Ex","version":3,"external_ref":"candidate-8841","metadata":{"interview":"onsite-12"},"callback_url":"","max_submits":3,"share_receipts":true,"submits_used":0,"expires":"2026-11-05T15:00:00Z","revoked":"2026-11-05T14:20:00Z","created":"2026-11-05T14:00:00Z","submissions":[]}}}},"403":{"description":"The Authorization header is missing, the key is not an API key, the origin is not allowed, or the request came through RapidAPI.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"missing":{"summary":"No header","value":{"error":"Missing Authorization header"}},"rapidapi":{"summary":"Through RapidAPI","value":{"error":"Stored problems are not available through RapidAPI."}}}}}},"404":{"description":"Unknown key, or the problem or session is not found.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"example":{"error":"Session 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 value of the Authorization header; a Bearer prefix is accepted too. 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","g++-15-cpp20","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","python-3.14-tests","nodejs-24-tests","openjdk-25-tests","dotnet-csharp-10-tests"]},"InputFile":{"type":"object","required":["name","content"],"properties":{"name":{"type":"string","maxLength":200,"pattern":"^[A-Za-z0-9][A-Za-z0-9._-]{0,99}(\/[A-Za-z0-9][A-Za-z0-9._-]{0,99}){0,3}$","description":"A file name, or a path of at most 4 parts joined by \/, at most 200 characters in all (parts of letters, digits, dots, hyphens and underscores, not starting with a dot). The first part cannot be input, run.sh, build, build.tar or go-trim.txt, and its part before the first dot cannot be code. Names in one request must differ, and a name cannot also be the directory of another."},"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 5 MB (5,242,880 bytes; see GET \/api\/limits\/, input_kb). One request body may be at most 32 MB. For SQL runs the script reads it with readfile('input') (SQLite) or read_text('input') (DuckDB)."},"args":{"type":"array","maxItems":32,"items":{"type":"string"},"description":"Command-line arguments the program receives after its own command, in order and exactly as sent (no shell expansion): at most 32 strings without NUL characters, at most 4,096 bytes in total as UTF-8. Missing, null and [] mean none. sqlite-3, duckdb-1.5 and erlang-29 cannot take arguments and answer 400 to any."},"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."},"memory_limit":{"type":"integer","minimum":16,"maximum":2048,"description":"MB the program may use at its peak, a whole number from min_memory_mb to max_memory_mb of GET \/api\/limits\/ (16 to 2048), sent as an integer such as 64 (64.0 is refused). Without it a run gets memory_mb (512); a value above that raises the sandbox's memory cap for this run on Pro and Business or with a CodeRunner exam tier (max_memory_mb of GET \/api\/usage\/), and the run still counts as one run; on Free and Starter it is refused with 400 and a link to the plan that allows it. It is checked against the peak the result reports as memory, which is that of the run command, as for time: a separate compile step never counts, a language that compiles as it runs counts its compiler, and library files the program maps count too. Past it the run reports exit code 137 (signal 9), as when the sandbox's own memory cap stops a program; a limit below memory_mb also adds a line on stderr saying how much it used; what it printed is kept. A run that also timed out reports 124. Without it only the sandbox's own cap applies."},"files":{"type":"array","maxItems":20,"items":{"$ref":"#\/components\/schemas\/InputFile"},"description":"Files the program can use: helper source files, which are compiled with the program or loaded by it as the language does, and input data. At most 20 files and 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","memory_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, the sandbox's own or the memory_limit you sent; 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."},"memory_limit":{"type":"integer","description":"The memory limit the run had, in MB: the memory_limit you sent, or the sandbox's own memory without one."}}},"CallbackBody":{"type":"object","required":["output","error","status","exit_code","signal","truncated","time","total","memory","files","files_truncated","time_limit","memory_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, the sandbox's own or the memory_limit you sent; 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."},"memory_limit":{"type":"integer","description":"The memory limit the run had, in MB: the memory_limit you sent, or the sandbox's own memory 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 5 MB (5,242,880 bytes). The tests' inputs and expected outputs together, like the whole request body, may be at most 32 MB."},"args":{"type":"array","maxItems":32,"items":{"type":"string"},"description":"Command-line arguments the program receives in this test, exactly as sent: at most 32 strings without NUL characters, at most 4,096 bytes in total as UTF-8. Missing, null and [] mean none. sqlite-3, duckdb-1.5 and erlang-29 cannot take arguments and answer 400 to any."},"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","checker_error","problem_error","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: exit code 137, killed at the sandbox's memory cap or over the memory_limit sent. 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. checker_error and problem_error appear only for a stored problem with a custom checker: the checker misbehaved, or the problem could not be judged (see the problems docs). Neither is the candidate's fault, and neither counts as a wrong answer."},"OverallVerdict":{"type":"string","enum":["internal_error","compilation_error","time_limit_exceeded","memory_limit_exceeded","output_limit_exceeded","runtime_error","wrong_answer","checker_error","problem_error","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. For a stored problem, problem_error and checker_error come first: a test that the problem or its checker could not judge decides the overall verdict whatever the other tests did."},"Checker":{"type":"string","enum":["trim","exact","tokens","float","rows","table","table_ordered"],"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. table: CSV tables with a header row, compared by column name, rows in any order; pandas' unnamed index column is ignored, missing values (empty, NaN, None, NULL, <NA>) are equal, true and false match in any case, numbers within tolerance. table_ordered: as table, rows in order."},"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"],"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. Not sent with suite."},"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 32 MB."},"suite":{"$ref":"#\/components\/schemas\/Suite","description":"Run a test pack's test command over `files` instead of `code` against `tests`: one sandbox, one run against your limits, one named result per test from the report the command writes. Needs a test pack as `compiler` (an entry of GET \/api\/compilers\/ with `pack`). With `suite`, `code` is not needed and `tests`, `checker`, `tolerance`, `scoring`, `stop_on_failure` and `args` are refused with 400 unless null, as are `async` and `callback_url`: a suite runs synchronously. `time_limit` covers the whole suite and defaults to 20."},"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. With suite, the seconds the whole suite may run (default 20)."},"memory_limit":{"type":"integer","minimum":16,"maximum":2048,"description":"MB each test's program may use at its peak, one value for every test, a whole number from min_memory_mb to max_memory_mb of GET \/api\/limits\/ (16 to 2048), sent as an integer such as 64 (64.0 is refused). A value above memory_mb (512) raises the sandbox's memory cap for every test, on Pro and Business or with an exam tier (Free and Starter: 400). It is checked as in POST \/api\/run-code-sync\/: against the peak of the run command, which a separate compile step never adds to. A test whose program passes it is memory_limit_exceeded (exit code 137, signal 9), with a line on stderr saying how much it used. Without it only the sandbox's own cap applies."},"files":{"type":"array","maxItems":20,"items":{"$ref":"#\/components\/schemas\/InputFile"},"description":"Files shared by every test, each test's sandbox getting its own copy: helper source files, which are compiled with the program or loaded by it as the language does, and input data. At most 20 files and 1,000,000 bytes in total once decoded (see GET \/api\/limits\/)."},"checker":{"$ref":"#\/components\/schemas\/Checker"},"tolerance":{"type":"number","minimum":0,"maximum":1,"default":1.0e-6,"description":"For the float, rows, table and table_ordered 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."},"async":{"type":"boolean","default":false,"description":"true answers 202 at once with the submission's id and judges it in the background. It waits in your account's queue and starts, in the order your account sent its submissions, once your per-minute and pending limits have room for all of its tests: those limits only pace when queued work starts, so a burst waits instead of getting 429. A request with more tests than your per-minute limit is refused with 429, since it could never start. Its tests are counted when it starts. Look the result up by the submission's id, or have it sent to callback_url."},"callback_url":{"type":"string","format":"uri","maxLength":2000,"description":"A public http(s) URL that receives the finished submission as a signed webhook (see the submissionFinished webhook); implies async: true. Without it, an async submission's result goes to the API key's callback URL when the key has one. No credentials or fragment, and redirects are not followed. Not available through RapidAPI."},"external_ref":{"type":"string","maxLength":200,"description":"Your own id for this submission, such as an attempt id, at most 200 characters. Stored with the submission and signed into its receipt. Use an opaque id, never an email or a name."},"metadata":{"type":"object","additionalProperties":true,"description":"Any JSON object of at most 4 KB as compact UTF-8 JSON, stored with the submission. It comes back when you look the submission up and in webhooks, never in receipts."}},"oneOf":[{"required":["code","tests"],"not":{"required":["suite"]},"description":"Tests: code run against each of tests."},{"required":["suite"],"not":{"anyOf":[{"required":["tests"],"properties":{"tests":{"not":{"type":"null"}}}},{"required":["checker"],"properties":{"checker":{"not":{"type":"null"}}}},{"required":["tolerance"],"properties":{"tolerance":{"not":{"type":"null"}}}},{"required":["scoring"],"properties":{"scoring":{"not":{"type":"null"}}}},{"required":["stop_on_failure"],"properties":{"stop_on_failure":{"not":{"type":"null"}}}},{"required":["args"],"properties":{"args":{"not":{"type":"null"}}}}]},"description":"A suite: a test pack's command run over files."}]},"Suite":{"type":"object","additionalProperties":false,"not":{"required":["preset","command"],"properties":{"preset":{"not":{"type":"null"}},"command":{"not":{"type":"null"}}}},"description":"What a suite runs: a preset of the pack, or a custom command, never both. {} runs the pack's default preset (pytest on python-3.14-tests, jest on nodejs-24-tests, junit on openjdk-25-tests, xunit on dotnet-csharp-10-tests). services starts a database in the same sandbox before either (python-3.14-tests and nodejs-24-tests).","properties":{"preset":{"type":["string","null"],"description":"A preset's name from the pack's `pack.presets` in GET \/api\/compilers\/: pytest; jest, mocha or node-test; junit; xunit or nunit. Each runs in one process (no workers) and writes a JUnit XML report. jest, mocha and node-test end once their tests have run, even if the code under test left a connection or server open. pytest, jest, mocha, node-test and junit give each test a 10-second limit; under junit that limit interrupts a test that waits, while one that never checks for an interrupt (a busy loop) runs on to the suite's time limit, and it applies to JUnit 5 and 6 (Jupiter) tests: JUnit 4 classes, which junit also runs and grades, are limited only by their own @Test(timeout). xunit and nunit have no per-test limit: their tests run under the suite's time limit only (an xUnit test's own Timeout still applies). pytest, junit, xunit and nunit print their output, failures included, to stderr (run.error), as jest does, so that many failures never fill the output limit. junit, xunit and nunit compile every .java or .cs file first: a failed compile gives compilation_error with the compiler's messages in run.error, and a compiler stopped by a signal gives internal_error. null or absent, with no command, runs the pack's default."},"command":{"type":["string","null"],"minLength":1,"description":"A custom command, at most 4,000 bytes once encoded as UTF-8 (characters beyond ASCII take 2 to 4 each), without NUL, run with bash in \/sandbox where the files are. It must write `$OUTPUT_DIR\/report.xml` (JUnit XML) or `$OUTPUT_DIR\/results.json` (Gradescope's shape: tests, each with a name and either a status or a score and max_score, and an output); report.xml is read when both exist. On nodejs-24-tests the pack's packages are linked as \/sandbox\/node_modules, so files under node_modules\/ are refused. A command that fails after writing a report counts as failing tests whatever its exit status; one that writes none and exits 71, 124 or 129 to 255 reads as that run problem (too many processes, a timeout, a signal)."},"services":{"type":["array","null"],"items":{"type":"string","enum":["postgresql"]},"uniqueItems":true,"description":"Services the pack starts in the same sandbox before the command, on python-3.14-tests and nodejs-24-tests only (see `pack.services` in GET \/api\/compilers\/). [\"postgresql\"] starts PostgreSQL 18 on 127.0.0.1 and ::1, port 5432, with its socket in \/tmp; every connection may be the user postgres, a superuser inside the sandbox, with no password, on database postgres. Then it runs every file under db\/ whose name ends in .sql, in the byte order of their paths, through psql, stopping at the first error (warnings and errors only reach run.error); the command gets DATABASE_URL (postgresql:\/\/postgres@127.0.0.1:5432\/postgres) and PGHOST, PGPORT, PGUSER and PGDATABASE. The server allows 8 connections at once: a ninth gets PostgreSQL's \"too many clients\" error in its test's result. Its data lives in \/sandbox (a 256 MB tmpfs shared with the request's files, of which the empty server takes about 31 MB; temporary files stop at 64 MB), apart from \/tmp where the report is written, and goes with the sandbox. Times are UTC and text sorts by code point. The server's start and the seeds count in the suite's time_limit. Needs an account whose runs may keep 32 processes at once (Pro and above, and exam tiers) and memory_limit of 1,024 MB or more (the server's memory is the run's); others get 400. A server that does not start gives internal_error; a seed that fails gives no_report, with psql's message in run.error. The command runs in a subshell, so its own exit status 69 reads as 1. null or [] starts nothing."}}},"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","memory_limit","compile_error","tests","summary","submission","receipt"],"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."},"memory_limit":{"type":"integer","description":"The memory limit used, in MB: the memory_limit sent, or the sandbox's own memory without one (always so for a stored problem)."},"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."},"summary":{"type":"string","description":"One or two plain sentences about the result, for example \"2 of 3 sample tests passed. Sample 2 expected 5 but the program printed 4.\" Built only from the visible tests and overall counts: hidden tests appear only as counts. It is deterministic; no AI writes it."},"submission":{"type":"string","pattern":"^sub_[A-Za-z0-9]{24}$","description":"The id this request is stored under as a submission."},"receipt":{"anyOf":[{"$ref":"#\/components\/schemas\/Receipt"},{"type":"null"}],"description":"The signed receipt of this result. null only when a receipt could not be signed; the result stands all the same."},"problem":{"type":"string","pattern":"^prob_[A-Za-z0-9]{24}$","description":"Set for a stored problem's submission: the problem's id. Absent from a POST \/api\/run-tests\/ result."},"version":{"type":"integer","minimum":1,"description":"Set with problem: the number of the problem version it was judged against."}}},"SuiteTestResult":{"type":"object","required":["name","classname","file","status","time","message","score","max_score"],"description":"One test as the suite's report gave it, in report order.","properties":{"name":{"type":"string","maxLength":500,"description":"The test's name, at most 500 characters."},"classname":{"type":["string","null"],"maxLength":500,"description":"Its class, module or describe block, as the report names it; null when none."},"file":{"type":["string","null"],"maxLength":500,"description":"The file the report names, passed through as given; null when none."},"status":{"type":"string","enum":["passed","failed","error","skipped"]},"time":{"type":["number","null"],"description":"Seconds, as the report gave them; null when none."},"message":{"type":["string","null"],"maxLength":4096,"description":"The failure, error or skip message, or a results.json test's output; at most 4,096 characters."},"score":{"type":["number","null"],"description":"A results.json test's score; null otherwise."},"max_score":{"type":["number","null"],"description":"A results.json test's max_score; null otherwise."}}},"SuiteResult":{"type":"object","required":["verdict","gradable","passed","failed","errors","skipped","total","score","tests","run","compiler","preset","pack","report_truncated","time_limit","memory_limit","summary"],"description":"A finished suite submission's result: the suite response without submission and receipt.","properties":{"verdict":{"type":"string","enum":["accepted","failed","compilation_error","time_limit_exceeded","memory_limit_exceeded","output_limit_exceeded","runtime_error","no_report","internal_error"],"description":"The run's own problem first, by the rules every run is judged by (runtime_error here is too many processes, exit code 71; compilation_error when a pack that compiles, the Java or C# pack, exits 65 with no report: its compile failed, and run.error holds the compiler's messages; internal_error when such a pack exits 70 with no report: its compiler was stopped by a signal; internal_error also when a suite with services exits 69 with no report: a service did not start; the presets give either status only from their compile step, and 1 for a test process that exits with one); then no_report when the command left no readable report, or one that names no tests (run.error then says so); else accepted when the report names at least one test and every test passed, failed otherwise. A non-zero exit alone is no problem: test runners exit 1 when a test fails."},"gradable":{"type":"boolean","description":"false for no_report and internal_error: there are no results to grade by."},"passed":{"type":"integer"},"failed":{"type":"integer"},"errors":{"type":"integer"},"skipped":{"type":"integer"},"total":{"type":"integer","description":"Tests in the report (at most 1,000 are read)."},"score":{"type":"number","minimum":0,"maximum":100,"description":"The percentage of tests passed, or for a results.json whose every test has score and max_score, their scores over their maximums; rounded to 2 decimals."},"tests":{"type":"array","maxItems":1000,"items":{"$ref":"#\/components\/schemas\/SuiteTestResult"},"description":"The report's tests, in its order. Empty when the run stopped (a run problem as the verdict), since a report left then may be the code's own, and empty without a report."},"run":{"type":"object","required":["exit_code","signal","time","memory","output","error","truncated"],"description":"The run itself: the test command's exit, and its stdout and stderr cut to 4,096 characters.","properties":{"exit_code":{"type":"integer"},"signal":{"type":["integer","null"]},"time":{"type":"number","description":"Seconds."},"memory":{"type":"integer","description":"Peak memory in KB."},"output":{"type":"string"},"error":{"type":"string"},"truncated":{"type":"boolean","description":"True when output or error was cut."}}},"compiler":{"$ref":"#\/components\/schemas\/CompilerId"},"preset":{"type":["string","null"],"description":"The preset that ran; null for a custom command."},"pack":{"type":"object","required":["version"],"properties":{"version":{"type":"string"}},"description":"The pack's version, which changes only when its frameworks or libraries do."},"report_truncated":{"type":"boolean","description":"True when the report had more than 1,000 tests."},"time_limit":{"type":"number","description":"The seconds the whole suite could run."},"memory_limit":{"type":"integer","description":"The memory limit used, in MB."},"summary":{"type":"string","description":"One plain sentence from the counts and verdict, such as \"7 of 10 tests passed.\"; never a test's name or message."}}},"RunTestsSuiteResponse":{"type":"object","required":["verdict","gradable","passed","failed","errors","skipped","total","score","tests","run","compiler","preset","pack","report_truncated","time_limit","memory_limit","summary","submission","receipt"],"description":"The answer to a run-tests request with suite.","properties":{"verdict":{"$ref":"#\/components\/schemas\/SuiteResult\/properties\/verdict"},"gradable":{"$ref":"#\/components\/schemas\/SuiteResult\/properties\/gradable"},"passed":{"$ref":"#\/components\/schemas\/SuiteResult\/properties\/passed"},"failed":{"$ref":"#\/components\/schemas\/SuiteResult\/properties\/failed"},"errors":{"$ref":"#\/components\/schemas\/SuiteResult\/properties\/errors"},"skipped":{"$ref":"#\/components\/schemas\/SuiteResult\/properties\/skipped"},"total":{"$ref":"#\/components\/schemas\/SuiteResult\/properties\/total"},"score":{"$ref":"#\/components\/schemas\/SuiteResult\/properties\/score"},"tests":{"$ref":"#\/components\/schemas\/SuiteResult\/properties\/tests"},"run":{"$ref":"#\/components\/schemas\/SuiteResult\/properties\/run"},"compiler":{"$ref":"#\/components\/schemas\/SuiteResult\/properties\/compiler"},"preset":{"$ref":"#\/components\/schemas\/SuiteResult\/properties\/preset"},"pack":{"$ref":"#\/components\/schemas\/SuiteResult\/properties\/pack"},"report_truncated":{"$ref":"#\/components\/schemas\/SuiteResult\/properties\/report_truncated"},"time_limit":{"$ref":"#\/components\/schemas\/SuiteResult\/properties\/time_limit"},"memory_limit":{"$ref":"#\/components\/schemas\/SuiteResult\/properties\/memory_limit"},"summary":{"$ref":"#\/components\/schemas\/SuiteResult\/properties\/summary"},"submission":{"$ref":"#\/components\/schemas\/RunTestsResponse\/properties\/submission"},"receipt":{"anyOf":[{"$ref":"#\/components\/schemas\/SuiteReceipt"},{"type":"null"}],"description":"The signed receipt; null only when one could not be signed."}}},"SubmissionQueued":{"type":"object","required":["submission","status"],"description":"An async submission accepted into the account's queue, or an idempotent replay of a submission that is async or still running.","properties":{"submission":{"type":"string","pattern":"^sub_[A-Za-z0-9]{24}$","description":"The submission's id."},"status":{"type":"string","enum":["queued","running","finished","failed"],"description":"queued for a new async submission; for a replay, the original submission's current status."}}},"SubmissionResult":{"type":"object","required":["verdict","score","passed","total","time_limit","memory_limit","compile_error","tests","summary"],"description":"A finished submission's result: the run-tests response without submission and receipt, which come beside it. Output files are not kept with a submission, so a test that returned files lists none here and has files_truncated true. For a stored problem's submission it also carries problem and version.","properties":{"verdict":{"$ref":"#\/components\/schemas\/RunTestsResponse\/properties\/verdict"},"score":{"$ref":"#\/components\/schemas\/RunTestsResponse\/properties\/score"},"passed":{"$ref":"#\/components\/schemas\/RunTestsResponse\/properties\/passed"},"total":{"$ref":"#\/components\/schemas\/RunTestsResponse\/properties\/total"},"time_limit":{"$ref":"#\/components\/schemas\/RunTestsResponse\/properties\/time_limit"},"memory_limit":{"$ref":"#\/components\/schemas\/RunTestsResponse\/properties\/memory_limit"},"compile_error":{"$ref":"#\/components\/schemas\/RunTestsResponse\/properties\/compile_error"},"tests":{"$ref":"#\/components\/schemas\/RunTestsResponse\/properties\/tests"},"summary":{"$ref":"#\/components\/schemas\/RunTestsResponse\/properties\/summary"},"problem":{"type":"string","pattern":"^prob_[A-Za-z0-9]{24}$","description":"Set for a stored problem's submission: the problem's id. Absent from a POST \/api\/run-tests\/ result."},"version":{"type":"integer","minimum":1,"description":"Set with problem: the number of the problem version it was judged against."}}},"WebhookEvent":{"type":"object","required":["event","delivery","submission","status","external_ref","metadata","rejudge_of","result","receipt","error"],"description":"The body of the submissionFinished webhook. Hidden tests carry only verdict and hidden, as in the response.","properties":{"event":{"type":"string","const":"submission.finished","description":"The event type, also sent in X-OC-Event."},"delivery":{"type":"string","pattern":"^dlv_[A-Za-z0-9]{24}$","description":"This event's id, the same on every retry of it and in X-OC-Delivery. Deduplicate on it."},"submission":{"type":"string","pattern":"^sub_[A-Za-z0-9]{24}$","description":"The submission's id, as the 202 answer gave it."},"status":{"type":"string","enum":["finished","failed"],"description":"finished when the submission was judged, whatever its verdict; failed when it was not judged (for example its API key was deleted, or not every test could start in time), with the reason in error."},"external_ref":{"type":["string","null"],"maxLength":200,"description":"The request's external_ref, or null."},"metadata":{"type":["object","null"],"description":"The request's metadata, or null."},"rejudge_of":{"type":["string","null"],"pattern":"^sub_[A-Za-z0-9]{24}$","description":"For a re-judge (POST \/api\/problems\/{problem}\/rejudge\/ with notify), the id of the earlier submission it re-judges; otherwise null."},"result":{"anyOf":[{"$ref":"#\/components\/schemas\/SubmissionResult"},{"type":"null"}],"description":"The result when status is finished: the run-tests response without submission and receipt. null when failed."},"receipt":{"anyOf":[{"$ref":"#\/components\/schemas\/Receipt"},{"type":"null"}],"description":"The signed receipt when status is finished. null when failed, or when a receipt could not be signed."},"error":{"type":["string","null"],"description":"Why the submission failed, when status is failed; send it again. Otherwise null."}}},"Receipt":{"type":"object","required":["receipt","format","submission","account","external_ref","issued","compiler","code_sha256","settings","verdict","score","passed","total","tests","key_id","signature"],"description":"A signed record of one judged submission: the code and tests by hash, the compiler image, the settings and the verdicts. It proves what was judged and how it came out; it does not prove who wrote the code. Hidden tests carry only their verdict. To check it, take the public key with its key_id from https:\/\/api.onlinecompiler.io\/.well-known\/receipt-keys.json and verify signature over the canonical JSON (RFC 8785: keys sorted, no whitespace, UTF-8) of every other field. A stored problem's receipt has no top-level tests_sha256 or files_sha256: it has a problem block with the problem's id, the version and the mode, and its settings.time_limit is the version's default time limit: a test's own limit is pinned by the signed problem id and version.","properties":{"receipt":{"type":"string","pattern":"^rcpt_[A-Za-z0-9]{24}$","description":"The receipt's id."},"format":{"type":"integer","const":1,"description":"The receipt format version."},"submission":{"type":"string","pattern":"^sub_[A-Za-z0-9]{24}$","description":"The submission it is for."},"account":{"type":"string","pattern":"^acct_[A-Za-z0-9]{16}$","description":"The public id of the account that sent the submission, the same in all of its receipts. It contains no email or key."},"external_ref":{"type":["string","null"],"maxLength":200,"description":"The request's external_ref, or null without one."},"issued":{"type":"string","format":"date-time","description":"When the receipt was signed, in UTC to the second."},"compiler":{"$ref":"#\/components\/schemas\/ReceiptCompiler"},"code_sha256":{"type":"string","pattern":"^[0-9a-f]{64}$","description":"Hex SHA-256 of the code as UTF-8."},"tests_sha256":{"type":"string","pattern":"^[0-9a-f]{64}$","description":"Not in a stored problem's receipt, which has it in `problem`. Hex SHA-256 of the canonical JSON of an object with two members: salt, the submission's hash_salt (returned only by GET \/api\/submissions\/{submission_id}\/ to the account that sent it), and tests, a list, in the order sent, of objects with input, expected_output, hidden and weight, defaults filled in (input \"\", hidden false, weight 1), and args as well for a test sent with a non-empty args. Without the salt it cannot be checked against a guess at the tests."},"files_sha256":{"type":["string","null"],"pattern":"^[0-9a-f]{64}$","description":"Not in a stored problem's receipt, which takes no input files. Hex SHA-256 of the canonical JSON of an object with two members: files, which maps each input file's name to the hex SHA-256 of its decoded content, and salt, the submission's hash_salt; null without files."},"settings":{"type":"object","required":["checker","tolerance","scoring","time_limit","stop_on_failure"],"description":"The judging settings used, defaults filled in; memory_limit only when the request sent one.","properties":{"checker":{"$ref":"#\/components\/schemas\/Checker"},"tolerance":{"type":"number"},"scoring":{"$ref":"#\/components\/schemas\/Scoring"},"time_limit":{"type":"number"},"stop_on_failure":{"type":"boolean"},"memory_limit":{"type":"integer","description":"Only in a receipt of a request that sent a memory_limit: the MB each test's program could use. Without it the sandbox's own memory cap applied."}}},"verdict":{"$ref":"#\/components\/schemas\/OverallVerdict"},"score":{"type":"number","minimum":0,"maximum":100},"passed":{"type":"integer"},"total":{"type":"integer"},"tests":{"type":"array","items":{"$ref":"#\/components\/schemas\/ReceiptTest"},"description":"One entry per test, in the order sent."},"key_id":{"type":"string","description":"The id of the key that signed it, listed with its public key at https:\/\/api.onlinecompiler.io\/.well-known\/receipt-keys.json."},"signature":{"type":"string","description":"Base64 Ed25519 signature over the canonical JSON of every other field."},"problem":{"type":["object","null"],"required":["id","version","mode","tests_sha256"],"description":"Present only in the receipt of a stored problem's submission, where it is also signed. Absent from the receipt of a POST \/api\/run-tests\/ submission, which hashes its own tests in the top-level tests_sha256.","properties":{"id":{"type":"string","pattern":"^prob_[A-Za-z0-9]{24}$","description":"The stored problem's id."},"version":{"type":"integer","minimum":1,"description":"The number of the version it was judged against."},"mode":{"type":"string","enum":["all","samples","tests"],"description":"all when every test of the version was judged; samples when only its visible tests were; tests when only the tests named in tests were. A samples or tests receipt does not vouch for the other tests."},"tests":{"type":"array","items":{"type":"integer","minimum":1},"description":"Only when mode is tests: the 1-based positions of the judged tests, sorted. tests_sha256 covers only these."},"tests_sha256":{"type":"string","pattern":"^[0-9a-f]{64}$","description":"Hex SHA-256 of the canonical JSON of an object with salt (the submission's hash_salt) and tests (the judged tests in order, each with input, expected_output, hidden and weight). Only the problem's owner holds the tests, so only the owner can reproduce it."}}}}},"SuiteReceipt":{"type":"object","required":["receipt","format","submission","account","external_ref","issued","compiler","suite","files_sha256","settings","verdict","score","passed","total","tests","key_id","signature"],"description":"A suite submission's signed receipt: the suite by its preset, its command's hash, the pack's version and its services, the files by hash, and each test's status only, never a test's name or message. Checked as a receipt is.","properties":{"receipt":{"$ref":"#\/components\/schemas\/Receipt\/properties\/receipt"},"format":{"$ref":"#\/components\/schemas\/Receipt\/properties\/format"},"submission":{"$ref":"#\/components\/schemas\/Receipt\/properties\/submission"},"account":{"$ref":"#\/components\/schemas\/Receipt\/properties\/account"},"external_ref":{"$ref":"#\/components\/schemas\/Receipt\/properties\/external_ref"},"issued":{"$ref":"#\/components\/schemas\/Receipt\/properties\/issued"},"compiler":{"$ref":"#\/components\/schemas\/Receipt\/properties\/compiler"},"key_id":{"$ref":"#\/components\/schemas\/Receipt\/properties\/key_id"},"signature":{"$ref":"#\/components\/schemas\/Receipt\/properties\/signature"},"suite":{"type":"object","required":["preset","command_sha256","pack_version"],"properties":{"preset":{"type":["string","null"]},"command_sha256":{"type":"string","pattern":"^[0-9a-f]{64}$","description":"SHA-256 of the command that ran (a preset's or the custom one, without the services' lines), as UTF-8."},"pack_version":{"type":"string"},"services":{"type":"array","items":{"type":"string"},"description":"The services the suite started, sorted; absent when it started none."}}},"files_sha256":{"type":["string","null"],"description":"The files' hash, salted as in a receipt; null without files."},"settings":{"type":"object","required":["time_limit","memory_limit"],"properties":{"time_limit":{"type":"number"},"memory_limit":{"type":"integer"}}},"verdict":{"$ref":"#\/components\/schemas\/SuiteResult\/properties\/verdict"},"score":{"type":"number"},"passed":{"type":"integer"},"total":{"type":"integer"},"tests":{"type":"array","items":{"type":"object","required":["status"],"properties":{"status":{"$ref":"#\/components\/schemas\/SuiteTestResult\/properties\/status"}}}}}},"ReceiptTest":{"type":"object","required":["verdict","hidden"],"description":"One test's verdict. A hidden or skipped test carries only verdict and hidden.","properties":{"verdict":{"$ref":"#\/components\/schemas\/Verdict"},"hidden":{"type":"boolean"},"time":{"type":"string","description":"Wall time in seconds as a decimal string, for a visible test that ran."}}},"ReceiptCompiler":{"type":"object","required":["id","version","image"],"properties":{"id":{"type":"string","description":"The compiler id that ran; a retired id is recorded as its successor."},"version":{"type":"string","description":"The version tag of the compiler image."},"image":{"type":["string","null"],"description":"The id of the compiler image that ran (sha256:...), or null when it could not be read."}}},"CompilerList":{"type":"object","required":["compilers","retired"],"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."},"pack":{"type":"object","required":["version","presets","default","services"],"description":"Only on a test pack, which run-tests' suite runs on.","properties":{"version":{"type":"string"},"presets":{"type":"array","items":{"type":"string"}},"default":{"type":"string","description":"The preset an empty suite runs."},"services":{"type":"array","items":{"type":"string"},"description":"The services a suite on this pack may ask for in `suite.services`, sorted: [\"postgresql\"] on python-3.14-tests and nodejs-24-tests, [] on the others."}}}}}},"retired":{"type":"object","additionalProperties":{"$ref":"#\/components\/schemas\/CompilerId"},"description":"Retired compiler ids, each with the id it now runs as. A request may still send one."}}},"Limits":{"type":"object","properties":{"memory_mb":{"type":"integer","description":"The memory a run gets when it sends no memory_limit, in MB."},"min_memory_mb":{"type":"integer","description":"The lowest memory_limit a run may send, in MB."},"max_memory_mb":{"type":"integer","description":"The highest memory_limit any plan allows, in MB (Pro and Business, or with an exam tier; Free and Starter allow memory_mb). GET \/api\/usage\/ gives your account's as max_memory_mb."},"cpus":{"type":"integer"},"timeout_seconds":{"type":"integer"},"processes":{"type":"integer"},"code_kb":{"type":"integer"},"input_kb":{"type":"integer","description":"Cap on one run's input (stdin), or one test's, in KB (1,000 bytes), rounded down; input_bytes is exact."},"input_bytes":{"type":"integer","description":"Cap on one run's input (stdin), or one test's, in UTF-8 bytes."},"widget_input_kb":{"type":"integer","description":"Cap on a run's input through the embeddable widget, in KB (1,000 bytes); widget_input_bytes is exact."},"widget_input_bytes":{"type":"integer","description":"Cap on a run's input through the embeddable widget, in UTF-8 bytes."},"request_bytes":{"type":"integer","description":"Cap on one request body to a run endpoint."},"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"},"input_retention_days":{"type":"integer","description":"Days an input over 64 KB stays downloadable from the dashboard after its last use."}},"required":["memory_mb","min_memory_mb","max_memory_mb","cpus","timeout_seconds","processes","code_kb","input_kb","input_bytes","widget_input_kb","widget_input_bytes","request_bytes","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","input_retention_days"],"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","max_memory_mb","max_processes"],"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"},"max_memory_mb":{"type":"integer","description":"The highest memory_limit this account's runs may send, in MB: 2048 on Pro and above or with an exam tier, 512 on Free and Starter."},"max_processes":{"type":"integer","description":"Processes one run of this account may keep alive at once: 16 on Free and Starter, 100 on Pro and Business or with an exam tier, 200 on Platform (a run that keeps more than about 120 small processes also needs a memory_limit above 512). Past it the sandbox stops and the run reports exit code 71."},"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."}}},"Submission":{"type":"object","required":["submission","status","created","finished","external_ref","metadata","problem","mode","rejudge_of","result","receipt","error","checker_log","hash_salt"],"description":"A submission as the account that sent it sees it. Hidden tests carry only verdict and hidden.","properties":{"submission":{"type":"string","pattern":"^sub_[A-Za-z0-9]{24}$","description":"The submission's id."},"status":{"type":"string","enum":["queued","running","finished","failed"],"description":"queued while it waits in the account's queue, running while it is judged, finished when it was judged whatever its verdict, failed when it was not judged (see error): for example its API key was deleted, or not every test could start in time."},"created":{"type":"string","format":"date-time","description":"When the request was accepted, UTC, in seconds, like 2026-11-03T09:14:22Z."},"finished":{"type":["string","null"],"format":"date-time","description":"When it finished or failed, in the same form; null until then."},"external_ref":{"type":["string","null"],"maxLength":200,"description":"The request's external_ref, or null."},"metadata":{"type":["object","null"],"description":"The request's metadata, or null."},"problem":{"type":["object","null"],"required":["id","version"],"properties":{"id":{"type":"string","pattern":"^prob_[A-Za-z0-9]{24}$","description":"The stored problem's id."},"version":{"type":"integer","minimum":1,"description":"The number of the version it was judged against."}},"description":"The stored problem and version a POST \/api\/problems\/{id}\/submissions submission was judged against; null for POST \/api\/run-tests\/."},"mode":{"type":["string","null"],"enum":["all","samples","tests",null],"description":"Which of a stored problem's tests it ran: all of them, only the sample (visible) tests, or the ones chosen with `tests`. Null for a plain run-tests submission, which has no stored problem. Problem statistics count only `all`."},"rejudge_of":{"type":["string","null"],"pattern":"^sub_[A-Za-z0-9]{24}$","description":"The id of the earlier submission this one re-judges against a newer version of the problem, or null."},"result":{"anyOf":[{"$ref":"#\/components\/schemas\/SubmissionResult"},{"$ref":"#\/components\/schemas\/SuiteResult"},{"type":"null"}],"description":"The result once status is finished: the run-tests response without submission and receipt. null before, and when failed."},"receipt":{"anyOf":[{"$ref":"#\/components\/schemas\/Receipt"},{"$ref":"#\/components\/schemas\/SuiteReceipt"},{"type":"null"}],"description":"The signed receipt once status is finished. null before, when failed, or when a receipt could not be signed."},"error":{"type":["string","null"],"description":"Why the submission failed, when status is failed; send it again. Otherwise null."},"checker_log":{"type":["string","null"],"description":"What the problem's custom checker wrote while judging this submission, and one line for each test whose checker failed (it ran too long, never started, printed too much or exited with a code other than 0, 1 or 2), for the problem's owner (this account) only: it appears in no other response, webhook or receipt. null when there is none."},"hash_salt":{"type":"string","pattern":"^[0-9a-f]{32}$","example":"5f1c9a7e3b2d4c6a8e0f1a3b5c7d9e2f","description":"A random value, different for every submission, that the receipt's tests_sha256 and files_sha256 are salted with, so that a shared receipt cannot confirm a guess at the hidden tests. Only this lookup returns it: it is not in the receipt, the shared receipt, the webhook or the run-tests response. Keep it with your copy of the request; with it you can show which tests and files a receipt covers (see the receipts docs)."}}},"SubmissionDeleted":{"type":"object","required":["submission","deleted"],"description":"A submission was deleted.","properties":{"submission":{"type":"string","pattern":"^sub_[A-Za-z0-9]{24}$","description":"The deleted submission's id."},"deleted":{"type":"boolean","const":true}}},"SharedReceipt":{"type":"object","required":["receipt","url"],"description":"A receipt that is now public.","properties":{"receipt":{"type":"string","pattern":"^rcpt_[A-Za-z0-9]{24}$","description":"The receipt's id."},"url":{"type":"string","format":"uri","description":"The page that shows the receipt and checks its signature, for example https:\/\/onlinecompiler.io\/r\/rcpt_..."}}},"PublicReceipt":{"type":"object","required":["receipt"],"description":"A shared receipt, and nothing else.","properties":{"receipt":{"$ref":"#\/components\/schemas\/Receipt"}}},"ReceiptKeys":{"type":"object","required":["keys"],"description":"The public keys receipts are signed with.","properties":{"keys":{"type":"array","description":"One entry per key.","items":{"type":"object","required":["key_id","algorithm","public_key"],"properties":{"key_id":{"type":"string","description":"The id a receipt names in key_id."},"algorithm":{"type":"string","const":"Ed25519"},"public_key":{"type":"string","description":"The 32-byte public key, base64."}}}}}},"ProblemTestInput":{"type":"object","required":["expected_output"],"description":"One test of a draft.","properties":{"name":{"type":"string","maxLength":100,"default":"","description":"A label for the test, up to 100 characters."},"input":{"type":"string","default":"","description":"Standard input, UTF-8 without NUL, at most 5 MB. A larger input than a request body allows is sent alone with PUT \/api\/problems\/{problem}\/draft\/tests\/{position}\/."},"expected_output":{"type":"string","description":"What the program should print: UTF-8 without NUL, at most 64 KB."},"hidden":{"type":"boolean","default":true,"description":"true if left out: a stored problem's tests are hidden unless you say otherwise. Visible tests are the samples a candidate sees."},"weight":{"type":"number","exclusiveMinimum":0,"default":1,"description":"Counts only for weighted scoring."},"time_limit":{"type":["number","null"],"description":"A time limit for this test in seconds; null or left out uses the version's time_limit."}}},"DraftRequest":{"type":"object","required":["tests"],"description":"A problem's draft: the fields of one version. PUT \/api\/problems\/{problem}\/draft\/ replaces the whole draft with it, and POST \/api\/problems\/ takes it together with a title. Fields you leave out take their defaults.","properties":{"title":{"type":"string","minLength":1,"maxLength":200,"description":"Required when creating a problem; ignored when replacing a draft (change the title with PATCH)."},"slug":{"type":"string","pattern":"^([a-z0-9][a-z0-9-]{0,63})?$","description":"Optional, when creating only. A name of your own for the problem, 1 to 64 lowercase letters, digits and hyphens, unique among your problems; wherever a problem id goes in a path (except the key-less public view) the slug works too. A slug another of your problems has answers 409."},"public":{"type":"boolean","default":false,"description":"When creating only. true makes the current version readable by anyone, with no key, at GET \/api\/problems\/{id}\/public."},"statement":{"type":"string","default":"","description":"The problem text for a candidate, at most 64 KB."},"tests":{"type":"array","minItems":1,"items":{"$ref":"#\/components\/schemas\/ProblemTestInput"},"description":"1 up to your plan's pending limit (see GET \/api\/usage\/). Inputs and expected outputs, together with the data files, are at most 20 MB per version."},"files":{"type":["array","null"],"maxItems":8,"items":{"$ref":"#\/components\/schemas\/ProblemFileInput"},"description":"Data files placed in each test's working directory: at most 8, each at most 5 MB, at most 10 MB together, and with the tests at most 20 MB per version. They count against your plan's data limit like test data. Left out or null, the new draft keeps the files of the version it starts from (the current draft, else the current version, else the newest), so saving a draft does not drop files uploaded on their own. An empty list removes them all; a list replaces them. GET shows each file as name, bytes and sha256, never its content."},"checker":{"type":"string","enum":["trim","exact","tokens","float","rows","table","table_ordered","custom"],"default":"trim","description":"One of the run-tests checkers, or custom, which runs your own checker program (needs custom_checker and reference_solution)."},"tolerance":{"type":"number","minimum":0,"maximum":1,"default":1.0e-6,"description":"For the float, rows, table and table_ordered checkers."},"scoring":{"$ref":"#\/components\/schemas\/Scoring"},"time_limit":{"type":"number","default":2,"description":"Default time limit per test in seconds, without any start-up allowance; a test's own time_limit overrides it."},"languages":{"type":"array","items":{"$ref":"#\/components\/schemas\/CompilerId"},"description":"The compilers a submission may use. Empty or left out allows any compiler."},"starter_code":{"type":"object","additionalProperties":{"type":"string","maxLength":50000},"description":"Code a candidate starts from, by compiler id, at most 50,000 bytes each. Shown in the public view."},"drivers":{"type":"object","additionalProperties":{"type":"string","maxLength":50000},"description":"A wrapper program by compiler id, at most 50,000 bytes each, that must contain ##CODE## where the candidate's code goes. It is not shown to candidates, but a candidate's program can read its own source, driver included, and print it on a visible test, and compiler and runtime messages can quote it, so keep test data and anything sensitive out of drivers."},"reference_solution":{"type":"object","required":["compiler","code"],"description":"A solution that must pass every test before the version is published. Its compiler must be one of languages. It runs inside the version's driver for its compiler, like any submission, so with a driver it is the code the driver wraps (a whole program that reads stdin gets the version rejected).","properties":{"compiler":{"$ref":"#\/components\/schemas\/CompilerId"},"code":{"type":"string","description":"Source code, at most 100,000 bytes."}}},"custom_checker":{"type":"object","required":["compiler","code"],"description":"The checker program when checker is custom. It sees each test's input, expected output and the program's output as files at \/judge\/input, \/judge\/expected and \/judge\/output (input also on stdin, except for the SQL compilers), and has 5 seconds for each test plus the compiler's start-up allowance. Exit 0 accepts, 1 or 2 is a wrong answer, any other exit is a checker error. It can be in any supported language; Python, JavaScript (Node), C, C++ and Java are recommended, because C, C++ and Java are compiled once and kept, and interpreted languages start fast. Other compiled languages (Rust, Go, Kotlin, C# and so on) compile again for every test inside the checker's 30-second sandbox, so on a problem with many tests they can run out of time and give checker errors. See the problems docs.","properties":{"compiler":{"$ref":"#\/components\/schemas\/CompilerId"},"code":{"type":"string","description":"Source code, at most 100,000 bytes."}}}}},"ProblemCheck":{"type":["object","null"],"description":"The reference check of a version: null for a draft and for a version published without a reference solution.","properties":{"submission":{"type":"string","pattern":"^sub_[A-Za-z0-9]{24}$","description":"The check's submission, which is queued, run and counted like any other."},"status":{"type":"string","enum":["checking","passed","failed"]},"tests":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"verdict":{"type":"string"},"time":{"type":["number","null"],"description":"The reference solution's time in seconds; null when the test never ran."}}},"description":"Each test's verdict and time, hidden tests included: this is the owner's record."},"warnings":{"type":"array","items":{"type":"string"},"description":"A line for each test whose time limit is less than twice the reference solution's time."},"message":{"type":"string","description":"Why a failed check failed: the custom checker did not compile; the custom checker failed (see the check's checker_log); the reference solution did not pass every test; the check could not finish because of an error on our side (publish again); the check was deleted; or what stopped it from running, such as its API key being deleted or disabled."}}},"ProblemVersionFile":{"type":"object","description":"One of a version's data files as its owner sees it: the name, the size in bytes and the SHA-256, never the content.","required":["name","bytes","sha256"],"properties":{"name":{"type":"string"},"bytes":{"type":"integer","minimum":0,"description":"The file's size in bytes."},"sha256":{"type":"string","pattern":"^[0-9a-f]{64}$","description":"The SHA-256 of the file's bytes, in lowercase hex."}}},"ProblemFileInput":{"type":"object","required":["name","content"],"description":"A data file in a draft body, placed in each test's working directory when it runs. It has the shape of a run-tests input file. content is required: the name, bytes and sha256 that GET shows for a file are not valid input.","properties":{"name":{"type":"string","maxLength":100,"pattern":"^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$","description":"A plain file name, distinct within the draft. It cannot be input, run.sh, build, build.tar or go-trim.txt, and its part before the first dot cannot be code."},"content":{"type":"string","description":"The file's content: UTF-8 text without NUL characters, or base64 when encoding is base64. At most 5 MB once decoded; the request body itself is at most 4 MB, so send a bigger file with PUT \/api\/problems\/{problem}\/draft\/files\/{name}\/."},"encoding":{"type":"string","enum":["utf8","base64"],"default":"utf8"}},"additionalProperties":false},"ProblemVersion":{"type":"object","description":"A version of a problem as its owner sees it in GET \/api\/problems\/{problem}\/, with every test's data, hidden tests included.","required":["version","state","created","published","statement","tests","files","checker","tolerance","scoring","time_limit","languages","starter_code","drivers","reference_solution","custom_checker","check"],"properties":{"version":{"type":["integer","null"],"description":"The version's number; null for a draft, which is numbered when published."},"state":{"type":"string","enum":["draft","checking","published","rejected"],"description":"draft: being edited. checking: the reference check is running. published: it can be submitted to once it is the current version. rejected: the check failed; its number is not reused."},"created":{"type":"string","format":"date-time"},"published":{"type":["string","null"],"format":"date-time"},"statement":{"type":"string"},"tests":{"type":"array","items":{"type":"object","required":["name","input","expected_output","hidden","weight","time_limit"],"properties":{"name":{"type":"string"},"input":{"type":"string"},"expected_output":{"type":"string"},"hidden":{"type":"boolean"},"weight":{"type":"number"},"time_limit":{"type":["number","null"]}}}},"files":{"type":"array","description":"The version's data files, sorted by name: each file's size in bytes and SHA-256, never its content.","items":{"$ref":"#\/components\/schemas\/ProblemVersionFile"}},"checker":{"type":"string","enum":["trim","exact","tokens","float","rows","table","table_ordered","custom"]},"tolerance":{"type":"number"},"scoring":{"$ref":"#\/components\/schemas\/Scoring"},"time_limit":{"type":"number"},"languages":{"type":"array","items":{"type":"string"}},"starter_code":{"type":"object","additionalProperties":{"type":"string"}},"drivers":{"type":"object","additionalProperties":{"type":"string"}},"reference_solution":{"type":["object","null"]},"custom_checker":{"type":["object","null"]},"check":{"$ref":"#\/components\/schemas\/ProblemCheck"}}},"ProblemVersionChanged":{"type":"object","description":"A version as a write answers with it: the same fields as ProblemVersion, except that each test has the size in bytes and the SHA-256 of its input and expected output in place of the text. GET \/api\/problems\/{problem}\/ has the text.","required":["version","state","created","published","statement","tests","files","checker","tolerance","scoring","time_limit","languages","starter_code","drivers","reference_solution","custom_checker","check"],"properties":{"version":{"type":["integer","null"],"description":"The version's number; null for a draft, which is numbered when published."},"state":{"type":"string","enum":["draft","checking","published","rejected"],"description":"draft: being edited. checking: the reference check is running. published: it can be submitted to once it is the current version. rejected: the check failed; its number is not reused."},"created":{"type":"string","format":"date-time"},"published":{"type":["string","null"],"format":"date-time"},"statement":{"type":"string"},"tests":{"type":"array","items":{"type":"object","required":["name","input_bytes","input_sha256","expected_output_bytes","expected_output_sha256","hidden","weight","time_limit"],"properties":{"name":{"type":"string"},"input_bytes":{"type":"integer","minimum":0,"description":"The input's size in UTF-8 bytes."},"input_sha256":{"type":"string","pattern":"^[0-9a-f]{64}$","description":"The SHA-256 of the input's UTF-8 bytes, in lowercase hex."},"expected_output_bytes":{"type":"integer","minimum":0,"description":"The expected output's size in UTF-8 bytes."},"expected_output_sha256":{"type":"string","pattern":"^[0-9a-f]{64}$","description":"The SHA-256 of the expected output's UTF-8 bytes, in lowercase hex."},"hidden":{"type":"boolean"},"weight":{"type":"number"},"time_limit":{"type":["number","null"]}}}},"files":{"type":"array","description":"The version's data files, sorted by name: each file's size in bytes and SHA-256, never its content.","items":{"$ref":"#\/components\/schemas\/ProblemVersionFile"}},"checker":{"type":"string","enum":["trim","exact","tokens","float","rows","table","table_ordered","custom"]},"tolerance":{"type":"number"},"scoring":{"$ref":"#\/components\/schemas\/Scoring"},"time_limit":{"type":"number"},"languages":{"type":"array","items":{"type":"string"}},"starter_code":{"type":"object","additionalProperties":{"type":"string"}},"drivers":{"type":"object","additionalProperties":{"type":"string"}},"reference_solution":{"type":["object","null"]},"custom_checker":{"type":["object","null"]},"check":{"$ref":"#\/components\/schemas\/ProblemCheck"}}},"ProblemListEntry":{"type":"object","required":["problem","slug","title","status","public","version","created","updated","check"],"properties":{"problem":{"type":"string","pattern":"^prob_[A-Za-z0-9]{24}$","description":"The problem's id."},"slug":{"type":["string","null"],"description":"The problem's slug, or null."},"title":{"type":"string"},"status":{"type":"string","enum":["active","archived"],"description":"An archived problem takes no submissions and does not count toward your plan's problem limit; its data still counts."},"public":{"type":"boolean"},"version":{"type":["integer","null"],"description":"The current version's number, or null before the first publish."},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","format":"date-time"},"check":{"type":["object","null"],"required":["version","state"],"properties":{"version":{"type":"integer"},"state":{"type":"string","enum":["checking","published","rejected"]}},"description":"The newest numbered version and its state; null before the first publish."}},"description":"A problem as GET \/api\/problems\/ lists it."},"Problem":{"type":"object","description":"A problem as its owner sees it in GET \/api\/problems\/{problem}\/: the list fields, the draft and the current version in full (every test's data, hidden tests included), and every version without its content.","required":["problem","slug","title","status","public","version","created","updated","check","draft","current","versions"],"properties":{"problem":{"type":"string","pattern":"^prob_[A-Za-z0-9]{24}$","description":"The problem's id."},"slug":{"type":["string","null"],"description":"The problem's slug, or null."},"title":{"type":"string"},"status":{"type":"string","enum":["active","archived"],"description":"An archived problem takes no submissions and does not count toward your plan's problem limit; its data still counts."},"public":{"type":"boolean"},"version":{"type":["integer","null"],"description":"The current version's number, or null before the first publish."},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","format":"date-time"},"check":{"type":["object","null"],"required":["version","state"],"properties":{"version":{"type":"integer"},"state":{"type":"string","enum":["checking","published","rejected"]}},"description":"The newest numbered version and its state; null before the first publish."},"draft":{"anyOf":[{"$ref":"#\/components\/schemas\/ProblemVersion"},{"type":"null"}],"description":"The draft, or null when there is none."},"current":{"anyOf":[{"$ref":"#\/components\/schemas\/ProblemVersion"},{"type":"null"}],"description":"The version submissions are judged against, or null before the first publish."},"versions":{"type":"array","items":{"type":"object","required":["version","state","created","published","check"],"properties":{"version":{"type":["integer","null"]},"state":{"type":"string","enum":["draft","checking","published","rejected"]},"created":{"type":"string","format":"date-time"},"published":{"type":["string","null"],"format":"date-time"},"check":{"$ref":"#\/components\/schemas\/ProblemCheck"}}},"description":"The draft first, then the numbered versions, newest first."}}},"ProblemChanged":{"type":"object","description":"What creating a problem, PATCH, the draft writes (PUT draft, the test-input and data-file uploads, and a data file's DELETE), archive and restore answer: the problem as GET shows it, except that the draft and the current version give each test's size and SHA-256 in place of its input and expected output, so a write never sends your test data back. GET \/api\/problems\/{problem}\/ has the test data. Data files are listed by name, size and SHA-256 in both, never with their content.","required":["problem","slug","title","status","public","version","created","updated","check","draft","current","versions"],"properties":{"problem":{"type":"string","pattern":"^prob_[A-Za-z0-9]{24}$","description":"The problem's id."},"slug":{"type":["string","null"],"description":"The problem's slug, or null."},"title":{"type":"string"},"status":{"type":"string","enum":["active","archived"],"description":"An archived problem takes no submissions and does not count toward your plan's problem limit; its data still counts."},"public":{"type":"boolean"},"version":{"type":["integer","null"],"description":"The current version's number, or null before the first publish."},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","format":"date-time"},"check":{"type":["object","null"],"required":["version","state"],"properties":{"version":{"type":"integer"},"state":{"type":"string","enum":["checking","published","rejected"]}},"description":"The newest numbered version and its state; null before the first publish."},"draft":{"anyOf":[{"$ref":"#\/components\/schemas\/ProblemVersionChanged"},{"type":"null"}],"description":"The draft, or null when there is none."},"current":{"anyOf":[{"$ref":"#\/components\/schemas\/ProblemVersionChanged"},{"type":"null"}],"description":"The version submissions are judged against, or null before the first publish."},"versions":{"type":"array","items":{"type":"object","required":["version","state","created","published","check"],"properties":{"version":{"type":["integer","null"]},"state":{"type":"string","enum":["draft","checking","published","rejected"]},"created":{"type":"string","format":"date-time"},"published":{"type":["string","null"],"format":"date-time"},"check":{"$ref":"#\/components\/schemas\/ProblemCheck"}}},"description":"The draft first, then the numbered versions, newest first."}}},"ProblemPublicView":{"type":"object","description":"The current version as a candidate's page shows it. A hidden test appears only in hidden_tests and total_tests; drivers, the reference solution, checker code and the check record are never in it.","required":["problem","title","version","statement","languages","starter_code","checker","scoring","time_limit","tests","hidden_tests","total_tests"],"properties":{"problem":{"type":"string","pattern":"^prob_[A-Za-z0-9]{24}$"},"title":{"type":"string"},"version":{"type":"integer"},"statement":{"type":"string"},"languages":{"type":"array","items":{"type":"string"}},"starter_code":{"type":"object","additionalProperties":{"type":"string"}},"checker":{"type":"string","description":"The checker's name only."},"scoring":{"$ref":"#\/components\/schemas\/Scoring"},"time_limit":{"type":"number"},"tests":{"type":"array","description":"The visible tests (the samples).","items":{"type":"object","properties":{"name":{"type":"string"},"input":{"type":"string"},"expected_output":{"type":"string"},"time_limit":{"type":["number","null"]}}}},"hidden_tests":{"type":"integer"},"total_tests":{"type":"integer"}}},"ProblemSubmissionRequest":{"type":"object","required":["compiler","code"],"description":"A submission to a stored problem. The tests, checker, scoring and limits come from the problem's current version, so there are none here. The judge options of POST \/api\/run-tests\/ (async, callback_url, external_ref, metadata) and the Idempotency-Key header work the same.","properties":{"compiler":{"$ref":"#\/components\/schemas\/CompilerId"},"code":{"type":"string","description":"The candidate's code, at most 100,000 bytes. If the version has a driver for the compiler, it goes where the driver says ##CODE##."},"mode":{"type":"string","enum":["all","samples"],"default":"all","description":"samples judges only the visible tests, for a candidate to try the code; its receipt says so. A problem with no visible test refuses samples with 400."},"tests":{"type":"array","minItems":1,"uniqueItems":true,"items":{"type":"integer","minimum":1},"description":"Judge only these tests, given as 1-based positions of the version's tests (hidden ones may be chosen and still show only their verdict). The score is over them, the submission's mode is tests and its receipt lists them. Send it without mode or with mode all; with samples the answer is 400. At most as many tests as a submission may run on the plan."},"async":{"type":"boolean","default":false,"description":"As on POST \/api\/run-tests\/. Recommended for a problem with a custom checker."},"callback_url":{"type":"string","format":"uri","maxLength":2000},"external_ref":{"type":"string","maxLength":200},"metadata":{"type":"object"}}},"RejudgeRequest":{"type":"object","additionalProperties":false,"description":"Which submissions to re-judge, and against which version. Every field is optional, and the body may be left out.","properties":{"version":{"type":"integer","minimum":1,"description":"The number of a published version of the problem. Default: the current version. It must be above the version of every chosen submission."},"submissions":{"type":"array","maxItems":100,"uniqueItems":true,"items":{"type":"string","pattern":"^sub_[A-Za-z0-9]{24}$"},"description":"Re-judge only these submissions of the problem, at most 100. One that is not finished yet, failed, was already re-judged against the version, lost its code or ran in a language the version does not allow is skipped with its reason. Default: every candidate, oldest first, 100 a call."},"notify":{"type":"boolean","default":false,"description":"Send each re-judge's signed webhook to the callback URL of the submission it re-judges, if that had one. Default: no webhook."}}},"RejudgeResult":{"type":"object","required":["version","queued","skipped","remaining"],"description":"What a re-judge call queued and skipped.","properties":{"version":{"type":"integer","minimum":1,"description":"The version the submissions are re-judged against."},"queued":{"type":"array","description":"The re-judges queued, oldest original first.","items":{"type":"object","required":["submission","rejudge_of"],"properties":{"submission":{"type":"string","pattern":"^sub_[A-Za-z0-9]{24}$","description":"The new submission, queued like any async submission."},"rejudge_of":{"type":"string","pattern":"^sub_[A-Za-z0-9]{24}$","description":"The earlier submission it re-judges."}}}},"skipped":{"type":"array","description":"Submissions not re-judged, each with its reason: the chosen ones first, in the order sent, then the candidates this call reached and skipped. A skipped candidate with no re-judge is reached again by the next call.","items":{"type":"object","required":["submission","reason"],"properties":{"submission":{"type":"string","pattern":"^sub_[A-Za-z0-9]{24}$"},"reason":{"type":"string","description":"code not kept (the code is no longer stored, or cannot be told apart from the driver it ran in); language not allowed in version N; already re-judged against version N (rejudge names that re-judge); not finished yet; failed, not judged; or, rarely, the refusal a new submission in its language would get."},"rejudge":{"type":"string","pattern":"^sub_[A-Za-z0-9]{24}$","description":"With already re-judged against version N: that re-judge, whose result is the one to read."}}}},"remaining":{"type":"integer","minimum":0,"description":"How many candidates this call did not reach: those past the 100 a call takes, and those left when the account's queue had no room. Skipped submissions are not counted. Call again for them."}}},"PublishResult":{"type":"object","required":["problem","version","state"],"description":"The outcome of publishing a draft.","properties":{"problem":{"type":"string","pattern":"^prob_[A-Za-z0-9]{24}$"},"version":{"type":"integer","minimum":1,"description":"The number the draft was given."},"state":{"type":"string","enum":["published","checking"],"description":"published: it is the current version now (200). checking: its reference check is queued (202)."},"warnings":{"type":"array","items":{"type":"string"},"description":"With state published: No reference solution: the expected outputs were not checked."},"check":{"type":"string","pattern":"^sub_[A-Za-z0-9]{24}$","description":"With state checking: the reference check's submission. GET \/api\/problems\/{problem} shows how it went."}}},"ProblemList":{"type":"object","required":["problems"],"properties":{"problems":{"type":"array","items":{"$ref":"#\/components\/schemas\/ProblemListEntry"}}},"description":"The account's problems, newest first."},"ProblemSessionRequest":{"type":"object","required":["external_ref"],"description":"A new submit session on the problem's current published version.","properties":{"external_ref":{"type":"string","maxLength":200,"description":"Your own reference for the candidate or attempt. Every submission made under the session carries it in its receipt and webhook. Required."},"metadata":{"type":"object","description":"Up to 4 KB of JSON you want back on every webhook for the session's submissions."},"callback_url":{"type":"string","format":"uri","maxLength":2000,"description":"Where the signed webhook of each Submit goes. Without it the webhook of the API key that created the session is used."},"expires_in":{"type":"integer","minimum":60,"maximum":86400,"default":3600,"description":"Seconds the session stays open, from 60 (one minute) to 86,400 (24 hours)."},"max_submits":{"type":"integer","minimum":1,"maximum":20,"default":1,"description":"How many Submits the session takes, from 1 to 20."},"share_receipts":{"type":"boolean","default":true,"description":"Whether each Submit's signed receipt is shared: public at https:\/\/onlinecompiler.io\/r\/{receipt} to anyone with the link, as POST \/api\/submissions\/{submission_id}\/share\/ makes it, so the widget can link to it. A shared receipt shows external_ref and your account reference, never the code, tests or output. Send false to keep the receipts private; the widget then shows no receipt link."}}},"ProblemSession":{"type":"object","description":"A submit session as its owner sees it. It never holds the token.","required":["session","problem","version","external_ref","metadata","callback_url","max_submits","share_receipts","submits_used","expires","revoked","created","submissions"],"properties":{"session":{"type":"string","description":"The session's id, pss_ and 24 characters.","example":"pss_Qm4Tn8Vx2Kb7Hc3Ld9Wz5Ey1"},"problem":{"type":"string","description":"The problem's id."},"version":{"type":"integer","description":"The problem version the session is pinned to: the current one when the session was created. Publishing a newer version later does not change it."},"external_ref":{"type":"string","maxLength":200},"metadata":{"type":["object","null"]},"callback_url":{"type":"string","description":"Empty when the API key's own webhook is used."},"max_submits":{"type":"integer"},"share_receipts":{"type":"boolean","description":"Whether the receipts of Submits made under the session are shared (public by link)."},"submits_used":{"type":"integer","description":"Submits counted so far. A Submit refused after it was counted, or one that failed on our side, is given back."},"expires":{"type":"string","format":"date-time"},"revoked":{"type":["string","null"],"format":"date-time","description":"When the session was revoked, or null."},"created":{"type":"string","format":"date-time"},"submissions":{"type":"array","items":{"type":"string"},"description":"The ids of the submissions made under the session, oldest first. Read each with GET \/api\/submissions\/{submission_id}\/."}}},"ProblemSessionCreated":{"type":"object","description":"A new session: a ProblemSession plus the token, which is shown only in this answer.","required":["session","problem","version","external_ref","metadata","callback_url","max_submits","share_receipts","submits_used","expires","revoked","created","submissions","token"],"properties":{"session":{"type":"string","description":"The session's id, pss_ and 24 characters.","example":"pss_Qm4Tn8Vx2Kb7Hc3Ld9Wz5Ey1"},"problem":{"type":"string","description":"The problem's id."},"version":{"type":"integer","description":"The problem version the session is pinned to: the current one when the session was created. Publishing a newer version later does not change it."},"external_ref":{"type":"string","maxLength":200},"metadata":{"type":["object","null"]},"callback_url":{"type":"string","description":"Empty when the API key's own webhook is used."},"max_submits":{"type":"integer"},"share_receipts":{"type":"boolean","description":"Whether the receipts of Submits made under the session are shared (public by link)."},"submits_used":{"type":"integer","description":"Submits counted so far. A Submit refused after it was counted, or one that failed on our side, is given back."},"expires":{"type":"string","format":"date-time"},"revoked":{"type":["string","null"],"format":"date-time","description":"When the session was revoked, or null."},"created":{"type":"string","format":"date-time"},"submissions":{"type":"array","items":{"type":"string"},"description":"The ids of the submissions made under the session, oldest first. Read each with GET \/api\/submissions\/{submission_id}\/."},"token":{"type":"string","pattern":"^pst_[A-Za-z0-9]{32}$","description":"Give this to the candidate's page as the widget's data-session. It is shown once and stored only as a hash, so it cannot be read again; create a new session if it is lost."}}},"SubmissionListEntry":{"type":"object","required":["submission","status","created","finished","external_ref","metadata","problem","mode","rejudge_of","verdict","score","passed","total","error"],"properties":{"submission":{"type":"string","pattern":"^sub_[A-Za-z0-9]{24}$","description":"The submission's id."},"status":{"type":"string","enum":["queued","running","finished","failed"],"description":"queued while it waits in the account's queue, running while it is judged, finished when it was judged whatever its verdict, failed when it was not judged (see error): for example its API key was deleted, or not every test could start in time."},"created":{"type":"string","format":"date-time","description":"When the request was accepted, UTC, in seconds, like 2026-11-03T09:14:22Z."},"finished":{"type":["string","null"],"format":"date-time","description":"When it finished or failed, in the same form; null until then."},"external_ref":{"type":["string","null"],"maxLength":200,"description":"The request's external_ref, or null."},"metadata":{"type":["object","null"],"description":"The request's metadata, or null."},"problem":{"type":["object","null"],"required":["id","version"],"properties":{"id":{"type":"string","pattern":"^prob_[A-Za-z0-9]{24}$","description":"The stored problem's id."},"version":{"type":"integer","minimum":1,"description":"The number of the version it was judged against."}},"description":"The stored problem and version a POST \/api\/problems\/{id}\/submissions submission was judged against; null for POST \/api\/run-tests\/."},"mode":{"type":["string","null"],"enum":["all","samples","tests",null],"description":"Which of a stored problem's tests it ran: all of them, only the sample (visible) tests, or the ones chosen with `tests`. Null for a plain run-tests submission, which has no stored problem. Problem statistics count only `all`."},"rejudge_of":{"type":["string","null"],"pattern":"^sub_[A-Za-z0-9]{24}$","description":"The id of the earlier submission this one re-judges against a newer version of the problem, or null."},"verdict":{"oneOf":[{"$ref":"#\/components\/schemas\/OverallVerdict"},{"type":"null"}],"description":"The result's overall verdict once it has finished; null until then and for a failed one."},"score":{"type":["number","null"],"minimum":0,"maximum":100,"description":"The result's score from 0 to 100 once it has finished; null until then."},"passed":{"type":["integer","null"],"minimum":0,"description":"Tests accepted, hidden ones included; null until it has finished."},"total":{"type":["integer","null"],"minimum":0,"description":"Tests in the submission; null until it has finished."},"error":{"type":["string","null"],"description":"Why a failed submission was not judged; null otherwise."}},"description":"A submission in a list: what GET \/api\/submissions\/{submission_id}\/ answers without result, receipt, checker_log and hash_salt, plus the result's verdict, score, passed and total. Fetch one by its id for its tests and receipt."},"SubmissionList":{"type":"object","required":["submissions","next_cursor"],"properties":{"submissions":{"type":"array","maxItems":100,"items":{"$ref":"#\/components\/schemas\/SubmissionListEntry"},"description":"Newest first."},"next_cursor":{"type":["string","null"],"description":"Pass it as cursor for the next page, with the same filters; null on the last page."}},"description":"A page of the account's submissions."},"GuestRunRequest":{"type":"object","description":"A run without an API key: only these four fields. files, args and memory_limit need a key.","required":["compiler","code"],"additionalProperties":false,"properties":{"compiler":{"$ref":"#\/components\/schemas\/CompilerId"},"code":{"type":"string","description":"The program's source, up to 100 KB of UTF-8."},"input":{"type":"string","description":"Standard input, up to 64 KB for a guest run."},"time_limit":{"type":"number","exclusiveMinimum":0,"maximum":5,"description":"Seconds the program may run, at most 5 for a guest run (the default)."}}},"GuestRunResult":{"allOf":[{"$ref":"#\/components\/schemas\/RunResult"},{"type":"object","required":["guest"],"properties":{"guest":{"type":"object","required":["runs_left_this_hour","runs_per_hour","get_a_key"],"properties":{"runs_left_this_hour":{"type":"integer","minimum":0,"description":"Guest runs this caller has left in the current hour."},"runs_per_hour":{"type":"integer","minimum":1,"description":"Guest runs a caller gets an hour, per IPv4 address or IPv6 \/64."},"get_a_key":{"type":"string","format":"uri","description":"Where to get a free API key."}}}}}]}},"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, a bad run-tests option or Idempotency-Key, NUL in any string of an async run-tests body, or a key with no usable callback URL (for \/api\/run-code\/, and for async run-tests without callback_url when the key's URL can never receive results).","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"}},"external_ref":{"summary":"run-tests external_ref too long","value":{"error":"external_ref must be text of at most 200 characters"}},"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, and their answer has a Retry-After header with the seconds to wait before sending the request again. Where a paid plan raises the limit (per minute, pending, runs at once), the message names it with a link. For an async run-tests request, the per-minute and pending limits only pace when queued work starts, so a burst waits in the account's queue instead. It is refused when it has more tests than the per-minute limit (it could never start), when the queue is full (10 times the plan's pending limit in queued submissions, or 64 MB of queued request data), or when the month's allowance or the key's cap cannot cover its tests together with the tests already queued.","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 4 at once). Please try again shortly. Starter allows 8 runs at once: https:\/\/api.onlinecompiler.io\/billing\/?plan=starter"}},"host":{"summary":"The host's sandboxes are busy","value":{"error":"Too many concurrent requests. Please try again shortly."}},"queue":{"summary":"The async queue is full (run-tests)","value":{"error":"Too many queued submissions for this account (limit 80)."}},"queue_bytes":{"summary":"Too much queued data (run-tests)","value":{"error":"Too much queued data for this account (limit 64 MB). Wait for queued submissions to finish."}}}}},"headers":{"Retry-After":{"$ref":"#\/components\/headers\/RetryAfter"}}},"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"}}}}}}},"headers":{"RetryAfter":{"description":"Seconds to wait before sending the refused request again (RFC 9110). Sent with every 429 that waiting can lift: the per-minute limit (until the last minute's runs leave room), the pending limit, the runs at once and busy sandboxes (1), and a full async queue (10). Not sent when waiting won't help: a spent monthly allowance or key cap, a request with more runs than its plan allows in a minute (it can never start).","schema":{"type":"integer","minimum":1},"example":1}}}}