Download the PHP package marceloeatworld/runpod-serverless-php without Composer

On this page you can find all versions of the php package marceloeatworld/runpod-serverless-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package runpod-serverless-php

RunPod Serverless PHP Client

Latest Version on Packagist PHP Version License

1 PHP client for the RunPod Serverless API, compatible with Laravel and native PHP, built on Saloon v4.


Table of Contents


Requirements

Saloon v4 is installed automatically as a dependency.

Installation

Quick Start

Your API key is available at runpod.io/console/user/settings. Your endpoint ID is the alphanumeric string visible in your endpoint's URL on the RunPod dashboard.


Job Lifecycle

Every RunPod job goes through a state machine:

Status Description
IN_QUEUE Waiting for an available worker
IN_PROGRESS Actively being processed
COMPLETED Finished successfully, output available
FAILED Worker returned an error
CANCELLED Manually stopped via cancel()
TIMED_OUT Expired (TTL in queue or executionTimeout during processing)

API Reference

Submitting Jobs

Async: run(array $input)

Submits a job and returns immediately. You then poll status() or use a webhook.

Payload limit: 10 MB.

Sync: runSync(array $input)

Submits a job and waits for completion. Best for fast tasks (< 90 seconds).

If the job takes longer than ~90 seconds, runSync returns with status IN_PROGRESS. You must then fall back to polling status().

Payload limit: 20 MB.

Full Polling Example


Checking Job Status

status(string $jobId)

Retrieve the current state and results of a job.


Streaming Results

stream(string $jobId)

Retrieve incremental results from a streaming job. The worker must support streaming.

Streaming in RunPod is poll-based, not chunked transfer encoding. Each chunk is limited to 1 MB.


Cancelling Jobs

cancel(string $jobId)

Cancel a queued or running job.


Retrying Failed Jobs

retry(string $jobId)

Requeue a failed or timed-out job. RunPod re-uses the same job ID and original input.


Endpoint Health

health()

Get worker pool and job pipeline statistics.


Purging the Queue

purgeQueue()

Remove all pending jobs from the queue. Running jobs are not affected.

Use with caution. This is irreversible and has a strict rate limit (2 calls per 10 seconds).


RunPodResponse

Every method returns a RunPodResponse object wrapping the raw API JSON response.

Status Checks

Data Accessors

Method Return Type Description
$response->id ?string Unique job identifier
$response->status ?string Current job status
$response->data array Complete raw API response
->getOutput() mixed Worker's output (when COMPLETED)
->getError() mixed Error details (when FAILED)
->getMetrics() ?array Execution metrics
->getExecutionTime() ?int Active processing time in ms
->getDelayTime() ?int Time spent waiting in queue in ms
->getWorkerId() ?string ID of the worker that processed the job
->getStream() ?array Array of stream chunks (from stream())

JSON Serialization

RunPodResponse implements JsonSerializable, so you can pass it directly to json_encode() or return it from a Laravel controller:


Advanced Configuration

The fluent methods withWebhook(), withPolicy(), and withS3Config() configure options on the endpoint resource. They are chainable and apply to the next run() or runSync() call.

Note: These options are sticky on the resource instance. If you call withWebhook() once, subsequent run() calls on the same instance will continue sending that webhook. Create a new endpoint instance if you need different config.

Webhooks

Instead of polling status(), you can provide a webhook URL. RunPod will POST the complete response JSON to your URL when the job finishes.

Webhook behavior:

Execution Policies

Control job timeout and priority behavior.

Parameter Default Range Description
executionTimeout 600,000 (10 min) 5s - 7 days Max time a job can actively run on a worker
ttl 86,400,000 (24h) 10s - 7 days Total lifespan from submission (includes queue wait)
lowPriority false - If true, the job won't trigger autoscaling of new workers

executionTimeout vs ttl: TTL counts from when the job is submitted (including queue time). executionTimeout counts from when a worker starts processing the job. If TTL expires while a job is running, it's immediately removed.

S3 Storage Integration

For large payloads exceeding the 10/20 MB limits, use S3 integration to pass data via object storage.

Combining Options

All fluent methods are chainable:


Error Handling

This client uses Saloon's AlwaysThrowOnErrors trait. Any HTTP 4xx/5xx response automatically throws an exception. Connection-level errors (DNS, timeout) are also thrown.

Exception hierarchy:


Rate Limits

RunPod enforces per-endpoint rate limits:

Endpoint Max per 10s Max Concurrent
/run 1,000 200
/runsync 2,000 400
/status 2,000 400
/stream 2,000 400
/cancel 100 20
/purge-queue 2 -

Exceeding these limits returns HTTP 429. Implement exponential backoff with jitter when retrying.


Result Retention

RunPod automatically deletes job results after a retention period:

Mode Retention After Completion
Async (run) 30 minutes
Sync (runSync) 1 minute (5 minutes max)

Fetch your results within these windows, or use webhooks to receive results immediately.


Laravel Integration

1. Configuration

Add to config/services.php:

Add to your .env:

2. Service Provider

Register as a singleton in AppServiceProvider (or a dedicated provider):

3. Usage in Controllers

4. Usage in Jobs / Queues


Support & Security

For security issues, please email [email protected].

License

MIT License - see LICENSE


All versions of runpod-serverless-php with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
saloonphp/saloon Version ^4.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package marceloeatworld/runpod-serverless-php contains the following files

Loading the files please wait ...