Skip to content

feat(ai): add AI Gateway support#271

Open
innomaxx wants to merge 1 commit into
masterfrom
feature/issue-248_add-ai-gateway
Open

feat(ai): add AI Gateway support#271
innomaxx wants to merge 1 commit into
masterfrom
feature/issue-248_add-ai-gateway

Conversation

@innomaxx

@innomaxx innomaxx commented Jun 6, 2026

Copy link
Copy Markdown
Collaborator

Closes #248

@innomaxx innomaxx requested a review from andrii-bodnar June 6, 2026 12:17
@codecov

codecov Bot commented Jun 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.35%. Comparing base (f3bca05) to head (f20705c).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #271      +/-   ##
============================================
+ Coverage     93.30%   93.35%   +0.05%     
- Complexity     1840     1850      +10     
============================================
  Files           169      171       +2     
  Lines          4969     5005      +36     
============================================
+ Hits           4636     4672      +36     
  Misses          333      333              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds SDK support for the Crowdin AI Gateway endpoints (per #248), enabling consumers of this PHP client to proxy GET/POST/PUT/PATCH/DELETE requests through Crowdin’s AI Gateway for both Crowdin and Enterprise environments.

Changes:

  • Introduces AiGatewayApi (Crowdin) and Enterprise\AiGatewayApi with gateway GET/POST/PUT/PATCH/DELETE methods.
  • Adds a generic AiGatewayResponse model to wrap the API’s data payload.
  • Registers the new aiGateway service on the Crowdin client and adds unit tests for both environments.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/CrowdinApiClient/Api/AiGatewayApi.php Adds Crowdin (non-Enterprise) AI Gateway API methods under /users/{userId}/ai/providers/{providerId}/gateway/{path}.
src/CrowdinApiClient/Api/Enterprise/AiGatewayApi.php Adds Enterprise AI Gateway API methods under /ai/providers/{providerId}/gateway/{path}.
src/CrowdinApiClient/Model/AiGatewayResponse.php Adds a lightweight response model for AI Gateway responses.
src/CrowdinApiClient/Crowdin.php Exposes the new $aiGateway API service in both standard and Enterprise service lists.
tests/CrowdinApiClient/Api/AiGatewayApiTest.php Adds unit tests covering Crowdin AI Gateway GET/POST/PUT/PATCH/DELETE behavior.
tests/CrowdinApiClient/Api/Enterprise/AiGatewayApiTest.php Adds unit tests covering Enterprise AI Gateway GET/POST/PUT/PATCH/DELETE behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

use CrowdinApiClient\Http\ResponseDecorator\ResponseModelDecorator;
use CrowdinApiClient\Model\AiGatewayResponse;

class AiGatewayApi extends AbstractApi
use CrowdinApiClient\Http\ResponseDecorator\ResponseModelDecorator;
use CrowdinApiClient\Model\AiGatewayResponse;

class AiGatewayApi extends AbstractApi
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.

Add support for AI Gateway provider methods

2 participants