---
title: "Run Python or JavaScript code directly in a machine"
method: POST
path: "/smolmachines/v1/machines/{id}/code"
tags: ["Smol Machines"]
---

# Run Python or JavaScript code directly in a machine

`POST /smolmachines/v1/machines/{id}/code`

## Request

- Base URL: `https://api.orthogonal.com/mpp`
- URL: `https://api.orthogonal.com/mpp/smolmachines/v1/machines/{id}/code`
- Auth: none declared
- TypeScript: <https://skmtc.dev/orthogonal/apis/orthogonal-api-marketplace/docs/smolmachines/v1/machines/:id/code/post.ts> (a function with typed inputs; its response is checked against the schema)

## Path parameters

- `id` string, required

## Request body

- object
  - `code` string, required
  - `cwd` string
  - `env` object
  - `language` string, required
  - `timeoutSeconds` number

## Response `200`

Successful response

## Changes

- **2026-11-08** `857e915717f4`: 2 breaking
  - added the new path request parameter `id`
  - added required request body
- **2026-08-21** `bf5b6f84d6e0`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/orthogonal/apis/orthogonal-api-marketplace/changes/smolmachines/v1/machines/:id/code/post.md)

---

[API](https://skmtc.dev/orthogonal/apis/orthogonal-api-marketplace.md) - [All operations](https://skmtc.dev/orthogonal/apis/orthogonal-api-marketplace/llms.txt) - [OpenAPI document](https://skmtc.dev/orthogonal/apis/orthogonal-api-marketplace/revisions/8d772cb34c17?raw)
