{"id":26984617,"url":"https://github.com/dneustadt/openai-client","last_synced_at":"2025-06-16T21:39:14.228Z","repository":{"id":56970450,"uuid":"369493450","full_name":"dneustadt/openai-client","owner":"dneustadt","description":"OpenAI PHP API Client","archived":false,"fork":false,"pushed_at":"2022-11-05T20:05:05.000Z","size":222,"stargazers_count":8,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-06T04:10:05.951Z","etag":null,"topics":["api","client","openai","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dneustadt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-21T10:07:07.000Z","updated_at":"2024-01-07T13:30:04.000Z","dependencies_parsed_at":"2022-08-21T07:10:17.945Z","dependency_job_id":null,"html_url":"https://github.com/dneustadt/openai-client","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/dneustadt/openai-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dneustadt%2Fopenai-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dneustadt%2Fopenai-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dneustadt%2Fopenai-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dneustadt%2Fopenai-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dneustadt","download_url":"https://codeload.github.com/dneustadt/openai-client/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dneustadt%2Fopenai-client/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260246416,"owners_count":22980392,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","client","openai","php"],"created_at":"2025-04-03T17:48:36.432Z","updated_at":"2025-06-16T21:39:14.208Z","avatar_url":"https://github.com/dneustadt.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenAI PHP Client\n\nOpenAI is an AI research and deployment company. Our mission is to ensure that artificial general intelligence benefits all of humanity.\n\n## Installation \u0026 Usage\n\n### Requirements\n\nPHP 7.2 and later.\n\n### Composer\n\nTo install via [Composer](https://getcomposer.org/):\n\n`composer require dneustadt/openai-client`\n\n## Getting Started\n\nPlease follow the [installation procedure](#installation--usage) and then run the following:\n\n```php\n\u003c?php\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\n// Configure API key authorization: api_key\n$config = OpenAI\\Client\\Configuration::getDefaultConfiguration()-\u003esetApiKey('Authorization', 'YOUR_API_KEY');\n\n$apiInstance = new OpenAI\\Client\\Api\\AnswerApi(\n    // If you want use custom http client, pass your client which implements `GuzzleHttp\\ClientInterface`.\n    // This is optional, `GuzzleHttp\\Client` will be used as default.\n    new GuzzleHttp\\Client(),\n    $config\n);\n$open_ai_organization = 'open_ai_organization_example'; // optional\n$answer_payload = new \\OpenAI\\Client\\Model\\AnswerPayload(); // \\OpenAI\\Client\\Model\\AnswerPayload\n\ntry {\n    $result = $apiInstance-\u003epostAnswer($open_ai_organization, $answer_payload);\n    print_r($result);\n} catch (Exception $e) {\n    echo 'Exception when calling AnswerApi-\u003epostAnswer: ', $e-\u003egetMessage(), PHP_EOL;\n}\n\n```\n\n## API Endpoints\n\nAll URIs are relative to *https://api.openai.com/v1*\n\nClass | Method | HTTP request | Description\n------------ | ------------- | ------------- | -------------\n*AnswerApi* | [**postAnswer**](docs/Api/AnswerApi.md#postanswer) | **POST** /answers | Answers the specified question using the provided documents and examples.\n*ClassificationApi* | [**postClassification**](docs/Api/ClassificationApi.md#postclassification) | **POST** /classifications | The endpoint first searches over the labeled examples to select the ones most relevant for the particular query. Then, the relevant examples are combined with the query to construct a prompt to produce the final label via the completions endpoint.\n*CompletionsApi* | [**postCompletions**](docs/Api/CompletionsApi.md#postcompletions) | **POST** /engines/{engine_id}/completions | Creates a new completion for the provided prompt and parameters\n*EmbeddingsApi* | [**postEmbeddings**](docs/Api/EmbeddingsApi.md#postembeddings) | **POST** /embeddings | Creates an embedding vector representing the input text.\n*EnginesApi* | [**getEngineById**](docs/Api/EnginesApi.md#getenginebyid) | **GET** /engines/{engine_id} | Retrieves an engine instance, providing basic information about the engine such as the owner and availability.\n*EnginesApi* | [**getEngines**](docs/Api/EnginesApi.md#getengines) | **GET** /engines | Lists the currently available engines, and provides basic information about each one such as the owner and availability.\n*FilesApi* | [**deleteFile**](docs/Api/FilesApi.md#deletefile) | **DELETE** /files/{file_id} | Delete a file.\n*FilesApi* | [**getFileById**](docs/Api/FilesApi.md#getfilebyid) | **GET** /files/{file_id} | Returns information about a specific file.\n*FilesApi* | [**getFiles**](docs/Api/FilesApi.md#getfiles) | **GET** /files | Returns a list of files that belong to the user\u0026#39;s organization.\n*FilesApi* | [**postFile**](docs/Api/FilesApi.md#postfile) | **POST** /files | Upload a file that contains document(s) to be used across various endpoints/features.\n*FineTunesApi* | [**getFineTune**](docs/Api/FineTunesApi.md#getfinetune) | **GET** /fine-tunes/{fine_tune_id} | Gets info about the fine-tune job.\n*FineTunesApi* | [**getFineTuneEvents**](docs/Api/FineTunesApi.md#getfinetuneevents) | **GET** /fine-tunes/{fine_tune_id}/events | Get fine-grained status updates for a fine-tune job.\n*FineTunesApi* | [**getFineTunes**](docs/Api/FineTunesApi.md#getfinetunes) | **GET** /fine-tunes | List your organization\u0026#39;s fine-tuning jobs\n*FineTunesApi* | [**postFineTuneCancel**](docs/Api/FineTunesApi.md#postfinetunecancel) | **POST** /fine-tunes/{fine_tune_id}/cancel | Immediately cancel a fine-tune job.\n*FineTunesApi* | [**postFineTunes**](docs/Api/FineTunesApi.md#postfinetunes) | **POST** /fine-tunes | Creates a job that fine-tunes a specified model from a given dataset.\n*ImagesApi* | [**postImagesEdits**](docs/Api/ImagesApi.md#postimagesedits) | **POST** /images/edits | Creates an edited or extended image given an original image and a prompt.\n*ImagesApi* | [**postImagesGenerations**](docs/Api/ImagesApi.md#postimagesgenerations) | **POST** /images/generations | Given a prompt and/or an input image, the model will generate a new image.\n*ImagesApi* | [**postImagesVariations**](docs/Api/ImagesApi.md#postimagesvariations) | **POST** /images/variations | Creates a variation of a given image.\n*ModelsApi* | [**deleteModel**](docs/Api/ModelsApi.md#deletemodel) | **DELETE** /models/{model} | Delete a fine-tuned model. You must have the Owner role in your organization.\n*ModelsApi* | [**getModel**](docs/Api/ModelsApi.md#getmodel) | **GET** /models/{model} | Retrieves a model instance, providing basic information about the model such as the owner and permissioning.\n*ModelsApi* | [**getModels**](docs/Api/ModelsApi.md#getmodels) | **GET** /models | Lists the currently available models, and provides basic information about each one such as the owner and availability.\n*ModerationsApi* | [**postModerations**](docs/Api/ModerationsApi.md#postmoderations) | **POST** /moderations | Classifies if text violates OpenAI\u0026#39;s Content Policy\n*SearchApi* | [**postSearch**](docs/Api/SearchApi.md#postsearch) | **POST** /search | The search endpoint computes similarity scores between provided query and documents. Documents can be passed directly to the API if there are no more than 200 of them.\n\n## Models\n\n### Request Payloads\n\n- [AnswerPayload](docs/Model/AnswerPayload.md)\n- [ClassificationPayload](docs/Model/ClassificationPayload.md)\n- [CompletionPayload](docs/Model/CompletionPayload.md)\n- [ImagesGenerationsPayload](docs/Model/ImagesGenerationsPayload.md)\n- [SearchPayload](docs/Model/SearchPayload.md)\n- [EmbeddingsPayload](docs/Model/EmbeddingsPayload.md)\n- [FineTunesPayload](docs/Model/FineTunesPayload.md)\n- [ModerationsPayload](docs/Model/ModerationsPayload.md)\n\n### Response Models\n\n- [Answer](docs/Model/Answer.md)\n- [Classification](docs/Model/Classification.md)\n- [Completion](docs/Model/Completion.md)\n- [Engines](docs/Model/Engines.md)\n- [Engine](docs/Model/Engine.md)\n- [File](docs/Model/File.md)\n- [Files](docs/Model/Files.md)\n- [Images](docs/Model/Images.md)\n- [Search](docs/Model/Search.md)\n- [Embeddings](docs/Model/Embeddings.md)\n- [FineTune](docs/Model/FineTune.md)\n- [FineTuneEvents](docs/Model/FineTuneEvents.md)\n- [FineTunes](docs/Model/FineTunes.md)\n- [Models](docs/Model/Models.md)\n- [Model](docs/Model/Model.md)\n- [ModelDelete](docs/Model/ModelDelete.md)\n- [Moderations](docs/Model/Moderations.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdneustadt%2Fopenai-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdneustadt%2Fopenai-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdneustadt%2Fopenai-client/lists"}