rp serverless run
Submit a job to a deployed endpoint on the data plane.
rp serverless run <id> --input '<json>' | --input-file <path|->
[--sync|--async] [--worker-id <id>]
[--affinity soft|strict|strict-resume] [--timeout <s>] [--json]
Arguments
<id> endpoint id — from `rp serverless list`
Options
--input '<json>' job input as a JSON string
--input-file <path|-> read job input from a file, or - for stdin
--sync block until the job completes (default)
--async queue and print the job id instead of waiting
--worker-id <id> pin the job to one worker on a load-balanced
endpoint (X-Runpod-Worker-Id request header);
ids come from `rp serverless workers <id>` or
the response header of a previous run
--affinity soft|strict|strict-resume
affinity mode for --worker-id (default: soft)
--timeout <s> request timeout in seconds (default: 300)
--json print the raw API response
Notes
--input and --input-file are mutually exclusive, as are --sync and --async.
The body is wrapped as { "input": worker_timeout on timeout, 404 affinity_worker_gone when
the worker is gone), strict-resume sends "strict-resume
Examples
# Run a synchronous job with inline input
$ rp serverless run end_abc --input '{"prompt":"hi"}'
# Submit a job from a file and return immediately
$ rp serverless run end_abc --input-file job.json --async
# Pin a session to one worker (strict), then release the pin
$ rp serverless run end_abc --input '{"prompt":"hi"}' --worker-id pod-abc123 --affinity strict
API: POST /v2/{id}/runsync (or /run with --async)