Skip to content

feat(ai): add AI Gateway support - #271

Merged
andrii-bodnar merged 3 commits into
masterfrom
feature/issue-248_add-ai-gateway
Aug 17, 2026
Merged

feat(ai): add AI Gateway support#271
andrii-bodnar merged 3 commits 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.19%. Comparing base (110fb34) to head (ed76f2c).

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #271      +/-   ##
============================================
+ Coverage     93.14%   93.19%   +0.05%     
- Complexity     1890     1900      +10     
============================================
  Files           175      177       +2     
  Lines          5114     5150      +36     
============================================
+ Hits           4763     4799      +36     
  Misses          351      351              

☔ 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
@andrii-bodnar

Copy link
Copy Markdown
Member

@innomaxx conflicts

Resolve conflict in Crowdin.php: keep both the Application API service
(from master) and the AI Gateway service (from this branch).
@andrii-bodnar
andrii-bodnar merged commit 041e3d4 into master Aug 17, 2026
8 checks passed
@andrii-bodnar
andrii-bodnar deleted the feature/issue-248_add-ai-gateway branch August 17, 2026 11:07
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

3 participants