---
name: "xpay-code-runner-execute-code"
description: "Execute JavaScript or Python code securely with comprehensive error handling and security measures"
version: "1.0.0"
price: "$0.01/call"
provider: "Code Runner"
---

# Execute Code

Execute JavaScript or Python code securely with comprehensive error handling and security measures

**Provider:** Code Runner
**Price:** $0.01/call
**Pricing model:** Flat rate per call

## When to Use

Use this tool when you need to execute javascript or python code securely with comprehensive error handling and security measures. This is part of the Code Runner provider on xpay✦.

## MCP Connection

Connect to xpay✦ to access this tool (and 3+ others):

```json
{
  "mcpServers": {
    "xpay": {
      "url": "https://mcp.xpay.sh/mcp?key=YOUR_API_KEY"
    }
  }
}
```

For Claude Code:
```bash
claude mcp add --transport http xpay "https://mcp.xpay.sh/mcp?key=YOUR_API_KEY"
```

## How to Execute

Use the xpay✦ meta-tools to run this tool:

1. **`xpay_details`** — Get full input schema: `xpay_details("code-runner/execute_code")`
2. **`xpay_run`** — Execute: `xpay_run("code-runner/execute_code", { ...inputs })`

## Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `input` | string | No | Input data for the program (stdin) |
| `language` | string | Yes | Programming language to execute |
| `memoryLimit` | number | No | Memory limit in MB (max 512) |
| `code` | string | Yes | Code to execute |
| `enableNetworking` | boolean | No | Enable network access for this execution |
| `timeout` | number | No | Execution timeout in milliseconds (max 60000) |

## Pricing

- **Cost:** $0.01/call
- **Balance check:** Use `xpay_balance` to check remaining credits
- Get your API key at [xpay.tools](https://xpay.tools/account/settings/api-keys/) — $5 free credits included

## Related Skills

- [Code Runner (all tools)](https://xpay.tools/skills/code-runner/SKILL.md) — 4 tools
- [Execute Code With Variables](https://xpay.tools/skills/code-runner/execute-code-with-variables/SKILL.md) — $0.01/call
- [Get Capabilities](https://xpay.tools/skills/code-runner/get-capabilities/SKILL.md) — $0.01/call
- [Validate Code](https://xpay.tools/skills/code-runner/validate-code/SKILL.md) — $0.01/call

## Links

- Tool page: https://xpay.tools/code-runner/execute-code/
- Provider: https://xpay.tools/code-runner/
- All tools: https://xpay.tools/explore
