Skip to content

Modernize OpenAI REST APIs for v6.0 - #167

Merged
orhanerday merged 9 commits into
mainfrom
refactor/v6-docker-validation
Oct 7, 2026
Merged

orhanerday merged 9 commits into
mainfrom
refactor/v6-docker-validation

Conversation

@orhanerday

Copy link
Copy Markdown
Owner

The existing client exposes retired API integrations, uses obsolete fallback models, and can mask native cURL connection errors. This refactor updates the supported REST endpoints for the upcoming 6.0.0 major release, while retaining PHP 7.4 support.

Changes

  • Remove legacy text Completions, Assistants/Threads/Runs, Answers, Classifications, Search, Engines, Edits, and image variations; document replacements in MIGRATING.md.
  • Add Responses, Conversations, Vector Stores, Batches, Uploads, stored Chat operations, Realtime REST operations, checkpoint permissions, graders, Decisions, webhook management/signature verification, and Audio voices/consents.
  • Add all ten organization Usage endpoints and Costs, including filters, grouping, and cursor pagination.
  • Use gpt-4o-mini for chat and text-embedding-3-small for embeddings. Add deferred API-key configuration, custom cURL options, and configurable API path prefixes.
  • Fix cURL error capture, JSON encoding, multipart arrays, GET query serialization, and per-request streaming callbacks. Preserve valid empty response bodies and raw HTTP API errors.
  • Replace obsolete examples/tests with current workflows, native cURL checks, and real API tests with resource cleanup. Simplify the README and document endpoint/testing boundaries in API_COVERAGE.md.

Compatibility

This requires a major version bump: published versions already include 5.x, and removed public methods require consumers to migrate. Core dependencies remain PHP >=7.4, ext-curl, and ext-json. Full Azure deployment URL routing and an SSE event parser are outside this change; streaming callbacks receive raw chunks.

Validation

Full Linux ARM64 Docker suites on 2026-10-07, using separately resolved dependencies and real OpenAI API/admin credentials:

Runtime Passed Failed Skipped Assertions
PHP 7.4.33 / Pest 1.23.1 68 1 1 440
PHP 8.4.26 / Pest 4.7.8 68 1 1 438

All 22 native transport/webhook tests passed on both runtimes. All 16 Usage/Costs tests, key configuration, image generation/edit streaming, and the other live workflows passed. The custom-voice consent test is explicitly skipped without eligible account access.

PHP lint passed in both containers, Composer strict validation passed, PHP CS Fixer found no changes across all nine source/test PHP files, and all 43 README PHP examples passed syntax checks. No cURL mocks were used. The custom API-version test now checks a successful native request and the resulting URL.

Merge blocker

cancelVectorStoreFileBatch() returns HTTP 500 in both full runs. The test remains enabled and fails on the actual error; it does not swallow HTTP 400/500 responses. The route/method were checked against the API reference, and earlier probes reproduced the failure with alternate bodies and the beta header. This suggests an API-side issue, but successful cancellation remains unverified.

Request IDs from the latest runs:

  • req_c5c8c6a205ad4c72a98f6de38f676811 (PHP 7.4)
  • req_ea153b6c396b4b0594ff22adeae32766 (PHP 8.4)

Keep this PR in draft until that failure is resolved or an explicit release decision is made. See API_COVERAGE.md for remaining account/media-dependent validation and the full route inventory.

Refs #127, #135, #149, #152, #155, #156, #159. Related proposals: #114, #139, #146, #150, #153, #162, #165.

Remove retired integrations and add Responses, Conversations, Vector Stores, Batches, Uploads, and Realtime client secrets. Fix request encoding, streaming, and cURL errors; replace legacy tests with native cURL and live API coverage. Update migration notes and the PHP test matrix, and remove the unused Ray development dependency.
Add stored Chat CRUD, Decisions, webhook management and signature verification, Audio voices and consents, fine-tuning graders, and Realtime call controls and translation credentials. Include their tests and endpoint documentation.
Remove promotional text and duplicate examples, simplify setup instructions, and record REST coverage and validation limits. Preserve the observed vector file-batch cancellation failure and custom voice account limitation.
@orhanerday
orhanerday marked this pull request as ready for review October 7, 2026 15:50
@orhanerday
orhanerday merged commit 95bb412 into main Oct 7, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant