Download the PHP package humantone/humantone-php without Composer

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

humantone/humantone-php

Official PHP SDK for HumanTone. Humanize AI-generated text and check AI likelihood from your PHP code. One API key, same credits you already use in the HumanTone web app.

Install

Requires PHP 8.2 or later.

Requirements

Quickstart

The client also picks up HUMANTONE_API_KEY from the environment automatically:

What's included

The SDK exposes three methods that map 1:1 to the three HumanTone API endpoints.

$client->humanize(...)

Rewrites AI-generated text to sound more natural.

Argument Type Default Notes
text string required Min 30 words. Max depends on plan (Basic 750, Standard 1000, Pro 1500).
level HumanizationLevel Standard Advanced and Extreme are English-only.
outputFormat OutputFormat Text SDK default is Text even though the API default is Html.
customInstructions ?string null Free-form rewrite guidance. Max 1000 chars.

Returns HumanizeResult with $text, $outputFormat, $creditsUsed, $requestId (nullable string).

$client->detect(string $text): DetectResult

Returns AI likelihood score 0-100. Higher means more AI-like patterns. Free, but limited to 30 calls per day per account (shared between the web app and the API).

$client->account->get(): AccountInfo

Returns plan, credit balance, and subscription status. Useful for checking remaining credits before a large batch.

Configuration

You can inject any PSR-18 HTTP client:

When you inject a non-Guzzle PSR-18 client, the SDK can no longer distinguish a transport-level timeout from a generic network failure. Both are surfaced as NetworkException. Configure timeouts on your injected client. Guzzle (the default) maps connect-phase timeouts and CURLE_OPERATION_TIMEDOUT to TimeoutException.

Error handling

All exceptions raised by the SDK extend HumanToneException. Catch specific subclasses for expected cases.

Every exception exposes:

Specific exceptions add typed accessors: RateLimitException::getRetryAfterSeconds(): int, DailyLimitExceededException::getTimeToNextRenew(): ?int, InsufficientCreditsException::getRequiredCredits(): ?int and getAvailableCredits(): ?int.

Retry behavior

The SDK retries account.get() on network errors, 5xx, and 429 (up to 2 retries). POST methods (humanize, detect) do not retry on network or 5xx by default. Humanize debits credits, so a retried request risks double-billing. Set retryOnPost: true to opt in. 429 always retries on every method.

Retry-After headers are honored in both numeric (seconds) and HTTP-date formats.

Limits to remember

Links

License

MIT. Copyright (c) HumanTone.


All versions of humantone-php with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
ext-json Version *
guzzlehttp/guzzle Version ^7.0
psr/http-client 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 humantone/humantone-php contains the following files

Loading the files please wait ...