Download the PHP package latentkit/latentkit-php without Composer

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

LatentKit PHP SDK

Official PHP 8.1+ client for LatentKit's canonical, route-based /v1 API.

The application sends the task. The API key's assigned published route selects the provider and model. Do not send model, provider, route, or policy; the SDK rejects those route-control fields before making a request.

Install

Install the current beta from Packagist:

For repository development, run composer install inside sdk/php and load vendor/autoload.php.

Quickstart

Set the key server-side:

Client options

Keep the client and API key in server-side PHP. Never render the raw key into HTML or JavaScript.

Inspect the connected route

Use the typed context when an integration needs connection, route, model, or recent request status:

The latest request reports the model that won that request. It is not a fixed model: the assigned route can choose another eligible model or use a fallback on the next call. Runtime SDK credentials cannot change the route.

When a compatible gateway returns the ordered models list without a separate model_count, the typed context derives the count from the returned models. This avoids presenting a populated route as unavailable or empty.

$client->me->retrieve() remains available when raw associative arrays are preferred.

Supported resources in 0.1

Chat streaming, completions, speech, transcription, translation, video, control-plane helpers, IDE auth, and agent sessions are not part of PHP 0.1. JavaScript and Python remain the full-surface SDKs while PHP parity expands.

Queue is enqueue-only

LatentKit currently exposes POST /v1/queue but no public per-job result endpoint. The PHP SDK deliberately has no queue->retrieve() method. WordPress, Drupal, Laravel, and commerce plugins that need a result must run their own background job and call the synchronous SDK method from that job.

Errors and request IDs

AuthenticationException, RateLimitException, and ValidationException extend ApiException. Network/client failures throw TransportException; malformed successful API responses throw InvalidResponseException.

HTTP transports

The default CurlTransport has no concrete HTTP-library dependency and requires ext-curl.

Framework applications may inject an existing PSR-18 client plus PSR-17 request/stream factories:

Configure timeouts on the injected PSR-18 client. PSR-18 does not standardize timeout configuration or streaming.

Development

The tests use an in-memory transport and never contact LatentKit.


All versions of latentkit-php with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
psr/http-client Version ^1.0
psr/http-factory Version ^1.0
psr/http-message Version ^1.1 || ^2.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 latentkit/latentkit-php contains the following files

Loading the files please wait ...