diff --git a/en/java/resources/admin/index.md b/en/java/resources/admin/index.md index d17b6a6..b5f3e14 100644 --- a/en/java/resources/admin/index.md +++ b/en/java/resources/admin/index.md @@ -2173,6 +2173,70 @@ Get audio speeches usage details for the organization. When `group_by=project_id`, this field provides the project ID of the grouped usage result. + - `class OrganizationUsageFileSearchesResult:` + + The aggregated file search calls usage details of the specific time bucket. + + - `long numRequests` + + The count of file search calls. + + - `JsonValue; object_ "organization.usage.file_searches.result"constant` + + - `ORGANIZATION_USAGE_FILE_SEARCHES_RESULT("organization.usage.file_searches.result")` + + - `Optional apiKeyId` + + When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. + + - `Optional projectId` + + When `group_by=project_id`, this field provides the project ID of the grouped usage result. + + - `Optional userId` + + When `group_by=user_id`, this field provides the user ID of the grouped usage result. + + - `Optional vectorStoreId` + + When `group_by=vector_store_id`, this field provides the vector store ID of the grouped usage result. + + - `class OrganizationUsageWebSearchesResult:` + + The aggregated web search calls usage details of the specific time bucket. + + - `long numModelRequests` + + The count of model requests. + + - `long numRequests` + + The count of web search calls. + + - `JsonValue; object_ "organization.usage.web_searches.result"constant` + + - `ORGANIZATION_USAGE_WEB_SEARCHES_RESULT("organization.usage.web_searches.result")` + + - `Optional apiKeyId` + + When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. + + - `Optional contextLevel` + + When `group_by=context_level`, this field provides the search context size of the grouped usage result. + + - `Optional model` + + When `group_by=model`, this field provides the model name of the grouped usage result. + + - `Optional projectId` + + When `group_by=project_id`, this field provides the project ID of the grouped usage result. + + - `Optional userId` + + When `group_by=user_id`, this field provides the user ID of the grouped usage result. + - `class OrganizationCostsResult:` The aggregated costs details of the specific time bucket. @@ -2617,6 +2681,70 @@ Get audio transcriptions usage details for the organization. When `group_by=project_id`, this field provides the project ID of the grouped usage result. + - `class OrganizationUsageFileSearchesResult:` + + The aggregated file search calls usage details of the specific time bucket. + + - `long numRequests` + + The count of file search calls. + + - `JsonValue; object_ "organization.usage.file_searches.result"constant` + + - `ORGANIZATION_USAGE_FILE_SEARCHES_RESULT("organization.usage.file_searches.result")` + + - `Optional apiKeyId` + + When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. + + - `Optional projectId` + + When `group_by=project_id`, this field provides the project ID of the grouped usage result. + + - `Optional userId` + + When `group_by=user_id`, this field provides the user ID of the grouped usage result. + + - `Optional vectorStoreId` + + When `group_by=vector_store_id`, this field provides the vector store ID of the grouped usage result. + + - `class OrganizationUsageWebSearchesResult:` + + The aggregated web search calls usage details of the specific time bucket. + + - `long numModelRequests` + + The count of model requests. + + - `long numRequests` + + The count of web search calls. + + - `JsonValue; object_ "organization.usage.web_searches.result"constant` + + - `ORGANIZATION_USAGE_WEB_SEARCHES_RESULT("organization.usage.web_searches.result")` + + - `Optional apiKeyId` + + When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. + + - `Optional contextLevel` + + When `group_by=context_level`, this field provides the search context size of the grouped usage result. + + - `Optional model` + + When `group_by=model`, this field provides the model name of the grouped usage result. + + - `Optional projectId` + + When `group_by=project_id`, this field provides the project ID of the grouped usage result. + + - `Optional userId` + + When `group_by=user_id`, this field provides the user ID of the grouped usage result. + - `class OrganizationCostsResult:` The aggregated costs details of the specific time bucket. @@ -3043,6 +3171,70 @@ Get code interpreter sessions usage details for the organization. When `group_by=project_id`, this field provides the project ID of the grouped usage result. + - `class OrganizationUsageFileSearchesResult:` + + The aggregated file search calls usage details of the specific time bucket. + + - `long numRequests` + + The count of file search calls. + + - `JsonValue; object_ "organization.usage.file_searches.result"constant` + + - `ORGANIZATION_USAGE_FILE_SEARCHES_RESULT("organization.usage.file_searches.result")` + + - `Optional apiKeyId` + + When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. + + - `Optional projectId` + + When `group_by=project_id`, this field provides the project ID of the grouped usage result. + + - `Optional userId` + + When `group_by=user_id`, this field provides the user ID of the grouped usage result. + + - `Optional vectorStoreId` + + When `group_by=vector_store_id`, this field provides the vector store ID of the grouped usage result. + + - `class OrganizationUsageWebSearchesResult:` + + The aggregated web search calls usage details of the specific time bucket. + + - `long numModelRequests` + + The count of model requests. + + - `long numRequests` + + The count of web search calls. + + - `JsonValue; object_ "organization.usage.web_searches.result"constant` + + - `ORGANIZATION_USAGE_WEB_SEARCHES_RESULT("organization.usage.web_searches.result")` + + - `Optional apiKeyId` + + When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. + + - `Optional contextLevel` + + When `group_by=context_level`, this field provides the search context size of the grouped usage result. + + - `Optional model` + + When `group_by=model`, this field provides the model name of the grouped usage result. + + - `Optional projectId` + + When `group_by=project_id`, this field provides the project ID of the grouped usage result. + + - `Optional userId` + + When `group_by=user_id`, this field provides the user ID of the grouped usage result. + - `class OrganizationCostsResult:` The aggregated costs details of the specific time bucket. @@ -3495,6 +3687,70 @@ Get completions usage details for the organization. When `group_by=project_id`, this field provides the project ID of the grouped usage result. + - `class OrganizationUsageFileSearchesResult:` + + The aggregated file search calls usage details of the specific time bucket. + + - `long numRequests` + + The count of file search calls. + + - `JsonValue; object_ "organization.usage.file_searches.result"constant` + + - `ORGANIZATION_USAGE_FILE_SEARCHES_RESULT("organization.usage.file_searches.result")` + + - `Optional apiKeyId` + + When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. + + - `Optional projectId` + + When `group_by=project_id`, this field provides the project ID of the grouped usage result. + + - `Optional userId` + + When `group_by=user_id`, this field provides the user ID of the grouped usage result. + + - `Optional vectorStoreId` + + When `group_by=vector_store_id`, this field provides the vector store ID of the grouped usage result. + + - `class OrganizationUsageWebSearchesResult:` + + The aggregated web search calls usage details of the specific time bucket. + + - `long numModelRequests` + + The count of model requests. + + - `long numRequests` + + The count of web search calls. + + - `JsonValue; object_ "organization.usage.web_searches.result"constant` + + - `ORGANIZATION_USAGE_WEB_SEARCHES_RESULT("organization.usage.web_searches.result")` + + - `Optional apiKeyId` + + When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. + + - `Optional contextLevel` + + When `group_by=context_level`, this field provides the search context size of the grouped usage result. + + - `Optional model` + + When `group_by=model`, this field provides the model name of the grouped usage result. + + - `Optional projectId` + + When `group_by=project_id`, this field provides the project ID of the grouped usage result. + + - `Optional userId` + + When `group_by=user_id`, this field provides the user ID of the grouped usage result. + - `class OrganizationCostsResult:` The aggregated costs details of the specific time bucket. @@ -3939,6 +4195,70 @@ Get embeddings usage details for the organization. When `group_by=project_id`, this field provides the project ID of the grouped usage result. + - `class OrganizationUsageFileSearchesResult:` + + The aggregated file search calls usage details of the specific time bucket. + + - `long numRequests` + + The count of file search calls. + + - `JsonValue; object_ "organization.usage.file_searches.result"constant` + + - `ORGANIZATION_USAGE_FILE_SEARCHES_RESULT("organization.usage.file_searches.result")` + + - `Optional apiKeyId` + + When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. + + - `Optional projectId` + + When `group_by=project_id`, this field provides the project ID of the grouped usage result. + + - `Optional userId` + + When `group_by=user_id`, this field provides the user ID of the grouped usage result. + + - `Optional vectorStoreId` + + When `group_by=vector_store_id`, this field provides the vector store ID of the grouped usage result. + + - `class OrganizationUsageWebSearchesResult:` + + The aggregated web search calls usage details of the specific time bucket. + + - `long numModelRequests` + + The count of model requests. + + - `long numRequests` + + The count of web search calls. + + - `JsonValue; object_ "organization.usage.web_searches.result"constant` + + - `ORGANIZATION_USAGE_WEB_SEARCHES_RESULT("organization.usage.web_searches.result")` + + - `Optional apiKeyId` + + When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. + + - `Optional contextLevel` + + When `group_by=context_level`, this field provides the search context size of the grouped usage result. + + - `Optional model` + + When `group_by=model`, this field provides the model name of the grouped usage result. + + - `Optional projectId` + + When `group_by=project_id`, this field provides the project ID of the grouped usage result. + + - `Optional userId` + + When `group_by=user_id`, this field provides the user ID of the grouped usage result. + - `class OrganizationCostsResult:` The aggregated costs details of the specific time bucket. @@ -4411,35 +4731,99 @@ Get images usage details for the organization. When `group_by=project_id`, this field provides the project ID of the grouped usage result. - - `class OrganizationCostsResult:` + - `class OrganizationUsageFileSearchesResult:` - The aggregated costs details of the specific time bucket. + The aggregated file search calls usage details of the specific time bucket. - - `JsonValue; object_ "organization.costs.result"constant` + - `long numRequests` - - `ORGANIZATION_COSTS_RESULT("organization.costs.result")` + The count of file search calls. - - `Optional amount` + - `JsonValue; object_ "organization.usage.file_searches.result"constant` - The monetary value in its associated currency. + - `ORGANIZATION_USAGE_FILE_SEARCHES_RESULT("organization.usage.file_searches.result")` - - `Optional currency` + - `Optional apiKeyId` - Lowercase ISO-4217 currency e.g. "usd" + When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. - - `Optional value` + - `Optional projectId` - The numeric value of the cost. + When `group_by=project_id`, this field provides the project ID of the grouped usage result. - - `Optional apiKeyId` + - `Optional userId` - When `group_by=api_key_id`, this field provides the API Key ID of the grouped costs result. + When `group_by=user_id`, this field provides the user ID of the grouped usage result. - - `Optional lineItem` + - `Optional vectorStoreId` - When `group_by=line_item`, this field provides the line item of the grouped costs result. + When `group_by=vector_store_id`, this field provides the vector store ID of the grouped usage result. - - `Optional projectId` + - `class OrganizationUsageWebSearchesResult:` + + The aggregated web search calls usage details of the specific time bucket. + + - `long numModelRequests` + + The count of model requests. + + - `long numRequests` + + The count of web search calls. + + - `JsonValue; object_ "organization.usage.web_searches.result"constant` + + - `ORGANIZATION_USAGE_WEB_SEARCHES_RESULT("organization.usage.web_searches.result")` + + - `Optional apiKeyId` + + When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. + + - `Optional contextLevel` + + When `group_by=context_level`, this field provides the search context size of the grouped usage result. + + - `Optional model` + + When `group_by=model`, this field provides the model name of the grouped usage result. + + - `Optional projectId` + + When `group_by=project_id`, this field provides the project ID of the grouped usage result. + + - `Optional userId` + + When `group_by=user_id`, this field provides the user ID of the grouped usage result. + + - `class OrganizationCostsResult:` + + The aggregated costs details of the specific time bucket. + + - `JsonValue; object_ "organization.costs.result"constant` + + - `ORGANIZATION_COSTS_RESULT("organization.costs.result")` + + - `Optional amount` + + The monetary value in its associated currency. + + - `Optional currency` + + Lowercase ISO-4217 currency e.g. "usd" + + - `Optional value` + + The numeric value of the cost. + + - `Optional apiKeyId` + + When `group_by=api_key_id`, this field provides the API Key ID of the grouped costs result. + + - `Optional lineItem` + + When `group_by=line_item`, this field provides the line item of the grouped costs result. + + - `Optional projectId` When `group_by=project_id`, this field provides the project ID of the grouped costs result. @@ -4855,6 +5239,70 @@ Get moderations usage details for the organization. When `group_by=project_id`, this field provides the project ID of the grouped usage result. + - `class OrganizationUsageFileSearchesResult:` + + The aggregated file search calls usage details of the specific time bucket. + + - `long numRequests` + + The count of file search calls. + + - `JsonValue; object_ "organization.usage.file_searches.result"constant` + + - `ORGANIZATION_USAGE_FILE_SEARCHES_RESULT("organization.usage.file_searches.result")` + + - `Optional apiKeyId` + + When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. + + - `Optional projectId` + + When `group_by=project_id`, this field provides the project ID of the grouped usage result. + + - `Optional userId` + + When `group_by=user_id`, this field provides the user ID of the grouped usage result. + + - `Optional vectorStoreId` + + When `group_by=vector_store_id`, this field provides the vector store ID of the grouped usage result. + + - `class OrganizationUsageWebSearchesResult:` + + The aggregated web search calls usage details of the specific time bucket. + + - `long numModelRequests` + + The count of model requests. + + - `long numRequests` + + The count of web search calls. + + - `JsonValue; object_ "organization.usage.web_searches.result"constant` + + - `ORGANIZATION_USAGE_WEB_SEARCHES_RESULT("organization.usage.web_searches.result")` + + - `Optional apiKeyId` + + When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. + + - `Optional contextLevel` + + When `group_by=context_level`, this field provides the search context size of the grouped usage result. + + - `Optional model` + + When `group_by=model`, this field provides the model name of the grouped usage result. + + - `Optional projectId` + + When `group_by=project_id`, this field provides the project ID of the grouped usage result. + + - `Optional userId` + + When `group_by=user_id`, this field provides the user ID of the grouped usage result. + - `class OrganizationCostsResult:` The aggregated costs details of the specific time bucket. @@ -5281,6 +5729,70 @@ Get vector stores usage details for the organization. When `group_by=project_id`, this field provides the project ID of the grouped usage result. + - `class OrganizationUsageFileSearchesResult:` + + The aggregated file search calls usage details of the specific time bucket. + + - `long numRequests` + + The count of file search calls. + + - `JsonValue; object_ "organization.usage.file_searches.result"constant` + + - `ORGANIZATION_USAGE_FILE_SEARCHES_RESULT("organization.usage.file_searches.result")` + + - `Optional apiKeyId` + + When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. + + - `Optional projectId` + + When `group_by=project_id`, this field provides the project ID of the grouped usage result. + + - `Optional userId` + + When `group_by=user_id`, this field provides the user ID of the grouped usage result. + + - `Optional vectorStoreId` + + When `group_by=vector_store_id`, this field provides the vector store ID of the grouped usage result. + + - `class OrganizationUsageWebSearchesResult:` + + The aggregated web search calls usage details of the specific time bucket. + + - `long numModelRequests` + + The count of model requests. + + - `long numRequests` + + The count of web search calls. + + - `JsonValue; object_ "organization.usage.web_searches.result"constant` + + - `ORGANIZATION_USAGE_WEB_SEARCHES_RESULT("organization.usage.web_searches.result")` + + - `Optional apiKeyId` + + When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. + + - `Optional contextLevel` + + When `group_by=context_level`, this field provides the search context size of the grouped usage result. + + - `Optional model` + + When `group_by=model`, this field provides the model name of the grouped usage result. + + - `Optional projectId` + + When `group_by=project_id`, this field provides the project ID of the grouped usage result. + + - `Optional userId` + + When `group_by=user_id`, this field provides the user ID of the grouped usage result. + - `class OrganizationCostsResult:` The aggregated costs details of the specific time bucket. @@ -5385,17 +5897,17 @@ public final class Main { } ``` -## Costs +## File search calls -`UsageCostsResponse admin().organization().usage().costs(UsageCostsParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` +`UsageFileSearchCallsResponse admin().organization().usage().fileSearchCalls(UsageFileSearchCallsParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` -**get** `/organization/costs` +**get** `/organization/usage/file_search_calls` -Get costs details for the organization. +Get file search calls usage details for the organization. ### Parameters -- `UsageCostsParams params` +- `UsageFileSearchCallsParams params` - `long startTime` @@ -5403,11 +5915,15 @@ Get costs details for the organization. - `Optional> apiKeyIds` - Return only costs for these API keys. + Return only usage for these API keys. - `Optional bucketWidth` - Width of each time bucket in response. Currently only `1d` is supported, default to `1d`. + Width of each time bucket in response. Currently `1m`, `1h` and `1d` are supported, default to `1d`. + + - `_1M("1m")` + + - `_1H("1h")` - `_1D("1d")` @@ -5417,17 +5933,23 @@ Get costs details for the organization. - `Optional> groupBy` - Group the costs by the specified fields. Support fields include `project_id`, `line_item`, `api_key_id` and any combination of them. + Group the usage data by the specified fields. Support fields include `project_id`, `user_id`, `api_key_id`, `vector_store_id` or any combination of them. - `PROJECT_ID("project_id")` - - `LINE_ITEM("line_item")` + - `USER_ID("user_id")` - `API_KEY_ID("api_key_id")` + - `VECTOR_STORE_ID("vector_store_id")` + - `Optional limit` - A limit on the number of buckets to be returned. Limit can range between 1 and 180, and the default is 7. + Specifies the number of buckets to return. + + - `bucket_width=1d`: default: 7, max: 31 + - `bucket_width=1h`: default: 24, max: 168 + - `bucket_width=1m`: default: 60, max: 1440 - `Optional page` @@ -5435,11 +5957,19 @@ Get costs details for the organization. - `Optional> projectIds` - Return only costs for these projects. + Return only usage for these projects. + + - `Optional> userIds` + + Return only usage for these users. + + - `Optional> vectorStoreIds` + + Return only usage for these vector stores. ### Returns -- `class UsageCostsResponse:` +- `class UsageFileSearchCallsResponse:` - `List data` @@ -5707,6 +6237,70 @@ Get costs details for the organization. When `group_by=project_id`, this field provides the project ID of the grouped usage result. + - `class OrganizationUsageFileSearchesResult:` + + The aggregated file search calls usage details of the specific time bucket. + + - `long numRequests` + + The count of file search calls. + + - `JsonValue; object_ "organization.usage.file_searches.result"constant` + + - `ORGANIZATION_USAGE_FILE_SEARCHES_RESULT("organization.usage.file_searches.result")` + + - `Optional apiKeyId` + + When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. + + - `Optional projectId` + + When `group_by=project_id`, this field provides the project ID of the grouped usage result. + + - `Optional userId` + + When `group_by=user_id`, this field provides the user ID of the grouped usage result. + + - `Optional vectorStoreId` + + When `group_by=vector_store_id`, this field provides the vector store ID of the grouped usage result. + + - `class OrganizationUsageWebSearchesResult:` + + The aggregated web search calls usage details of the specific time bucket. + + - `long numModelRequests` + + The count of model requests. + + - `long numRequests` + + The count of web search calls. + + - `JsonValue; object_ "organization.usage.web_searches.result"constant` + + - `ORGANIZATION_USAGE_WEB_SEARCHES_RESULT("organization.usage.web_searches.result")` + + - `Optional apiKeyId` + + When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. + + - `Optional contextLevel` + + When `group_by=context_level`, this field provides the search context size of the grouped usage result. + + - `Optional model` + + When `group_by=model`, this field provides the model name of the grouped usage result. + + - `Optional projectId` + + When `group_by=project_id`, this field provides the project ID of the grouped usage result. + + - `Optional userId` + + When `group_by=user_id`, this field provides the user ID of the grouped usage result. + - `class OrganizationCostsResult:` The aggregated costs details of the specific time bucket. @@ -5760,8 +6354,8 @@ package com.openai.example; import com.openai.client.OpenAIClient; import com.openai.client.okhttp.OpenAIOkHttpClient; -import com.openai.models.admin.organization.usage.UsageCostsParams; -import com.openai.models.admin.organization.usage.UsageCostsResponse; +import com.openai.models.admin.organization.usage.UsageFileSearchCallsParams; +import com.openai.models.admin.organization.usage.UsageFileSearchCallsResponse; public final class Main { private Main() {} @@ -5769,10 +6363,10 @@ public final class Main { public static void main(String[] args) { OpenAIClient client = OpenAIOkHttpClient.fromEnv(); - UsageCostsParams params = UsageCostsParams.builder() + UsageFileSearchCallsParams params = UsageFileSearchCallsParams.builder() .startTime(0L) .build(); - UsageCostsResponse response = client.admin().organization().usage().costs(params); + UsageFileSearchCallsResponse response = client.admin().organization().usage().fileSearchCalls(params); } } ``` @@ -5811,572 +6405,1582 @@ public final class Main { } ``` -# Invites - -## List invites +## Web search calls -`InviteListPage admin().organization().invites().list(InviteListParamsparams = InviteListParams.none(), RequestOptionsrequestOptions = RequestOptions.none())` +`UsageWebSearchCallsResponse admin().organization().usage().webSearchCalls(UsageWebSearchCallsParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` -**get** `/organization/invites` +**get** `/organization/usage/web_search_calls` -Returns a list of invites in the organization. +Get web search calls usage details for the organization. ### Parameters -- `InviteListParams params` +- `UsageWebSearchCallsParams params` - - `Optional after` + - `long startTime` - 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. + Start time (Unix seconds) of the query time range, inclusive. - - `Optional limit` + - `Optional> apiKeyIds` - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + Return only usage for these API keys. -### Returns + - `Optional bucketWidth` -- `class Invite:` + Width of each time bucket in response. Currently `1m`, `1h` and `1d` are supported, default to `1d`. - Represents an individual `invite` to the organization. + - `_1M("1m")` - - `String id` + - `_1H("1h")` - The identifier, which can be referenced in API endpoints + - `_1D("1d")` - - `long createdAt` + - `Optional> contextLevels` - The Unix timestamp (in seconds) of when the invite was sent. + Return only web search usage for these context levels. - - `String email` + - `LOW("low")` - The email address of the individual to whom the invite was sent + - `MEDIUM("medium")` - - `JsonValue; object_ "organization.invite"constant` + - `HIGH("high")` - The object type, which is always `organization.invite` + - `Optional endTime` - - `ORGANIZATION_INVITE("organization.invite")` + End time (Unix seconds) of the query time range, exclusive. - - `List projects` + - `Optional> groupBy` - The projects that were granted membership upon acceptance of the invite. + Group the usage data by the specified fields. Support fields include `project_id`, `user_id`, `api_key_id`, `model`, `context_level` or any combination of them. - - `String id` + - `PROJECT_ID("project_id")` - Project's public ID + - `USER_ID("user_id")` - - `Role role` + - `API_KEY_ID("api_key_id")` - Project membership role + - `MODEL("model")` - - `MEMBER("member")` + - `CONTEXT_LEVEL("context_level")` - - `OWNER("owner")` + - `Optional limit` - - `Role role` + Specifies the number of buckets to return. - `owner` or `reader` + - `bucket_width=1d`: default: 7, max: 31 + - `bucket_width=1h`: default: 24, max: 168 + - `bucket_width=1m`: default: 60, max: 1440 - - `OWNER("owner")` + - `Optional> models` - - `READER("reader")` + Return only usage for these models. - - `Status status` + - `Optional page` - `accepted`,`expired`, or `pending` + A cursor for use in pagination. Corresponding to the `next_page` field from the previous response. - - `ACCEPTED("accepted")` + - `Optional> projectIds` - - `EXPIRED("expired")` + Return only usage for these projects. - - `PENDING("pending")` + - `Optional> userIds` - - `Optional acceptedAt` + Return only usage for these users. - The Unix timestamp (in seconds) of when the invite was accepted. +### Returns - - `Optional expiresAt` +- `class UsageWebSearchCallsResponse:` - The Unix timestamp (in seconds) of when the invite expires. + - `List data` -### Example + - `long endTime` -```java -package com.openai.example; + - `JsonValue; object_ "bucket"constant` -import com.openai.client.OpenAIClient; -import com.openai.client.okhttp.OpenAIOkHttpClient; -import com.openai.models.admin.organization.invites.InviteListPage; -import com.openai.models.admin.organization.invites.InviteListParams; + - `BUCKET("bucket")` -public final class Main { - private Main() {} + - `List results` - public static void main(String[] args) { - OpenAIClient client = OpenAIOkHttpClient.fromEnv(); + - `class OrganizationUsageCompletionsResult:` - InviteListPage page = client.admin().organization().invites().list(); - } -} -``` + The aggregated completions usage details of the specific time bucket. -#### Response + - `long inputTokens` -```json -{ - "data": [ - { - "id": "id", - "created_at": 0, - "email": "email", - "object": "organization.invite", - "projects": [ - { - "id": "id", - "role": "member" - } - ], - "role": "owner", - "status": "accepted", - "accepted_at": 0, - "expires_at": 0 - } - ], - "has_more": true, - "object": "list", - "first_id": "first_id", - "last_id": "last_id" -} -``` + The aggregated number of text input tokens used, including cached tokens. For customers subscribe to scale tier, this includes scale tier tokens. -## Create invite + - `long numModelRequests` -`Invite admin().organization().invites().create(InviteCreateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` + The count of requests made to the model. -**post** `/organization/invites` + - `JsonValue; object_ "organization.usage.completions.result"constant` -Create an invite for a user to the organization. The invite must be accepted by the user before they have access to the organization. + - `ORGANIZATION_USAGE_COMPLETIONS_RESULT("organization.usage.completions.result")` -### Parameters + - `long outputTokens` -- `InviteCreateParams params` + The aggregated number of text output tokens used. For customers subscribe to scale tier, this includes scale tier tokens. - - `String email` + - `Optional apiKeyId` - Send an email to this address + When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. - - `Role role` + - `Optional batch` - `owner` or `reader` + When `group_by=batch`, this field tells whether the grouped usage result is batch or not. - - `READER("reader")` + - `Optional inputAudioTokens` - - `OWNER("owner")` + The aggregated number of audio input tokens used, including cached tokens. - - `Optional> projects` + - `Optional inputCachedTokens` - An array of projects to which membership is granted at the same time the org invite is accepted. If omitted, the user will be invited to the default project for compatibility with legacy behavior. + The aggregated number of text input tokens that has been cached from previous requests. For customers subscribe to scale tier, this includes scale tier tokens. - - `String id` + - `Optional model` - Project's public ID + When `group_by=model`, this field provides the model name of the grouped usage result. - - `Role role` + - `Optional outputAudioTokens` - Project membership role + The aggregated number of audio output tokens used. - - `MEMBER("member")` + - `Optional projectId` - - `OWNER("owner")` + When `group_by=project_id`, this field provides the project ID of the grouped usage result. -### Returns + - `Optional serviceTier` -- `class Invite:` + When `group_by=service_tier`, this field provides the service tier of the grouped usage result. - Represents an individual `invite` to the organization. + - `Optional userId` - - `String id` + When `group_by=user_id`, this field provides the user ID of the grouped usage result. - The identifier, which can be referenced in API endpoints + - `class OrganizationUsageEmbeddingsResult:` - - `long createdAt` + The aggregated embeddings usage details of the specific time bucket. - The Unix timestamp (in seconds) of when the invite was sent. + - `long inputTokens` - - `String email` + The aggregated number of input tokens used. - The email address of the individual to whom the invite was sent + - `long numModelRequests` - - `JsonValue; object_ "organization.invite"constant` + The count of requests made to the model. - The object type, which is always `organization.invite` + - `JsonValue; object_ "organization.usage.embeddings.result"constant` - - `ORGANIZATION_INVITE("organization.invite")` + - `ORGANIZATION_USAGE_EMBEDDINGS_RESULT("organization.usage.embeddings.result")` - - `List projects` + - `Optional apiKeyId` - The projects that were granted membership upon acceptance of the invite. + When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. - - `String id` + - `Optional model` - Project's public ID + When `group_by=model`, this field provides the model name of the grouped usage result. - - `Role role` + - `Optional projectId` - Project membership role + When `group_by=project_id`, this field provides the project ID of the grouped usage result. - - `MEMBER("member")` + - `Optional userId` - - `OWNER("owner")` + When `group_by=user_id`, this field provides the user ID of the grouped usage result. - - `Role role` + - `class OrganizationUsageModerationsResult:` - `owner` or `reader` + The aggregated moderations usage details of the specific time bucket. - - `OWNER("owner")` + - `long inputTokens` - - `READER("reader")` + The aggregated number of input tokens used. - - `Status status` + - `long numModelRequests` - `accepted`,`expired`, or `pending` + The count of requests made to the model. - - `ACCEPTED("accepted")` + - `JsonValue; object_ "organization.usage.moderations.result"constant` - - `EXPIRED("expired")` + - `ORGANIZATION_USAGE_MODERATIONS_RESULT("organization.usage.moderations.result")` - - `PENDING("pending")` + - `Optional apiKeyId` - - `Optional acceptedAt` + When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. - The Unix timestamp (in seconds) of when the invite was accepted. + - `Optional model` - - `Optional expiresAt` + When `group_by=model`, this field provides the model name of the grouped usage result. - The Unix timestamp (in seconds) of when the invite expires. + - `Optional projectId` -### Example + When `group_by=project_id`, this field provides the project ID of the grouped usage result. -```java -package com.openai.example; + - `Optional userId` -import com.openai.client.OpenAIClient; -import com.openai.client.okhttp.OpenAIOkHttpClient; -import com.openai.models.admin.organization.invites.Invite; -import com.openai.models.admin.organization.invites.InviteCreateParams; + When `group_by=user_id`, this field provides the user ID of the grouped usage result. -public final class Main { - private Main() {} + - `class OrganizationUsageImagesResult:` - public static void main(String[] args) { - OpenAIClient client = OpenAIOkHttpClient.fromEnv(); + The aggregated images usage details of the specific time bucket. - InviteCreateParams params = InviteCreateParams.builder() - .email("email") - .role(InviteCreateParams.Role.READER) - .build(); - Invite invite = client.admin().organization().invites().create(params); - } -} -``` + - `long images` -#### Response + The number of images processed. -```json -{ - "id": "id", - "created_at": 0, - "email": "email", - "object": "organization.invite", - "projects": [ - { - "id": "id", - "role": "member" - } - ], - "role": "owner", - "status": "accepted", - "accepted_at": 0, - "expires_at": 0 -} -``` + - `long numModelRequests` -## Retrieve invite + The count of requests made to the model. -`Invite admin().organization().invites().retrieve(InviteRetrieveParamsparams = InviteRetrieveParams.none(), RequestOptionsrequestOptions = RequestOptions.none())` + - `JsonValue; object_ "organization.usage.images.result"constant` -**get** `/organization/invites/{invite_id}` + - `ORGANIZATION_USAGE_IMAGES_RESULT("organization.usage.images.result")` -Retrieves an invite. + - `Optional apiKeyId` -### Parameters + When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. -- `InviteRetrieveParams params` + - `Optional model` - - `Optional inviteId` + When `group_by=model`, this field provides the model name of the grouped usage result. -### Returns + - `Optional projectId` -- `class Invite:` + When `group_by=project_id`, this field provides the project ID of the grouped usage result. - Represents an individual `invite` to the organization. + - `Optional size` - - `String id` + When `group_by=size`, this field provides the image size of the grouped usage result. - The identifier, which can be referenced in API endpoints + - `Optional source` - - `long createdAt` + When `group_by=source`, this field provides the source of the grouped usage result, possible values are `image.generation`, `image.edit`, `image.variation`. - The Unix timestamp (in seconds) of when the invite was sent. + - `Optional userId` - - `String email` + When `group_by=user_id`, this field provides the user ID of the grouped usage result. - The email address of the individual to whom the invite was sent + - `class OrganizationUsageAudioSpeechesResult:` - - `JsonValue; object_ "organization.invite"constant` + The aggregated audio speeches usage details of the specific time bucket. - The object type, which is always `organization.invite` + - `long characters` - - `ORGANIZATION_INVITE("organization.invite")` + The number of characters processed. - - `List projects` + - `long numModelRequests` - The projects that were granted membership upon acceptance of the invite. + The count of requests made to the model. - - `String id` + - `JsonValue; object_ "organization.usage.audio_speeches.result"constant` - Project's public ID + - `ORGANIZATION_USAGE_AUDIO_SPEECHES_RESULT("organization.usage.audio_speeches.result")` - - `Role role` + - `Optional apiKeyId` - Project membership role + When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. - - `MEMBER("member")` + - `Optional model` - - `OWNER("owner")` + When `group_by=model`, this field provides the model name of the grouped usage result. - - `Role role` + - `Optional projectId` - `owner` or `reader` + When `group_by=project_id`, this field provides the project ID of the grouped usage result. - - `OWNER("owner")` + - `Optional userId` - - `READER("reader")` + When `group_by=user_id`, this field provides the user ID of the grouped usage result. - - `Status status` + - `class OrganizationUsageAudioTranscriptionsResult:` - `accepted`,`expired`, or `pending` + The aggregated audio transcriptions usage details of the specific time bucket. - - `ACCEPTED("accepted")` + - `long numModelRequests` - - `EXPIRED("expired")` + The count of requests made to the model. - - `PENDING("pending")` + - `JsonValue; object_ "organization.usage.audio_transcriptions.result"constant` - - `Optional acceptedAt` + - `ORGANIZATION_USAGE_AUDIO_TRANSCRIPTIONS_RESULT("organization.usage.audio_transcriptions.result")` - The Unix timestamp (in seconds) of when the invite was accepted. + - `long seconds` - - `Optional expiresAt` + The number of seconds processed. - The Unix timestamp (in seconds) of when the invite expires. + - `Optional apiKeyId` -### Example + When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. -```java -package com.openai.example; + - `Optional model` -import com.openai.client.OpenAIClient; -import com.openai.client.okhttp.OpenAIOkHttpClient; -import com.openai.models.admin.organization.invites.Invite; -import com.openai.models.admin.organization.invites.InviteRetrieveParams; + When `group_by=model`, this field provides the model name of the grouped usage result. -public final class Main { - private Main() {} + - `Optional projectId` - public static void main(String[] args) { - OpenAIClient client = OpenAIOkHttpClient.fromEnv(); + When `group_by=project_id`, this field provides the project ID of the grouped usage result. - Invite invite = client.admin().organization().invites().retrieve("invite_id"); - } -} -``` + - `Optional userId` -#### Response + When `group_by=user_id`, this field provides the user ID of the grouped usage result. -```json -{ - "id": "id", - "created_at": 0, - "email": "email", - "object": "organization.invite", - "projects": [ - { - "id": "id", - "role": "member" - } - ], - "role": "owner", - "status": "accepted", - "accepted_at": 0, - "expires_at": 0 -} -``` + - `class OrganizationUsageVectorStoresResult:` -## Delete invite + The aggregated vector stores usage details of the specific time bucket. -`InviteDeleteResponse admin().organization().invites().delete(InviteDeleteParamsparams = InviteDeleteParams.none(), RequestOptionsrequestOptions = RequestOptions.none())` + - `JsonValue; object_ "organization.usage.vector_stores.result"constant` -**delete** `/organization/invites/{invite_id}` + - `ORGANIZATION_USAGE_VECTOR_STORES_RESULT("organization.usage.vector_stores.result")` -Delete an invite. If the invite has already been accepted, it cannot be deleted. + - `long usageBytes` -### Parameters + The vector stores usage in bytes. -- `InviteDeleteParams params` + - `Optional projectId` - - `Optional inviteId` + When `group_by=project_id`, this field provides the project ID of the grouped usage result. -### Returns + - `class OrganizationUsageCodeInterpreterSessionsResult:` -- `class InviteDeleteResponse:` + The aggregated code interpreter sessions usage details of the specific time bucket. - - `String id` + - `long numSessions` - - `boolean deleted` + The number of code interpreter sessions. - - `JsonValue; object_ "organization.invite.deleted"constant` + - `JsonValue; object_ "organization.usage.code_interpreter_sessions.result"constant` - The object type, which is always `organization.invite.deleted` + - `ORGANIZATION_USAGE_CODE_INTERPRETER_SESSIONS_RESULT("organization.usage.code_interpreter_sessions.result")` - - `ORGANIZATION_INVITE_DELETED("organization.invite.deleted")` + - `Optional projectId` -### Example + When `group_by=project_id`, this field provides the project ID of the grouped usage result. -```java -package com.openai.example; + - `class OrganizationUsageFileSearchesResult:` -import com.openai.client.OpenAIClient; -import com.openai.client.okhttp.OpenAIOkHttpClient; -import com.openai.models.admin.organization.invites.InviteDeleteParams; -import com.openai.models.admin.organization.invites.InviteDeleteResponse; + The aggregated file search calls usage details of the specific time bucket. -public final class Main { - private Main() {} + - `long numRequests` - public static void main(String[] args) { - OpenAIClient client = OpenAIOkHttpClient.fromEnv(); + The count of file search calls. - InviteDeleteResponse invite = client.admin().organization().invites().delete("invite_id"); - } -} -``` + - `JsonValue; object_ "organization.usage.file_searches.result"constant` -#### Response + - `ORGANIZATION_USAGE_FILE_SEARCHES_RESULT("organization.usage.file_searches.result")` -```json -{ - "id": "id", - "deleted": true, - "object": "organization.invite.deleted" -} -``` + - `Optional apiKeyId` -## Domain Types + When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. -### Invite + - `Optional projectId` -- `class Invite:` + When `group_by=project_id`, this field provides the project ID of the grouped usage result. - Represents an individual `invite` to the organization. + - `Optional userId` - - `String id` + When `group_by=user_id`, this field provides the user ID of the grouped usage result. - The identifier, which can be referenced in API endpoints + - `Optional vectorStoreId` - - `long createdAt` + When `group_by=vector_store_id`, this field provides the vector store ID of the grouped usage result. - The Unix timestamp (in seconds) of when the invite was sent. + - `class OrganizationUsageWebSearchesResult:` - - `String email` + The aggregated web search calls usage details of the specific time bucket. - The email address of the individual to whom the invite was sent + - `long numModelRequests` - - `JsonValue; object_ "organization.invite"constant` + The count of model requests. - The object type, which is always `organization.invite` + - `long numRequests` - - `ORGANIZATION_INVITE("organization.invite")` + The count of web search calls. - - `List projects` + - `JsonValue; object_ "organization.usage.web_searches.result"constant` - The projects that were granted membership upon acceptance of the invite. + - `ORGANIZATION_USAGE_WEB_SEARCHES_RESULT("organization.usage.web_searches.result")` - - `String id` + - `Optional apiKeyId` - Project's public ID + When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. - - `Role role` + - `Optional contextLevel` - Project membership role + When `group_by=context_level`, this field provides the search context size of the grouped usage result. - - `MEMBER("member")` + - `Optional model` - - `OWNER("owner")` + When `group_by=model`, this field provides the model name of the grouped usage result. - - `Role role` + - `Optional projectId` - `owner` or `reader` + When `group_by=project_id`, this field provides the project ID of the grouped usage result. - - `OWNER("owner")` + - `Optional userId` - - `READER("reader")` + When `group_by=user_id`, this field provides the user ID of the grouped usage result. - - `Status status` + - `class OrganizationCostsResult:` - `accepted`,`expired`, or `pending` + The aggregated costs details of the specific time bucket. - - `ACCEPTED("accepted")` + - `JsonValue; object_ "organization.costs.result"constant` - - `EXPIRED("expired")` + - `ORGANIZATION_COSTS_RESULT("organization.costs.result")` - - `PENDING("pending")` + - `Optional amount` - - `Optional acceptedAt` + The monetary value in its associated currency. - The Unix timestamp (in seconds) of when the invite was accepted. + - `Optional currency` - - `Optional expiresAt` + Lowercase ISO-4217 currency e.g. "usd" - The Unix timestamp (in seconds) of when the invite expires. + - `Optional value` -# Users + The numeric value of the cost. -## List users + - `Optional apiKeyId` -`UserListPage admin().organization().users().list(UserListParamsparams = UserListParams.none(), RequestOptionsrequestOptions = RequestOptions.none())` + When `group_by=api_key_id`, this field provides the API Key ID of the grouped costs result. -**get** `/organization/users` + - `Optional lineItem` -Lists all of the users in the organization. + When `group_by=line_item`, this field provides the line item of the grouped costs result. -### Parameters + - `Optional projectId` -- `UserListParams params` + When `group_by=project_id`, this field provides the project ID of the grouped costs result. - - `Optional after` + - `Optional quantity` - 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. + When `group_by=line_item`, this field provides the quantity of the grouped costs result. - - `Optional> emails` + - `long startTime` - Filter by the email address of users. + - `boolean hasMore` - - `Optional limit` + - `Optional nextPage` - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + - `JsonValue; object_ "page"constant` -### Returns + - `PAGE("page")` + +### Example + +```java +package com.openai.example; + +import com.openai.client.OpenAIClient; +import com.openai.client.okhttp.OpenAIOkHttpClient; +import com.openai.models.admin.organization.usage.UsageWebSearchCallsParams; +import com.openai.models.admin.organization.usage.UsageWebSearchCallsResponse; + +public final class Main { + private Main() {} + + public static void main(String[] args) { + OpenAIClient client = OpenAIOkHttpClient.fromEnv(); + + UsageWebSearchCallsParams params = UsageWebSearchCallsParams.builder() + .startTime(0L) + .build(); + UsageWebSearchCallsResponse response = client.admin().organization().usage().webSearchCalls(params); + } +} +``` + +#### Response + +```json +{ + "data": [ + { + "end_time": 0, + "object": "bucket", + "results": [ + { + "input_tokens": 0, + "num_model_requests": 0, + "object": "organization.usage.completions.result", + "output_tokens": 0, + "api_key_id": "api_key_id", + "batch": true, + "input_audio_tokens": 0, + "input_cached_tokens": 0, + "model": "model", + "output_audio_tokens": 0, + "project_id": "project_id", + "service_tier": "service_tier", + "user_id": "user_id" + } + ], + "start_time": 0 + } + ], + "has_more": true, + "next_page": "next_page", + "object": "page" +} +``` + +## Costs + +`UsageCostsResponse admin().organization().usage().costs(UsageCostsParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` + +**get** `/organization/costs` + +Get costs details for the organization. + +### Parameters + +- `UsageCostsParams params` + + - `long startTime` + + Start time (Unix seconds) of the query time range, inclusive. + + - `Optional> apiKeyIds` + + Return only costs for these API keys. + + - `Optional bucketWidth` + + Width of each time bucket in response. Currently only `1d` is supported, default to `1d`. + + - `_1D("1d")` + + - `Optional endTime` + + End time (Unix seconds) of the query time range, exclusive. + + - `Optional> groupBy` + + Group the costs by the specified fields. Support fields include `project_id`, `line_item`, `api_key_id` and any combination of them. + + - `PROJECT_ID("project_id")` + + - `LINE_ITEM("line_item")` + + - `API_KEY_ID("api_key_id")` + + - `Optional limit` + + A limit on the number of buckets to be returned. Limit can range between 1 and 180, and the default is 7. + + - `Optional page` + + A cursor for use in pagination. Corresponding to the `next_page` field from the previous response. + + - `Optional> projectIds` + + Return only costs for these projects. + +### Returns + +- `class UsageCostsResponse:` + + - `List data` + + - `long endTime` + + - `JsonValue; object_ "bucket"constant` + + - `BUCKET("bucket")` + + - `List results` + + - `class OrganizationUsageCompletionsResult:` + + The aggregated completions usage details of the specific time bucket. + + - `long inputTokens` + + The aggregated number of text input tokens used, including cached tokens. For customers subscribe to scale tier, this includes scale tier tokens. + + - `long numModelRequests` + + The count of requests made to the model. + + - `JsonValue; object_ "organization.usage.completions.result"constant` + + - `ORGANIZATION_USAGE_COMPLETIONS_RESULT("organization.usage.completions.result")` + + - `long outputTokens` + + The aggregated number of text output tokens used. For customers subscribe to scale tier, this includes scale tier tokens. + + - `Optional apiKeyId` + + When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. + + - `Optional batch` + + When `group_by=batch`, this field tells whether the grouped usage result is batch or not. + + - `Optional inputAudioTokens` + + The aggregated number of audio input tokens used, including cached tokens. + + - `Optional inputCachedTokens` + + The aggregated number of text input tokens that has been cached from previous requests. For customers subscribe to scale tier, this includes scale tier tokens. + + - `Optional model` + + When `group_by=model`, this field provides the model name of the grouped usage result. + + - `Optional outputAudioTokens` + + The aggregated number of audio output tokens used. + + - `Optional projectId` + + When `group_by=project_id`, this field provides the project ID of the grouped usage result. + + - `Optional serviceTier` + + When `group_by=service_tier`, this field provides the service tier of the grouped usage result. + + - `Optional userId` + + When `group_by=user_id`, this field provides the user ID of the grouped usage result. + + - `class OrganizationUsageEmbeddingsResult:` + + The aggregated embeddings usage details of the specific time bucket. + + - `long inputTokens` + + The aggregated number of input tokens used. + + - `long numModelRequests` + + The count of requests made to the model. + + - `JsonValue; object_ "organization.usage.embeddings.result"constant` + + - `ORGANIZATION_USAGE_EMBEDDINGS_RESULT("organization.usage.embeddings.result")` + + - `Optional apiKeyId` + + When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. + + - `Optional model` + + When `group_by=model`, this field provides the model name of the grouped usage result. + + - `Optional projectId` + + When `group_by=project_id`, this field provides the project ID of the grouped usage result. + + - `Optional userId` + + When `group_by=user_id`, this field provides the user ID of the grouped usage result. + + - `class OrganizationUsageModerationsResult:` + + The aggregated moderations usage details of the specific time bucket. + + - `long inputTokens` + + The aggregated number of input tokens used. + + - `long numModelRequests` + + The count of requests made to the model. + + - `JsonValue; object_ "organization.usage.moderations.result"constant` + + - `ORGANIZATION_USAGE_MODERATIONS_RESULT("organization.usage.moderations.result")` + + - `Optional apiKeyId` + + When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. + + - `Optional model` + + When `group_by=model`, this field provides the model name of the grouped usage result. + + - `Optional projectId` + + When `group_by=project_id`, this field provides the project ID of the grouped usage result. + + - `Optional userId` + + When `group_by=user_id`, this field provides the user ID of the grouped usage result. + + - `class OrganizationUsageImagesResult:` + + The aggregated images usage details of the specific time bucket. + + - `long images` + + The number of images processed. + + - `long numModelRequests` + + The count of requests made to the model. + + - `JsonValue; object_ "organization.usage.images.result"constant` + + - `ORGANIZATION_USAGE_IMAGES_RESULT("organization.usage.images.result")` + + - `Optional apiKeyId` + + When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. + + - `Optional model` + + When `group_by=model`, this field provides the model name of the grouped usage result. + + - `Optional projectId` + + When `group_by=project_id`, this field provides the project ID of the grouped usage result. + + - `Optional size` + + When `group_by=size`, this field provides the image size of the grouped usage result. + + - `Optional source` + + When `group_by=source`, this field provides the source of the grouped usage result, possible values are `image.generation`, `image.edit`, `image.variation`. + + - `Optional userId` + + When `group_by=user_id`, this field provides the user ID of the grouped usage result. + + - `class OrganizationUsageAudioSpeechesResult:` + + The aggregated audio speeches usage details of the specific time bucket. + + - `long characters` + + The number of characters processed. + + - `long numModelRequests` + + The count of requests made to the model. + + - `JsonValue; object_ "organization.usage.audio_speeches.result"constant` + + - `ORGANIZATION_USAGE_AUDIO_SPEECHES_RESULT("organization.usage.audio_speeches.result")` + + - `Optional apiKeyId` + + When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. + + - `Optional model` + + When `group_by=model`, this field provides the model name of the grouped usage result. + + - `Optional projectId` + + When `group_by=project_id`, this field provides the project ID of the grouped usage result. + + - `Optional userId` + + When `group_by=user_id`, this field provides the user ID of the grouped usage result. + + - `class OrganizationUsageAudioTranscriptionsResult:` + + The aggregated audio transcriptions usage details of the specific time bucket. + + - `long numModelRequests` + + The count of requests made to the model. + + - `JsonValue; object_ "organization.usage.audio_transcriptions.result"constant` + + - `ORGANIZATION_USAGE_AUDIO_TRANSCRIPTIONS_RESULT("organization.usage.audio_transcriptions.result")` + + - `long seconds` + + The number of seconds processed. + + - `Optional apiKeyId` + + When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. + + - `Optional model` + + When `group_by=model`, this field provides the model name of the grouped usage result. + + - `Optional projectId` + + When `group_by=project_id`, this field provides the project ID of the grouped usage result. + + - `Optional userId` + + When `group_by=user_id`, this field provides the user ID of the grouped usage result. + + - `class OrganizationUsageVectorStoresResult:` + + The aggregated vector stores usage details of the specific time bucket. + + - `JsonValue; object_ "organization.usage.vector_stores.result"constant` + + - `ORGANIZATION_USAGE_VECTOR_STORES_RESULT("organization.usage.vector_stores.result")` + + - `long usageBytes` + + The vector stores usage in bytes. + + - `Optional projectId` + + When `group_by=project_id`, this field provides the project ID of the grouped usage result. + + - `class OrganizationUsageCodeInterpreterSessionsResult:` + + The aggregated code interpreter sessions usage details of the specific time bucket. + + - `long numSessions` + + The number of code interpreter sessions. + + - `JsonValue; object_ "organization.usage.code_interpreter_sessions.result"constant` + + - `ORGANIZATION_USAGE_CODE_INTERPRETER_SESSIONS_RESULT("organization.usage.code_interpreter_sessions.result")` + + - `Optional projectId` + + When `group_by=project_id`, this field provides the project ID of the grouped usage result. + + - `class OrganizationUsageFileSearchesResult:` + + The aggregated file search calls usage details of the specific time bucket. + + - `long numRequests` + + The count of file search calls. + + - `JsonValue; object_ "organization.usage.file_searches.result"constant` + + - `ORGANIZATION_USAGE_FILE_SEARCHES_RESULT("organization.usage.file_searches.result")` + + - `Optional apiKeyId` + + When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. + + - `Optional projectId` + + When `group_by=project_id`, this field provides the project ID of the grouped usage result. + + - `Optional userId` + + When `group_by=user_id`, this field provides the user ID of the grouped usage result. + + - `Optional vectorStoreId` + + When `group_by=vector_store_id`, this field provides the vector store ID of the grouped usage result. + + - `class OrganizationUsageWebSearchesResult:` + + The aggregated web search calls usage details of the specific time bucket. + + - `long numModelRequests` + + The count of model requests. + + - `long numRequests` + + The count of web search calls. + + - `JsonValue; object_ "organization.usage.web_searches.result"constant` + + - `ORGANIZATION_USAGE_WEB_SEARCHES_RESULT("organization.usage.web_searches.result")` + + - `Optional apiKeyId` + + When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. + + - `Optional contextLevel` + + When `group_by=context_level`, this field provides the search context size of the grouped usage result. + + - `Optional model` + + When `group_by=model`, this field provides the model name of the grouped usage result. + + - `Optional projectId` + + When `group_by=project_id`, this field provides the project ID of the grouped usage result. + + - `Optional userId` + + When `group_by=user_id`, this field provides the user ID of the grouped usage result. + + - `class OrganizationCostsResult:` + + The aggregated costs details of the specific time bucket. + + - `JsonValue; object_ "organization.costs.result"constant` + + - `ORGANIZATION_COSTS_RESULT("organization.costs.result")` + + - `Optional amount` + + The monetary value in its associated currency. + + - `Optional currency` + + Lowercase ISO-4217 currency e.g. "usd" + + - `Optional value` + + The numeric value of the cost. + + - `Optional apiKeyId` + + When `group_by=api_key_id`, this field provides the API Key ID of the grouped costs result. + + - `Optional lineItem` + + When `group_by=line_item`, this field provides the line item of the grouped costs result. + + - `Optional projectId` + + When `group_by=project_id`, this field provides the project ID of the grouped costs result. + + - `Optional quantity` + + When `group_by=line_item`, this field provides the quantity of the grouped costs result. + + - `long startTime` + + - `boolean hasMore` + + - `Optional nextPage` + + - `JsonValue; object_ "page"constant` + + - `PAGE("page")` + +### Example + +```java +package com.openai.example; + +import com.openai.client.OpenAIClient; +import com.openai.client.okhttp.OpenAIOkHttpClient; +import com.openai.models.admin.organization.usage.UsageCostsParams; +import com.openai.models.admin.organization.usage.UsageCostsResponse; + +public final class Main { + private Main() {} + + public static void main(String[] args) { + OpenAIClient client = OpenAIOkHttpClient.fromEnv(); + + UsageCostsParams params = UsageCostsParams.builder() + .startTime(0L) + .build(); + UsageCostsResponse response = client.admin().organization().usage().costs(params); + } +} +``` + +#### Response + +```json +{ + "data": [ + { + "end_time": 0, + "object": "bucket", + "results": [ + { + "input_tokens": 0, + "num_model_requests": 0, + "object": "organization.usage.completions.result", + "output_tokens": 0, + "api_key_id": "api_key_id", + "batch": true, + "input_audio_tokens": 0, + "input_cached_tokens": 0, + "model": "model", + "output_audio_tokens": 0, + "project_id": "project_id", + "service_tier": "service_tier", + "user_id": "user_id" + } + ], + "start_time": 0 + } + ], + "has_more": true, + "next_page": "next_page", + "object": "page" +} +``` + +# Invites + +## List invites + +`InviteListPage admin().organization().invites().list(InviteListParamsparams = InviteListParams.none(), RequestOptionsrequestOptions = RequestOptions.none())` + +**get** `/organization/invites` + +Returns a list of invites in the organization. + +### Parameters + +- `InviteListParams params` + + - `Optional after` + + 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. + + - `Optional limit` + + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + +### Returns + +- `class Invite:` + + Represents an individual `invite` to the organization. + + - `String id` + + The identifier, which can be referenced in API endpoints + + - `long createdAt` + + The Unix timestamp (in seconds) of when the invite was sent. + + - `String email` + + The email address of the individual to whom the invite was sent + + - `JsonValue; object_ "organization.invite"constant` + + The object type, which is always `organization.invite` + + - `ORGANIZATION_INVITE("organization.invite")` + + - `List projects` + + The projects that were granted membership upon acceptance of the invite. + + - `String id` + + Project's public ID + + - `Role role` + + Project membership role + + - `MEMBER("member")` + + - `OWNER("owner")` + + - `Role role` + + `owner` or `reader` + + - `OWNER("owner")` + + - `READER("reader")` + + - `Status status` + + `accepted`,`expired`, or `pending` + + - `ACCEPTED("accepted")` + + - `EXPIRED("expired")` + + - `PENDING("pending")` + + - `Optional acceptedAt` + + The Unix timestamp (in seconds) of when the invite was accepted. + + - `Optional expiresAt` + + The Unix timestamp (in seconds) of when the invite expires. + +### Example + +```java +package com.openai.example; + +import com.openai.client.OpenAIClient; +import com.openai.client.okhttp.OpenAIOkHttpClient; +import com.openai.models.admin.organization.invites.InviteListPage; +import com.openai.models.admin.organization.invites.InviteListParams; + +public final class Main { + private Main() {} + + public static void main(String[] args) { + OpenAIClient client = OpenAIOkHttpClient.fromEnv(); + + InviteListPage page = client.admin().organization().invites().list(); + } +} +``` + +#### Response + +```json +{ + "data": [ + { + "id": "id", + "created_at": 0, + "email": "email", + "object": "organization.invite", + "projects": [ + { + "id": "id", + "role": "member" + } + ], + "role": "owner", + "status": "accepted", + "accepted_at": 0, + "expires_at": 0 + } + ], + "has_more": true, + "object": "list", + "first_id": "first_id", + "last_id": "last_id" +} +``` + +## Create invite + +`Invite admin().organization().invites().create(InviteCreateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` + +**post** `/organization/invites` + +Create an invite for a user to the organization. The invite must be accepted by the user before they have access to the organization. + +### Parameters + +- `InviteCreateParams params` + + - `String email` + + Send an email to this address + + - `Role role` + + `owner` or `reader` + + - `READER("reader")` + + - `OWNER("owner")` + + - `Optional> projects` + + An array of projects to which membership is granted at the same time the org invite is accepted. If omitted, the user will be invited to the default project for compatibility with legacy behavior. If empty list is passed, the user will not be invited to any projects, including the default one. + + - `String id` + + Project's public ID + + - `Role role` + + Project membership role + + - `MEMBER("member")` + + - `OWNER("owner")` + +### Returns + +- `class Invite:` + + Represents an individual `invite` to the organization. + + - `String id` + + The identifier, which can be referenced in API endpoints + + - `long createdAt` + + The Unix timestamp (in seconds) of when the invite was sent. + + - `String email` + + The email address of the individual to whom the invite was sent + + - `JsonValue; object_ "organization.invite"constant` + + The object type, which is always `organization.invite` + + - `ORGANIZATION_INVITE("organization.invite")` + + - `List projects` + + The projects that were granted membership upon acceptance of the invite. + + - `String id` + + Project's public ID + + - `Role role` + + Project membership role + + - `MEMBER("member")` + + - `OWNER("owner")` + + - `Role role` + + `owner` or `reader` + + - `OWNER("owner")` + + - `READER("reader")` + + - `Status status` + + `accepted`,`expired`, or `pending` + + - `ACCEPTED("accepted")` + + - `EXPIRED("expired")` + + - `PENDING("pending")` + + - `Optional acceptedAt` + + The Unix timestamp (in seconds) of when the invite was accepted. + + - `Optional expiresAt` + + The Unix timestamp (in seconds) of when the invite expires. + +### Example + +```java +package com.openai.example; + +import com.openai.client.OpenAIClient; +import com.openai.client.okhttp.OpenAIOkHttpClient; +import com.openai.models.admin.organization.invites.Invite; +import com.openai.models.admin.organization.invites.InviteCreateParams; + +public final class Main { + private Main() {} + + public static void main(String[] args) { + OpenAIClient client = OpenAIOkHttpClient.fromEnv(); + + InviteCreateParams params = InviteCreateParams.builder() + .email("email") + .role(InviteCreateParams.Role.READER) + .build(); + Invite invite = client.admin().organization().invites().create(params); + } +} +``` + +#### Response + +```json +{ + "id": "id", + "created_at": 0, + "email": "email", + "object": "organization.invite", + "projects": [ + { + "id": "id", + "role": "member" + } + ], + "role": "owner", + "status": "accepted", + "accepted_at": 0, + "expires_at": 0 +} +``` + +## Retrieve invite + +`Invite admin().organization().invites().retrieve(InviteRetrieveParamsparams = InviteRetrieveParams.none(), RequestOptionsrequestOptions = RequestOptions.none())` + +**get** `/organization/invites/{invite_id}` + +Retrieves an invite. + +### Parameters + +- `InviteRetrieveParams params` + + - `Optional inviteId` + +### Returns + +- `class Invite:` + + Represents an individual `invite` to the organization. + + - `String id` + + The identifier, which can be referenced in API endpoints + + - `long createdAt` + + The Unix timestamp (in seconds) of when the invite was sent. + + - `String email` + + The email address of the individual to whom the invite was sent + + - `JsonValue; object_ "organization.invite"constant` + + The object type, which is always `organization.invite` + + - `ORGANIZATION_INVITE("organization.invite")` + + - `List projects` + + The projects that were granted membership upon acceptance of the invite. + + - `String id` + + Project's public ID + + - `Role role` + + Project membership role + + - `MEMBER("member")` + + - `OWNER("owner")` + + - `Role role` + + `owner` or `reader` + + - `OWNER("owner")` + + - `READER("reader")` + + - `Status status` + + `accepted`,`expired`, or `pending` + + - `ACCEPTED("accepted")` + + - `EXPIRED("expired")` + + - `PENDING("pending")` + + - `Optional acceptedAt` + + The Unix timestamp (in seconds) of when the invite was accepted. + + - `Optional expiresAt` + + The Unix timestamp (in seconds) of when the invite expires. + +### Example + +```java +package com.openai.example; + +import com.openai.client.OpenAIClient; +import com.openai.client.okhttp.OpenAIOkHttpClient; +import com.openai.models.admin.organization.invites.Invite; +import com.openai.models.admin.organization.invites.InviteRetrieveParams; + +public final class Main { + private Main() {} + + public static void main(String[] args) { + OpenAIClient client = OpenAIOkHttpClient.fromEnv(); + + Invite invite = client.admin().organization().invites().retrieve("invite_id"); + } +} +``` + +#### Response + +```json +{ + "id": "id", + "created_at": 0, + "email": "email", + "object": "organization.invite", + "projects": [ + { + "id": "id", + "role": "member" + } + ], + "role": "owner", + "status": "accepted", + "accepted_at": 0, + "expires_at": 0 +} +``` + +## Delete invite + +`InviteDeleteResponse admin().organization().invites().delete(InviteDeleteParamsparams = InviteDeleteParams.none(), RequestOptionsrequestOptions = RequestOptions.none())` + +**delete** `/organization/invites/{invite_id}` + +Delete an invite. If the invite has already been accepted, it cannot be deleted. + +### Parameters + +- `InviteDeleteParams params` + + - `Optional inviteId` + +### Returns + +- `class InviteDeleteResponse:` + + - `String id` + + - `boolean deleted` + + - `JsonValue; object_ "organization.invite.deleted"constant` + + The object type, which is always `organization.invite.deleted` + + - `ORGANIZATION_INVITE_DELETED("organization.invite.deleted")` + +### Example + +```java +package com.openai.example; + +import com.openai.client.OpenAIClient; +import com.openai.client.okhttp.OpenAIOkHttpClient; +import com.openai.models.admin.organization.invites.InviteDeleteParams; +import com.openai.models.admin.organization.invites.InviteDeleteResponse; + +public final class Main { + private Main() {} + + public static void main(String[] args) { + OpenAIClient client = OpenAIOkHttpClient.fromEnv(); + + InviteDeleteResponse invite = client.admin().organization().invites().delete("invite_id"); + } +} +``` + +#### Response + +```json +{ + "id": "id", + "deleted": true, + "object": "organization.invite.deleted" +} +``` + +## Domain Types + +### Invite + +- `class Invite:` + + Represents an individual `invite` to the organization. + + - `String id` + + The identifier, which can be referenced in API endpoints + + - `long createdAt` + + The Unix timestamp (in seconds) of when the invite was sent. + + - `String email` + + The email address of the individual to whom the invite was sent + + - `JsonValue; object_ "organization.invite"constant` + + The object type, which is always `organization.invite` + + - `ORGANIZATION_INVITE("organization.invite")` + + - `List projects` + + The projects that were granted membership upon acceptance of the invite. + + - `String id` + + Project's public ID + + - `Role role` + + Project membership role + + - `MEMBER("member")` + + - `OWNER("owner")` + + - `Role role` + + `owner` or `reader` + + - `OWNER("owner")` + + - `READER("reader")` + + - `Status status` + + `accepted`,`expired`, or `pending` + + - `ACCEPTED("accepted")` + + - `EXPIRED("expired")` + + - `PENDING("pending")` + + - `Optional acceptedAt` + + The Unix timestamp (in seconds) of when the invite was accepted. + + - `Optional expiresAt` + + The Unix timestamp (in seconds) of when the invite expires. + +# Users + +## List users + +`UserListPage admin().organization().users().list(UserListParamsparams = UserListParams.none(), RequestOptionsrequestOptions = RequestOptions.none())` + +**get** `/organization/users` + +Lists all of the users in the organization. + +### Parameters + +- `UserListParams params` + + - `Optional after` + + 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. + + - `Optional> emails` + + Filter by the email address of users. + + - `Optional limit` + + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + +### Returns - `class OrganizationUser:` @@ -8762,39 +10366,293 @@ public final class Main { } ``` -## Delete organization role +## Delete organization role + +`RoleDeleteResponse admin().organization().roles().delete(RoleDeleteParamsparams = RoleDeleteParams.none(), RequestOptionsrequestOptions = RequestOptions.none())` + +**delete** `/organization/roles/{role_id}` + +Deletes a custom role from the organization. + +### Parameters + +- `RoleDeleteParams params` + + - `Optional roleId` + +### Returns + +- `class RoleDeleteResponse:` + + Confirmation payload returned after deleting a role. + + - `String id` + + Identifier of the deleted role. + + - `boolean deleted` + + Whether the role was deleted. + + - `JsonValue; object_ "role.deleted"constant` + + Always `role.deleted`. + + - `ROLE_DELETED("role.deleted")` + +### Example + +```java +package com.openai.example; + +import com.openai.client.OpenAIClient; +import com.openai.client.okhttp.OpenAIOkHttpClient; +import com.openai.models.admin.organization.roles.RoleDeleteParams; +import com.openai.models.admin.organization.roles.RoleDeleteResponse; + +public final class Main { + private Main() {} + + public static void main(String[] args) { + OpenAIClient client = OpenAIOkHttpClient.fromEnv(); + + RoleDeleteResponse role = client.admin().organization().roles().delete("role_id"); + } +} +``` + +#### Response + +```json +{ + "id": "id", + "deleted": true, + "object": "role.deleted" +} +``` + +## Domain Types + +### Role + +- `class Role:` + + Details about a role that can be assigned through the public Roles API. + + - `String id` + + Identifier for the role. + + - `Optional description` + + Optional description of the role. + + - `String name` + + Unique name for the role. + + - `JsonValue; object_ "role"constant` + + Always `role`. + + - `ROLE("role")` + + - `List permissions` + + Permissions granted by the role. + + - `boolean predefinedRole` + + Whether the role is predefined and managed by OpenAI. + + - `String resourceType` + + Resource type the role is bound to (for example `api.organization` or `api.project`). + +# Certificates + +## List organization certificates + +`CertificateListPage admin().organization().certificates().list(CertificateListParamsparams = CertificateListParams.none(), RequestOptionsrequestOptions = RequestOptions.none())` + +**get** `/organization/certificates` + +List uploaded certificates for this organization. + +### Parameters + +- `CertificateListParams params` + + - `Optional after` + + 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. + + - `Optional limit` + + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + + - `Optional order` + + Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. + + - `ASC("asc")` + + - `DESC("desc")` + +### Returns + +- `class CertificateListResponse:` + + Represents an individual certificate configured at the organization level. + + - `String id` + + The identifier, which can be referenced in API endpoints + + - `boolean active` + + Whether the certificate is currently active at the organization level. + + - `CertificateDetails certificateDetails` + + - `Optional expiresAt` + + The Unix timestamp (in seconds) of when the certificate expires. + + - `Optional validAt` + + The Unix timestamp (in seconds) of when the certificate becomes valid. + + - `long createdAt` + + The Unix timestamp (in seconds) of when the certificate was uploaded. + + - `Optional name` + + The name of the certificate. + + - `JsonValue; object_ "organization.certificate"constant` + + The object type, which is always `organization.certificate`. + + - `ORGANIZATION_CERTIFICATE("organization.certificate")` + +### Example + +```java +package com.openai.example; + +import com.openai.client.OpenAIClient; +import com.openai.client.okhttp.OpenAIOkHttpClient; +import com.openai.models.admin.organization.certificates.CertificateListPage; +import com.openai.models.admin.organization.certificates.CertificateListParams; + +public final class Main { + private Main() {} + + public static void main(String[] args) { + OpenAIClient client = OpenAIOkHttpClient.fromEnv(); + + CertificateListPage page = client.admin().organization().certificates().list(); + } +} +``` + +#### Response + +```json +{ + "data": [ + { + "id": "id", + "active": true, + "certificate_details": { + "expires_at": 0, + "valid_at": 0 + }, + "created_at": 0, + "name": "name", + "object": "organization.certificate" + } + ], + "first_id": "cert_abc", + "has_more": true, + "last_id": "cert_abc", + "object": "list" +} +``` + +## Upload certificate + +`Certificate admin().organization().certificates().create(CertificateCreateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` + +**post** `/organization/certificates` + +Upload a certificate to the organization. This does **not** automatically activate the certificate. + +Organizations can upload up to 50 certificates. + +### Parameters + +- `CertificateCreateParams params` + + - `String certificate` + + The certificate content in PEM format + + - `Optional name` + + An optional name for the certificate + +### Returns + +- `class Certificate:` + + Represents an individual `certificate` uploaded to the organization. + + - `String id` + + The identifier, which can be referenced in API endpoints + + - `CertificateDetails certificateDetails` + + - `Optional content` -`RoleDeleteResponse admin().organization().roles().delete(RoleDeleteParamsparams = RoleDeleteParams.none(), RequestOptionsrequestOptions = RequestOptions.none())` + The content of the certificate in PEM format. -**delete** `/organization/roles/{role_id}` + - `Optional expiresAt` -Deletes a custom role from the organization. + The Unix timestamp (in seconds) of when the certificate expires. -### Parameters + - `Optional validAt` -- `RoleDeleteParams params` + The Unix timestamp (in seconds) of when the certificate becomes valid. - - `Optional roleId` + - `long createdAt` -### Returns + The Unix timestamp (in seconds) of when the certificate was uploaded. -- `class RoleDeleteResponse:` + - `Optional name` - Confirmation payload returned after deleting a role. + The name of the certificate. - - `String id` + - `Object object_` - Identifier of the deleted role. + The object type. - - `boolean deleted` + - If creating, updating, or getting a specific certificate, the object type is `certificate`. + - If listing, activating, or deactivating certificates for the organization, the object type is `organization.certificate`. + - If listing, activating, or deactivating certificates for a project, the object type is `organization.project.certificate`. - Whether the role was deleted. + - `CERTIFICATE("certificate")` - - `JsonValue; object_ "role.deleted"constant` + - `ORGANIZATION_CERTIFICATE("organization.certificate")` - Always `role.deleted`. + - `ORGANIZATION_PROJECT_CERTIFICATE("organization.project.certificate")` - - `ROLE_DELETED("role.deleted")` + - `Optional active` + + Whether the certificate is currently active at the specified scope. Not returned when getting details for a specific certificate. ### Example @@ -8803,8 +10661,8 @@ package com.openai.example; import com.openai.client.OpenAIClient; import com.openai.client.okhttp.OpenAIOkHttpClient; -import com.openai.models.admin.organization.roles.RoleDeleteParams; -import com.openai.models.admin.organization.roles.RoleDeleteResponse; +import com.openai.models.admin.organization.certificates.Certificate; +import com.openai.models.admin.organization.certificates.CertificateCreateParams; public final class Main { private Main() {} @@ -8812,7 +10670,10 @@ public final class Main { public static void main(String[] args) { OpenAIClient client = OpenAIOkHttpClient.fromEnv(); - RoleDeleteResponse role = client.admin().organization().roles().delete("role_id"); + CertificateCreateParams params = CertificateCreateParams.builder() + .certificate("certificate") + .build(); + Certificate certificate = client.admin().organization().certificates().create(params); } } ``` @@ -8822,94 +10683,55 @@ public final class Main { ```json { "id": "id", - "deleted": true, - "object": "role.deleted" + "certificate_details": { + "content": "content", + "expires_at": 0, + "valid_at": 0 + }, + "created_at": 0, + "name": "name", + "object": "certificate", + "active": true } ``` -## Domain Types - -### Role - -- `class Role:` - - Details about a role that can be assigned through the public Roles API. - - - `String id` - - Identifier for the role. - - - `Optional description` - - Optional description of the role. - - - `String name` - - Unique name for the role. - - - `JsonValue; object_ "role"constant` - - Always `role`. - - - `ROLE("role")` - - - `List permissions` - - Permissions granted by the role. - - - `boolean predefinedRole` - - Whether the role is predefined and managed by OpenAI. - - - `String resourceType` - - Resource type the role is bound to (for example `api.organization` or `api.project`). - -# Certificates +## Get certificate -## List organization certificates +`Certificate admin().organization().certificates().retrieve(CertificateRetrieveParamsparams = CertificateRetrieveParams.none(), RequestOptionsrequestOptions = RequestOptions.none())` -`CertificateListPage admin().organization().certificates().list(CertificateListParamsparams = CertificateListParams.none(), RequestOptionsrequestOptions = RequestOptions.none())` +**get** `/organization/certificates/{certificate_id}` -**get** `/organization/certificates` +Get a certificate that has been uploaded to the organization. -List uploaded certificates for this organization. +You can get a certificate regardless of whether it is active or not. ### Parameters -- `CertificateListParams params` - - - `Optional after` - - 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. - - - `Optional limit` - - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. +- `CertificateRetrieveParams params` - - `Optional order` + - `Optional certificateId` - Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. + - `Optional> include` - - `ASC("asc")` + A list of additional fields to include in the response. Currently the only supported value is `content` to fetch the PEM content of the certificate. - - `DESC("desc")` + - `CONTENT("content")` ### Returns -- `class CertificateListResponse:` +- `class Certificate:` - Represents an individual certificate configured at the organization level. + Represents an individual `certificate` uploaded to the organization. - `String id` The identifier, which can be referenced in API endpoints - - `boolean active` + - `CertificateDetails certificateDetails` - Whether the certificate is currently active at the organization level. + - `Optional content` - - `CertificateDetails certificateDetails` + The content of the certificate in PEM format. - `Optional expiresAt` @@ -8927,12 +10749,24 @@ List uploaded certificates for this organization. The name of the certificate. - - `JsonValue; object_ "organization.certificate"constant` + - `Object object_` - The object type, which is always `organization.certificate`. + The object type. + + - If creating, updating, or getting a specific certificate, the object type is `certificate`. + - If listing, activating, or deactivating certificates for the organization, the object type is `organization.certificate`. + - If listing, activating, or deactivating certificates for a project, the object type is `organization.project.certificate`. + + - `CERTIFICATE("certificate")` - `ORGANIZATION_CERTIFICATE("organization.certificate")` + - `ORGANIZATION_PROJECT_CERTIFICATE("organization.project.certificate")` + + - `Optional active` + + Whether the certificate is currently active at the specified scope. Not returned when getting details for a specific certificate. + ### Example ```java @@ -8940,8 +10774,8 @@ package com.openai.example; import com.openai.client.OpenAIClient; import com.openai.client.okhttp.OpenAIOkHttpClient; -import com.openai.models.admin.organization.certificates.CertificateListPage; -import com.openai.models.admin.organization.certificates.CertificateListParams; +import com.openai.models.admin.organization.certificates.Certificate; +import com.openai.models.admin.organization.certificates.CertificateRetrieveParams; public final class Main { private Main() {} @@ -8949,7 +10783,7 @@ public final class Main { public static void main(String[] args) { OpenAIClient client = OpenAIOkHttpClient.fromEnv(); - CertificateListPage page = client.admin().organization().certificates().list(); + Certificate certificate = client.admin().organization().certificates().retrieve("certificate_id"); } } ``` @@ -8958,47 +10792,36 @@ public final class Main { ```json { - "data": [ - { "id": "id", - "active": true, "certificate_details": { + "content": "content", "expires_at": 0, "valid_at": 0 }, "created_at": 0, "name": "name", - "object": "organization.certificate" - } - ], - "first_id": "cert_abc", - "has_more": true, - "last_id": "cert_abc", - "object": "list" + "object": "certificate", + "active": true } ``` -## Upload certificate - -`Certificate admin().organization().certificates().create(CertificateCreateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` +## Modify certificate -**post** `/organization/certificates` +`Certificate admin().organization().certificates().update(CertificateUpdateParamsparams = CertificateUpdateParams.none(), RequestOptionsrequestOptions = RequestOptions.none())` -Upload a certificate to the organization. This does **not** automatically activate the certificate. +**post** `/organization/certificates/{certificate_id}` -Organizations can upload up to 50 certificates. +Modify a certificate. Note that only the name can be modified. ### Parameters -- `CertificateCreateParams params` - - - `String certificate` +- `CertificateUpdateParams params` - The certificate content in PEM format + - `Optional certificateId` - `Optional name` - An optional name for the certificate + The updated name for the certificate ### Returns @@ -9046,9 +10869,77 @@ Organizations can upload up to 50 certificates. - `ORGANIZATION_PROJECT_CERTIFICATE("organization.project.certificate")` - - `Optional active` + - `Optional active` + + Whether the certificate is currently active at the specified scope. Not returned when getting details for a specific certificate. + +### Example + +```java +package com.openai.example; + +import com.openai.client.OpenAIClient; +import com.openai.client.okhttp.OpenAIOkHttpClient; +import com.openai.models.admin.organization.certificates.Certificate; +import com.openai.models.admin.organization.certificates.CertificateUpdateParams; + +public final class Main { + private Main() {} + + public static void main(String[] args) { + OpenAIClient client = OpenAIOkHttpClient.fromEnv(); + + Certificate certificate = client.admin().organization().certificates().update("certificate_id"); + } +} +``` + +#### Response + +```json +{ + "id": "id", + "certificate_details": { + "content": "content", + "expires_at": 0, + "valid_at": 0 + }, + "created_at": 0, + "name": "name", + "object": "certificate", + "active": true +} +``` + +## Delete certificate + +`CertificateDeleteResponse admin().organization().certificates().delete(CertificateDeleteParamsparams = CertificateDeleteParams.none(), RequestOptionsrequestOptions = RequestOptions.none())` + +**delete** `/organization/certificates/{certificate_id}` + +Delete a certificate from the organization. + +The certificate must be inactive for the organization and all projects. + +### Parameters + +- `CertificateDeleteParams params` + + - `Optional certificateId` + +### Returns + +- `class CertificateDeleteResponse:` + + - `String id` + + The ID of the certificate that was deleted. + + - `JsonValue; object_ "certificate.deleted"constant` + + The object type, must be `certificate.deleted`. - Whether the certificate is currently active at the specified scope. Not returned when getting details for a specific certificate. + - `CERTIFICATE_DELETED("certificate.deleted")` ### Example @@ -9057,8 +10948,8 @@ package com.openai.example; import com.openai.client.OpenAIClient; import com.openai.client.okhttp.OpenAIOkHttpClient; -import com.openai.models.admin.organization.certificates.Certificate; -import com.openai.models.admin.organization.certificates.CertificateCreateParams; +import com.openai.models.admin.organization.certificates.CertificateDeleteParams; +import com.openai.models.admin.organization.certificates.CertificateDeleteResponse; public final class Main { private Main() {} @@ -9066,10 +10957,7 @@ public final class Main { public static void main(String[] args) { OpenAIClient client = OpenAIOkHttpClient.fromEnv(); - CertificateCreateParams params = CertificateCreateParams.builder() - .certificate("certificate") - .build(); - Certificate certificate = client.admin().organization().certificates().create(params); + CertificateDeleteResponse certificate = client.admin().organization().certificates().delete("certificate_id"); } } ``` @@ -9079,55 +10967,41 @@ public final class Main { ```json { "id": "id", - "certificate_details": { - "content": "content", - "expires_at": 0, - "valid_at": 0 - }, - "created_at": 0, - "name": "name", - "object": "certificate", - "active": true + "object": "certificate.deleted" } ``` -## Get certificate +## Activate certificates for organization -`Certificate admin().organization().certificates().retrieve(CertificateRetrieveParamsparams = CertificateRetrieveParams.none(), RequestOptionsrequestOptions = RequestOptions.none())` +`CertificateActivatePage admin().organization().certificates().activate(CertificateActivateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` -**get** `/organization/certificates/{certificate_id}` +**post** `/organization/certificates/activate` -Get a certificate that has been uploaded to the organization. +Activate certificates at the organization level. -You can get a certificate regardless of whether it is active or not. +You can atomically and idempotently activate up to 10 certificates at a time. ### Parameters -- `CertificateRetrieveParams params` - - - `Optional certificateId` - - - `Optional> include` - - A list of additional fields to include in the response. Currently the only supported value is `content` to fetch the PEM content of the certificate. +- `CertificateActivateParams params` - - `CONTENT("content")` + - `List certificateIds` ### Returns -- `class Certificate:` +- `class CertificateActivateResponse:` - Represents an individual `certificate` uploaded to the organization. + Represents an individual certificate configured at the organization level. - `String id` The identifier, which can be referenced in API endpoints - - `CertificateDetails certificateDetails` + - `boolean active` - - `Optional content` + Whether the certificate is currently active at the organization level. - The content of the certificate in PEM format. + - `CertificateDetails certificateDetails` - `Optional expiresAt` @@ -9145,24 +11019,12 @@ You can get a certificate regardless of whether it is active or not. The name of the certificate. - - `Object object_` - - The object type. - - - If creating, updating, or getting a specific certificate, the object type is `certificate`. - - If listing, activating, or deactivating certificates for the organization, the object type is `organization.certificate`. - - If listing, activating, or deactivating certificates for a project, the object type is `organization.project.certificate`. + - `JsonValue; object_ "organization.certificate"constant` - - `CERTIFICATE("certificate")` + The object type, which is always `organization.certificate`. - `ORGANIZATION_CERTIFICATE("organization.certificate")` - - `ORGANIZATION_PROJECT_CERTIFICATE("organization.project.certificate")` - - - `Optional active` - - Whether the certificate is currently active at the specified scope. Not returned when getting details for a specific certificate. - ### Example ```java @@ -9170,8 +11032,8 @@ package com.openai.example; import com.openai.client.OpenAIClient; import com.openai.client.okhttp.OpenAIOkHttpClient; -import com.openai.models.admin.organization.certificates.Certificate; -import com.openai.models.admin.organization.certificates.CertificateRetrieveParams; +import com.openai.models.admin.organization.certificates.CertificateActivatePage; +import com.openai.models.admin.organization.certificates.CertificateActivateParams; public final class Main { private Main() {} @@ -9179,7 +11041,10 @@ public final class Main { public static void main(String[] args) { OpenAIClient client = OpenAIOkHttpClient.fromEnv(); - Certificate certificate = client.admin().organization().certificates().retrieve("certificate_id"); + CertificateActivateParams params = CertificateActivateParams.builder() + .addCertificateId("cert_abc") + .build(); + CertificateActivatePage page = client.admin().organization().certificates().activate(params); } } ``` @@ -9188,52 +11053,54 @@ public final class Main { ```json { + "data": [ + { "id": "id", + "active": true, "certificate_details": { - "content": "content", "expires_at": 0, "valid_at": 0 }, "created_at": 0, "name": "name", - "object": "certificate", - "active": true + "object": "organization.certificate" + } + ], + "object": "organization.certificate.activation" } ``` -## Modify certificate - -`Certificate admin().organization().certificates().update(CertificateUpdateParamsparams = CertificateUpdateParams.none(), RequestOptionsrequestOptions = RequestOptions.none())` +## Deactivate certificates for organization -**post** `/organization/certificates/{certificate_id}` +`CertificateDeactivatePage admin().organization().certificates().deactivate(CertificateDeactivateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` -Modify a certificate. Note that only the name can be modified. +**post** `/organization/certificates/deactivate` -### Parameters +Deactivate certificates at the organization level. -- `CertificateUpdateParams params` +You can atomically and idempotently deactivate up to 10 certificates at a time. - - `Optional certificateId` +### Parameters - - `Optional name` +- `CertificateDeactivateParams params` - The updated name for the certificate + - `List certificateIds` ### Returns -- `class Certificate:` +- `class CertificateDeactivateResponse:` - Represents an individual `certificate` uploaded to the organization. + Represents an individual certificate configured at the organization level. - `String id` The identifier, which can be referenced in API endpoints - - `CertificateDetails certificateDetails` + - `boolean active` - - `Optional content` + Whether the certificate is currently active at the organization level. - The content of the certificate in PEM format. + - `CertificateDetails certificateDetails` - `Optional expiresAt` @@ -9251,24 +11118,12 @@ Modify a certificate. Note that only the name can be modified. The name of the certificate. - - `Object object_` - - The object type. - - - If creating, updating, or getting a specific certificate, the object type is `certificate`. - - If listing, activating, or deactivating certificates for the organization, the object type is `organization.certificate`. - - If listing, activating, or deactivating certificates for a project, the object type is `organization.project.certificate`. + - `JsonValue; object_ "organization.certificate"constant` - - `CERTIFICATE("certificate")` + The object type, which is always `organization.certificate`. - `ORGANIZATION_CERTIFICATE("organization.certificate")` - - `ORGANIZATION_PROJECT_CERTIFICATE("organization.project.certificate")` - - - `Optional active` - - Whether the certificate is currently active at the specified scope. Not returned when getting details for a specific certificate. - ### Example ```java @@ -9276,8 +11131,8 @@ package com.openai.example; import com.openai.client.OpenAIClient; import com.openai.client.okhttp.OpenAIOkHttpClient; -import com.openai.models.admin.organization.certificates.Certificate; -import com.openai.models.admin.organization.certificates.CertificateUpdateParams; +import com.openai.models.admin.organization.certificates.CertificateDeactivatePage; +import com.openai.models.admin.organization.certificates.CertificateDeactivateParams; public final class Main { private Main() {} @@ -9285,7 +11140,10 @@ public final class Main { public static void main(String[] args) { OpenAIClient client = OpenAIOkHttpClient.fromEnv(); - Certificate certificate = client.admin().organization().certificates().update("certificate_id"); + CertificateDeactivateParams params = CertificateDeactivateParams.builder() + .addCertificateId("cert_abc") + .build(); + CertificateDeactivatePage page = client.admin().organization().certificates().deactivate(params); } } ``` @@ -9294,132 +11152,136 @@ public final class Main { ```json { + "data": [ + { "id": "id", + "active": true, "certificate_details": { - "content": "content", "expires_at": 0, "valid_at": 0 }, "created_at": 0, "name": "name", - "object": "certificate", - "active": true + "object": "organization.certificate" + } + ], + "object": "organization.certificate.deactivation" } ``` -## Delete certificate +## Domain Types -`CertificateDeleteResponse admin().organization().certificates().delete(CertificateDeleteParamsparams = CertificateDeleteParams.none(), RequestOptionsrequestOptions = RequestOptions.none())` +### Certificate -**delete** `/organization/certificates/{certificate_id}` +- `class Certificate:` -Delete a certificate from the organization. + Represents an individual `certificate` uploaded to the organization. -The certificate must be inactive for the organization and all projects. + - `String id` -### Parameters + The identifier, which can be referenced in API endpoints -- `CertificateDeleteParams params` + - `CertificateDetails certificateDetails` - - `Optional certificateId` + - `Optional content` -### Returns + The content of the certificate in PEM format. -- `class CertificateDeleteResponse:` + - `Optional expiresAt` - - `String id` + The Unix timestamp (in seconds) of when the certificate expires. - The ID of the certificate that was deleted. + - `Optional validAt` - - `JsonValue; object_ "certificate.deleted"constant` + The Unix timestamp (in seconds) of when the certificate becomes valid. - The object type, must be `certificate.deleted`. + - `long createdAt` - - `CERTIFICATE_DELETED("certificate.deleted")` + The Unix timestamp (in seconds) of when the certificate was uploaded. -### Example + - `Optional name` -```java -package com.openai.example; + The name of the certificate. -import com.openai.client.OpenAIClient; -import com.openai.client.okhttp.OpenAIOkHttpClient; -import com.openai.models.admin.organization.certificates.CertificateDeleteParams; -import com.openai.models.admin.organization.certificates.CertificateDeleteResponse; + - `Object object_` -public final class Main { - private Main() {} + The object type. - public static void main(String[] args) { - OpenAIClient client = OpenAIOkHttpClient.fromEnv(); + - If creating, updating, or getting a specific certificate, the object type is `certificate`. + - If listing, activating, or deactivating certificates for the organization, the object type is `organization.certificate`. + - If listing, activating, or deactivating certificates for a project, the object type is `organization.project.certificate`. - CertificateDeleteResponse certificate = client.admin().organization().certificates().delete("certificate_id"); - } -} -``` + - `CERTIFICATE("certificate")` -#### Response + - `ORGANIZATION_CERTIFICATE("organization.certificate")` -```json -{ - "id": "id", - "object": "certificate.deleted" -} -``` + - `ORGANIZATION_PROJECT_CERTIFICATE("organization.project.certificate")` -## Activate certificates for organization + - `Optional active` -`CertificateActivatePage admin().organization().certificates().activate(CertificateActivateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` + Whether the certificate is currently active at the specified scope. Not returned when getting details for a specific certificate. -**post** `/organization/certificates/activate` +# Projects -Activate certificates at the organization level. +## List projects -You can atomically and idempotently activate up to 10 certificates at a time. +`ProjectListPage admin().organization().projects().list(ProjectListParamsparams = ProjectListParams.none(), RequestOptionsrequestOptions = RequestOptions.none())` + +**get** `/organization/projects` + +Returns a list of projects. ### Parameters -- `CertificateActivateParams params` +- `ProjectListParams params` - - `List certificateIds` + - `Optional after` + + 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. + + - `Optional includeArchived` + + If `true` returns all projects including those that have been `archived`. Archived projects are not included by default. + + - `Optional limit` + + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. ### Returns -- `class CertificateActivateResponse:` +- `class Project:` - Represents an individual certificate configured at the organization level. + Represents an individual project. - `String id` The identifier, which can be referenced in API endpoints - - `boolean active` + - `long createdAt` - Whether the certificate is currently active at the organization level. + The Unix timestamp (in seconds) of when the project was created. - - `CertificateDetails certificateDetails` + - `JsonValue; object_ "organization.project"constant` - - `Optional expiresAt` + The object type, which is always `organization.project` - The Unix timestamp (in seconds) of when the certificate expires. + - `ORGANIZATION_PROJECT("organization.project")` - - `Optional validAt` + - `Optional archivedAt` - The Unix timestamp (in seconds) of when the certificate becomes valid. + The Unix timestamp (in seconds) of when the project was archived or `null`. - - `long createdAt` + - `Optional externalKeyId` - The Unix timestamp (in seconds) of when the certificate was uploaded. + The external key associated with the project. - `Optional name` - The name of the certificate. - - - `JsonValue; object_ "organization.certificate"constant` + The name of the project. This appears in reporting. - The object type, which is always `organization.certificate`. + - `Optional status` - - `ORGANIZATION_CERTIFICATE("organization.certificate")` + `active` or `archived` ### Example @@ -9428,8 +11290,8 @@ package com.openai.example; import com.openai.client.OpenAIClient; import com.openai.client.okhttp.OpenAIOkHttpClient; -import com.openai.models.admin.organization.certificates.CertificateActivatePage; -import com.openai.models.admin.organization.certificates.CertificateActivateParams; +import com.openai.models.admin.organization.projects.ProjectListPage; +import com.openai.models.admin.organization.projects.ProjectListParams; public final class Main { private Main() {} @@ -9437,10 +11299,7 @@ public final class Main { public static void main(String[] args) { OpenAIClient client = OpenAIOkHttpClient.fromEnv(); - CertificateActivateParams params = CertificateActivateParams.builder() - .addCertificateId("cert_abc") - .build(); - CertificateActivatePage page = client.admin().organization().certificates().activate(params); + ProjectListPage page = client.admin().organization().projects().list(); } } ``` @@ -9452,73 +11311,80 @@ public final class Main { "data": [ { "id": "id", - "active": true, - "certificate_details": { - "expires_at": 0, - "valid_at": 0 - }, "created_at": 0, + "object": "organization.project", + "archived_at": 0, + "external_key_id": "external_key_id", "name": "name", - "object": "organization.certificate" + "status": "status" } ], - "object": "organization.certificate.activation" + "has_more": true, + "object": "list", + "first_id": "first_id", + "last_id": "last_id" } ``` -## Deactivate certificates for organization - -`CertificateDeactivatePage admin().organization().certificates().deactivate(CertificateDeactivateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` +## Create project -**post** `/organization/certificates/deactivate` +`Project admin().organization().projects().create(ProjectCreateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` -Deactivate certificates at the organization level. +**post** `/organization/projects` -You can atomically and idempotently deactivate up to 10 certificates at a time. +Create a new project in the organization. Projects can be created and archived, but cannot be deleted. ### Parameters -- `CertificateDeactivateParams params` +- `ProjectCreateParams params` - - `List certificateIds` + - `String name` + + The friendly name of the project, this name appears in reports. + + - `Optional externalKeyId` + + External key ID to associate with the project. + + - `Optional geography` + + Create the project with the specified data residency region. Your organization must have access to Data residency functionality in order to use. See [data residency controls](https://platform.openai.com/docs/guides/your-data#data-residency-controls) to review the functionality and limitations of setting this field. ### Returns -- `class CertificateDeactivateResponse:` +- `class Project:` - Represents an individual certificate configured at the organization level. + Represents an individual project. - `String id` The identifier, which can be referenced in API endpoints - - `boolean active` + - `long createdAt` - Whether the certificate is currently active at the organization level. + The Unix timestamp (in seconds) of when the project was created. - - `CertificateDetails certificateDetails` + - `JsonValue; object_ "organization.project"constant` - - `Optional expiresAt` + The object type, which is always `organization.project` - The Unix timestamp (in seconds) of when the certificate expires. + - `ORGANIZATION_PROJECT("organization.project")` - - `Optional validAt` + - `Optional archivedAt` - The Unix timestamp (in seconds) of when the certificate becomes valid. + The Unix timestamp (in seconds) of when the project was archived or `null`. - - `long createdAt` + - `Optional externalKeyId` - The Unix timestamp (in seconds) of when the certificate was uploaded. + The external key associated with the project. - `Optional name` - The name of the certificate. - - - `JsonValue; object_ "organization.certificate"constant` + The name of the project. This appears in reporting. - The object type, which is always `organization.certificate`. + - `Optional status` - - `ORGANIZATION_CERTIFICATE("organization.certificate")` + `active` or `archived` ### Example @@ -9527,8 +11393,8 @@ package com.openai.example; import com.openai.client.OpenAIClient; import com.openai.client.okhttp.OpenAIOkHttpClient; -import com.openai.models.admin.organization.certificates.CertificateDeactivatePage; -import com.openai.models.admin.organization.certificates.CertificateDeactivateParams; +import com.openai.models.admin.organization.projects.Project; +import com.openai.models.admin.organization.projects.ProjectCreateParams; public final class Main { private Main() {} @@ -9536,10 +11402,10 @@ public final class Main { public static void main(String[] args) { OpenAIClient client = OpenAIOkHttpClient.fromEnv(); - CertificateDeactivateParams params = CertificateDeactivateParams.builder() - .addCertificateId("cert_abc") + ProjectCreateParams params = ProjectCreateParams.builder() + .name("name") .build(); - CertificateDeactivatePage page = client.admin().organization().certificates().deactivate(params); + Project project = client.admin().organization().projects().create(params); } } ``` @@ -9548,100 +11414,126 @@ public final class Main { ```json { - "data": [ - { "id": "id", - "active": true, - "certificate_details": { - "expires_at": 0, - "valid_at": 0 - }, "created_at": 0, + "object": "organization.project", + "archived_at": 0, + "external_key_id": "external_key_id", "name": "name", - "object": "organization.certificate" - } - ], - "object": "organization.certificate.deactivation" + "status": "status" } ``` -## Domain Types +## Retrieve project -### Certificate +`Project admin().organization().projects().retrieve(ProjectRetrieveParamsparams = ProjectRetrieveParams.none(), RequestOptionsrequestOptions = RequestOptions.none())` -- `class Certificate:` +**get** `/organization/projects/{project_id}` - Represents an individual `certificate` uploaded to the organization. +Retrieves a project. + +### Parameters + +- `ProjectRetrieveParams params` + + - `Optional projectId` + +### Returns + +- `class Project:` + + Represents an individual project. - `String id` The identifier, which can be referenced in API endpoints - - `CertificateDetails certificateDetails` + - `long createdAt` - - `Optional content` + The Unix timestamp (in seconds) of when the project was created. - The content of the certificate in PEM format. + - `JsonValue; object_ "organization.project"constant` - - `Optional expiresAt` + The object type, which is always `organization.project` - The Unix timestamp (in seconds) of when the certificate expires. + - `ORGANIZATION_PROJECT("organization.project")` - - `Optional validAt` + - `Optional archivedAt` - The Unix timestamp (in seconds) of when the certificate becomes valid. + The Unix timestamp (in seconds) of when the project was archived or `null`. - - `long createdAt` + - `Optional externalKeyId` - The Unix timestamp (in seconds) of when the certificate was uploaded. + The external key associated with the project. - `Optional name` - The name of the certificate. + The name of the project. This appears in reporting. - - `Object object_` + - `Optional status` - The object type. + `active` or `archived` - - If creating, updating, or getting a specific certificate, the object type is `certificate`. - - If listing, activating, or deactivating certificates for the organization, the object type is `organization.certificate`. - - If listing, activating, or deactivating certificates for a project, the object type is `organization.project.certificate`. +### Example - - `CERTIFICATE("certificate")` +```java +package com.openai.example; - - `ORGANIZATION_CERTIFICATE("organization.certificate")` +import com.openai.client.OpenAIClient; +import com.openai.client.okhttp.OpenAIOkHttpClient; +import com.openai.models.admin.organization.projects.Project; +import com.openai.models.admin.organization.projects.ProjectRetrieveParams; - - `ORGANIZATION_PROJECT_CERTIFICATE("organization.project.certificate")` +public final class Main { + private Main() {} - - `Optional active` + public static void main(String[] args) { + OpenAIClient client = OpenAIOkHttpClient.fromEnv(); - Whether the certificate is currently active at the specified scope. Not returned when getting details for a specific certificate. + Project project = client.admin().organization().projects().retrieve("project_id"); + } +} +``` -# Projects +#### Response -## List projects +```json +{ + "id": "id", + "created_at": 0, + "object": "organization.project", + "archived_at": 0, + "external_key_id": "external_key_id", + "name": "name", + "status": "status" +} +``` -`ProjectListPage admin().organization().projects().list(ProjectListParamsparams = ProjectListParams.none(), RequestOptionsrequestOptions = RequestOptions.none())` +## Modify project -**get** `/organization/projects` +`Project admin().organization().projects().update(ProjectUpdateParamsparams = ProjectUpdateParams.none(), RequestOptionsrequestOptions = RequestOptions.none())` -Returns a list of projects. +**post** `/organization/projects/{project_id}` + +Modifies a project in the organization. ### Parameters -- `ProjectListParams params` +- `ProjectUpdateParams params` - - `Optional after` + - `Optional projectId` - 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. + - `Optional externalKeyId` - - `Optional includeArchived` + External key ID to associate with the project. - If `true` returns all projects including those that have been `archived`. Archived projects are not included by default. + - `Optional geography` - - `Optional limit` + Geography for the project. - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + - `Optional name` + + The updated name of the project, this name appears in reports. ### Returns @@ -9686,8 +11578,8 @@ package com.openai.example; import com.openai.client.OpenAIClient; import com.openai.client.okhttp.OpenAIOkHttpClient; -import com.openai.models.admin.organization.projects.ProjectListPage; -import com.openai.models.admin.organization.projects.ProjectListParams; +import com.openai.models.admin.organization.projects.Project; +import com.openai.models.admin.organization.projects.ProjectUpdateParams; public final class Main { private Main() {} @@ -9695,7 +11587,7 @@ public final class Main { public static void main(String[] args) { OpenAIClient client = OpenAIOkHttpClient.fromEnv(); - ProjectListPage page = client.admin().organization().projects().list(); + Project project = client.admin().organization().projects().update("project_id"); } } ``` @@ -9704,8 +11596,6 @@ public final class Main { ```json { - "data": [ - { "id": "id", "created_at": 0, "object": "organization.project", @@ -9713,38 +11603,22 @@ public final class Main { "external_key_id": "external_key_id", "name": "name", "status": "status" - } - ], - "has_more": true, - "object": "list", - "first_id": "first_id", - "last_id": "last_id" } ``` -## Create project - -`Project admin().organization().projects().create(ProjectCreateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` - -**post** `/organization/projects` - -Create a new project in the organization. Projects can be created and archived, but cannot be deleted. - -### Parameters - -- `ProjectCreateParams params` +## Archive project - - `String name` +`Project admin().organization().projects().archive(ProjectArchiveParamsparams = ProjectArchiveParams.none(), RequestOptionsrequestOptions = RequestOptions.none())` - The friendly name of the project, this name appears in reports. +**post** `/organization/projects/{project_id}/archive` - - `Optional externalKeyId` +Archives a project in the organization. Archived projects cannot be used or updated. - External key ID to associate with the project. +### Parameters - - `Optional geography` +- `ProjectArchiveParams params` - Create the project with the specified data residency region. Your organization must have access to Data residency functionality in order to use. See [data residency controls](https://platform.openai.com/docs/guides/your-data#data-residency-controls) to review the functionality and limitations of setting this field. + - `Optional projectId` ### Returns @@ -9790,7 +11664,7 @@ package com.openai.example; import com.openai.client.OpenAIClient; import com.openai.client.okhttp.OpenAIOkHttpClient; import com.openai.models.admin.organization.projects.Project; -import com.openai.models.admin.organization.projects.ProjectCreateParams; +import com.openai.models.admin.organization.projects.ProjectArchiveParams; public final class Main { private Main() {} @@ -9798,10 +11672,7 @@ public final class Main { public static void main(String[] args) { OpenAIClient client = OpenAIOkHttpClient.fromEnv(); - ProjectCreateParams params = ProjectCreateParams.builder() - .name("name") - .build(); - Project project = client.admin().organization().projects().create(params); + Project project = client.admin().organization().projects().archive("project_id"); } } ``` @@ -9820,21 +11691,9 @@ public final class Main { } ``` -## Retrieve project - -`Project admin().organization().projects().retrieve(ProjectRetrieveParamsparams = ProjectRetrieveParams.none(), RequestOptionsrequestOptions = RequestOptions.none())` - -**get** `/organization/projects/{project_id}` - -Retrieves a project. - -### Parameters - -- `ProjectRetrieveParams params` - - - `Optional projectId` +## Domain Types -### Returns +### Project - `class Project:` @@ -9870,6 +11729,62 @@ Retrieves a project. `active` or `archived` +# Users + +## List project users + +`UserListPage admin().organization().projects().users().list(UserListParamsparams = UserListParams.none(), RequestOptionsrequestOptions = RequestOptions.none())` + +**get** `/organization/projects/{project_id}/users` + +Returns a list of users in the project. + +### Parameters + +- `UserListParams params` + + - `Optional projectId` + + - `Optional after` + + 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. + + - `Optional limit` + + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + +### Returns + +- `class ProjectUser:` + + Represents an individual user in a project. + + - `String id` + + The identifier, which can be referenced in API endpoints + + - `long addedAt` + + The Unix timestamp (in seconds) of when the project was added. + + - `JsonValue; object_ "organization.project.user"constant` + + The object type, which is always `organization.project.user` + + - `ORGANIZATION_PROJECT_USER("organization.project.user")` + + - `String role` + + `owner` or `member` + + - `Optional email` + + The email address of the user + + - `Optional name` + + The name of the user + ### Example ```java @@ -9877,8 +11792,8 @@ package com.openai.example; import com.openai.client.OpenAIClient; import com.openai.client.okhttp.OpenAIOkHttpClient; -import com.openai.models.admin.organization.projects.Project; -import com.openai.models.admin.organization.projects.ProjectRetrieveParams; +import com.openai.models.admin.organization.projects.users.UserListPage; +import com.openai.models.admin.organization.projects.users.UserListParams; public final class Main { private Main() {} @@ -9886,7 +11801,7 @@ public final class Main { public static void main(String[] args) { OpenAIClient client = OpenAIOkHttpClient.fromEnv(); - Project project = client.admin().organization().projects().retrieve("project_id"); + UserListPage page = client.admin().organization().projects().users().list("project_id"); } } ``` @@ -9895,77 +11810,80 @@ public final class Main { ```json { + "data": [ + { "id": "id", - "created_at": 0, - "object": "organization.project", - "archived_at": 0, - "external_key_id": "external_key_id", - "name": "name", - "status": "status" + "added_at": 0, + "object": "organization.project.user", + "role": "role", + "email": "email", + "name": "name" + } + ], + "has_more": true, + "object": "object", + "first_id": "first_id", + "last_id": "last_id" } ``` -## Modify project +## Create project user -`Project admin().organization().projects().update(ProjectUpdateParamsparams = ProjectUpdateParams.none(), RequestOptionsrequestOptions = RequestOptions.none())` +`ProjectUser admin().organization().projects().users().create(UserCreateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` -**post** `/organization/projects/{project_id}` +**post** `/organization/projects/{project_id}/users` -Modifies a project in the organization. +Adds a user to the project. Users must already be members of the organization to be added to a project. ### Parameters -- `ProjectUpdateParams params` +- `UserCreateParams params` - `Optional projectId` - - `Optional externalKeyId` + - `String role` - External key ID to associate with the project. + `owner` or `member` - - `Optional geography` + - `Optional email` - Geography for the project. + Email of the user to add. - - `Optional name` + - `Optional userId` - The updated name of the project, this name appears in reports. + The ID of the user. ### Returns -- `class Project:` +- `class ProjectUser:` - Represents an individual project. + Represents an individual user in a project. - `String id` The identifier, which can be referenced in API endpoints - - `long createdAt` + - `long addedAt` - The Unix timestamp (in seconds) of when the project was created. + The Unix timestamp (in seconds) of when the project was added. - - `JsonValue; object_ "organization.project"constant` + - `JsonValue; object_ "organization.project.user"constant` - The object type, which is always `organization.project` + The object type, which is always `organization.project.user` - - `ORGANIZATION_PROJECT("organization.project")` + - `ORGANIZATION_PROJECT_USER("organization.project.user")` - - `Optional archivedAt` + - `String role` - The Unix timestamp (in seconds) of when the project was archived or `null`. + `owner` or `member` - - `Optional externalKeyId` + - `Optional email` - The external key associated with the project. + The email address of the user - `Optional name` - The name of the project. This appears in reporting. - - - `Optional status` - - `active` or `archived` + The name of the user ### Example @@ -9974,8 +11892,8 @@ package com.openai.example; import com.openai.client.OpenAIClient; import com.openai.client.okhttp.OpenAIOkHttpClient; -import com.openai.models.admin.organization.projects.Project; -import com.openai.models.admin.organization.projects.ProjectUpdateParams; +import com.openai.models.admin.organization.projects.users.ProjectUser; +import com.openai.models.admin.organization.projects.users.UserCreateParams; public final class Main { private Main() {} @@ -9983,7 +11901,11 @@ public final class Main { public static void main(String[] args) { OpenAIClient client = OpenAIOkHttpClient.fromEnv(); - Project project = client.admin().organization().projects().update("project_id"); + UserCreateParams params = UserCreateParams.builder() + .projectId("project_id") + .role("role") + .build(); + ProjectUser projectUser = client.admin().organization().projects().users().create(params); } } ``` @@ -9993,64 +11915,151 @@ public final class Main { ```json { "id": "id", - "created_at": 0, - "object": "organization.project", - "archived_at": 0, - "external_key_id": "external_key_id", - "name": "name", - "status": "status" + "added_at": 0, + "object": "organization.project.user", + "role": "role", + "email": "email", + "name": "name" +} +``` + +## Retrieve project user + +`ProjectUser admin().organization().projects().users().retrieve(UserRetrieveParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` + +**get** `/organization/projects/{project_id}/users/{user_id}` + +Retrieves a user in the project. + +### Parameters + +- `UserRetrieveParams params` + + - `String projectId` + + - `Optional userId` + +### Returns + +- `class ProjectUser:` + + Represents an individual user in a project. + + - `String id` + + The identifier, which can be referenced in API endpoints + + - `long addedAt` + + The Unix timestamp (in seconds) of when the project was added. + + - `JsonValue; object_ "organization.project.user"constant` + + The object type, which is always `organization.project.user` + + - `ORGANIZATION_PROJECT_USER("organization.project.user")` + + - `String role` + + `owner` or `member` + + - `Optional email` + + The email address of the user + + - `Optional name` + + The name of the user + +### Example + +```java +package com.openai.example; + +import com.openai.client.OpenAIClient; +import com.openai.client.okhttp.OpenAIOkHttpClient; +import com.openai.models.admin.organization.projects.users.ProjectUser; +import com.openai.models.admin.organization.projects.users.UserRetrieveParams; + +public final class Main { + private Main() {} + + public static void main(String[] args) { + OpenAIClient client = OpenAIOkHttpClient.fromEnv(); + + UserRetrieveParams params = UserRetrieveParams.builder() + .projectId("project_id") + .userId("user_id") + .build(); + ProjectUser projectUser = client.admin().organization().projects().users().retrieve(params); + } +} +``` + +#### Response + +```json +{ + "id": "id", + "added_at": 0, + "object": "organization.project.user", + "role": "role", + "email": "email", + "name": "name" } ``` -## Archive project +## Modify project user -`Project admin().organization().projects().archive(ProjectArchiveParamsparams = ProjectArchiveParams.none(), RequestOptionsrequestOptions = RequestOptions.none())` +`ProjectUser admin().organization().projects().users().update(UserUpdateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` -**post** `/organization/projects/{project_id}/archive` +**post** `/organization/projects/{project_id}/users/{user_id}` -Archives a project in the organization. Archived projects cannot be used or updated. +Modifies a user's role in the project. ### Parameters -- `ProjectArchiveParams params` +- `UserUpdateParams params` - - `Optional projectId` + - `String projectId` + + - `Optional userId` + + - `Optional role` + + `owner` or `member` ### Returns -- `class Project:` +- `class ProjectUser:` - Represents an individual project. + Represents an individual user in a project. - `String id` The identifier, which can be referenced in API endpoints - - `long createdAt` + - `long addedAt` - The Unix timestamp (in seconds) of when the project was created. + The Unix timestamp (in seconds) of when the project was added. - - `JsonValue; object_ "organization.project"constant` + - `JsonValue; object_ "organization.project.user"constant` - The object type, which is always `organization.project` + The object type, which is always `organization.project.user` - - `ORGANIZATION_PROJECT("organization.project")` + - `ORGANIZATION_PROJECT_USER("organization.project.user")` - - `Optional archivedAt` + - `String role` - The Unix timestamp (in seconds) of when the project was archived or `null`. + `owner` or `member` - - `Optional externalKeyId` + - `Optional email` - The external key associated with the project. + The email address of the user - `Optional name` - The name of the project. This appears in reporting. - - - `Optional status` - - `active` or `archived` + The name of the user ### Example @@ -10059,8 +12068,8 @@ package com.openai.example; import com.openai.client.OpenAIClient; import com.openai.client.okhttp.OpenAIOkHttpClient; -import com.openai.models.admin.organization.projects.Project; -import com.openai.models.admin.organization.projects.ProjectArchiveParams; +import com.openai.models.admin.organization.projects.users.ProjectUser; +import com.openai.models.admin.organization.projects.users.UserUpdateParams; public final class Main { private Main() {} @@ -10068,7 +12077,11 @@ public final class Main { public static void main(String[] args) { OpenAIClient client = OpenAIOkHttpClient.fromEnv(); - Project project = client.admin().organization().projects().archive("project_id"); + UserUpdateParams params = UserUpdateParams.builder() + .projectId("project_id") + .userId("user_id") + .build(); + ProjectUser projectUser = client.admin().organization().projects().users().update(params); } } ``` @@ -10078,78 +12091,83 @@ public final class Main { ```json { "id": "id", - "created_at": 0, - "object": "organization.project", - "archived_at": 0, - "external_key_id": "external_key_id", - "name": "name", - "status": "status" + "added_at": 0, + "object": "organization.project.user", + "role": "role", + "email": "email", + "name": "name" } ``` -## Domain Types - -### Project - -- `class Project:` - - Represents an individual project. - - - `String id` - - The identifier, which can be referenced in API endpoints - - - `long createdAt` - - The Unix timestamp (in seconds) of when the project was created. +## Delete project user - - `JsonValue; object_ "organization.project"constant` +`UserDeleteResponse admin().organization().projects().users().delete(UserDeleteParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` - The object type, which is always `organization.project` +**delete** `/organization/projects/{project_id}/users/{user_id}` - - `ORGANIZATION_PROJECT("organization.project")` +Deletes a user from the project. - - `Optional archivedAt` +Returns confirmation of project user deletion, or an error if the project is +archived (archived projects have no users). - The Unix timestamp (in seconds) of when the project was archived or `null`. +### Parameters - - `Optional externalKeyId` +- `UserDeleteParams params` - The external key associated with the project. + - `String projectId` - - `Optional name` + - `Optional userId` - The name of the project. This appears in reporting. +### Returns - - `Optional status` +- `class UserDeleteResponse:` - `active` or `archived` + - `String id` -# Users + - `boolean deleted` -## List project users + - `JsonValue; object_ "organization.project.user.deleted"constant` -`UserListPage admin().organization().projects().users().list(UserListParamsparams = UserListParams.none(), RequestOptionsrequestOptions = RequestOptions.none())` + - `ORGANIZATION_PROJECT_USER_DELETED("organization.project.user.deleted")` -**get** `/organization/projects/{project_id}/users` +### Example -Returns a list of users in the project. +```java +package com.openai.example; -### Parameters +import com.openai.client.OpenAIClient; +import com.openai.client.okhttp.OpenAIOkHttpClient; +import com.openai.models.admin.organization.projects.users.UserDeleteParams; +import com.openai.models.admin.organization.projects.users.UserDeleteResponse; -- `UserListParams params` +public final class Main { + private Main() {} - - `Optional projectId` + public static void main(String[] args) { + OpenAIClient client = OpenAIOkHttpClient.fromEnv(); - - `Optional after` + UserDeleteParams params = UserDeleteParams.builder() + .projectId("project_id") + .userId("user_id") + .build(); + UserDeleteResponse user = client.admin().organization().projects().users().delete(params); + } +} +``` - 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. +#### Response - - `Optional limit` +```json +{ + "id": "id", + "deleted": true, + "object": "organization.project.user.deleted" +} +``` - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. +## Domain Types -### Returns +### Project User - `class ProjectUser:` @@ -10181,105 +12199,89 @@ Returns a list of users in the project. The name of the user -### Example +# Roles -```java -package com.openai.example; +## List project user role assignments -import com.openai.client.OpenAIClient; -import com.openai.client.okhttp.OpenAIOkHttpClient; -import com.openai.models.admin.organization.projects.users.UserListPage; -import com.openai.models.admin.organization.projects.users.UserListParams; +`RoleListPage admin().organization().projects().users().roles().list(RoleListParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` -public final class Main { - private Main() {} +**get** `/projects/{project_id}/users/{user_id}/roles` - public static void main(String[] args) { - OpenAIClient client = OpenAIOkHttpClient.fromEnv(); +Lists the project roles assigned to a user within a project. - UserListPage page = client.admin().organization().projects().users().list("project_id"); - } -} -``` +### Parameters -#### Response +- `RoleListParams params` -```json -{ - "data": [ - { - "id": "id", - "added_at": 0, - "object": "organization.project.user", - "role": "role", - "email": "email", - "name": "name" - } - ], - "has_more": true, - "object": "object", - "first_id": "first_id", - "last_id": "last_id" -} -``` + - `String projectId` -## Create project user + - `Optional userId` -`ProjectUser admin().organization().projects().users().create(UserCreateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` + - `Optional after` -**post** `/organization/projects/{project_id}/users` + Cursor for pagination. Provide the value from the previous response's `next` field to continue listing project roles. -Adds a user to the project. Users must already be members of the organization to be added to a project. + - `Optional limit` -### Parameters + A limit on the number of project role assignments to return. -- `UserCreateParams params` + - `Optional order` - - `Optional projectId` + Sort order for the returned project roles. - - `String role` + - `ASC("asc")` - `owner` or `member` + - `DESC("desc")` - - `Optional email` +### Returns - Email of the user to add. +- `class RoleListResponse:` - - `Optional userId` + Detailed information about a role assignment entry returned when listing assignments. - The ID of the user. + - `String id` -### Returns + Identifier for the role. -- `class ProjectUser:` + - `Optional createdAt` - Represents an individual user in a project. + When the role was created. - - `String id` + - `Optional createdBy` - The identifier, which can be referenced in API endpoints + Identifier of the actor who created the role. - - `long addedAt` + - `Optional createdByUserObj` - The Unix timestamp (in seconds) of when the project was added. + User details for the actor that created the role, when available. - - `JsonValue; object_ "organization.project.user"constant` + - `Optional description` - The object type, which is always `organization.project.user` + Description of the role. + + - `Optional metadata` + + Arbitrary metadata stored on the role. + + - `String name` + + Name of the role. + + - `List permissions` - - `ORGANIZATION_PROJECT_USER("organization.project.user")` + Permissions associated with the role. - - `String role` + - `boolean predefinedRole` - `owner` or `member` + Whether the role is predefined by OpenAI. - - `Optional email` + - `String resourceType` - The email address of the user + Resource type the role applies to. - - `Optional name` + - `Optional updatedAt` - The name of the user + When the role was last updated. ### Example @@ -10288,8 +12290,8 @@ package com.openai.example; import com.openai.client.OpenAIClient; import com.openai.client.okhttp.OpenAIOkHttpClient; -import com.openai.models.admin.organization.projects.users.ProjectUser; -import com.openai.models.admin.organization.projects.users.UserCreateParams; +import com.openai.models.admin.organization.projects.users.roles.RoleListPage; +import com.openai.models.admin.organization.projects.users.roles.RoleListParams; public final class Main { private Main() {} @@ -10297,11 +12299,11 @@ public final class Main { public static void main(String[] args) { OpenAIClient client = OpenAIOkHttpClient.fromEnv(); - UserCreateParams params = UserCreateParams.builder() + RoleListParams params = RoleListParams.builder() .projectId("project_id") - .role("role") + .userId("user_id") .build(); - ProjectUser projectUser = client.admin().organization().projects().users().create(params); + RoleListPage page = client.admin().organization().projects().users().roles().list(params); } } ``` @@ -10310,36 +12312,102 @@ public final class Main { ```json { + "data": [ + { "id": "id", - "added_at": 0, - "object": "organization.project.user", - "role": "role", - "email": "email", - "name": "name" + "created_at": 0, + "created_by": "created_by", + "created_by_user_obj": { + "foo": "bar" + }, + "description": "description", + "metadata": { + "foo": "bar" + }, + "name": "name", + "permissions": [ + "string" + ], + "predefined_role": true, + "resource_type": "resource_type", + "updated_at": 0 + } + ], + "has_more": true, + "next": "next", + "object": "list" } ``` -## Retrieve project user +## Assign project role to user -`ProjectUser admin().organization().projects().users().retrieve(UserRetrieveParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` +`RoleCreateResponse admin().organization().projects().users().roles().create(RoleCreateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` -**get** `/organization/projects/{project_id}/users/{user_id}` +**post** `/projects/{project_id}/users/{user_id}/roles` -Retrieves a user in the project. +Assigns a project role to a user within a project. ### Parameters -- `UserRetrieveParams params` +- `RoleCreateParams params` - `String projectId` - `Optional userId` + - `String roleId` + + Identifier of the role to assign. + ### Returns -- `class ProjectUser:` +- `class RoleCreateResponse:` - Represents an individual user in a project. + Role assignment linking a user to a role. + + - `JsonValue; object_ "user.role"constant` + + Always `user.role`. + + - `USER_ROLE("user.role")` + + - `Role role` + + Details about a role that can be assigned through the public Roles API. + + - `String id` + + Identifier for the role. + + - `Optional description` + + Optional description of the role. + + - `String name` + + Unique name for the role. + + - `JsonValue; object_ "role"constant` + + Always `role`. + + - `ROLE("role")` + + - `List permissions` + + Permissions granted by the role. + + - `boolean predefinedRole` + + Whether the role is predefined and managed by OpenAI. + + - `String resourceType` + + Resource type the role is bound to (for example `api.organization` or `api.project`). + + - `OrganizationUser user` + + Represents an individual `user` within an organization. - `String id` @@ -10347,115 +12415,95 @@ Retrieves a user in the project. - `long addedAt` - The Unix timestamp (in seconds) of when the project was added. + The Unix timestamp (in seconds) of when the user was added. - - `JsonValue; object_ "organization.project.user"constant` + - `JsonValue; object_ "organization.user"constant` - The object type, which is always `organization.project.user` + The object type, which is always `organization.user` - - `ORGANIZATION_PROJECT_USER("organization.project.user")` + - `ORGANIZATION_USER("organization.user")` - - `String role` + - `Optional apiKeyLastUsedAt` - `owner` or `member` + The Unix timestamp (in seconds) of the user's last API key usage. - - `Optional email` + - `Optional created` - The email address of the user + The Unix timestamp (in seconds) of when the user was created. - - `Optional name` + - `Optional developerPersona` - The name of the user + The developer persona metadata for the user. -### Example + - `Optional email` -```java -package com.openai.example; + The email address of the user -import com.openai.client.OpenAIClient; -import com.openai.client.okhttp.OpenAIOkHttpClient; -import com.openai.models.admin.organization.projects.users.ProjectUser; -import com.openai.models.admin.organization.projects.users.UserRetrieveParams; + - `Optional isDefault` -public final class Main { - private Main() {} + Whether this is the organization's default user. - public static void main(String[] args) { - OpenAIClient client = OpenAIOkHttpClient.fromEnv(); + - `Optional isScaleTierAuthorizedPurchaser` - UserRetrieveParams params = UserRetrieveParams.builder() - .projectId("project_id") - .userId("user_id") - .build(); - ProjectUser projectUser = client.admin().organization().projects().users().retrieve(params); - } -} -``` + Whether the user is an authorized purchaser for Scale Tier. -#### Response + - `Optional isScimManaged` -```json -{ - "id": "id", - "added_at": 0, - "object": "organization.project.user", - "role": "role", - "email": "email", - "name": "name" -} -``` + Whether the user is managed through SCIM. -## Modify project user + - `Optional isServiceAccount` -`ProjectUser admin().organization().projects().users().update(UserUpdateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` + Whether the user is a service account. -**post** `/organization/projects/{project_id}/users/{user_id}` + - `Optional name` -Modifies a user's role in the project. + The name of the user -### Parameters + - `Optional projects` -- `UserUpdateParams params` + Projects associated with the user, if included. - - `String projectId` + - `List data` - - `Optional userId` + - `Optional id` + + - `Optional name` - `Optional role` - `owner` or `member` + - `JsonValue; object_ "list"constant` -### Returns + - `LIST("list")` -- `class ProjectUser:` + - `Optional role` - Represents an individual user in a project. + `owner` or `reader` - - `String id` + - `Optional technicalLevel` - The identifier, which can be referenced in API endpoints + The technical level metadata for the user. - - `long addedAt` + - `Optional user` - The Unix timestamp (in seconds) of when the project was added. + Nested user details. - - `JsonValue; object_ "organization.project.user"constant` + - `String id` - The object type, which is always `organization.project.user` + - `JsonValue; object_ "user"constant` - - `ORGANIZATION_PROJECT_USER("organization.project.user")` + - `USER("user")` - - `String role` + - `Optional banned` - `owner` or `member` + - `Optional bannedAt` - `Optional email` - The email address of the user + - `Optional enabled` - `Optional name` - The name of the user + - `Optional picture` ### Example @@ -10464,8 +12512,8 @@ package com.openai.example; import com.openai.client.OpenAIClient; import com.openai.client.okhttp.OpenAIOkHttpClient; -import com.openai.models.admin.organization.projects.users.ProjectUser; -import com.openai.models.admin.organization.projects.users.UserUpdateParams; +import com.openai.models.admin.organization.projects.users.roles.RoleCreateParams; +import com.openai.models.admin.organization.projects.users.roles.RoleCreateResponse; public final class Main { private Main() {} @@ -10473,11 +12521,12 @@ public final class Main { public static void main(String[] args) { OpenAIClient client = OpenAIOkHttpClient.fromEnv(); - UserUpdateParams params = UserUpdateParams.builder() + RoleCreateParams params = RoleCreateParams.builder() .projectId("project_id") .userId("user_id") + .roleId("role_id") .build(); - ProjectUser projectUser = client.admin().organization().projects().users().update(params); + RoleCreateResponse role = client.admin().organization().projects().users().roles().create(params); } } ``` @@ -10486,45 +12535,88 @@ public final class Main { ```json { + "object": "user.role", + "role": { + "id": "id", + "description": "description", + "name": "name", + "object": "role", + "permissions": [ + "string" + ], + "predefined_role": true, + "resource_type": "resource_type" + }, + "user": { + "id": "id", + "added_at": 0, + "object": "organization.user", + "api_key_last_used_at": 0, + "created": 0, + "developer_persona": "developer_persona", + "email": "email", + "is_default": true, + "is_scale_tier_authorized_purchaser": true, + "is_scim_managed": true, + "is_service_account": true, + "name": "name", + "projects": { + "data": [ + { "id": "id", - "added_at": 0, - "object": "organization.project.user", + "name": "name", + "role": "role" + } + ], + "object": "list" + }, "role": "role", + "technical_level": "technical_level", + "user": { + "id": "id", + "object": "user", + "banned": true, + "banned_at": 0, "email": "email", - "name": "name" + "enabled": true, + "name": "name", + "picture": "picture" + } + } } ``` -## Delete project user - -`UserDeleteResponse admin().organization().projects().users().delete(UserDeleteParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` +## Unassign project role from user -**delete** `/organization/projects/{project_id}/users/{user_id}` +`RoleDeleteResponse admin().organization().projects().users().roles().delete(RoleDeleteParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` -Deletes a user from the project. +**delete** `/projects/{project_id}/users/{user_id}/roles/{role_id}` -Returns confirmation of project user deletion, or an error if the project is -archived (archived projects have no users). +Unassigns a project role from a user within a project. ### Parameters -- `UserDeleteParams params` +- `RoleDeleteParams params` - `String projectId` - - `Optional userId` + - `String userId` + + - `Optional roleId` ### Returns -- `class UserDeleteResponse:` +- `class RoleDeleteResponse:` - - `String id` + Confirmation payload returned after unassigning a role. - `boolean deleted` - - `JsonValue; object_ "organization.project.user.deleted"constant` + Whether the assignment was removed. - - `ORGANIZATION_PROJECT_USER_DELETED("organization.project.user.deleted")` + - `String object_` + + Identifier for the deleted assignment, such as `group.role.deleted` or `user.role.deleted`. ### Example @@ -10533,8 +12625,8 @@ package com.openai.example; import com.openai.client.OpenAIClient; import com.openai.client.okhttp.OpenAIOkHttpClient; -import com.openai.models.admin.organization.projects.users.UserDeleteParams; -import com.openai.models.admin.organization.projects.users.UserDeleteResponse; +import com.openai.models.admin.organization.projects.users.roles.RoleDeleteParams; +import com.openai.models.admin.organization.projects.users.roles.RoleDeleteResponse; public final class Main { private Main() {} @@ -10542,11 +12634,12 @@ public final class Main { public static void main(String[] args) { OpenAIClient client = OpenAIOkHttpClient.fromEnv(); - UserDeleteParams params = UserDeleteParams.builder() + RoleDeleteParams params = RoleDeleteParams.builder() .projectId("project_id") .userId("user_id") + .roleId("role_id") .build(); - UserDeleteResponse user = client.admin().organization().projects().users().delete(params); + RoleDeleteResponse role = client.admin().organization().projects().users().roles().delete(params); } } ``` @@ -10555,129 +12648,66 @@ public final class Main { ```json { - "id": "id", "deleted": true, - "object": "organization.project.user.deleted" + "object": "object" } ``` -## Domain Types - -### Project User - -- `class ProjectUser:` - - Represents an individual user in a project. - - - `String id` - - The identifier, which can be referenced in API endpoints - - - `long addedAt` - - The Unix timestamp (in seconds) of when the project was added. - - - `JsonValue; object_ "organization.project.user"constant` - - The object type, which is always `organization.project.user` - - - `ORGANIZATION_PROJECT_USER("organization.project.user")` - - - `String role` - - `owner` or `member` - - - `Optional email` - - The email address of the user - - - `Optional name` - - The name of the user - -# Roles +# Service Accounts -## List project user role assignments +## List project service accounts -`RoleListPage admin().organization().projects().users().roles().list(RoleListParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` +`ServiceAccountListPage admin().organization().projects().serviceAccounts().list(ServiceAccountListParamsparams = ServiceAccountListParams.none(), RequestOptionsrequestOptions = RequestOptions.none())` -**get** `/projects/{project_id}/users/{user_id}/roles` +**get** `/organization/projects/{project_id}/service_accounts` -Lists the project roles assigned to a user within a project. +Returns a list of service accounts in the project. ### Parameters -- `RoleListParams params` - - - `String projectId` +- `ServiceAccountListParams params` - - `Optional userId` + - `Optional projectId` - `Optional after` - Cursor for pagination. Provide the value from the previous response's `next` field to continue listing project roles. + 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. - `Optional limit` - A limit on the number of project role assignments to return. - - - `Optional order` - - Sort order for the returned project roles. - - - `ASC("asc")` - - - `DESC("desc")` + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. ### Returns -- `class RoleListResponse:` +- `class ProjectServiceAccount:` - Detailed information about a role assignment entry returned when listing assignments. + Represents an individual service account in a project. - `String id` - Identifier for the role. - - - `Optional createdAt` - - When the role was created. - - - `Optional createdBy` - - Identifier of the actor who created the role. - - - `Optional createdByUserObj` - - User details for the actor that created the role, when available. - - - `Optional description` - - Description of the role. + The identifier, which can be referenced in API endpoints - - `Optional metadata` + - `long createdAt` - Arbitrary metadata stored on the role. + The Unix timestamp (in seconds) of when the service account was created - `String name` - Name of the role. - - - `List permissions` + The name of the service account - Permissions associated with the role. + - `JsonValue; object_ "organization.project.service_account"constant` - - `boolean predefinedRole` + The object type, which is always `organization.project.service_account` - Whether the role is predefined by OpenAI. + - `ORGANIZATION_PROJECT_SERVICE_ACCOUNT("organization.project.service_account")` - - `String resourceType` + - `Role role` - Resource type the role applies to. + `owner` or `member` - - `Optional updatedAt` + - `OWNER("owner")` - When the role was last updated. + - `MEMBER("member")` ### Example @@ -10686,8 +12716,8 @@ package com.openai.example; import com.openai.client.OpenAIClient; import com.openai.client.okhttp.OpenAIOkHttpClient; -import com.openai.models.admin.organization.projects.users.roles.RoleListPage; -import com.openai.models.admin.organization.projects.users.roles.RoleListParams; +import com.openai.models.admin.organization.projects.serviceaccounts.ServiceAccountListPage; +import com.openai.models.admin.organization.projects.serviceaccounts.ServiceAccountListParams; public final class Main { private Main() {} @@ -10695,11 +12725,7 @@ public final class Main { public static void main(String[] args) { OpenAIClient client = OpenAIOkHttpClient.fromEnv(); - RoleListParams params = RoleListParams.builder() - .projectId("project_id") - .userId("user_id") - .build(); - RoleListPage page = client.admin().organization().projects().users().roles().list(params); + ServiceAccountListPage page = client.admin().organization().projects().serviceAccounts().list("project_id"); } } ``` @@ -10712,194 +12738,231 @@ public final class Main { { "id": "id", "created_at": 0, - "created_by": "created_by", - "created_by_user_obj": { - "foo": "bar" - }, - "description": "description", - "metadata": { - "foo": "bar" - }, "name": "name", - "permissions": [ - "string" - ], - "predefined_role": true, - "resource_type": "resource_type", - "updated_at": 0 + "object": "organization.project.service_account", + "role": "owner" } ], "has_more": true, - "next": "next", - "object": "list" + "object": "list", + "first_id": "first_id", + "last_id": "last_id" } ``` -## Assign project role to user +## Create project service account -`RoleCreateResponse admin().organization().projects().users().roles().create(RoleCreateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` +`ServiceAccountCreateResponse admin().organization().projects().serviceAccounts().create(ServiceAccountCreateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` -**post** `/projects/{project_id}/users/{user_id}/roles` +**post** `/organization/projects/{project_id}/service_accounts` -Assigns a project role to a user within a project. +Creates a new service account in the project. This also returns an unredacted API key for the service account. ### Parameters -- `RoleCreateParams params` - - - `String projectId` +- `ServiceAccountCreateParams params` - - `Optional userId` + - `Optional projectId` - - `String roleId` + - `String name` - Identifier of the role to assign. + The name of the service account being created. ### Returns -- `class RoleCreateResponse:` +- `class ServiceAccountCreateResponse:` - Role assignment linking a user to a role. + - `String id` - - `JsonValue; object_ "user.role"constant` + - `Optional apiKey` - Always `user.role`. + - `String id` - - `USER_ROLE("user.role")` + - `long createdAt` - - `Role role` + - `String name` - Details about a role that can be assigned through the public Roles API. + - `JsonValue; object_ "organization.project.service_account.api_key"constant` - - `String id` + The object type, which is always `organization.project.service_account.api_key` - Identifier for the role. + - `ORGANIZATION_PROJECT_SERVICE_ACCOUNT_API_KEY("organization.project.service_account.api_key")` - - `Optional description` + - `String value` - Optional description of the role. + - `long createdAt` - `String name` - Unique name for the role. + - `JsonValue; object_ "organization.project.service_account"constant` - - `JsonValue; object_ "role"constant` + - `ORGANIZATION_PROJECT_SERVICE_ACCOUNT("organization.project.service_account")` - Always `role`. + - `JsonValue; role "member"constant` - - `ROLE("role")` + Service accounts can only have one role of type `member` - - `List permissions` + - `MEMBER("member")` - Permissions granted by the role. +### Example - - `boolean predefinedRole` +```java +package com.openai.example; - Whether the role is predefined and managed by OpenAI. +import com.openai.client.OpenAIClient; +import com.openai.client.okhttp.OpenAIOkHttpClient; +import com.openai.models.admin.organization.projects.serviceaccounts.ServiceAccountCreateParams; +import com.openai.models.admin.organization.projects.serviceaccounts.ServiceAccountCreateResponse; - - `String resourceType` +public final class Main { + private Main() {} - Resource type the role is bound to (for example `api.organization` or `api.project`). + public static void main(String[] args) { + OpenAIClient client = OpenAIOkHttpClient.fromEnv(); - - `OrganizationUser user` + ServiceAccountCreateParams params = ServiceAccountCreateParams.builder() + .projectId("project_id") + .name("name") + .build(); + ServiceAccountCreateResponse serviceAccount = client.admin().organization().projects().serviceAccounts().create(params); + } +} +``` - Represents an individual `user` within an organization. +#### Response - - `String id` +```json +{ + "id": "id", + "api_key": { + "id": "id", + "created_at": 0, + "name": "name", + "object": "organization.project.service_account.api_key", + "value": "value" + }, + "created_at": 0, + "name": "name", + "object": "organization.project.service_account", + "role": "member" +} +``` - The identifier, which can be referenced in API endpoints +## Retrieve project service account - - `long addedAt` +`ProjectServiceAccount admin().organization().projects().serviceAccounts().retrieve(ServiceAccountRetrieveParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` - The Unix timestamp (in seconds) of when the user was added. +**get** `/organization/projects/{project_id}/service_accounts/{service_account_id}` - - `JsonValue; object_ "organization.user"constant` +Retrieves a service account in the project. - The object type, which is always `organization.user` +### Parameters - - `ORGANIZATION_USER("organization.user")` +- `ServiceAccountRetrieveParams params` - - `Optional apiKeyLastUsedAt` + - `String projectId` - The Unix timestamp (in seconds) of the user's last API key usage. + - `Optional serviceAccountId` - - `Optional created` +### Returns - The Unix timestamp (in seconds) of when the user was created. +- `class ProjectServiceAccount:` - - `Optional developerPersona` + Represents an individual service account in a project. - The developer persona metadata for the user. + - `String id` - - `Optional email` + The identifier, which can be referenced in API endpoints - The email address of the user + - `long createdAt` - - `Optional isDefault` + The Unix timestamp (in seconds) of when the service account was created - Whether this is the organization's default user. + - `String name` - - `Optional isScaleTierAuthorizedPurchaser` + The name of the service account - Whether the user is an authorized purchaser for Scale Tier. + - `JsonValue; object_ "organization.project.service_account"constant` - - `Optional isScimManaged` + The object type, which is always `organization.project.service_account` - Whether the user is managed through SCIM. + - `ORGANIZATION_PROJECT_SERVICE_ACCOUNT("organization.project.service_account")` - - `Optional isServiceAccount` + - `Role role` - Whether the user is a service account. + `owner` or `member` - - `Optional name` + - `OWNER("owner")` - The name of the user + - `MEMBER("member")` - - `Optional projects` +### Example - Projects associated with the user, if included. +```java +package com.openai.example; - - `List data` +import com.openai.client.OpenAIClient; +import com.openai.client.okhttp.OpenAIOkHttpClient; +import com.openai.models.admin.organization.projects.serviceaccounts.ProjectServiceAccount; +import com.openai.models.admin.organization.projects.serviceaccounts.ServiceAccountRetrieveParams; - - `Optional id` +public final class Main { + private Main() {} - - `Optional name` + public static void main(String[] args) { + OpenAIClient client = OpenAIOkHttpClient.fromEnv(); - - `Optional role` + ServiceAccountRetrieveParams params = ServiceAccountRetrieveParams.builder() + .projectId("project_id") + .serviceAccountId("service_account_id") + .build(); + ProjectServiceAccount projectServiceAccount = client.admin().organization().projects().serviceAccounts().retrieve(params); + } +} +``` - - `JsonValue; object_ "list"constant` +#### Response - - `LIST("list")` +```json +{ + "id": "id", + "created_at": 0, + "name": "name", + "object": "organization.project.service_account", + "role": "owner" +} +``` - - `Optional role` +## Delete project service account - `owner` or `reader` +`ServiceAccountDeleteResponse admin().organization().projects().serviceAccounts().delete(ServiceAccountDeleteParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` - - `Optional technicalLevel` +**delete** `/organization/projects/{project_id}/service_accounts/{service_account_id}` - The technical level metadata for the user. +Deletes a service account from the project. - - `Optional user` +Returns confirmation of service account deletion, or an error if the project +is archived (archived projects have no service accounts). - Nested user details. +### Parameters - - `String id` +- `ServiceAccountDeleteParams params` - - `JsonValue; object_ "user"constant` + - `String projectId` - - `USER("user")` + - `Optional serviceAccountId` - - `Optional banned` +### Returns - - `Optional bannedAt` +- `class ServiceAccountDeleteResponse:` - - `Optional email` + - `String id` - - `Optional enabled` + - `boolean deleted` - - `Optional name` + - `JsonValue; object_ "organization.project.service_account.deleted"constant` - - `Optional picture` + - `ORGANIZATION_PROJECT_SERVICE_ACCOUNT_DELETED("organization.project.service_account.deleted")` ### Example @@ -10908,8 +12971,8 @@ package com.openai.example; import com.openai.client.OpenAIClient; import com.openai.client.okhttp.OpenAIOkHttpClient; -import com.openai.models.admin.organization.projects.users.roles.RoleCreateParams; -import com.openai.models.admin.organization.projects.users.roles.RoleCreateResponse; +import com.openai.models.admin.organization.projects.serviceaccounts.ServiceAccountDeleteParams; +import com.openai.models.admin.organization.projects.serviceaccounts.ServiceAccountDeleteResponse; public final class Main { private Main() {} @@ -10917,12 +12980,11 @@ public final class Main { public static void main(String[] args) { OpenAIClient client = OpenAIOkHttpClient.fromEnv(); - RoleCreateParams params = RoleCreateParams.builder() + ServiceAccountDeleteParams params = ServiceAccountDeleteParams.builder() .projectId("project_id") - .userId("user_id") - .roleId("role_id") + .serviceAccountId("service_account_id") .build(); - RoleCreateResponse role = client.admin().organization().projects().users().roles().create(params); + ServiceAccountDeleteResponse serviceAccount = client.admin().organization().projects().serviceAccounts().delete(params); } } ``` @@ -10931,153 +12993,131 @@ public final class Main { ```json { - "object": "user.role", - "role": { - "id": "id", - "description": "description", - "name": "name", - "object": "role", - "permissions": [ - "string" - ], - "predefined_role": true, - "resource_type": "resource_type" - }, - "user": { - "id": "id", - "added_at": 0, - "object": "organization.user", - "api_key_last_used_at": 0, - "created": 0, - "developer_persona": "developer_persona", - "email": "email", - "is_default": true, - "is_scale_tier_authorized_purchaser": true, - "is_scim_managed": true, - "is_service_account": true, - "name": "name", - "projects": { - "data": [ - { - "id": "id", - "name": "name", - "role": "role" - } - ], - "object": "list" - }, - "role": "role", - "technical_level": "technical_level", - "user": { "id": "id", - "object": "user", - "banned": true, - "banned_at": 0, - "email": "email", - "enabled": true, - "name": "name", - "picture": "picture" - } - } + "deleted": true, + "object": "organization.project.service_account.deleted" } ``` -## Unassign project role from user +## Domain Types -`RoleDeleteResponse admin().organization().projects().users().roles().delete(RoleDeleteParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` +### Project Service Account -**delete** `/projects/{project_id}/users/{user_id}/roles/{role_id}` +- `class ProjectServiceAccount:` -Unassigns a project role from a user within a project. + Represents an individual service account in a project. + + - `String id` + + The identifier, which can be referenced in API endpoints + + - `long createdAt` + + The Unix timestamp (in seconds) of when the service account was created + + - `String name` + + The name of the service account + + - `JsonValue; object_ "organization.project.service_account"constant` + + The object type, which is always `organization.project.service_account` + + - `ORGANIZATION_PROJECT_SERVICE_ACCOUNT("organization.project.service_account")` + + - `Role role` + + `owner` or `member` + + - `OWNER("owner")` + + - `MEMBER("member")` + +# API Keys + +## List project API keys + +`ApiKeyListPage admin().organization().projects().apiKeys().list(ApiKeyListParamsparams = ApiKeyListParams.none(), RequestOptionsrequestOptions = RequestOptions.none())` + +**get** `/organization/projects/{project_id}/api_keys` + +Returns a list of API keys in the project. ### Parameters -- `RoleDeleteParams params` +- `ApiKeyListParams params` - - `String projectId` + - `Optional projectId` - - `String userId` + - `Optional after` - - `Optional roleId` + 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. + + - `Optional limit` + + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. ### Returns -- `class RoleDeleteResponse:` +- `class ProjectApiKey:` - Confirmation payload returned after unassigning a role. + Represents an individual API key in a project. - - `boolean deleted` + - `String id` - Whether the assignment was removed. + The identifier, which can be referenced in API endpoints - - `String object_` + - `long createdAt` - Identifier for the deleted assignment, such as `group.role.deleted` or `user.role.deleted`. + The Unix timestamp (in seconds) of when the API key was created -### Example + - `Optional lastUsedAt` -```java -package com.openai.example; + The Unix timestamp (in seconds) of when the API key was last used. -import com.openai.client.OpenAIClient; -import com.openai.client.okhttp.OpenAIOkHttpClient; -import com.openai.models.admin.organization.projects.users.roles.RoleDeleteParams; -import com.openai.models.admin.organization.projects.users.roles.RoleDeleteResponse; + - `String name` -public final class Main { - private Main() {} + The name of the API key - public static void main(String[] args) { - OpenAIClient client = OpenAIOkHttpClient.fromEnv(); + - `JsonValue; object_ "organization.project.api_key"constant` - RoleDeleteParams params = RoleDeleteParams.builder() - .projectId("project_id") - .userId("user_id") - .roleId("role_id") - .build(); - RoleDeleteResponse role = client.admin().organization().projects().users().roles().delete(params); - } -} -``` + The object type, which is always `organization.project.api_key` -#### Response + - `ORGANIZATION_PROJECT_API_KEY("organization.project.api_key")` -```json -{ - "deleted": true, - "object": "object" -} -``` + - `Owner owner` -# Service Accounts + - `Optional serviceAccount` -## List project service accounts + The service account that owns a project API key. -`ServiceAccountListPage admin().organization().projects().serviceAccounts().list(ServiceAccountListParamsparams = ServiceAccountListParams.none(), RequestOptionsrequestOptions = RequestOptions.none())` + - `String id` -**get** `/organization/projects/{project_id}/service_accounts` + The identifier, which can be referenced in API endpoints -Returns a list of service accounts in the project. + - `long createdAt` -### Parameters + The Unix timestamp (in seconds) of when the service account was created. -- `ServiceAccountListParams params` + - `String name` - - `Optional projectId` + The name of the service account. - - `Optional after` + - `String role` - 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. + The service account's project role. - - `Optional limit` + - `Optional type` - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + `user` or `service_account` -### Returns + - `USER("user")` -- `class ProjectServiceAccount:` + - `SERVICE_ACCOUNT("service_account")` - Represents an individual service account in a project. + - `Optional user` + + The user that owns a project API key. - `String id` @@ -11085,25 +13125,23 @@ Returns a list of service accounts in the project. - `long createdAt` - The Unix timestamp (in seconds) of when the service account was created - - - `String name` + The Unix timestamp (in seconds) of when the user was created. - The name of the service account + - `String email` - - `JsonValue; object_ "organization.project.service_account"constant` + The email address of the user. - The object type, which is always `organization.project.service_account` + - `String name` - - `ORGANIZATION_PROJECT_SERVICE_ACCOUNT("organization.project.service_account")` + The name of the user. - - `Role role` + - `String role` - `owner` or `member` + The user's project role. - - `OWNER("owner")` + - `String redactedValue` - - `MEMBER("member")` + The redacted value of the API key ### Example @@ -11112,8 +13150,8 @@ package com.openai.example; import com.openai.client.OpenAIClient; import com.openai.client.okhttp.OpenAIOkHttpClient; -import com.openai.models.admin.organization.projects.serviceaccounts.ServiceAccountListPage; -import com.openai.models.admin.organization.projects.serviceaccounts.ServiceAccountListParams; +import com.openai.models.admin.organization.projects.apikeys.ApiKeyListPage; +import com.openai.models.admin.organization.projects.apikeys.ApiKeyListParams; public final class Main { private Main() {} @@ -11121,7 +13159,7 @@ public final class Main { public static void main(String[] args) { OpenAIClient client = OpenAIOkHttpClient.fromEnv(); - ServiceAccountListPage page = client.admin().organization().projects().serviceAccounts().list("project_id"); + ApiKeyListPage page = client.admin().organization().projects().apiKeys().list("project_id"); } } ``` @@ -11134,9 +13172,26 @@ public final class Main { { "id": "id", "created_at": 0, + "last_used_at": 0, "name": "name", - "object": "organization.project.service_account", - "role": "owner" + "object": "organization.project.api_key", + "owner": { + "service_account": { + "id": "id", + "created_at": 0, + "name": "name", + "role": "role" + }, + "type": "user", + "user": { + "id": "id", + "created_at": 0, + "email": "email", + "name": "name", + "role": "role" + } + }, + "redacted_value": "redacted_value" } ], "has_more": true, @@ -11146,125 +13201,83 @@ public final class Main { } ``` -## Create project service account +## Retrieve project API key -`ServiceAccountCreateResponse admin().organization().projects().serviceAccounts().create(ServiceAccountCreateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` +`ProjectApiKey admin().organization().projects().apiKeys().retrieve(ApiKeyRetrieveParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` -**post** `/organization/projects/{project_id}/service_accounts` +**get** `/organization/projects/{project_id}/api_keys/{api_key_id}` -Creates a new service account in the project. This also returns an unredacted API key for the service account. +Retrieves an API key in the project. ### Parameters -- `ServiceAccountCreateParams params` - - - `Optional projectId` +- `ApiKeyRetrieveParams params` - - `String name` + - `String projectId` - The name of the service account being created. + - `Optional apiKeyId` ### Returns -- `class ServiceAccountCreateResponse:` - - - `String id` +- `class ProjectApiKey:` - - `Optional apiKey` + Represents an individual API key in a project. - `String id` - - `long createdAt` - - - `String name` - - - `JsonValue; object_ "organization.project.service_account.api_key"constant` - - The object type, which is always `organization.project.service_account.api_key` - - - `ORGANIZATION_PROJECT_SERVICE_ACCOUNT_API_KEY("organization.project.service_account.api_key")` - - - `String value` + The identifier, which can be referenced in API endpoints - `long createdAt` - - `String name` + The Unix timestamp (in seconds) of when the API key was created - - `JsonValue; object_ "organization.project.service_account"constant` + - `Optional lastUsedAt` - - `ORGANIZATION_PROJECT_SERVICE_ACCOUNT("organization.project.service_account")` + The Unix timestamp (in seconds) of when the API key was last used. - - `JsonValue; role "member"constant` + - `String name` - Service accounts can only have one role of type `member` + The name of the API key - - `MEMBER("member")` + - `JsonValue; object_ "organization.project.api_key"constant` -### Example + The object type, which is always `organization.project.api_key` -```java -package com.openai.example; + - `ORGANIZATION_PROJECT_API_KEY("organization.project.api_key")` -import com.openai.client.OpenAIClient; -import com.openai.client.okhttp.OpenAIOkHttpClient; -import com.openai.models.admin.organization.projects.serviceaccounts.ServiceAccountCreateParams; -import com.openai.models.admin.organization.projects.serviceaccounts.ServiceAccountCreateResponse; + - `Owner owner` -public final class Main { - private Main() {} + - `Optional serviceAccount` - public static void main(String[] args) { - OpenAIClient client = OpenAIOkHttpClient.fromEnv(); + The service account that owns a project API key. - ServiceAccountCreateParams params = ServiceAccountCreateParams.builder() - .projectId("project_id") - .name("name") - .build(); - ServiceAccountCreateResponse serviceAccount = client.admin().organization().projects().serviceAccounts().create(params); - } -} -``` + - `String id` -#### Response + The identifier, which can be referenced in API endpoints -```json -{ - "id": "id", - "api_key": { - "id": "id", - "created_at": 0, - "name": "name", - "object": "organization.project.service_account.api_key", - "value": "value" - }, - "created_at": 0, - "name": "name", - "object": "organization.project.service_account", - "role": "member" -} -``` + - `long createdAt` -## Retrieve project service account + The Unix timestamp (in seconds) of when the service account was created. -`ProjectServiceAccount admin().organization().projects().serviceAccounts().retrieve(ServiceAccountRetrieveParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` + - `String name` -**get** `/organization/projects/{project_id}/service_accounts/{service_account_id}` + The name of the service account. -Retrieves a service account in the project. + - `String role` -### Parameters + The service account's project role. -- `ServiceAccountRetrieveParams params` + - `Optional type` - - `String projectId` + `user` or `service_account` - - `Optional serviceAccountId` + - `USER("user")` -### Returns + - `SERVICE_ACCOUNT("service_account")` -- `class ProjectServiceAccount:` + - `Optional user` - Represents an individual service account in a project. + The user that owns a project API key. - `String id` @@ -11272,25 +13285,23 @@ Retrieves a service account in the project. - `long createdAt` - The Unix timestamp (in seconds) of when the service account was created - - - `String name` + The Unix timestamp (in seconds) of when the user was created. - The name of the service account + - `String email` - - `JsonValue; object_ "organization.project.service_account"constant` + The email address of the user. - The object type, which is always `organization.project.service_account` + - `String name` - - `ORGANIZATION_PROJECT_SERVICE_ACCOUNT("organization.project.service_account")` + The name of the user. - - `Role role` + - `String role` - `owner` or `member` + The user's project role. - - `OWNER("owner")` + - `String redactedValue` - - `MEMBER("member")` + The redacted value of the API key ### Example @@ -11299,8 +13310,8 @@ package com.openai.example; import com.openai.client.OpenAIClient; import com.openai.client.okhttp.OpenAIOkHttpClient; -import com.openai.models.admin.organization.projects.serviceaccounts.ProjectServiceAccount; -import com.openai.models.admin.organization.projects.serviceaccounts.ServiceAccountRetrieveParams; +import com.openai.models.admin.organization.projects.apikeys.ApiKeyRetrieveParams; +import com.openai.models.admin.organization.projects.apikeys.ProjectApiKey; public final class Main { private Main() {} @@ -11308,11 +13319,11 @@ public final class Main { public static void main(String[] args) { OpenAIClient client = OpenAIOkHttpClient.fromEnv(); - ServiceAccountRetrieveParams params = ServiceAccountRetrieveParams.builder() + ApiKeyRetrieveParams params = ApiKeyRetrieveParams.builder() .projectId("project_id") - .serviceAccountId("service_account_id") + .apiKeyId("api_key_id") .build(); - ProjectServiceAccount projectServiceAccount = client.admin().organization().projects().serviceAccounts().retrieve(params); + ProjectApiKey projectApiKey = client.admin().organization().projects().apiKeys().retrieve(params); } } ``` @@ -11323,42 +13334,59 @@ public final class Main { { "id": "id", "created_at": 0, + "last_used_at": 0, "name": "name", - "object": "organization.project.service_account", - "role": "owner" + "object": "organization.project.api_key", + "owner": { + "service_account": { + "id": "id", + "created_at": 0, + "name": "name", + "role": "role" + }, + "type": "user", + "user": { + "id": "id", + "created_at": 0, + "email": "email", + "name": "name", + "role": "role" + } + }, + "redacted_value": "redacted_value" } ``` -## Delete project service account +## Delete project API key -`ServiceAccountDeleteResponse admin().organization().projects().serviceAccounts().delete(ServiceAccountDeleteParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` +`ApiKeyDeleteResponse admin().organization().projects().apiKeys().delete(ApiKeyDeleteParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` -**delete** `/organization/projects/{project_id}/service_accounts/{service_account_id}` +**delete** `/organization/projects/{project_id}/api_keys/{api_key_id}` -Deletes a service account from the project. +Deletes an API key from the project. -Returns confirmation of service account deletion, or an error if the project -is archived (archived projects have no service accounts). +Returns confirmation of the key deletion, or an error if the key belonged to +a service account. ### Parameters -- `ServiceAccountDeleteParams params` +- `ApiKeyDeleteParams params` - `String projectId` - - `Optional serviceAccountId` + - `Optional apiKeyId` ### Returns -- `class ServiceAccountDeleteResponse:` +- `class ApiKeyDeleteResponse:` - `String id` - `boolean deleted` - - `JsonValue; object_ "organization.project.service_account.deleted"constant` + - `JsonValue; object_ "organization.project.api_key.deleted"constant` - - `ORGANIZATION_PROJECT_SERVICE_ACCOUNT_DELETED("organization.project.service_account.deleted")` + - `ORGANIZATION_PROJECT_API_KEY_DELETED("organization.project.api_key.deleted")` ### Example @@ -11367,8 +13395,8 @@ package com.openai.example; import com.openai.client.OpenAIClient; import com.openai.client.okhttp.OpenAIOkHttpClient; -import com.openai.models.admin.organization.projects.serviceaccounts.ServiceAccountDeleteParams; -import com.openai.models.admin.organization.projects.serviceaccounts.ServiceAccountDeleteResponse; +import com.openai.models.admin.organization.projects.apikeys.ApiKeyDeleteParams; +import com.openai.models.admin.organization.projects.apikeys.ApiKeyDeleteResponse; public final class Main { private Main() {} @@ -11376,11 +13404,11 @@ public final class Main { public static void main(String[] args) { OpenAIClient client = OpenAIOkHttpClient.fromEnv(); - ServiceAccountDeleteParams params = ServiceAccountDeleteParams.builder() + ApiKeyDeleteParams params = ApiKeyDeleteParams.builder() .projectId("project_id") - .serviceAccountId("service_account_id") + .apiKeyId("api_key_id") .build(); - ServiceAccountDeleteResponse serviceAccount = client.admin().organization().projects().serviceAccounts().delete(params); + ApiKeyDeleteResponse apiKey = client.admin().organization().projects().apiKeys().delete(params); } } ``` @@ -11391,17 +13419,17 @@ public final class Main { { "id": "id", "deleted": true, - "object": "organization.project.service_account.deleted" + "object": "organization.project.api_key.deleted" } ``` ## Domain Types -### Project Service Account +### Project API Key -- `class ProjectServiceAccount:` +- `class ProjectApiKey:` - Represents an individual service account in a project. + Represents an individual API key in a project. - `String id` @@ -11409,39 +13437,93 @@ public final class Main { - `long createdAt` - The Unix timestamp (in seconds) of when the service account was created + The Unix timestamp (in seconds) of when the API key was created + + - `Optional lastUsedAt` + + The Unix timestamp (in seconds) of when the API key was last used. - `String name` - The name of the service account + The name of the API key - - `JsonValue; object_ "organization.project.service_account"constant` + - `JsonValue; object_ "organization.project.api_key"constant` - The object type, which is always `organization.project.service_account` + The object type, which is always `organization.project.api_key` - - `ORGANIZATION_PROJECT_SERVICE_ACCOUNT("organization.project.service_account")` + - `ORGANIZATION_PROJECT_API_KEY("organization.project.api_key")` - - `Role role` + - `Owner owner` - `owner` or `member` + - `Optional serviceAccount` - - `OWNER("owner")` + The service account that owns a project API key. - - `MEMBER("member")` + - `String id` -# API Keys + The identifier, which can be referenced in API endpoints -## List project API keys + - `long createdAt` -`ApiKeyListPage admin().organization().projects().apiKeys().list(ApiKeyListParamsparams = ApiKeyListParams.none(), RequestOptionsrequestOptions = RequestOptions.none())` + The Unix timestamp (in seconds) of when the service account was created. -**get** `/organization/projects/{project_id}/api_keys` + - `String name` -Returns a list of API keys in the project. + The name of the service account. + + - `String role` + + The service account's project role. + + - `Optional type` + + `user` or `service_account` + + - `USER("user")` + + - `SERVICE_ACCOUNT("service_account")` + + - `Optional user` + + The user that owns a project API key. + + - `String id` + + The identifier, which can be referenced in API endpoints + + - `long createdAt` + + The Unix timestamp (in seconds) of when the user was created. + + - `String email` + + The email address of the user. + + - `String name` + + The name of the user. + + - `String role` + + The user's project role. + + - `String redactedValue` + + The redacted value of the API key + +# Rate Limits + +## List project rate limits + +`RateLimitListRateLimitsPage admin().organization().projects().rateLimits().listRateLimits(RateLimitListRateLimitsParamsparams = RateLimitListRateLimitsParams.none(), RequestOptionsrequestOptions = RequestOptions.none())` + +**get** `/organization/projects/{project_id}/rate_limits` + +Returns the rate limits per model for a project. ### Parameters -- `ApiKeyListParams params` +- `RateLimitListRateLimitsParams params` - `Optional projectId` @@ -11449,95 +13531,186 @@ Returns a list of API keys in the project. 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. + - `Optional before` + + 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. + - `Optional limit` - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + A limit on the number of objects to be returned. The default is 100. ### Returns -- `class ProjectApiKey:` +- `class ProjectRateLimit:` + + Represents a project rate limit config. + + - `String id` + + The identifier, which can be referenced in API endpoints. + + - `long maxRequestsPer1Minute` + + The maximum requests per minute. + + - `long maxTokensPer1Minute` + + The maximum tokens per minute. + + - `String model` + + The model this rate limit applies to. + + - `JsonValue; object_ "project.rate_limit"constant` + + The object type, which is always `project.rate_limit` + + - `PROJECT_RATE_LIMIT("project.rate_limit")` + + - `Optional batch1DayMaxInputTokens` + + The maximum batch input tokens per day. Only present for relevant models. + + - `Optional maxAudioMegabytesPer1Minute` + + The maximum audio megabytes per minute. Only present for relevant models. + + - `Optional maxImagesPer1Minute` + + The maximum images per minute. Only present for relevant models. + + - `Optional maxRequestsPer1Day` + + The maximum requests per day. Only present for relevant models. + +### Example + +```java +package com.openai.example; + +import com.openai.client.OpenAIClient; +import com.openai.client.okhttp.OpenAIOkHttpClient; +import com.openai.models.admin.organization.projects.ratelimits.RateLimitListRateLimitsPage; +import com.openai.models.admin.organization.projects.ratelimits.RateLimitListRateLimitsParams; + +public final class Main { + private Main() {} + + public static void main(String[] args) { + OpenAIClient client = OpenAIOkHttpClient.fromEnv(); + + RateLimitListRateLimitsPage page = client.admin().organization().projects().rateLimits().listRateLimits("project_id"); + } +} +``` + +#### Response + +```json +{ + "data": [ + { + "id": "id", + "max_requests_per_1_minute": 0, + "max_tokens_per_1_minute": 0, + "model": "model", + "object": "project.rate_limit", + "batch_1_day_max_input_tokens": 0, + "max_audio_megabytes_per_1_minute": 0, + "max_images_per_1_minute": 0, + "max_requests_per_1_day": 0 + } + ], + "has_more": true, + "object": "list", + "first_id": "first_id", + "last_id": "last_id" +} +``` + +## Modify project rate limit - Represents an individual API key in a project. +`ProjectRateLimit admin().organization().projects().rateLimits().updateRateLimit(RateLimitUpdateRateLimitParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` - - `String id` +**post** `/organization/projects/{project_id}/rate_limits/{rate_limit_id}` - The identifier, which can be referenced in API endpoints +Updates a project rate limit. - - `long createdAt` +### Parameters - The Unix timestamp (in seconds) of when the API key was created +- `RateLimitUpdateRateLimitParams params` - - `Optional lastUsedAt` + - `String projectId` - The Unix timestamp (in seconds) of when the API key was last used. + - `Optional rateLimitId` - - `String name` + - `Optional batch1DayMaxInputTokens` - The name of the API key + The maximum batch input tokens per day. Only relevant for certain models. - - `JsonValue; object_ "organization.project.api_key"constant` + - `Optional maxAudioMegabytesPer1Minute` - The object type, which is always `organization.project.api_key` + The maximum audio megabytes per minute. Only relevant for certain models. - - `ORGANIZATION_PROJECT_API_KEY("organization.project.api_key")` + - `Optional maxImagesPer1Minute` - - `Owner owner` + The maximum images per minute. Only relevant for certain models. - - `Optional serviceAccount` + - `Optional maxRequestsPer1Day` - The service account that owns a project API key. + The maximum requests per day. Only relevant for certain models. - - `String id` + - `Optional maxRequestsPer1Minute` - The identifier, which can be referenced in API endpoints + The maximum requests per minute. - - `long createdAt` + - `Optional maxTokensPer1Minute` - The Unix timestamp (in seconds) of when the service account was created. + The maximum tokens per minute. - - `String name` +### Returns - The name of the service account. +- `class ProjectRateLimit:` - - `String role` + Represents a project rate limit config. - The service account's project role. + - `String id` - - `Optional type` + The identifier, which can be referenced in API endpoints. - `user` or `service_account` + - `long maxRequestsPer1Minute` - - `USER("user")` + The maximum requests per minute. - - `SERVICE_ACCOUNT("service_account")` + - `long maxTokensPer1Minute` - - `Optional user` + The maximum tokens per minute. - The user that owns a project API key. + - `String model` - - `String id` + The model this rate limit applies to. - The identifier, which can be referenced in API endpoints + - `JsonValue; object_ "project.rate_limit"constant` - - `long createdAt` + The object type, which is always `project.rate_limit` - The Unix timestamp (in seconds) of when the user was created. + - `PROJECT_RATE_LIMIT("project.rate_limit")` - - `String email` + - `Optional batch1DayMaxInputTokens` - The email address of the user. + The maximum batch input tokens per day. Only present for relevant models. - - `String name` + - `Optional maxAudioMegabytesPer1Minute` - The name of the user. + The maximum audio megabytes per minute. Only present for relevant models. - - `String role` + - `Optional maxImagesPer1Minute` - The user's project role. + The maximum images per minute. Only present for relevant models. - - `String redactedValue` + - `Optional maxRequestsPer1Day` - The redacted value of the API key + The maximum requests per day. Only present for relevant models. ### Example @@ -11546,8 +13719,8 @@ package com.openai.example; import com.openai.client.OpenAIClient; import com.openai.client.okhttp.OpenAIOkHttpClient; -import com.openai.models.admin.organization.projects.apikeys.ApiKeyListPage; -import com.openai.models.admin.organization.projects.apikeys.ApiKeyListParams; +import com.openai.models.admin.organization.projects.ratelimits.ProjectRateLimit; +import com.openai.models.admin.organization.projects.ratelimits.RateLimitUpdateRateLimitParams; public final class Main { private Main() {} @@ -11555,7 +13728,11 @@ public final class Main { public static void main(String[] args) { OpenAIClient client = OpenAIOkHttpClient.fromEnv(); - ApiKeyListPage page = client.admin().organization().projects().apiKeys().list("project_id"); + RateLimitUpdateRateLimitParams params = RateLimitUpdateRateLimitParams.builder() + .projectId("project_id") + .rateLimitId("rate_limit_id") + .build(); + ProjectRateLimit projectRateLimit = client.admin().organization().projects().rateLimits().updateRateLimit(params); } } ``` @@ -11564,140 +13741,103 @@ public final class Main { ```json { - "data": [ - { - "id": "id", - "created_at": 0, - "last_used_at": 0, - "name": "name", - "object": "organization.project.api_key", - "owner": { - "service_account": { - "id": "id", - "created_at": 0, - "name": "name", - "role": "role" - }, - "type": "user", - "user": { "id": "id", - "created_at": 0, - "email": "email", - "name": "name", - "role": "role" - } - }, - "redacted_value": "redacted_value" - } - ], - "has_more": true, - "object": "list", - "first_id": "first_id", - "last_id": "last_id" + "max_requests_per_1_minute": 0, + "max_tokens_per_1_minute": 0, + "model": "model", + "object": "project.rate_limit", + "batch_1_day_max_input_tokens": 0, + "max_audio_megabytes_per_1_minute": 0, + "max_images_per_1_minute": 0, + "max_requests_per_1_day": 0 } ``` -## Retrieve project API key - -`ProjectApiKey admin().organization().projects().apiKeys().retrieve(ApiKeyRetrieveParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` - -**get** `/organization/projects/{project_id}/api_keys/{api_key_id}` - -Retrieves an API key in the project. - -### Parameters - -- `ApiKeyRetrieveParams params` - - - `String projectId` - - - `Optional apiKeyId` +## Domain Types -### Returns +### Project Rate Limit -- `class ProjectApiKey:` +- `class ProjectRateLimit:` - Represents an individual API key in a project. + Represents a project rate limit config. - `String id` - The identifier, which can be referenced in API endpoints - - - `long createdAt` + The identifier, which can be referenced in API endpoints. - The Unix timestamp (in seconds) of when the API key was created + - `long maxRequestsPer1Minute` - - `Optional lastUsedAt` + The maximum requests per minute. - The Unix timestamp (in seconds) of when the API key was last used. + - `long maxTokensPer1Minute` - - `String name` + The maximum tokens per minute. - The name of the API key + - `String model` - - `JsonValue; object_ "organization.project.api_key"constant` + The model this rate limit applies to. - The object type, which is always `organization.project.api_key` + - `JsonValue; object_ "project.rate_limit"constant` - - `ORGANIZATION_PROJECT_API_KEY("organization.project.api_key")` + The object type, which is always `project.rate_limit` - - `Owner owner` + - `PROJECT_RATE_LIMIT("project.rate_limit")` - - `Optional serviceAccount` + - `Optional batch1DayMaxInputTokens` - The service account that owns a project API key. + The maximum batch input tokens per day. Only present for relevant models. - - `String id` + - `Optional maxAudioMegabytesPer1Minute` - The identifier, which can be referenced in API endpoints + The maximum audio megabytes per minute. Only present for relevant models. - - `long createdAt` + - `Optional maxImagesPer1Minute` - The Unix timestamp (in seconds) of when the service account was created. + The maximum images per minute. Only present for relevant models. - - `String name` + - `Optional maxRequestsPer1Day` - The name of the service account. + The maximum requests per day. Only present for relevant models. - - `String role` +# Model Permissions - The service account's project role. +## Retrieve project model permissions - - `Optional type` +`ProjectModelPermissions admin().organization().projects().modelPermissions().retrieve(ModelPermissionRetrieveParamsparams = ModelPermissionRetrieveParams.none(), RequestOptionsrequestOptions = RequestOptions.none())` - `user` or `service_account` +**get** `/organization/projects/{project_id}/model_permissions` - - `USER("user")` +Returns model permissions for a project. - - `SERVICE_ACCOUNT("service_account")` +### Parameters - - `Optional user` +- `ModelPermissionRetrieveParams params` - The user that owns a project API key. + - `Optional projectId` - - `String id` +### Returns - The identifier, which can be referenced in API endpoints +- `class ProjectModelPermissions:` - - `long createdAt` + Represents the model allowlist or denylist policy for a project. - The Unix timestamp (in seconds) of when the user was created. + - `Mode mode` - - `String email` + Whether the project uses an allowlist or a denylist. - The email address of the user. + - `ALLOW_LIST("allow_list")` - - `String name` + - `DENY_LIST("deny_list")` - The name of the user. + - `List modelIds` - - `String role` + The model IDs included in the model permissions policy. - The user's project role. + - `JsonValue; object_ "project.model_permissions"constant` - - `String redactedValue` + The object type, which is always `project.model_permissions`. - The redacted value of the API key + - `PROJECT_MODEL_PERMISSIONS("project.model_permissions")` ### Example @@ -11706,8 +13846,8 @@ package com.openai.example; import com.openai.client.OpenAIClient; import com.openai.client.okhttp.OpenAIOkHttpClient; -import com.openai.models.admin.organization.projects.apikeys.ApiKeyRetrieveParams; -import com.openai.models.admin.organization.projects.apikeys.ProjectApiKey; +import com.openai.models.admin.organization.projects.modelpermissions.ModelPermissionRetrieveParams; +import com.openai.models.admin.organization.projects.modelpermissions.ProjectModelPermissions; public final class Main { private Main() {} @@ -11715,11 +13855,7 @@ public final class Main { public static void main(String[] args) { OpenAIClient client = OpenAIOkHttpClient.fromEnv(); - ApiKeyRetrieveParams params = ApiKeyRetrieveParams.builder() - .projectId("project_id") - .apiKeyId("api_key_id") - .build(); - ProjectApiKey projectApiKey = client.admin().organization().projects().apiKeys().retrieve(params); + ProjectModelPermissions projectModelPermissions = client.admin().organization().projects().modelPermissions().retrieve("project_id"); } } ``` @@ -11728,61 +13864,63 @@ public final class Main { ```json { - "id": "id", - "created_at": 0, - "last_used_at": 0, - "name": "name", - "object": "organization.project.api_key", - "owner": { - "service_account": { - "id": "id", - "created_at": 0, - "name": "name", - "role": "role" - }, - "type": "user", - "user": { - "id": "id", - "created_at": 0, - "email": "email", - "name": "name", - "role": "role" - } - }, - "redacted_value": "redacted_value" + "mode": "allow_list", + "model_ids": [ + "string" + ], + "object": "project.model_permissions" } ``` -## Delete project API key +## Modify project model permissions + +`ProjectModelPermissions admin().organization().projects().modelPermissions().update(ModelPermissionUpdateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` + +**post** `/organization/projects/{project_id}/model_permissions` + +Updates model permissions for a project. + +### Parameters -`ApiKeyDeleteResponse admin().organization().projects().apiKeys().delete(ApiKeyDeleteParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` +- `ModelPermissionUpdateParams params` -**delete** `/organization/projects/{project_id}/api_keys/{api_key_id}` + - `Optional projectId` -Deletes an API key from the project. + - `Mode mode` -Returns confirmation of the key deletion, or an error if the key belonged to -a service account. + The model permissions mode to apply. -### Parameters + - `ALLOW_LIST("allow_list")` -- `ApiKeyDeleteParams params` + - `DENY_LIST("deny_list")` - - `String projectId` + - `List modelIds` - - `Optional apiKeyId` + The model IDs included in this permissions policy. ### Returns -- `class ApiKeyDeleteResponse:` +- `class ProjectModelPermissions:` - - `String id` + Represents the model allowlist or denylist policy for a project. - - `boolean deleted` + - `Mode mode` - - `JsonValue; object_ "organization.project.api_key.deleted"constant` + Whether the project uses an allowlist or a denylist. - - `ORGANIZATION_PROJECT_API_KEY_DELETED("organization.project.api_key.deleted")` + - `ALLOW_LIST("allow_list")` + + - `DENY_LIST("deny_list")` + + - `List modelIds` + + The model IDs included in the model permissions policy. + + - `JsonValue; object_ "project.model_permissions"constant` + + The object type, which is always `project.model_permissions`. + + - `PROJECT_MODEL_PERMISSIONS("project.model_permissions")` ### Example @@ -11791,8 +13929,8 @@ package com.openai.example; import com.openai.client.OpenAIClient; import com.openai.client.okhttp.OpenAIOkHttpClient; -import com.openai.models.admin.organization.projects.apikeys.ApiKeyDeleteParams; -import com.openai.models.admin.organization.projects.apikeys.ApiKeyDeleteResponse; +import com.openai.models.admin.organization.projects.modelpermissions.ModelPermissionUpdateParams; +import com.openai.models.admin.organization.projects.modelpermissions.ProjectModelPermissions; public final class Main { private Main() {} @@ -11800,11 +13938,12 @@ public final class Main { public static void main(String[] args) { OpenAIClient client = OpenAIOkHttpClient.fromEnv(); - ApiKeyDeleteParams params = ApiKeyDeleteParams.builder() + ModelPermissionUpdateParams params = ModelPermissionUpdateParams.builder() .projectId("project_id") - .apiKeyId("api_key_id") + .mode(ModelPermissionUpdateParams.Mode.ALLOW_LIST) + .addModelId("string") .build(); - ApiKeyDeleteResponse apiKey = client.admin().organization().projects().apiKeys().delete(params); + ProjectModelPermissions projectModelPermissions = client.admin().organization().projects().modelPermissions().update(params); } } ``` @@ -11813,171 +13952,177 @@ public final class Main { ```json { - "id": "id", - "deleted": true, - "object": "organization.project.api_key.deleted" + "mode": "allow_list", + "model_ids": [ + "string" + ], + "object": "project.model_permissions" } ``` -## Domain Types +## Delete project model permissions -### Project API Key +`ProjectModelPermissionsDeleted admin().organization().projects().modelPermissions().delete(ModelPermissionDeleteParamsparams = ModelPermissionDeleteParams.none(), RequestOptionsrequestOptions = RequestOptions.none())` -- `class ProjectApiKey:` +**delete** `/organization/projects/{project_id}/model_permissions` - Represents an individual API key in a project. +Deletes model permissions for a project. - - `String id` +### Parameters - The identifier, which can be referenced in API endpoints +- `ModelPermissionDeleteParams params` - - `long createdAt` + - `Optional projectId` - The Unix timestamp (in seconds) of when the API key was created +### Returns - - `Optional lastUsedAt` +- `class ProjectModelPermissionsDeleted:` - The Unix timestamp (in seconds) of when the API key was last used. + Confirmation payload returned after deleting project model permissions. - - `String name` + - `boolean deleted` - The name of the API key + Whether the project model permissions were deleted. - - `JsonValue; object_ "organization.project.api_key"constant` + - `JsonValue; object_ "project.model_permissions.deleted"constant` - The object type, which is always `organization.project.api_key` + The object type, which is always `project.model_permissions.deleted`. - - `ORGANIZATION_PROJECT_API_KEY("organization.project.api_key")` + - `PROJECT_MODEL_PERMISSIONS_DELETED("project.model_permissions.deleted")` - - `Owner owner` +### Example - - `Optional serviceAccount` +```java +package com.openai.example; - The service account that owns a project API key. +import com.openai.client.OpenAIClient; +import com.openai.client.okhttp.OpenAIOkHttpClient; +import com.openai.models.admin.organization.projects.modelpermissions.ModelPermissionDeleteParams; +import com.openai.models.admin.organization.projects.modelpermissions.ProjectModelPermissionsDeleted; - - `String id` +public final class Main { + private Main() {} - The identifier, which can be referenced in API endpoints + public static void main(String[] args) { + OpenAIClient client = OpenAIOkHttpClient.fromEnv(); - - `long createdAt` + ProjectModelPermissionsDeleted projectModelPermissionsDeleted = client.admin().organization().projects().modelPermissions().delete("project_id"); + } +} +``` - The Unix timestamp (in seconds) of when the service account was created. +#### Response - - `String name` +```json +{ + "deleted": true, + "object": "project.model_permissions.deleted" +} +``` - The name of the service account. +## Domain Types - - `String role` +### Project Model Permissions - The service account's project role. +- `class ProjectModelPermissions:` - - `Optional type` + Represents the model allowlist or denylist policy for a project. - `user` or `service_account` + - `Mode mode` - - `USER("user")` + Whether the project uses an allowlist or a denylist. - - `SERVICE_ACCOUNT("service_account")` + - `ALLOW_LIST("allow_list")` - - `Optional user` + - `DENY_LIST("deny_list")` - The user that owns a project API key. + - `List modelIds` - - `String id` + The model IDs included in the model permissions policy. - The identifier, which can be referenced in API endpoints + - `JsonValue; object_ "project.model_permissions"constant` - - `long createdAt` + The object type, which is always `project.model_permissions`. - The Unix timestamp (in seconds) of when the user was created. + - `PROJECT_MODEL_PERMISSIONS("project.model_permissions")` - - `String email` +### Project Model Permissions Deleted - The email address of the user. +- `class ProjectModelPermissionsDeleted:` - - `String name` + Confirmation payload returned after deleting project model permissions. - The name of the user. + - `boolean deleted` - - `String role` + Whether the project model permissions were deleted. - The user's project role. + - `JsonValue; object_ "project.model_permissions.deleted"constant` - - `String redactedValue` + The object type, which is always `project.model_permissions.deleted`. - The redacted value of the API key + - `PROJECT_MODEL_PERMISSIONS_DELETED("project.model_permissions.deleted")` -# Rate Limits +# Hosted Tool Permissions -## List project rate limits +## Retrieve project hosted tool permissions -`RateLimitListRateLimitsPage admin().organization().projects().rateLimits().listRateLimits(RateLimitListRateLimitsParamsparams = RateLimitListRateLimitsParams.none(), RequestOptionsrequestOptions = RequestOptions.none())` +`ProjectHostedToolPermissions admin().organization().projects().hostedToolPermissions().retrieve(HostedToolPermissionRetrieveParamsparams = HostedToolPermissionRetrieveParams.none(), RequestOptionsrequestOptions = RequestOptions.none())` -**get** `/organization/projects/{project_id}/rate_limits` +**get** `/organization/projects/{project_id}/hosted_tool_permissions` -Returns the rate limits per model for a project. +Returns hosted tool permissions for a project. ### Parameters -- `RateLimitListRateLimitsParams params` +- `HostedToolPermissionRetrieveParams params` - `Optional projectId` - - `Optional after` - - 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. - - - `Optional before` - - 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. - - - `Optional limit` - - A limit on the number of objects to be returned. The default is 100. - ### Returns -- `class ProjectRateLimit:` +- `class ProjectHostedToolPermissions:` - Represents a project rate limit config. + Represents hosted tool permissions for a project. - - `String id` + - `CodeInterpreter codeInterpreter` - The identifier, which can be referenced in API endpoints. + Permission state for a single hosted tool on a project. - - `long maxRequestsPer1Minute` + - `boolean enabled` - The maximum requests per minute. + Whether the hosted tool is enabled for the project. - - `long maxTokensPer1Minute` + - `FileSearch fileSearch` - The maximum tokens per minute. + Permission state for a single hosted tool on a project. - - `String model` + - `boolean enabled` - The model this rate limit applies to. + Whether the hosted tool is enabled for the project. - - `JsonValue; object_ "project.rate_limit"constant` + - `ImageGeneration imageGeneration` - The object type, which is always `project.rate_limit` + Permission state for a single hosted tool on a project. - - `PROJECT_RATE_LIMIT("project.rate_limit")` + - `boolean enabled` - - `Optional batch1DayMaxInputTokens` + Whether the hosted tool is enabled for the project. - The maximum batch input tokens per day. Only present for relevant models. + - `Mcp mcp` - - `Optional maxAudioMegabytesPer1Minute` + Permission state for a single hosted tool on a project. - The maximum audio megabytes per minute. Only present for relevant models. + - `boolean enabled` - - `Optional maxImagesPer1Minute` + Whether the hosted tool is enabled for the project. - The maximum images per minute. Only present for relevant models. + - `WebSearch webSearch` - - `Optional maxRequestsPer1Day` + Permission state for a single hosted tool on a project. - The maximum requests per day. Only present for relevant models. + - `boolean enabled` + + Whether the hosted tool is enabled for the project. ### Example @@ -11986,8 +14131,8 @@ package com.openai.example; import com.openai.client.OpenAIClient; import com.openai.client.okhttp.OpenAIOkHttpClient; -import com.openai.models.admin.organization.projects.ratelimits.RateLimitListRateLimitsPage; -import com.openai.models.admin.organization.projects.ratelimits.RateLimitListRateLimitsParams; +import com.openai.models.admin.organization.projects.hostedtoolpermissions.HostedToolPermissionRetrieveParams; +import com.openai.models.admin.organization.projects.hostedtoolpermissions.ProjectHostedToolPermissions; public final class Main { private Main() {} @@ -11995,7 +14140,7 @@ public final class Main { public static void main(String[] args) { OpenAIClient client = OpenAIOkHttpClient.fromEnv(); - RateLimitListRateLimitsPage page = client.admin().organization().projects().rateLimits().listRateLimits("project_id"); + ProjectHostedToolPermissions projectHostedToolPermissions = client.admin().organization().projects().hostedToolPermissions().retrieve("project_id"); } } ``` @@ -12004,109 +14149,123 @@ public final class Main { ```json { - "data": [ - { - "id": "id", - "max_requests_per_1_minute": 0, - "max_tokens_per_1_minute": 0, - "model": "model", - "object": "project.rate_limit", - "batch_1_day_max_input_tokens": 0, - "max_audio_megabytes_per_1_minute": 0, - "max_images_per_1_minute": 0, - "max_requests_per_1_day": 0 + "code_interpreter": { + "enabled": true + }, + "file_search": { + "enabled": true + }, + "image_generation": { + "enabled": true + }, + "mcp": { + "enabled": true + }, + "web_search": { + "enabled": true } - ], - "has_more": true, - "object": "list", - "first_id": "first_id", - "last_id": "last_id" } ``` -## Modify project rate limit +## Modify project hosted tool permissions -`ProjectRateLimit admin().organization().projects().rateLimits().updateRateLimit(RateLimitUpdateRateLimitParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` +`ProjectHostedToolPermissions admin().organization().projects().hostedToolPermissions().update(HostedToolPermissionUpdateParamsparams = HostedToolPermissionUpdateParams.none(), RequestOptionsrequestOptions = RequestOptions.none())` -**post** `/organization/projects/{project_id}/rate_limits/{rate_limit_id}` +**post** `/organization/projects/{project_id}/hosted_tool_permissions` -Updates a project rate limit. +Updates hosted tool permissions for a project. ### Parameters -- `RateLimitUpdateRateLimitParams params` +- `HostedToolPermissionUpdateParams params` - - `String projectId` + - `Optional projectId` - - `Optional rateLimitId` + - `Optional codeInterpreter` - - `Optional batch1DayMaxInputTokens` + The code interpreter permission update. - The maximum batch input tokens per day. Only relevant for certain models. + - `boolean enabled` - - `Optional maxAudioMegabytesPer1Minute` + Whether to enable the hosted tool for the project. - The maximum audio megabytes per minute. Only relevant for certain models. + - `Optional fileSearch` - - `Optional maxImagesPer1Minute` + The file search permission update. - The maximum images per minute. Only relevant for certain models. + - `boolean enabled` - - `Optional maxRequestsPer1Day` + Whether to enable the hosted tool for the project. - The maximum requests per day. Only relevant for certain models. + - `Optional imageGeneration` - - `Optional maxRequestsPer1Minute` + The image generation permission update. - The maximum requests per minute. + - `boolean enabled` - - `Optional maxTokensPer1Minute` + Whether to enable the hosted tool for the project. - The maximum tokens per minute. + - `Optional mcp` + + The MCP permission update. + + - `boolean enabled` + + Whether to enable the hosted tool for the project. + + - `Optional webSearch` + + The web search permission update. + + - `boolean enabled` + + Whether to enable the hosted tool for the project. ### Returns -- `class ProjectRateLimit:` +- `class ProjectHostedToolPermissions:` - Represents a project rate limit config. + Represents hosted tool permissions for a project. - - `String id` + - `CodeInterpreter codeInterpreter` - The identifier, which can be referenced in API endpoints. + Permission state for a single hosted tool on a project. - - `long maxRequestsPer1Minute` + - `boolean enabled` - The maximum requests per minute. + Whether the hosted tool is enabled for the project. - - `long maxTokensPer1Minute` + - `FileSearch fileSearch` - The maximum tokens per minute. + Permission state for a single hosted tool on a project. - - `String model` + - `boolean enabled` - The model this rate limit applies to. + Whether the hosted tool is enabled for the project. - - `JsonValue; object_ "project.rate_limit"constant` + - `ImageGeneration imageGeneration` - The object type, which is always `project.rate_limit` + Permission state for a single hosted tool on a project. - - `PROJECT_RATE_LIMIT("project.rate_limit")` + - `boolean enabled` - - `Optional batch1DayMaxInputTokens` + Whether the hosted tool is enabled for the project. - The maximum batch input tokens per day. Only present for relevant models. + - `Mcp mcp` - - `Optional maxAudioMegabytesPer1Minute` + Permission state for a single hosted tool on a project. - The maximum audio megabytes per minute. Only present for relevant models. + - `boolean enabled` - - `Optional maxImagesPer1Minute` + Whether the hosted tool is enabled for the project. - The maximum images per minute. Only present for relevant models. + - `WebSearch webSearch` - - `Optional maxRequestsPer1Day` + Permission state for a single hosted tool on a project. - The maximum requests per day. Only present for relevant models. + - `boolean enabled` + + Whether the hosted tool is enabled for the project. ### Example @@ -12115,8 +14274,8 @@ package com.openai.example; import com.openai.client.OpenAIClient; import com.openai.client.okhttp.OpenAIOkHttpClient; -import com.openai.models.admin.organization.projects.ratelimits.ProjectRateLimit; -import com.openai.models.admin.organization.projects.ratelimits.RateLimitUpdateRateLimitParams; +import com.openai.models.admin.organization.projects.hostedtoolpermissions.HostedToolPermissionUpdateParams; +import com.openai.models.admin.organization.projects.hostedtoolpermissions.ProjectHostedToolPermissions; public final class Main { private Main() {} @@ -12124,11 +14283,7 @@ public final class Main { public static void main(String[] args) { OpenAIClient client = OpenAIOkHttpClient.fromEnv(); - RateLimitUpdateRateLimitParams params = RateLimitUpdateRateLimitParams.builder() - .projectId("project_id") - .rateLimitId("rate_limit_id") - .build(); - ProjectRateLimit projectRateLimit = client.admin().organization().projects().rateLimits().updateRateLimit(params); + ProjectHostedToolPermissions projectHostedToolPermissions = client.admin().organization().projects().hostedToolPermissions().update("project_id"); } } ``` @@ -12137,63 +14292,71 @@ public final class Main { ```json { - "id": "id", - "max_requests_per_1_minute": 0, - "max_tokens_per_1_minute": 0, - "model": "model", - "object": "project.rate_limit", - "batch_1_day_max_input_tokens": 0, - "max_audio_megabytes_per_1_minute": 0, - "max_images_per_1_minute": 0, - "max_requests_per_1_day": 0 + "code_interpreter": { + "enabled": true + }, + "file_search": { + "enabled": true + }, + "image_generation": { + "enabled": true + }, + "mcp": { + "enabled": true + }, + "web_search": { + "enabled": true + } } ``` ## Domain Types -### Project Rate Limit +### Project Hosted Tool Permissions -- `class ProjectRateLimit:` +- `class ProjectHostedToolPermissions:` - Represents a project rate limit config. + Represents hosted tool permissions for a project. - - `String id` + - `CodeInterpreter codeInterpreter` - The identifier, which can be referenced in API endpoints. + Permission state for a single hosted tool on a project. - - `long maxRequestsPer1Minute` + - `boolean enabled` - The maximum requests per minute. + Whether the hosted tool is enabled for the project. - - `long maxTokensPer1Minute` + - `FileSearch fileSearch` - The maximum tokens per minute. + Permission state for a single hosted tool on a project. - - `String model` + - `boolean enabled` - The model this rate limit applies to. + Whether the hosted tool is enabled for the project. - - `JsonValue; object_ "project.rate_limit"constant` + - `ImageGeneration imageGeneration` - The object type, which is always `project.rate_limit` + Permission state for a single hosted tool on a project. - - `PROJECT_RATE_LIMIT("project.rate_limit")` + - `boolean enabled` - - `Optional batch1DayMaxInputTokens` + Whether the hosted tool is enabled for the project. - The maximum batch input tokens per day. Only present for relevant models. + - `Mcp mcp` - - `Optional maxAudioMegabytesPer1Minute` + Permission state for a single hosted tool on a project. - The maximum audio megabytes per minute. Only present for relevant models. + - `boolean enabled` - - `Optional maxImagesPer1Minute` + Whether the hosted tool is enabled for the project. - The maximum images per minute. Only present for relevant models. + - `WebSearch webSearch` - - `Optional maxRequestsPer1Day` + Permission state for a single hosted tool on a project. - The maximum requests per day. Only present for relevant models. + - `boolean enabled` + + Whether the hosted tool is enabled for the project. # Groups