Skip to content
This repository has been archived by the owner on Nov 22, 2023. It is now read-only.

Engines

Greg Priday edited this page Jul 7, 2021 · 1 revision

Engines API

Engines describe and provide access to the various models available in the API. You can refer to the Engines documentation to understand what engines are available and the differences between them.

https://beta.openai.com/docs/api-reference/engines

use SiteOrigin\OpenAI\Client;
$client = new Client($_ENV['OPENAI_API_KEY']);
$engines = $client->engines()->list();

The shortened output of $engines in JSON format:

(object) array(
   'object' => 'list',
   'data' => 
  array (
    0 => 
    (object) array(
       'id' => 'ada',
       'object' => 'engine',
       'created' => NULL,
       'max_replicas' => NULL,
       'owner' => 'openai',
       'permissions' => NULL,
       'ready' => true,
       'ready_replicas' => NULL,
       'replicas' => NULL,
    ),
    1 => 
    (object) array(
       'id' => 'babbage',
       'object' => 'engine',
       'created' => NULL,
       'max_replicas' => NULL,
       'owner' => 'openai',
       'permissions' => NULL,
       'ready' => true,
       'ready_replicas' => NULL,
       'replicas' => NULL,
    ),
    2 => 
    (object) array(
       'id' => 'content-filter-alpha',
       'object' => 'engine',
       'created' => NULL,
       'max_replicas' => NULL,
       'owner' => 'openai',
       'permissions' => NULL,
       'ready' => true,
       'ready_replicas' => NULL,
       'replicas' => NULL,
    ),
    3 => (object) array( /* ... */ ),
    4 => (object) array( /* ... */ ),
    5 => (object) array( /* ... */ ),
    6 => (object) array( /* ... */ ),
    7 => (object) array( /* ... */ ),
    
  ),
)
Clone this wiki locally