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

# Update API Key Labels

> Update labels for an API key. Setting an empty object will remove all labels.

Update labels for an API key. Labels are key-value pairs that can be used for organization and filtering. Setting an empty object will remove all labels.

<Tip>
  Labels are useful for organizing and filtering API keys. Common use cases include tagging by environment (production, staging), team, or project.
</Tip>


## OpenAPI

````yaml POST /v1/manage/apikey/{id}/label
openapi: 3.0.3
info:
  title: Requesty API
  description: Requesty API for AI model routing and key management
  version: 1.0.0
servers:
  - url: https://api-v2.requesty.ai
    description: Management API endpoint
  - url: https://router.requesty.ai
    description: Inference router endpoint
security:
  - BearerAuth: []
paths:
  /v1/manage/apikey/{id}/label:
    servers:
      - url: https://api-v2.requesty.ai
        description: Management API endpoint
    post:
      summary: Update API key labels
      description: >-
        Update labels for an API key. Setting an empty object will remove all
        labels.
      operationId: updateApiKeyLabel
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateLabelRequest'
      responses:
        '204':
          description: Labels updated successfully
        '400':
          description: Bad request - malformed payload or invalid parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized - missing or empty Authorization header.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '402':
          description: Payment required - organization balance exhausted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden - invalid token or model not in access list.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found - provider/model not supported.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded. Retry after the Retry-After header value.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '502':
          description: Bad gateway - upstream provider returned an invalid response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    UpdateLabelRequest:
      type: object
      properties:
        labels:
          type: object
          additionalProperties:
            type: string
          description: Key-value pairs of labels. Empty object removes all labels.
      required:
        - labels
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - origin
            - message
          properties:
            origin:
              type: string
              enum:
                - router
                - provider
              description: >-
                Whether the error originated from Requesty's router or an
                upstream provider.
            message:
              type: string
              description: Human-readable error description.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: API key for authentication

````