feat(api): update API spec from langfuse/langfuse 1ded68c #1414
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Important
This PR updates the API to allow optional public and secret keys when creating API keys and adds a reference to the Metrics API documentation.
public_keyandsecret_keyparameters tocreate_api_key()inProjectsClientandAsyncProjectsClient.metrics()docstring inmetrics/client.py.This description was created by
for 665b045. You can customize this summary. It will automatically update as commits are pushed.
Disclaimer: Experimental PR review
Greptile Overview
Updated On: 2025-10-21 08:00:53 UTC
Summary
This PR updates the auto-generated API client to sync with the upstream Langfuse API specification (commit 1ded68c).
Key changes:
public_keyandsecret_keyparameters tocreate_api_keymethod, allowing predefined API keys to be created with custom values instead of auto-generated onespublic_keyandsecret_keyparametersThe changes are straightforward API surface additions with no breaking changes to existing functionality.
Confidence Score: 4/5
Important Files Changed
File Analysis
Sequence Diagram
sequenceDiagram participant Client participant ProjectsClient participant API as Langfuse API Note over Client,API: create_api_key - New Flow with Optional Keys Client->>ProjectsClient: create_api_key(project_id, note?, public_key?, secret_key?) ProjectsClient->>ProjectsClient: Prepare request payload<br/>{note, publicKey, secretKey} ProjectsClient->>API: POST /api/public/projects/{id}/apiKeys alt Success (200-299) API-->>ProjectsClient: ApiKeyResponse ProjectsClient-->>Client: Return ApiKeyResponse else Bad Request (400) API-->>ProjectsClient: Error response ProjectsClient-->>Client: Raise Error else Unauthorized (401) API-->>ProjectsClient: Error response ProjectsClient-->>Client: Raise UnauthorizedError else Forbidden (403) API-->>ProjectsClient: Error response ProjectsClient-->>Client: Raise AccessDeniedError else Not Found (404) API-->>ProjectsClient: Error response ProjectsClient-->>Client: Raise NotFoundError else Method Not Allowed (405) API-->>ProjectsClient: Error response ProjectsClient-->>Client: Raise MethodNotAllowedError end Note over Client,API: Metrics Query - Enhanced Documentation Client->>MetricsClient: metrics(query) MetricsClient->>API: POST /api/public/metrics API-->>MetricsClient: MetricsResponse MetricsClient-->>Client: Return MetricsResponse