Know of an official OpenAPI document? Contribute it →
For Agents
Submit source code in 30+ languages for compilation and execution and retrieve output, runtime, memory, and status by submission id.
Use for: Submit a Python script for execution and capture stdout, Run a Java solution against three test inputs and report runtime, Check whether a previous submission has finished compiling, Get the execution result for submission id 'abc-123'
Not supported: Does not handle interview workflow, candidate scoring, or test case management - use for raw code compilation and execution only.
Jentic publishes the only available OpenAPI specification for HackerEarth Code Evaluation API, keeping it validated and agent-ready. The HackerEarth Code Evaluation API v4 compiles and executes source code in 30+ programming languages and returns the run output, runtime, memory usage, and compilation status. Agents submit a code string with the target language, runtime input, and resource limits, then poll for a result by submission id. It is widely used as a remote sandbox for online judges, coding interview platforms, and AI-generated code validation.
Install Jentic One Beta
Jentic One is a self-hosted execution layer for AI agents. It lets your agent call the HackerEarth Code Evaluation API, or any other public or private API you need. You set the rules, the agent never sees your credentials, and every call is logged.
Two steps, two machines. Install the instance in a safe environment, then register your agent from wherever it runs.
Step 1: Jentic One Host machine
# On the machine that will host your Jentic One instance:
curl -fsSL "https://jentic.com/install.sh?src=apis&api=%2Fapis%2Fhackerearth.com%2Fhackerearth" | shStep 2: Agent machine
# On the machine where your agent runs (keep this separate from the instance):
curl -fsSL "https://jentic.com/install.sh?src=apis&api=%2Fapis%2Fhackerearth.com%2Fhackerearth" | sh
jentic register # connects your agent to your Jentic One instanceJentic One is in public beta. The setup above keeps your agent separate from the instance, which is what you want before using real credentials: an agent running as the same OS user as Jentic One can read its stored keys directly. Just evaluating? A single local install is fine to start. See the secure deployment guide for the tiers.
What an agent can do with HackerEarth Code Evaluation API.
Submit source code in over 30 languages including Python, Java, C++, Go, and Rust for compilation
Run user-supplied stdin against submitted code in a sandboxed environment
Configure per-submission CPU time and memory limits
Poll a submission by id to retrieve compile status, run output, and resource metrics
Receive results asynchronously by configuring a callback URL on the submission
Patterns agents use HackerEarth Code Evaluation API for, with concrete tasks.
★ AI-Generated Code Validation
Use HackerEarth as the execution sandbox for code an LLM has just written. The agent posts the generated source plus a test input to /code-evaluation/submissions, polls /code-evaluation/submissions/{id} for completion, and verifies the output matches the expected value before showing it to the user. This is the standard pattern for code-writing agents that want to avoid running untrusted code locally.
POST a Python solution that reads stdin and prints its sum to /code-evaluation/submissions, poll /code-evaluation/submissions/{id} until status is COMPLETED, and confirm the output equals the expected total.
Online Judge for a Learning Platform
Power a coursework grading flow that runs student submissions against hidden test cases. The platform sends each submission to HackerEarth with strict time and memory limits, collects per-test output, and assigns a verdict (accepted, wrong answer, time limit, runtime error). The two-endpoint design keeps the integration small.
Submit a student's C++ solution with a 1-second time limit and 256 MB memory limit, and report the verdict based on the returned status field.
Interview Coding Sandbox
Provide a remote run-button inside an interview platform so candidates can execute code against sample inputs in real time. The platform calls /code-evaluation/submissions on each click, awaits completion, and streams output back to the candidate's editor. The async callback mode avoids blocking polling loops.
POST the candidate's current editor buffer with stdin from the sample test, then GET /code-evaluation/submissions/{id} until completion and stream the output back to the UI.
Agent Discovery Through Jentic
AI coding agents discover the HackerEarth submit and result-fetch operations by searching Jentic with intents like 'execute this python code'. Jentic returns the matching operation with its input schema and the agent posts the source. Credentials stay isolated in your Jentic One instance.
Use Jentic search 'execute python code' to find the HackerEarth submit operation, execute it with a Python source string, and poll the result endpoint until status is COMPLETED.
2 endpoints — jentic publishes the only available openapi specification for hackerearth code evaluation api, keeping it validated and agent-ready.
METHOD
PATH
DESCRIPTION
/code-evaluation/submissions
Submit source code for compilation and execution
/code-evaluation/submissions/{id}
Fetch the result of a code submission by id
/code-evaluation/submissions
Submit source code for compilation and execution
/code-evaluation/submissions/{id}
Fetch the result of a code submission by id
What agents get from Jentic-routed access to this vendor.
Setup
Wiring the HackerEarth Code Evaluation API by hand means setting its client-secret header, submitting code to one endpoint, then polling a second endpoint by submission id yourself. Through Jentic you install once, import the HackerEarth Code Evaluation API from the API Directory, store the client secret once, and your agent calls it.
Permission scoping
The HackerEarth Code Evaluation API only submits code and reads back a result by id, so scope your agent to the operations it needs, such as creating a submission and fetching its status. You choose which of the two operations it may call.
Credential isolation
Your HackerEarth client-secret partner key is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
Intent-based discovery
Agents search Jentic by intent such as 'execute python code' or 'poll a code submission result', and Jentic returns the HackerEarth submit and status operations with their input schemas so the agent calls the right endpoint without browsing the partner docs.
Alternatives and complements available in the Jentic catalogue.
Specific to using HackerEarth Code Evaluation API through Jentic.
Why is there no official OpenAPI spec for HackerEarth Code Evaluation API?
HackerEarth does not publish an OpenAPI specification. Jentic generates and maintains this spec so that AI agents and developers can call HackerEarth Code Evaluation API via structured tooling. It is validated against the live API and kept up to date. Get started with Jentic One, the self-hosted execution layer.
What authentication does the HackerEarth Code Evaluation API use?
Requests must include a client-secret header containing the partner key issued from the HackerEarth developer dashboard. Through Jentic, this secret is stored encrypted in the vault and injected at execution time so the agent never sees the raw key.
Which languages does the HackerEarth Code Evaluation API support?
The v4 API supports over 30 languages including Python 2 and 3, Java, C, C++, C#, Go, Rust, Kotlin, Ruby, JavaScript (Node), TypeScript, PHP, Swift, Scala, and Haskell. The exact identifier list is documented in the HackerEarth language reference and passed in the lang field of the submission body.
How do I submit code and read the result?
POST to /code-evaluation/submissions with the source, lang, input, time_limit, and memory_limit fields. The response returns a submission id. Poll GET /code-evaluation/submissions/{id} until the status field reads COMPLETED, then read the output, time_used, and memory_used fields. To avoid polling, supply a callback URL in the submission body.
What are the rate limits for the HackerEarth Code Evaluation API?
Limits are tied to the partner plan associated with the client-secret. Free trial keys are heavily throttled while paid partner plans receive higher concurrent execution allowances. Check the response headers and your dashboard for current usage versus quota.
How do I use HackerEarth code execution with AI agents through Jentic?
Run pip install jentic, search 'execute python code', and Jentic returns the HackerEarth POST /code-evaluation/submissions operation. Execute it with the source, then call the GET /code-evaluation/submissions/{id} operation until completion.
Can I limit what my agent is allowed to do with the HackerEarth Code Evaluation API?
Yes. Because Jentic One is self-hosted, you run it and your own rules decide which of this API's operations and credentials the agent may use. This API exposes only two operations, submitting code with POST /code-evaluation/submissions and fetching a result by id with GET /code-evaluation/submissions/{id}, so you can allow your agent to poll and read existing results while withholding the ability to create new submissions, or grant both. Your HackerEarth client-secret partner key stays with your Jentic One instance and is injected only for the operations you have permitted.
GET STARTED