{"id":28220650,"url":"https://github.com/php-client/openai","last_synced_at":"2026-02-27T22:02:10.334Z","repository":{"id":277426620,"uuid":"932394991","full_name":"php-client/openai","owner":"php-client","description":"PHP client for OpenAI API","archived":false,"fork":false,"pushed_at":"2025-04-25T20:49:51.000Z","size":42,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-07-12T10:39:23.860Z","etag":null,"topics":["api","client","gpt","openai","php","saloon","sdk"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/php-client.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-02-13T21:00:38.000Z","updated_at":"2025-05-26T11:56:36.000Z","dependencies_parsed_at":"2025-06-11T15:31:26.343Z","dependency_job_id":"d2658361-a20b-4043-9235-d615feb168df","html_url":"https://github.com/php-client/openai","commit_stats":null,"previous_names":["php-client/openai"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/php-client/openai","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-client%2Fopenai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-client%2Fopenai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-client%2Fopenai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-client%2Fopenai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/php-client","download_url":"https://codeload.github.com/php-client/openai/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-client%2Fopenai/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29917207,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T19:37:42.220Z","status":"ssl_error","status_checked_at":"2026-02-27T19:37:41.463Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","gpt","openai","php","saloon","sdk"],"created_at":"2025-05-18T04:16:03.439Z","updated_at":"2026-02-27T22:02:10.282Z","avatar_url":"https://github.com/php-client.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PHP client for OpenAI API.\n\nThis is a PHP client for the OpenAI API.\n\n## Installation\n\nInstall the package via composer:\n\n```bash\ncomposer require php-client/openai\n```\n\n## Usage\n\n```php\nuse PhpClient\\OpenAI\\OpenAI;\n\n$openai = new OpenAI(\n    baseUrl: 'https://api.openai.com',\n    token: 'YOUR_API_TOKEN',\n);\n\n$response = $openai-\u003eapi-\u003echat()-\u003ecreateChatCompletion(\n    model: 'gpt-4o',\n    messages: [\n        ['role' =\u003e 'user', 'content' =\u003e 'Hello'],\n    ],\n);\n\necho $response-\u003ejson(key: 'choices.0.message.content');\n\n// or\n\nforeach ($response-\u003ejson(key: 'choices') as $choice) {\n    echo $choice['message']['content'];\n}\n\n```\n\n## List of available API methods\n\n- Audio\n    - Create speech|transcription|translation\n- Chat\n    - Create chat completion\n- Embeddings\n    - Create embeddings\n- Fine-tuning\n    - Create|Retrieve|Cancel fine-tuning job\n    - List fine-tuning jobs|events|checkpoints\n- Batch\n    - Create|Retrieve|Cancel|List batch\n- Files\n    - List files\n    - Upload|Retrieve|Delete file\n    - Retrieve file content\n- Uploads\n    - Create|Complete|Cancel upload\n    - Add upload part\n- Images\n    - Create image\n    - Create image edit|variation\n- Models\n    - List models\n    - Retrieve model\n    - Delete fine-tuned model\n- Moderations\n    - Create moderation\n- LegacyCompletions\n    - Create completion\n\n## Not implemented API methods (in development)\n\n- Assistants\n- Administration\n- Realtime\n- Legacy\n\n## License\n\nThis package is released under the [MIT License](LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphp-client%2Fopenai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphp-client%2Fopenai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphp-client%2Fopenai/lists"}