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.
Download texhub/openai
More information about texhub/openai
Files in texhub/openai
Package openai
Short Description Full-featured OpenAI SDK for any PHP framework with first-class Laravel support: chat, tools/function-calling, vision, assistants (v2), files, images, audio, embeddings, models and usage analytics.
License MIT
Homepage https://texhub.pro
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
ext-curl Version *
ext-json Version *