# Judge0 Submit Code (Async)

> Judge0 Submit Code (Async) is a paid API for AI agents from Judge0 at judge0.mpp.paywithlocus.com, paid per call via MPP, $0.006/call, status unknown (last checked 2026-10-10, last successful call 2026-06-10).

Asynchronously submits source code for sandboxed execution in 60+ programming languages and returns a token to retrieve the result

## Facts

- Endpoint: POST https://judge0.mpp.paywithlocus.com/judge0/submit-code?utm_source=zero.xyz
- Price: $0.006/call
- Payment: MPP
- Status: unknown
- Last checked: 2026-10-10
- Last successful call: 2026-06-10
- Success rate: 100% of calls made through Zero
- Rating: 5.0 / 5 from 1 review
- Activations on Zero: 2
- Provider: Judge0
- Docs: https://ce.judge0.com
- Website: https://judge0.com
- Tags: code-execution, sandbox, programming-languages, compute
- Canonical page: https://www.zero.xyz/c/judge0-submit-code-b2f2a925
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_N1DNal15OFjMZHPsTKG-_

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability judge0-submit-code-b2f2a925 -d '<json body>'
```

Example prompt: Run this Python 3 code asynchronously in a sandbox and give me back the submission token so I can check the result: the code reads two integers from stdin and prints their sum, with stdin set to '5\n3\n' and expected output '8'.

## When to prefer this

Use this endpoint when you need asynchronous code execution and will poll for the result separately using the returned token — ideal for longer-running programs, batch workflows, or when you want to decouple submission from result retrieval. Prefer the synchronous Execute Code endpoint when you need an immediate response in a single call.

## Known failure modes

- Invalid language_id returns 422 Unprocessable Entity
- Missing required source_code field returns 400 Bad Request
- Code exceeds cpu_time_limit results in Time Limit Exceeded status on retrieval
- Code exceeds memory_limit results in Memory Limit Exceeded status on retrieval
- Compilation errors are captured and returned as compiler output on retrieval
- Network errors or sandbox unavailability return 5xx errors

## How this service works

Submit code for asynchronous execution. Returns a token immediately — use get-submission to poll for results. Use this instead of execute-code for long-running programs that may time out.

## Output

Returns a JSON object with a submission token (UUID string) that can be used with the Get Submission endpoint to poll for execution results including stdout, stderr, status, and timing/memory metrics.

## Example request

```json
{
 "stdin": "5 3",
 "language_id": "71",
 "source_code": "print(sum(map(int, input().split())))",
 "expected_output": "8"
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "source_code",
  "language_id"
 ],
 "properties": {
  "stdin": {
   "type": "string",
   "description": "Standard input for the program"
  },
  "language_id": {
   "type": "integer",
   "description": "Language ID (e.g., 71 for Python 3, 63 for JavaScript, 54 for C++, 62 for Java). Use list-languages to find IDs."
  },
  "source_code": {
   "type": "string",
   "description": "Program source code to execute"
  },
  "stack_limit": {
   "type": "number",
   "description": "Stack size limit in kilobytes"
  },
  "memory_limit": {
   "type": "number",
   "description": "Memory limit in kilobytes"
  },
  "cpu_time_limit": {
   "type": "number",
   "description": "CPU time limit in seconds (default: instance-dependent)"
  },
  "enable_network": {
   "type": "boolean",
   "description": "Allow network access inside the sandbox"
  },
  "expected_output": {
   "type": "string",
   "description": "Expected output — if provided, status will indicate whether output matches"
  },
  "wall_time_limit": {
   "type": "number",
   "description": "Wall clock time limit in seconds"
  },
  "compiler_options": {
   "type": "string",
   "description": "Compiler flags (max 512 chars, e.g., \"-O2 -Wall\")"
  },
  "command_line_arguments": {
   "type": "string",
   "description": "Command-line arguments passed to the program (max 512 chars)"
  },
  "redirect_stderr_to_stdout": {
   "type": "boolean",
   "description": "Redirect stderr to stdout in the output"
  }
 },
 "additionalProperties": true
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/judge0-submit-code-b2f2a925/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from judge0.mpp.paywithlocus.com](https://www.zero.xyz/host/judge0.mpp.paywithlocus.com/llms.txt)
