View Source OpenAi.Projects (OpenAI REST API Client v1.0.0)
Provides API endpoints related to projects
Summary
Functions
Archives a project in the organization. Archived projects cannot be used or updated.
Create a new project in the organization. Projects can be created and archived, but cannot be deleted.
Creates a new service account in the project. This also returns an unredacted API key for the service account.
Adds a user to the project. Users must already be members of the organization to be added to a project.
Deletes an API key from the project.
Deletes a service account from the project.
Deletes a user from the project.
Returns a list of API keys in the project.
Returns the rate limits per model for a project.
Returns a list of service accounts in the project.
Returns a list of users in the project.
Returns a list of projects.
Modifies a project in the organization.
Modifies a user's role in the project.
Retrieves a project.
Retrieves an API key in the project.
Retrieves a service account in the project.
Retrieves a user in the project.
Updates a project rate limit.
Functions
@spec archive_project(project_id :: String.t(), opts :: keyword()) :: {:ok, OpenAi.Project.t()} | {:error, OpenAi.Error.error()}
Archives a project in the organization. Archived projects cannot be used or updated.
@spec create_project(body :: OpenAi.Project.CreateRequest.t(), opts :: keyword()) :: {:ok, OpenAi.Project.t()} | {:error, OpenAi.Error.error()}
Create a new project in the organization. Projects can be created and archived, but cannot be deleted.
@spec create_project_service_account( project_id :: String.t(), body :: OpenAi.Project.ServiceAccount.CreateRequest.t(), opts :: keyword() ) :: {:ok, OpenAi.Project.ServiceAccount.CreateResponse.t()} | {:error, OpenAi.Error.error()}
Creates a new service account in the project. This also returns an unredacted API key for the service account.
@spec create_project_user( project_id :: String.t(), body :: OpenAi.Project.User.CreateRequest.t(), opts :: keyword() ) :: {:ok, OpenAi.Project.User.t()} | {:error, OpenAi.Error.error()}
Adds a user to the project. Users must already be members of the organization to be added to a project.
@spec delete_project_api_key( project_id :: String.t(), key_id :: String.t(), opts :: keyword() ) :: {:ok, OpenAi.Project.ApiKey.DeleteResponse.t()} | {:error, OpenAi.Error.error()}
Deletes an API key from the project.
delete_project_service_account(project_id, service_account_id, opts \\ [])
View Source@spec delete_project_service_account( project_id :: String.t(), service_account_id :: String.t(), opts :: keyword() ) :: {:ok, OpenAi.Project.ServiceAccount.DeleteResponse.t()} | {:error, OpenAi.Error.error()}
Deletes a service account from the project.
@spec delete_project_user( project_id :: String.t(), user_id :: String.t(), opts :: keyword() ) :: {:ok, OpenAi.Project.User.DeleteResponse.t()} | {:error, OpenAi.Error.error()}
Deletes a user from the project.
@spec list_project_api_keys(project_id :: String.t(), opts :: keyword()) :: {:ok, OpenAi.Project.ApiKey.ListResponse.t()} | {:error, OpenAi.Error.error()}
Returns a list of API keys in the project.
Options
limit: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.after: A cursor for use in pagination.afteris an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
@spec list_project_rate_limits(project_id :: String.t(), opts :: keyword()) :: {:ok, OpenAi.Project.RateLimitListResponse.t()} | {:error, OpenAi.Error.error()}
Returns the rate limits per model for a project.
Options
limit: A limit on the number of objects to be returned. The default is 100.after: A cursor for use in pagination.afteris an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.before: A cursor for use in pagination.beforeis an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, beginning with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.
@spec list_project_service_accounts(project_id :: String.t(), opts :: keyword()) :: {:ok, OpenAi.Project.ServiceAccount.ListResponse.t()} | {:error, OpenAi.Error.error()}
Returns a list of service accounts in the project.
Options
limit: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.after: A cursor for use in pagination.afteris an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
@spec list_project_users(project_id :: String.t(), opts :: keyword()) :: {:ok, OpenAi.Project.User.ListResponse.t()} | {:error, OpenAi.Error.error()}
Returns a list of users in the project.
Options
limit: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.after: A cursor for use in pagination.afteris an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
@spec list_projects(opts :: keyword()) :: {:ok, OpenAi.Project.ListResponse.t()} | {:error, OpenAi.Error.error()}
Returns a list of projects.
Options
limit: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.after: A cursor for use in pagination.afteris an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.include_archived: Iftruereturns all projects including those that have beenarchived. Archived projects are not included by default.
@spec modify_project( project_id :: String.t(), body :: OpenAi.Project.UpdateRequest.t(), opts :: keyword() ) :: {:ok, OpenAi.Project.t()} | {:error, OpenAi.Error.error()}
Modifies a project in the organization.
@spec modify_project_user( project_id :: String.t(), user_id :: String.t(), body :: OpenAi.Project.User.UpdateRequest.t(), opts :: keyword() ) :: {:ok, OpenAi.Project.User.t()} | {:error, OpenAi.Error.error()}
Modifies a user's role in the project.
@spec retrieve_project(project_id :: String.t(), opts :: keyword()) :: {:ok, OpenAi.Project.t()} | {:error, OpenAi.Error.error()}
Retrieves a project.
@spec retrieve_project_api_key( project_id :: String.t(), key_id :: String.t(), opts :: keyword() ) :: {:ok, OpenAi.Project.ApiKey.t()} | {:error, OpenAi.Error.error()}
Retrieves an API key in the project.
retrieve_project_service_account(project_id, service_account_id, opts \\ [])
View Source@spec retrieve_project_service_account( project_id :: String.t(), service_account_id :: String.t(), opts :: keyword() ) :: {:ok, OpenAi.Project.ServiceAccount.t()} | {:error, OpenAi.Error.error()}
Retrieves a service account in the project.
@spec retrieve_project_user( project_id :: String.t(), user_id :: String.t(), opts :: keyword() ) :: {:ok, OpenAi.Project.User.t()} | {:error, OpenAi.Error.error()}
Retrieves a user in the project.
update_project_rate_limits(project_id, rate_limit_id, body, opts \\ [])
View Source@spec update_project_rate_limits( project_id :: String.t(), rate_limit_id :: String.t(), body :: OpenAi.Project.RateLimitUpdateRequest.t(), opts :: keyword() ) :: {:ok, OpenAi.Project.RateLimit.t()} | {:error, OpenAi.Error.error()}
Updates a project rate limit.