# Code Execution API
> Compile and run code in 35+ programming languages from a single API call — no key, no container to manage. Send source code plus an optional stdin, compiler options and runtime arguments, pick a language (python, c++, java, go, rust, c#, javascript, typescript, ruby, php, kotlin, swift, haskell, and more) or an explicit compiler version, and get back the exit code, stdout, stderr and compiler messages. List every supported language with its default compiler, browse the full compiler catalogue (175+ compilers across versions) and filter it by language. Set save=true to also get a shareable permlink. Execution runs in a sandboxed upstream and is always live (never cached). 4 endpoints, backed by the public Wandbox service. Built for online IDEs, coding-education platforms, automated grading, interview tools and "run this snippet" features. No upstream key, no cache.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/codeexec-api/..."
```

## Pricing
- **Free** (Free) — 2,100 calls/Mo, 2 req/s
- **Starter** ($9/Mo) — 46,000 calls/Mo, 8 req/s
- **Pro** ($30/Mo) — 235,000 calls/Mo, 20 req/s
- **Mega** ($64/Mo) — 1,260,000 calls/Mo, 50 req/s

## Endpoints

### Execute

#### `GET /v1/run` — Compile + run code

**Parameters:**
- `language` (query, required, string) — Language (e.g. python, c++, go, rust, java) — or pass compiler Example: `python`
- `code` (query, required, string) — Source code Example: `print(sum(range(10)))`
- `stdin` (query, optional, string) — Standard input
- `options` (query, optional, string) — Wandbox option set (comma-separated)
- `compiler` (query, optional, string) — Explicit compiler name (overrides language)
- `args` (query, optional, string) — Runtime arguments (raw, newline-separated)
- `save` (query, optional, string) — true → also return a shareable permlink

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/codeexec-api/v1/run?language=python&code=print%28sum%28range%2810%29%29%29"
```

**Response:**
```json
{
    "data": {
        "signal": null,
        "stderr": "",
        "stdout": "",
        "compiler": "pypy-3.10-v7.3.17",
        "permlink": null,
        "exit_code": 126,
        "permlink_url": null,
        "compiler_error": "Error: OCI runtime error: crun: clone: Resource temporarily unavailable\n",
        "compiler_message": "Error: OCI runtime error: crun: clone: Resource temporarily unavailable\n"
    },
    "meta": {
        "timestamp": "2026-06-02T16:53:08.261Z",
        "request_id": "5adfc684-2d18-4d5c-817e-dfc821c7294d"
    },
    "status": "ok",
    "message": "Compile + run code",
    "success": true
}
```

### Catalogue

#### `GET /v1/compilers` — Compiler list

**Parameters:**
- `language` (query, optional, string) — Filter by language

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/codeexec-api/v1/compilers"
```

**Response:**
```json
{
    "data": {
        "count": 175,
        "compilers": [
            {
                "name": "gcc-head-c",
                "version": "17.0.0 20260513 (experimental)",
                "language": "C"
            },
            {
                "name": "gcc-13.2.0-c",
                "version": "13.2.0",
                "language": "C"
            },
            {
                "name": "gcc-12.3.0-c",
                "version": "12.3.0",
                "language": "C"
            },
            {
                "name": "gcc-11.4.0-c",
                "version": "11.4.0",
                "language": "C"
            },
            {
                "name": "gcc-10.5.0-c",
                "version": "10.5.0",
                "language": "C"
            },
            {
                "name": "gcc-9.3.0-c",
                "version": "9.3.0",
                "language": "C"
            },
            {
                "name": "gcc-8.4.0-c",
                "version": "8.4.0",
                "language": "C"
            },
            {
                "name": "gcc-7.5.0-c",
                "version": "7.5.0",
                "language": "C"
            },
            {
                "name": "gcc-6.5.0-c",
                "version": "6.5.0",
                "language": "C"
            },
            {
                "name": "gcc-head-pp",
                "version": "17.0.0 20260513 (experimental)",
                "language": "CPP"
            },
            {
      
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/languages` — Supported languages

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/codeexec-api/v1/languages"
```

**Response:**
```json
{
    "data": {
        "count": 35,
        "languages": [
            {
                "language": "Bash script",
                "versions": 1,
                "default_compiler": "bash"
            },
            {
                "language": "C",
                "versions": 14,
                "default_compiler": "clang-head-c"
            },
            {
                "language": "C#",
                "versions": 4,
                "default_compiler": "dotnetcore-8.0.402"
            },
            {
                "language": "C++",
                "versions": 14,
                "default_compiler": "clang-head"
            },
            {
                "language": "CPP",
                "versions": 2,
                "default_compiler": "clang-head-pp"
            },
            {
                "language": "Crystal",
                "versions": 1,
                "default_compiler": "crystal-1.13.3"
            },
            {
                "language": "D",
                "versions": 3,
                "default_compiler": "dmd-2.109.1"
            },
            {
                "language": "Elixir",
                "versions": 2,
                "default_compiler": "elixir-1.17.3"
            },
            {
                "language": "Erlang",
                "versions": 3,
                "default_compiler": "erlang-27.1"
            },
            {
                "language": "Go",
                "versions": 5,
                "default_compiler"
…(truncated, see openapi.json for full schema)
```

### Meta

#### `GET /v1/meta` — Spec

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/codeexec-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "auth": "none upstream; this gateway requires x-api-key",
        "name": "Code Execution API",
        "note": "Compile and run code in 35+ languages. Pass ?language= (e.g. python, c++, go, rust, java) or an explicit ?compiler= (see /v1/compilers), with code, optional stdin, options, compiler_options and args. Returns exit_code, stdout, stderr and compiler messages. Set save=true for a shareable permlink. Execution is live and never cached.",
        "source": "Wandbox (wandbox.org) — public compile/run, no key",
        "endpoints": 4
    },
    "meta": {
        "timestamp": "2026-06-02T16:53:08.581Z",
        "request_id": "16032aba-4b32-4901-a7b8-c964d9237cae"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


---
Marketplace page: https://www.oanor.com/api/codeexec-api
OpenAPI spec: https://www.oanor.com/api/codeexec-api/openapi.json
