Download the PHP package texhub/openai without Composer

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

TexHub · OpenAI

English · Русский

A complete, framework-agnostic OpenAI SDK for PHP — chat, function-calling/tools, vision, assistants (v2), files, images, audio, embeddings, moderations, models and usage analytics — with first-class Laravel support.

Designed to make working with OpenAI проще простого: a one-liner for a quick prompt, full power when you need it.

Reference: https://platform.openai.com/docs/api-reference


What's covered

Area Methods
Chat text(), ask(), create(), vision(), json(), stream(), streamText()
Tools / functions Tool::function(), code_interpreter, file_search, tool calls in responses
Responses API responses()->create() / stream() (modern unified endpoint)
Assistants (v2) create / retrieve / update / list / delete
Threads & runs messages, runs, run steps, tool outputs, poll-until-done
Files upload (disk or memory), list, retrieve, download, delete
Images generate, edit, variation (DALL·E / gpt-image-1)
Audio transcribe, translate, text-to-speech
Embeddings create(), vector()
Moderations create(), isFlagged()
Models list, ids, retrieve, delete
Usage token & cost analytics (admin key)
Escape hatch ->http() to call any endpoint

Installation

Requirements: PHP ≥ 8.2 with the curl and json extensions.


Quick start

Pick the model per-call via options: ['model' => '...'], or set a default in config.


Function calling (tools)


Vision (images in)

JSON mode & streaming


Assistants (v2)

Function tools inside a run

When a run returns status: requires_action, submit your tool outputs:


Files (and file_search)


Images


Audio


Embeddings & moderation


Usage & analytics


Error handling

Any endpoint (escape hatch)


Laravel

Auto-discovered. Publish config:

.env:

Facade:

…or inject \TexHub\OpenAI\OpenAI anywhere.


Testing

Inject the fake transport to test without network calls:

Run the suite:


Architecture


License

MIT © TexHub Pro — built by Mahmudi Shodmehr.


All versions of openai with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
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 texhub/openai contains the following files

Loading the files please wait ...