io.enterpriseai.resources.LlmManagementClient
Source: sdks/java/enterprise-ai-java/src/main/java/io/enterpriseai/resources/LlmManagementClient.java. Back to the Java SDK reference index.
This page is generated by tools/docs/gen_sdk_reference.py from the SDK sources and the OpenAPI text folders. Do not edit it by hand: change the source and regenerate.
Class LlmManagementClient
LLM projects, their quota and the LiteLLM keys of each project (/v1/llm/projects, roles tenant_admin or platform_admin). #createKey returns the clear LiteLLM key once in key: the platform never stores it.
Constructor LlmManagementClient
LlmManagementClient(Transport transport)
Creates the client on the shared transport; EnterpriseAIClient builds it and exposes it through the accessor of the same name.
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
transport | Transport | yes | Transport shared by the sub-clients of one client. |
LlmManagementClient.blockKey
JsonNode blockKey(String projectId, String keyId)
Block a project key. Blocks the key in LiteLLM: calls with it are refused until it is unblocked. The status becomes blocked. A revoked key answers 409 llm_key_revoked. Audited (llm_key.block). Requires tenant_admin or platform_admin.
Route: /v1/llm/projects/{project_id}/keys/{key_id}/block (POST).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
projectId | String | yes | Identifier (UUID) of the LLM project. | |
keyId | String | yes | Identifier (UUID) of the key in the platform. |
Returns: JsonNode. Decoded JSON answer of the operation "Block a project key".
Raises: the typed errors of the transport (Errors).
LlmManagementClient.createKey
JsonNode createKey(String projectId, Object body)
Generate a project key. Generates a LiteLLM key for the project and answers 201 with the key record plus key (the clear key) and key_shown_once: true, with Cache-Control: no-store. The clear key is in this answer only: it is never stored nor audited. Requires tenant_admin or platform_admin.
Route: /v1/llm/projects/{project_id}/keys (POST).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
projectId | String | yes | Identifier (UUID) of the LLM project. | |
body | Object | yes | Name, alias, models and limits of the new key. Unknown fields are refused. |
Returns: JsonNode. Decoded JSON answer of the operation "Generate a project key".
Raises: the typed errors of the transport (Errors).
LlmManagementClient.createProject
JsonNode createProject(Object body)
Create an LLM project. Creates an LLM project in the caller's tenant and answers 201 with the project. Requires tenant_admin or platform_admin.
Route: /v1/llm/projects (POST).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
body | Object | yes | The new LLM project. Unknown fields are refused. |
Returns: JsonNode. Decoded JSON answer of the operation "Create an LLM project".
Raises: the typed errors of the transport (Errors).
LlmManagementClient.deleteProject
JsonNode deleteProject(String projectId)
Delete an LLM project. Deletes the project, its LiteLLM team and its FinOps quotas, and answers 204. Refused with 409 llm_project_has_keys while the project has keys that are not revoked. A LiteLLM error while deleting the team stops the deletion. Audited (llm_project.delete). Requires tenant_admin or platform_admin; unknown id: 404 llm_project_not_found.
Route: /v1/llm/projects/{project_id} (DELETE).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
projectId | String | yes | Identifier (UUID) of the LLM project. |
Returns: JsonNode. Decoded JSON answer of the operation "Delete an LLM project".
Raises: the typed errors of the transport (Errors).
LlmManagementClient.getProject
JsonNode getProject(String projectId)
Get an LLM project. One LLM project with its effective models, quota, LiteLLM team, sync status and error, FinOps quotas and key count. Requires tenant_admin or platform_admin; unknown id: 404 llm_project_not_found.
Route: /v1/llm/projects/{project_id} (GET).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
projectId | String | yes | Identifier (UUID) of the LLM project. |
Returns: JsonNode. Decoded JSON answer of the operation "Get an LLM project".
Raises: the typed errors of the transport (Errors).
LlmManagementClient.listKeys
JsonNode listKeys(String projectId)
List the keys of a project. Keys of a project, newest first, with their alias, display prefix, models, limits, status, spend and expiry; never the clear key. With refresh, the spend of up to 50 keys that are not revoked is read again from LiteLLM and stored; usage_source is then litellm, or stored with litellm_error when LiteLLM did not answer. Requires tenant_admin or platform_admin.
Route: /v1/llm/projects/{project_id}/keys (GET).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
projectId | String | yes | Identifier (UUID) of the LLM project. |
Returns: JsonNode. Decoded JSON answer of the operation "List the keys of a project".
Raises: the typed errors of the transport (Errors).
LlmManagementClient.listProjects
JsonNode listProjects(Map<String, ?> query)
List the LLM projects. LLM projects of the tenant by name, each with its effective models (explicit ids plus the registry models of its categories), quota, LiteLLM team and sync state, FinOps quotas and number of keys that are not revoked. One page only (next_cursor is always null). Requires tenant_admin or platform_admin.
Route: /v1/llm/projects (GET).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
query | Map<String, ?> | yes | Query string parameters of the route. |
Returns: JsonNode. Decoded JSON answer of the operation "List the LLM projects".
Raises: the typed errors of the transport (Errors).
LlmManagementClient.revokeKey
JsonNode revokeKey(String projectId, String keyId)
Revoke a project key. Revokes a key: it is deleted in LiteLLM and kept here with status revoked and its revocation time, for the history. A revoked key cannot be changed again (409 llm_key_revoked). Audited (llm_key.revoke). Requires tenant_admin or platform_admin; unknown key: 404 llm_key_not_found.
Route: /v1/llm/projects/{project_id}/keys/{key_id} (DELETE).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
projectId | String | yes | Identifier (UUID) of the LLM project. | |
keyId | String | yes | Identifier (UUID) of the key in the platform (not the LiteLLM token). |
Returns: JsonNode. Decoded JSON answer of the operation "Revoke a project key".
Raises: the typed errors of the transport (Errors).
LlmManagementClient.setQuota
JsonNode setQuota(String projectId, Object body)
Set the quota of a project. Replaces the whole quota of the project (omitted fields take their default), rebuilds its FinOps quotas and pushes it to LiteLLM. With hard_stop false, LiteLLM gets no maximum budget (alert only) and the FinOps quotas are soft. An invalid quota answers 422 invalid_quota. Audited (llm_project.quota). Requires tenant_admin or platform_admin.
Route: /v1/llm/projects/{project_id}/quota (PUT).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
projectId | String | yes | Identifier (UUID) of the LLM project. | |
body | Object | yes | The complete new quota of the project. |
Returns: JsonNode. Decoded JSON answer of the operation "Set the quota of a project".
Raises: the typed errors of the transport (Errors).
LlmManagementClient.status
JsonNode status()
Check the LiteLLM admin connection. LiteLLM admin configuration without any secret value: whether it is configured, the admin address, whether the master key is present and where it is read from (setting, environment reference or OpenBao reference), the settings still missing, and a liveness probe (reachable) when it is configured. error_code is litellm_not_configured, litellm_unreachable or null. Requires tenant_admin or platform_admin.
Route: /v1/llm/management/status (GET).
This element takes no parameter.
Returns: JsonNode. Decoded JSON answer of the operation "Check the LiteLLM admin connection".
Raises: the typed errors of the transport (Errors).
LlmManagementClient.syncProject
JsonNode syncProject(String projectId)
Push a project to LiteLLM again. Pushes the project to LiteLLM again (team created or updated) and answers the project with its new sync_status. Unlike the other changes, a failure is returned: 503 litellm_not_configured, 502 litellm_unreachable or 502 litellm_rejected. Audited (llm_project.sync). Requires tenant_admin or platform_admin.
Route: /v1/llm/projects/{project_id}/sync (POST).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
projectId | String | yes | Identifier (UUID) of the LLM project. |
Returns: JsonNode. Decoded JSON answer of the operation "Push a project to LiteLLM again".
Raises: the typed errors of the transport (Errors).
LlmManagementClient.unblockKey
JsonNode unblockKey(String projectId, String keyId)
Unblock a project key. Unblocks the key in LiteLLM; the status becomes active again. A revoked key answers 409 llm_key_revoked. Audited (llm_key.unblock). Requires tenant_admin or platform_admin.
Route: /v1/llm/projects/{project_id}/keys/{key_id}/unblock (POST).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
projectId | String | yes | Identifier (UUID) of the LLM project. | |
keyId | String | yes | Identifier (UUID) of the key in the platform. |
Returns: JsonNode. Decoded JSON answer of the operation "Unblock a project key".
Raises: the typed errors of the transport (Errors).
LlmManagementClient.updateKey
JsonNode updateKey(String projectId, String keyId, Object body)
Update a project key. Changes the name, models and limits of a key, first in LiteLLM then here. The merged limits are checked against the project: a wider limit answers 422 llm_key_limit_exceeds_project, a model the project does not allow 422 llm_key_model_not_allowed. A revoked key answers 409 llm_key_revoked. Audited (llm_key.update). Requires tenant_admin or platform_admin.
Route: /v1/llm/projects/{project_id}/keys/{key_id} (PATCH).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
projectId | String | yes | Identifier (UUID) of the LLM project. | |
keyId | String | yes | Identifier (UUID) of the key in the platform. | |
body | Object | yes | Fields to change; omitted fields keep their value, a limit sent as null removes it. |
Returns: JsonNode. Decoded JSON answer of the operation "Update a project key".
Raises: the typed errors of the transport (Errors).
LlmManagementClient.updateProject
JsonNode updateProject(String projectId, Object body)
Update an LLM project. Changes the given fields of the project, rebuilds its FinOps quotas (removed when the project is no longer active or no longer linked) and pushes it to LiteLLM again; a LiteLLM failure does not fail the request but is shown in sync_status and sync_error. Another project with the new name answers 409 llm_project_exists; an unknown tenant project 404 tenant_project_not_found. Audited (llm_project.update). Requires tenant_admin or platform_admin.
Route: /v1/llm/projects/{project_id} (PATCH).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
projectId | String | yes | Identifier (UUID) of the LLM project. | |
body | Object | yes | Fields to change; omitted fields keep their value. The quota is changed with PUT .../quota. |
Returns: JsonNode. Decoded JSON answer of the operation "Update an LLM project".
Raises: the typed errors of the transport (Errors).