> ## Documentation Index
> Fetch the complete documentation index at: https://docs.openhands.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Refresh Managed Llm Api Key

> Refresh the managed OpenHands LiteLLM key for the current user/org.

Delegates the full managed-key lifecycle (effective-config classification,
alias cleanup, key generation with OpenHands metadata, and persistence) to
``SaasSettingsStore.rotate_managed_llm_key`` so the route does not
duplicate the storage-layer machinery. Only managed LiteLLM/OpenHands-
provider effective configs are rotated; BYOK/custom and non-managed configs
are rejected before any key is generated. The previous key token is deleted
best-effort only after the replacement is persisted.



## OpenAPI

````yaml /openapi/openhands-cloud.json post /api/keys/llm/managed/refresh
openapi: 3.1.0
info:
  title: OpenHands
  description: 'OpenHands: Code Less, Make More'
  version: 0.0.1
servers: []
security: []
paths:
  /api/keys/llm/managed/refresh:
    post:
      tags:
        - Keys
      summary: Refresh Managed Llm Api Key
      description: >-
        Refresh the managed OpenHands LiteLLM key for the current user/org.


        Delegates the full managed-key lifecycle (effective-config
        classification,

        alias cleanup, key generation with OpenHands metadata, and persistence)
        to

        ``SaasSettingsStore.rotate_managed_llm_key`` so the route does not

        duplicate the storage-layer machinery. Only managed LiteLLM/OpenHands-

        provider effective configs are rotated; BYOK/custom and non-managed
        configs

        are rejected before any key is generated. The previous key token is
        deleted

        best-effort only after the replacement is persisted.
      operationId: refresh_managed_llm_api_key_api_keys_llm_managed_refresh_post
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagedLlmApiKeyRefreshResponse'
      security:
        - APIKeyHeader: []
components:
  schemas:
    ManagedLlmApiKeyRefreshResponse:
      properties:
        refreshed:
          type: boolean
          title: Refreshed
      type: object
      required:
        - refreshed
      title: ManagedLlmApiKeyRefreshResponse
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-Access-Token

````