Search by

sdkfabric / openai

chriskapp

OpenAI PHP SDK managed by SDK Fabric

Package info

github.com/sdk-fabric/openai-php

Homepage

pkg:composer/sdkfabric/openai

Fund package maintenance!

chriskapp

Statistics

Installs: 7 214

Dependents: 1

Suggesters: 0

Stars: 0

Open Issues: 0

v0.2.1 2025-11-13 20:58 UTC

This package is auto-updated.

Last update: 2026-09-06 00:00:43 UTC


README

This SDK is managed by the SDK Fabric project, a global infrastructure to automatically generate SDKs for every API.

You can find more information about this SDK at TypeHub: https://app.typehub.cloud/d/sdkfabric/openai

Usage

<?php

require __DIR__ . '/vendor/autoload.php';

$client = new \SdkFabric\Openai\Client::build('[access_token]');

// Creates a model response for the given chat conversation.
$response = $client->completions()->create(new CompletionRequest());

// Delete a stored chat completion.
$response = $client->completions()->delete('completion_id');

// List stored Chat Completions.
$response = $client->completions()->getall('after', 1, 'model', 'order');

// Creates a model response.
$response = $client->responses()->create(new ResponseRequest());