# \ProjectsApi
All URIs are relative to *https://api.openai.com/v1*
[**archive_project**](ProjectsApi.md#archive_project) | **POST** /organization/projects/{project_id}/archive | Archives a project in the organization. Archived projects cannot be used or updated.
[**create_project**](ProjectsApi.md#create_project) | **POST** /organization/projects | Create a new project in the organization. Projects can be created and archived, but cannot be deleted.
[**create_project_service_account**](ProjectsApi.md#create_project_service_account) | **POST** /organization/projects/{project_id}/service_accounts | Creates a new service account in the project. This also returns an unredacted API key for the service account.
[**create_project_user**](ProjectsApi.md#create_project_user) | **POST** /organization/projects/{project_id}/users | Adds a user to the project. Users must already be members of the organization to be added to a project.
[**delete_project_api_key**](ProjectsApi.md#delete_project_api_key) | **DELETE** /organization/projects/{project_id}/api_keys/{key_id} | Deletes an API key from the project. Returns confirmation of the key deletion, or an error if the key belonged to a service account.
[**delete_project_service_account**](ProjectsApi.md#delete_project_service_account) | **DELETE** /organization/projects/{project_id}/service_accounts/{service_account_id} | Deletes a service account from the project. Returns confirmation of service account deletion, or an error if the project is archived (archived projects have no service accounts).
[**delete_project_user**](ProjectsApi.md#delete_project_user) | **DELETE** /organization/projects/{project_id}/users/{user_id} | Deletes a user from the project. Returns confirmation of project user deletion, or an error if the project is archived (archived projects have no users).
[**list_project_api_keys**](ProjectsApi.md#list_project_api_keys) | **GET** /organization/projects/{project_id}/api_keys | Returns a list of API keys in the project.
[**list_project_rate_limits**](ProjectsApi.md#list_project_rate_limits) | **GET** /organization/projects/{project_id}/rate_limits | Returns the rate limits per model for a project.
[**list_project_service_accounts**](ProjectsApi.md#list_project_service_accounts) | **GET** /organization/projects/{project_id}/service_accounts | Returns a list of service accounts in the project.
[**list_project_users**](ProjectsApi.md#list_project_users) | **GET** /organization/projects/{project_id}/users | Returns a list of users in the project.
[**list_projects**](ProjectsApi.md#list_projects) | **GET** /organization/projects | Returns a list of projects.
[**modify_project**](ProjectsApi.md#modify_project) | **POST** /organization/projects/{project_id} | Modifies a project in the organization.
[**modify_project_user**](ProjectsApi.md#modify_project_user) | **POST** /organization/projects/{project_id}/users/{user_id} | Modifies a user's role in the project.
[**retrieve_project**](ProjectsApi.md#retrieve_project) | **GET** /organization/projects/{project_id} | Retrieves a project.
[**retrieve_project_api_key**](ProjectsApi.md#retrieve_project_api_key) | **GET** /organization/projects/{project_id}/api_keys/{key_id} | Retrieves an API key in the project.
[**retrieve_project_service_account**](ProjectsApi.md#retrieve_project_service_account) | **GET** /organization/projects/{project_id}/service_accounts/{service_account_id} | Retrieves a service account in the project.
[**retrieve_project_user**](ProjectsApi.md#retrieve_project_user) | **GET** /organization/projects/{project_id}/users/{user_id} | Retrieves a user in the project.
[**update_project_rate_limits**](ProjectsApi.md#update_project_rate_limits) | **POST** /organization/projects/{project_id}/rate_limits/{rate_limit_id} | Updates a project rate limit.
## archive_project
> models::Project archive_project(project_id)
Archives a project in the organization. Archived projects cannot be used or updated.
### Parameters
**project_id** | **String** | The ID of the project. | [required] |
### Return type
[**models::Project**](Project.md)
### Authorization
[ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## create_project
> models::Project create_project(project_create_request)
Create a new project in the organization. Projects can be created and archived, but cannot be deleted.
### Parameters
**project_create_request** | [**ProjectCreateRequest**](ProjectCreateRequest.md) | The project create request payload. | [required] |
### Return type
[**models::Project**](Project.md)
### Authorization
[ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## create_project_service_account
> models::ProjectServiceAccountCreateResponse create_project_service_account(project_id, project_service_account_create_request)
Creates a new service account in the project. This also returns an unredacted API key for the service account.
### Parameters
**project_id** | **String** | The ID of the project. | [required] |
**project_service_account_create_request** | [**ProjectServiceAccountCreateRequest**](ProjectServiceAccountCreateRequest.md) | The project service account create request payload. | [required] |
### Return type
[**models::ProjectServiceAccountCreateResponse**](ProjectServiceAccountCreateResponse.md)
### Authorization
[ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## create_project_user
> models::ProjectUser create_project_user(project_id, project_user_create_request)
Adds a user to the project. Users must already be members of the organization to be added to a project.
### Parameters
**project_id** | **String** | The ID of the project. | [required] |
**project_user_create_request** | [**ProjectUserCreateRequest**](ProjectUserCreateRequest.md) | The project user create request payload. | [required] |
### Return type
[**models::ProjectUser**](ProjectUser.md)
### Authorization
[ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## delete_project_api_key
> models::ProjectApiKeyDeleteResponse delete_project_api_key(project_id, key_id)
Deletes an API key from the project. Returns confirmation of the key deletion, or an error if the key belonged to a service account.
### Parameters
**project_id** | **String** | The ID of the project. | [required] |
**key_id** | **String** | The ID of the API key. | [required] |
### Return type
[**models::ProjectApiKeyDeleteResponse**](ProjectApiKeyDeleteResponse.md)
### Authorization
[ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## delete_project_service_account
> models::ProjectServiceAccountDeleteResponse delete_project_service_account(project_id, service_account_id)
Deletes a service account from the project. Returns confirmation of service account deletion, or an error if the project is archived (archived projects have no service accounts).
### Parameters
**project_id** | **String** | The ID of the project. | [required] |
**service_account_id** | **String** | The ID of the service account. | [required] |
### Return type
[**models::ProjectServiceAccountDeleteResponse**](ProjectServiceAccountDeleteResponse.md)
### Authorization
[ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## delete_project_user
> models::ProjectUserDeleteResponse delete_project_user(project_id, user_id)
Deletes a user from the project. Returns confirmation of project user deletion, or an error if the project is archived (archived projects have no users).
### Parameters
**project_id** | **String** | The ID of the project. | [required] |
**user_id** | **String** | The ID of the user. | [required] |
### Return type
[**models::ProjectUserDeleteResponse**](ProjectUserDeleteResponse.md)
### Authorization
[ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## list_project_api_keys
> models::ProjectApiKeyListResponse list_project_api_keys(project_id, limit, after)
Returns a list of API keys in the project.
### Parameters
**project_id** | **String** | The ID of the project. | [required] |
**limit** | Option<**i32**> | A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. | |[default to 20]
**after** | Option<**String**> | A cursor for use in pagination. `after` is 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. | |
### Return type
[**models::ProjectApiKeyListResponse**](ProjectApiKeyListResponse.md)
### Authorization
[ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## list_project_rate_limits
> models::ProjectRateLimitListResponse list_project_rate_limits(project_id, limit, after, before)
Returns the rate limits per model for a project.
### Parameters
**project_id** | **String** | The ID of the project. | [required] |
**limit** | Option<**i32**> | A limit on the number of objects to be returned. The default is 100. | |[default to 100]
**after** | Option<**String**> | A cursor for use in pagination. `after` is 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** | Option<**String**> | A cursor for use in pagination. `before` is 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. | |
### Return type
[**models::ProjectRateLimitListResponse**](ProjectRateLimitListResponse.md)
### Authorization
[ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## list_project_service_accounts
> models::ProjectServiceAccountListResponse list_project_service_accounts(project_id, limit, after)
Returns a list of service accounts in the project.
### Parameters
**project_id** | **String** | The ID of the project. | [required] |
**limit** | Option<**i32**> | A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. | |[default to 20]
**after** | Option<**String**> | A cursor for use in pagination. `after` is 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. | |
### Return type
[**models::ProjectServiceAccountListResponse**](ProjectServiceAccountListResponse.md)
### Authorization
[ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## list_project_users
> models::ProjectUserListResponse list_project_users(project_id, limit, after)
Returns a list of users in the project.
### Parameters
**project_id** | **String** | The ID of the project. | [required] |
**limit** | Option<**i32**> | A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. | |[default to 20]
**after** | Option<**String**> | A cursor for use in pagination. `after` is 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. | |
### Return type
[**models::ProjectUserListResponse**](ProjectUserListResponse.md)
### Authorization
[ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## list_projects
> models::ProjectListResponse list_projects(limit, after, include_archived)
Returns a list of projects.
### Parameters
**limit** | Option<**i32**> | A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. | |[default to 20]
**after** | Option<**String**> | A cursor for use in pagination. `after` is 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** | Option<**bool**> | If `true` returns all projects including those that have been `archived`. Archived projects are not included by default. | |[default to false]
### Return type
[**models::ProjectListResponse**](ProjectListResponse.md)
### Authorization
[ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## modify_project
> models::Project modify_project(project_id, project_update_request)
Modifies a project in the organization.
### Parameters
**project_id** | **String** | The ID of the project. | [required] |
**project_update_request** | [**ProjectUpdateRequest**](ProjectUpdateRequest.md) | The project update request payload. | [required] |
### Return type
[**models::Project**](Project.md)
### Authorization
[ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## modify_project_user
> models::ProjectUser modify_project_user(project_id, user_id, project_user_update_request)
Modifies a user's role in the project.
### Parameters
**project_id** | **String** | The ID of the project. | [required] |
**user_id** | **String** | The ID of the user. | [required] |
**project_user_update_request** | [**ProjectUserUpdateRequest**](ProjectUserUpdateRequest.md) | The project user update request payload. | [required] |
### Return type
[**models::ProjectUser**](ProjectUser.md)
### Authorization
[ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## retrieve_project
> models::Project retrieve_project(project_id)
Retrieves a project.
### Parameters
**project_id** | **String** | The ID of the project. | [required] |
### Return type
[**models::Project**](Project.md)
### Authorization
[ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## retrieve_project_api_key
> models::ProjectApiKey retrieve_project_api_key(project_id, key_id)
Retrieves an API key in the project.
### Parameters
**project_id** | **String** | The ID of the project. | [required] |
**key_id** | **String** | The ID of the API key. | [required] |
### Return type
[**models::ProjectApiKey**](ProjectApiKey.md)
### Authorization
[ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## retrieve_project_service_account
> models::ProjectServiceAccount retrieve_project_service_account(project_id, service_account_id)
Retrieves a service account in the project.
### Parameters
**project_id** | **String** | The ID of the project. | [required] |
**service_account_id** | **String** | The ID of the service account. | [required] |
### Return type
[**models::ProjectServiceAccount**](ProjectServiceAccount.md)
### Authorization
[ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## retrieve_project_user
> models::ProjectUser retrieve_project_user(project_id, user_id)
Retrieves a user in the project.
### Parameters
**project_id** | **String** | The ID of the project. | [required] |
**user_id** | **String** | The ID of the user. | [required] |
### Return type
[**models::ProjectUser**](ProjectUser.md)
### Authorization
[ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## update_project_rate_limits
> models::ProjectRateLimit update_project_rate_limits(project_id, rate_limit_id, project_rate_limit_update_request)
Updates a project rate limit.
### Parameters
**project_id** | **String** | The ID of the project. | [required] |
**rate_limit_id** | **String** | The ID of the rate limit. | [required] |
**project_rate_limit_update_request** | [**ProjectRateLimitUpdateRequest**](ProjectRateLimitUpdateRequest.md) | The project rate limit update request payload. | [required] |
### Return type
[**models::ProjectRateLimit**](ProjectRateLimit.md)
### Authorization
[ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)