canonical: https://jentic.com/apis/judge0.com/judge0

# Judge0 CE API

Judge0 CE is an open-source online code execution system that compiles and runs source code in over 60 programming languages inside resource-limited sandboxes. The API exposes endpoints to create single or batch submissions, configure resource limits (CPU time, memory, output size), poll for completion, and inspect the available languages and statuses. It is the right tool when an education platform, coding-interview product, or AI agent needs to safely execute untrusted code and capture stdout, stderr, and runtime metrics.

## For AI agents

Submit code in 60+ languages to Judge0's sandboxed execution engine, configure resource limits, poll for results, and inspect supported languages and runtime statuses for coding-interview or education workflows.

## Scope

Does not handle source repository hosting, full IDE features, or persistent file storage between runs - use for one-shot sandboxed code execution and result retrieval only.

## Capabilities

- Submit source code with stdin and resource limits for sandboxed execution
- Create batch submissions to run a suite of test cases in one request
- Poll a submission token for stdout, stderr, and runtime metrics
- List the active programming languages and their version metadata
- Inspect the set of submission statuses (Accepted, Wrong Answer, etc.)
- Retrieve system info, configuration, statistics, and worker status for monitoring

## Use cases

### Coding-interview platform back-end

Coding-interview products that present candidates with problems can use Judge0 to safely execute and grade submissions. POST /submissions takes the candidate's source plus the test stdin and expected stdout, and the response token can be polled with GET `/submissions/{token}` for the verdict. Resource limits prevent runaway code from impacting other tenants. Batch submissions handle full test suites in a single round-trip.

Example prompt: Call POST `/submissions/batch` with the candidate's solution against 10 test cases, then poll GET `/submissions/batch` with the returned tokens until each has a status

### Education platform code runner

Online learning platforms can embed a code-runner widget that calls Judge0 each time a student clicks 'Run'. The submission specifies language, source, and stdin; the response captures stdout, stderr, and exit metrics. GET /languages drives the language picker so the widget always shows the currently active runtime versions. Per-student submission rates are kept low by debouncing the run button.

Example prompt: On the student's Run click, call POST /submissions with language_id=71 (Python), the editor source, and the lesson's stdin; poll the token for stdout

### AI assistant code execution

AI coding assistants that draft code can verify their output by executing it in Judge0 before returning to the user. The assistant generates a snippet, submits it to Judge0, captures the runtime result, and self-corrects if the output diverges from the expected stdout. This converts a static suggestion into a verified, executable answer.

Example prompt: After generating a Python solution, call POST /submissions with the source and expected stdin, poll for stdout, and re-prompt if stdout does not match

### Sandboxed execution via Jentic

When an agent needs sandboxed execution as a tool, Jentic exposes Judge0 without leaking its API key into the prompt. The agent calls Jentic with a 'run code' intent, Jentic resolves to POST /submissions, injects the X-Auth-Token and X-Auth-User headers, and returns the submission token. The agent then asks Jentic for the result - keeping the credential entirely outside the agent's reasoning context.

Example prompt: Use Jentic to search 'submit code to Judge0', load POST /submissions, execute with the snippet, then call GET `/submissions/{token}` for the result

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | `/submissions` | Create a single code submission |
| GET | `/submissions/{token}` | Get a single submission's result |
| POST | `/submissions/batch` | Create a batch of submissions |
| GET | `/submissions/batch` | Get batch submission results |
| DELETE | `/submissions/{token}` | Delete a submission |
| GET | `/languages` | List active languages |
| GET | `/statuses` | List submission statuses |
| GET | `/system_info` | Get system info |

## Key resources

- **Submissions** — Create, poll, and delete single or batch code submissions
- **Languages** — List active and historical programming language runtimes
- **Statuses** — Inspect the catalogue of submission outcome statuses
- **System** — System info, config, statistics, workers, and version endpoints

## Why Jentic

- **Setup:** Wiring the Judge0 CE API by hand means learning its X-Auth-Token and X-Auth-User headers, encoding source submissions, and polling by token for results yourself. Through Jentic you install once, import the Judge0 CE API from the API Directory, store the keys once, and your agent calls it.
- **Permission scoping:** Judge0 puts the submission token in the URL path (`/submissions/{token}`), so a rule can pin your agent to one submission: it can fetch the result for that token and nothing else. You choose the operations it may call, so ones like deleting a submission are not included unless you add them.
- **Credential handling:** Your Judge0 X-Auth-Token and X-Auth-User keys are stored once, encrypted, by your own Jentic One instance and injected at execution time. They never enter the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'run code in a sandbox' or 'submit a Judge0 batch', and Jentic returns the matching Judge0 operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **HackerEarth API** — Hosted code-execution and assessment platform with broader interview tooling
- **Codeforces API** — Competitive programming problem and contest data - pair with Judge0 to grade attempts
- **Replicate API** — Runs containerised models and code; broader scope than Judge0's submission model

## FAQ

### What authentication does the Judge0 CE API use?

Public Judge0 CE instances may accept anonymous calls, but production hosts use X-Auth-Token and optionally X-Auth-User headers as API keys. Jentic stores both keys encrypted and injects the headers at request time so the credentials never enter the agent's prompt.

### How many programming languages does Judge0 support?

Judge0 CE supports 60+ programming languages and runtimes - call GET /languages to retrieve the active set with their version metadata, or GET `/languages/all` to include historical entries that may be archived.

### What are the rate limits for Judge0?

ce.judge0.com is the public community instance and applies per-IP throttling that is not documented as a fixed number. For predictable throughput, self-host Judge0 or use the RapidAPI tier which publishes explicit per-second and per-day limits.

### How do I run a code snippet through Jentic?

Search Jentic for 'submit code to Judge0', load POST /submissions, and execute with language_id and source_code. Jentic injects the X-Auth-Token. Then load GET `/submissions/{token}` to poll the result. Get started with Jentic One, the self-hosted execution layer.

### Can I run multiple test cases in one request?

Yes. POST `/submissions/batch` accepts an array of submissions and returns an array of tokens. Use GET `/submissions/batch` with a comma-separated token list to fetch the results in one request - this is the right shape for grading a candidate against a full test suite.

### How do I configure resource limits on a submission?

POST /submissions accepts cpu_time_limit, wall_time_limit, memory_limit, stack_limit, and max_file_size fields per submission. Set conservative limits (e.g., 2 seconds CPU, 256 MB memory) for untrusted code so a runaway snippet can't impact other tenants on a shared instance.

### Can I limit what my agent is allowed to do with the Judge0 CE API?

Yes. Because you run Jentic One yourself, your own rules decide which Judge0 operations and credentials the agent may use, so you can allow POST /submissions and GET `/submissions/{token}` while leaving DELETE `/submissions/{token}` out entirely. Since the submission token sits in the URL path, a rule can pin the agent to a single token, letting it fetch that one result and nothing else. Only the operations you explicitly grant are callable.
