Download the PHP package wavespeedai/wavespeed-php without Composer

On this page you can find all versions of the php package wavespeedai/wavespeed-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 wavespeed-php

WaveSpeed PHP SDK

PHP SDK for the WaveSpeed inference platform

๐ŸŒ Visit wavespeed.ai โ€ข ๐Ÿ“– Documentation โ€ข ๐Ÿ’ฌ Issues


A port of the official WaveSpeed Python SDK to PHP, with the same API surface and the same retry semantics. Zero runtime dependencies โ€” just ext-curl and ext-json.

Requirements

Installation

API Client

Run WaveSpeed AI models with a simple API:

Authentication

Set your API key through the environment (get one at wavespeed.ai/accesskey):

Or pass it directly:

Or configure it once during bootstrap, so every client picks it up:

Options

timeout caps how long run() blocks. Left null it waits as long as the task takes, while each individual HTTP request stays bounded by Config::TIMEOUT (36000s by default). A local timeout never cancels the task โ€” see Recovering a Task.

Sync Mode

Pass enableSyncMode: true to ask the API to wait for the result in the initial request. If the server-side wait runs out, the SDK throws SyncModeTimeoutException carrying the task ID and result URL โ€” the task keeps processing and can be collected later.

Note: Not all models support sync mode. Check the model documentation for availability.

Handling Failure Without Exceptions

runNoThrow() reports the outcome instead of throwing, which suits queue workers that want to record a task ID and move on:

status is processing when a sync-mode wait expired: the task is alive server-side, so getResult($result['task_id']) will pick it up.

Recovering a Task

A local timeout does not cancel anything โ€” the job keeps running. Fetch its current state by id:

Retry Configuration

A submission POST is never retried automatically. It is not idempotent: if it fails without a response, the task may already exist, and replaying it would risk paying for the same job twice. Result-query GETs are idempotent and are retried freely. Setting maxRetries above 0 opts into submitting a replacement task after a confirmed transient failure.

Diagnostics

Retries are silent by default โ€” a library should not write to your output uninvited. Opt in with a logger:

Upload Files

Upload images, videos, or audio files. Large files stream straight from disk, so memory use stays flat:

Errors

Every exception implements WaveSpeed\Exception\WaveSpeedException, so one catch covers the SDK without swallowing unrelated errors:

Exception Meaning Retried by the SDK
ConfigurationException No API key, or an unusable argument โ€”
FileNotFoundException Upload path missing or unreadable โ€”
SubmissionException The submit POST failed Never (not idempotent)
PredictionFailedException Task reached failed / cancelled / timeout Never (a verdict, not a hiccup)
SyncModeTimeoutException Sync wait expired; task still running Never โ€” poll instead
TimeoutException Local wait budget ran out Yes, at the task level
ConnectionException No response obtained Yes, for idempotent requests
ApiException Any other API-level failure Yes for 429/5xx

Custom HTTP Transport

Client talks to the API only through the HttpClient interface, so you can substitute your own stack (a proxy-aware handler, a shared connection pool, a test double):

Examples

Runnable scripts live in examples/:

Local Development

The default suite never touches the network: MockHttpClient scripts the responses and FakeClock makes polling and backoff instant.

Environment Variables

Variable Description
WAVESPEED_API_KEY WaveSpeed API key
WAVESPEED_CLIENT_NAME Channel-attribution name sent as the X-Client-Name header (overrides the clientName argument; defaults to wavespeed-php)

Mapping From the Python SDK

Python PHP
wavespeed.run(...) WaveSpeed::run(...)
wavespeed.run_no_throw(...) WaveSpeed::runNoThrow(...)
wavespeed.get_result(id) WaveSpeed::getResult($id)
wavespeed.upload(file) WaveSpeed::upload($file)
wavespeed.Client(api_key=...) new WaveSpeed\Client(apiKey: ...)
wavespeed.config.api.timeout = 60 Config::set(Config::TIMEOUT, 60.0)
with wavespeed.config.patch(...) Config::patch([...], fn () => ...)
RuntimeError / ValueError Typed exceptions (see the table above)

License

MIT


WaveSpeed AI โ€” AI image & video generation platform. Try it in the browser: Image generator ยท Video generator


All versions of wavespeed-php with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
ext-curl Version *
ext-json Version *
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 wavespeedai/wavespeed-php contains the following files

Loading the files please wait ...