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 models including GPT-3, Codex and DALL·E.
Easily connect up to the popular Completions, Images and Moderations 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\Completions\CreateResponse $response */$response = $openaiClient->completions()->create( new \Tectalic\OpenAi\Models\Completions\CreateRequest([ 'model' => 'text-davinci-003', 'prompt' => 'Will using a third party package save time?', ]))->toModel(); echo $response->choices[0]->text;// Using a third party package can save time because you don't have to write the code yourself.
You can even train your own unique AI model using Fine Tunes to ensure your app stands out from the crowd.
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 20 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
.
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.