For your PHP and JavaScript applications, that uses fully typed requests and responses.
Add Artificial Intelligence to your PHP or JavaScript applications in minutes.
Supports popular OpenAI features and models including ChatGPT, GPT-4, GPT-3.5, GPT-3, Codex, DALL·E and Whisper.
Easily connect up to the popular Chat Completions, Completions, Images, Audio Transcriptions, Moderations and Embeddings endpoints using smart data objects that have full knowledge of the data type and structures so you can quickly and easily implement your user application.
Integrating OpenAI into your JavaScript application is now as simple as:
const tectalicOpenai = require('@tectalic/openai').default; const openaiClient = tectalicOpenai(process.env.OPENAI_API_KEY); const response = openaiClient.completions.create({ model: 'text-davinci-003', prompt: 'Will using a third party package save time?'}) response.then((result) => { console.log(result.data.choices[0].text)});// Using a third party package can save time because you don't have to write the code yourself.
Integrating OpenAI into your PHP application is now as simple as:
$openaiClient = \Tectalic\OpenAi\Manager::build( new \GuzzleHttp\Client(), new \Tectalic\OpenAi\Authentication(getenv('OPENAI_API_KEY'))); /** @var \Tectalic\OpenAi\Models\ChatCompletions\CreateResponse $response */$response = $openaiClient->chatCompletions()->create( new \Tectalic\OpenAi\Models\ChatCompletions\CreateRequest([ 'model' => 'gpt-4', 'messages' => [ [ 'role' => 'user', 'content' => 'Will using a well designed and supported third party package save time?', ], ], ]))->toModel(); echo $response->choices[0]->message->content;// Yes, using a well-designed and supported third-party package can save time during software development.
You can even train your own unique AI model using Fine Tunes to ensure your app stands out from the crowd.
See the PHP Examples and JavaScript examples for full details.
All requests and responses are fully typed, with complete details of the OpenAI API request and response structures at your fingertips.
All API endpoints, requests and responses are fully documented within advanced IDEs such as Visual Studio Code or PhpStorm.
Spend your time building great software, not reading complex API documentation.
Make full use of the OpenAI API, with the ability to easily query all 23 API endpoints.
By our developers, with unit and functional integration tests. All test cases are provided.
Our Australian-based team of developers are here to help you.
Written in JavaScript
With everything you need
npm
.
Written in PHP
With everything you need
composer
.
A GPT-4 and GPT-3.5 ChatGPT API Client for Your PHP Applications
The Tectalic OpenAI PHP Client Library now supports the new ChatGPT and Whisper APIs, including GPT-4 and GPT-3.5.
An OpenAI API Client (SDK) for Your JavaScript Projects
Our new OpenAI REST API Client is now available, with GPT-3, Codex and DALL·E model support. Includes Typescript declarations for all requests and responses and IDE autocomplete support.
How to build a PHP app using the OpenAI API
Learn how to build an AI-based business name generator application using PHP, Laravel and the OpenAI API.
An OpenAI API Client (SDK) for Your PHP Projects
Our new OpenAI REST API Client is now available, with GPT-3 and Codex model support. Includes Data Transfer Objects (DTOs) for all requests and responses and IDE autocomplete support.