Class ProjectApiKeysClient
java.lang.Object
io.github.stefanbratanov.jvm.openai.ProjectApiKeysClient
Manage API keys for a given project. Supports listing and deleting keys for users. This API does
not allow issuing keys for users, as users need to authorize themselves to generate keys.
Based on Project API Keys
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final record
-
Method Summary
Modifier and TypeMethodDescriptiondeleteProjectApiKey
(String projectId, String keyId) Deletes an API key from the project.Returns a list of API keys in the project.retrieveProjectApiKey
(String projectId, String keyId) Retrieves an API key in the project.
-
Method Details
-
listProjectApiKeys
public ProjectApiKeysClient.PaginatedProjectApiKeys listProjectApiKeys(String projectId, Optional<String> after, Optional<Integer> limit) Returns a list of API keys in the project.- Parameters:
projectId
- The ID of the project.after
- A cursor for use in pagination. after is an object ID that defines your place in the list.limit
- A limit on the number of objects to be returned.- Throws:
OpenAIException
- in case of API errors
-
retrieveProjectApiKey
Retrieves an API key in the project.- Parameters:
projectId
- The ID of the project.keyId
- The ID of the API key.- Throws:
OpenAIException
- in case of API errors
-
deleteProjectApiKey
Deletes an API key from the project.- Parameters:
projectId
- The ID of the project.keyId
- The ID of the API key.- Throws:
OpenAIException
- in case of API errors
-