Class ProjectApiKeysClient

java.lang.Object
io.github.stefanbratanov.jvm.openai.ProjectApiKeysClient

public final class ProjectApiKeysClient extends Object
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

  • 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

      public ProjectApiKey retrieveProjectApiKey(String projectId, String keyId)
      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

      public DeletionStatus deleteProjectApiKey(String projectId, String keyId)
      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