Skip to main content
POST
Required API key scope: pods:write

Authorizations

Authorization
string
header
required

Runpod API key authentication. Generate an API key in the Runpod console and send it in the Authorization header as Bearer <api_key>. Keys are scoped to the permissions granted when created; requests may return 403 when a valid key lacks access to the requested resource or action.

Console sessions (Clerk JWTs) act for the signed-in user. To act for a team instead, also send X-Team-Id: <team_id>; it applies only when the user owns or belongs to that team, otherwise the request runs against the user's own account. API keys created inside a team already act for that team and do not need the header.

Path Parameters

id
string
required

Pod identifier

Body

application/json
command
tuple
required

Command to run, as an argv array of 1-256 arguments of at most 4096 characters each. It is run directly, never through a shell; for pipes, redirects or globbing pass ["sh", "-c", "..."]. The first element, the program, must contain a non-whitespace character; later arguments may be empty. No argument may contain a NUL character.

timeoutSeconds
integer
default:20

How long the call waits for the command to finish, in seconds. A command still running at this point returns with timedOut: true.

Required range: 1 <= x <= 25
Example:

10

cwd
string

Absolute working directory for the command, at most 1024 characters and without control characters. Defaults to the image's WORKDIR.

Maximum string length: 1024
Pattern: ^/[^\x00-\x1f\x7f]*$
Example:

"/workspace"

env
object

Up to 64 environment variables added to the container's environment for this command only. A name is 1-256 characters and must not contain = or a NUL character; a value is at most 16384 characters and must not contain a NUL character.

Example:

Response

The command finished or the call stopped waiting for it. A non-zero exitCode is a result, not an error.

stdout
string
required

The command's standard output, as UTF-8 with invalid bytes replaced. Capped at 1 MiB; see truncated.

stderr
string
required

The command's standard error, as UTF-8 with invalid bytes replaced. Capped at 1 MiB; see truncated.

exitCode
integer | null
required

The command's exit code. A non-zero code is a result, not an error. Null only when timedOut is true.

timedOut
boolean
required

The call stopped waiting at timeoutSeconds. It does not mean the command was stopped: it may still be running inside the container.

truncated
boolean
required

stdout or stderr reached the 1 MiB cap and was cut.

durationMs
integer
required

Wall time of the command as measured on the pod's machine, in milliseconds.

Last modified on November 22, 2026