crowdin / crowdin/crowdin-api-client-go

Add support for List AI Request Logs method

Open
#151 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
10
Forks
18
Avg merge
1h 11m
Merged PRs (30d)
1

Description

The Crowdin API adds a **List AI Request Logs** method for auditing AI usage:

- crowdin.com: `GET /users/{userId}/ai/request-logs`
- Crowdin Enterprise: `GET /ai/request-logs`
- operationId: `api.ai.requestLogs.getMany`

Optional query filters: `requestId`, `projectId`, `userId`, `aiProviderId`, `model`, `sourceAction` (enum: `ai_proxy`, `ai_gateway`, `ai_translate_strings`, `ai_file_translate`, `ai_prompt_completion`, `pre_translate:manual`, `pre_translate:workflow`, `ai_alignment`, `qa_check`, `ai_suggestion`, `advisor`), `promptAction`, `statuses` (comma-separated: `pending`, `success`, `error`, `timeout`), `systemCredentials` (boolean), `isAutoTriggered` (boolean), `tokenName`, `oauthClientId`, `createdAfter`/`createdBefore` (date-time), plus `limit`/`offset`.

The response model (`AiRequestLog`) includes: `id`, `requestId`, `createdAt`, `status`, `httpStatus`, `model`, `sourceAction`, `promptAction`, `systemCredentials`, `isAutoTriggered`, `durationMs`, `inputTokens`, `outputTokens`, `totalCost`, `userId`, `projectId`, `promptId`, `aiProviderId`, `tokenName`, `oauthClientId`, `oauthClientName`, `ip`, `userAgent`, and `error`.

Client libraries should add this method so consumers can monitor AI request activity and costs via the SDK.

**References:**
- [List AI Request Logs](https://support.crowdin.com/developer/api/v2/#operation/api.ai.requestLogs.getMany)
- Crowdin Enterprise: [List AI Request Logs](https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.ai.requestLogs.getMany)

Contributor guide

Open the contributing guide

Research direction

Start by inspecting the existing Go client methods and response models for comparable Crowdin API list endpoints. Add the List AI Request Logs operation for the documented Crowdin and Crowdin Enterprise paths, including the listed filters and AiRequestLog fields. Run the relevant existing client tests, and consider the work done when both endpoint variants and response data are covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api, backend-api-design
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.