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

# List embedding models compatible with the KB dimension policy

> List embedding models the user can pick at KB-creation time.

Walks the caller's credentials, looks up each provider's
embedding model class, gathers its model cards, and projects
each card through the manager's :class:`DimensionPolicy`.
Incompatible cards are dropped; matryoshka cards under a
``FIXED`` / ``LOCKED_BY_EXISTING`` policy are narrowed to the
locked dimension.  Providers that end up with zero compatible
models are omitted from the response entirely.

Args:
    user_id (`str`):
        Injected authenticated user ID.
    storage (`StorageBase`):
        Injected storage backend used to enumerate credentials.
    manager (`KnowledgeBaseManagerBase`):
        Injected knowledge base manager.

Returns:
    `ListKbEmbeddingModelsResponse`:
        One entry per credential with at least one compatible
        embedding model, plus the policy used for filtering.



## OpenAPI

````yaml /versions/2.0.4dev/en/deploy/openapi.json get /knowledge_bases/embedding_models
openapi: 3.1.0
info:
  title: AgentScope
  version: 2.0.3
servers: []
security: []
paths:
  /knowledge_bases/embedding_models:
    get:
      tags:
        - knowledge_bases
      summary: List embedding models compatible with the KB dimension policy
      description: |-
        List embedding models the user can pick at KB-creation time.

        Walks the caller's credentials, looks up each provider's
        embedding model class, gathers its model cards, and projects
        each card through the manager's :class:`DimensionPolicy`.
        Incompatible cards are dropped; matryoshka cards under a
        ``FIXED`` / ``LOCKED_BY_EXISTING`` policy are narrowed to the
        locked dimension.  Providers that end up with zero compatible
        models are omitted from the response entirely.

        Args:
            user_id (`str`):
                Injected authenticated user ID.
            storage (`StorageBase`):
                Injected storage backend used to enumerate credentials.
            manager (`KnowledgeBaseManagerBase`):
                Injected knowledge base manager.

        Returns:
            `ListKbEmbeddingModelsResponse`:
                One entry per credential with at least one compatible
                embedding model, plus the policy used for filtering.
      operationId: list_kb_embedding_models_knowledge_bases_embedding_models_get
      parameters:
        - name: x-user-id
          in: header
          required: true
          schema:
            type: string
            description: >-
              Caller's user ID. Temporary header-based identity; will be
              replaced by JWT auth.
            title: X-User-Id
          description: >-
            Caller's user ID. Temporary header-based identity; will be replaced
            by JWT auth.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListKbEmbeddingModelsResponse'
        '404':
          description: Not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ListKbEmbeddingModelsResponse:
      properties:
        providers:
          items:
            $ref: '#/components/schemas/KbEmbeddingProvider'
          type: array
          title: Providers
          description: >-
            One entry per credential that has at least one compatible embedding
            model.
        policy:
          $ref: '#/components/schemas/DimensionPolicy'
          description: >-
            The dimension policy used to filter the cards; surfaced verbatim so
            the UI can explain *why* models were filtered.
      type: object
      required:
        - providers
        - policy
      title: ListKbEmbeddingModelsResponse
      description: |-
        Response body listing KB-compatible embedding models.

        The list is pre-filtered server-side against the manager's
        dimension policy.  The policy itself is also returned so the
        front-end can render an explanatory banner and lock the dimension
        selector when applicable.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    KbEmbeddingProvider:
      properties:
        credential:
          $ref: '#/components/schemas/CredentialRecord'
          description: The credential record exposing these models.
        models:
          items:
            $ref: '#/components/schemas/EmbeddingModelCard'
          type: array
          title: Models
          description: >-
            Embedding model cards available under this credential, filtered to
            those compatible with the manager's dimension policy.
      type: object
      required:
        - credential
        - models
      title: KbEmbeddingProvider
      description: |-
        One credential and the embedding models it can serve.

        The model cards have been projected through the manager's
        dimension policy: incompatible models are removed and matryoshka
        cards are narrowed to the locked dimension when applicable.
    DimensionPolicy:
      properties:
        kind:
          $ref: '#/components/schemas/DimensionPolicyKind'
          description: What constraint applies to the chosen dimension.
        dimension:
          anyOf:
            - type: integer
            - type: 'null'
          title: Dimension
          description: >-
            The required dimension when ``kind`` is ``FIXED`` or
            ``LOCKED_BY_EXISTING``.  Always ``None`` for ``ANY``.
      type: object
      required:
        - kind
      title: DimensionPolicy
      description: The dimension policy a manager exposes to the front-end.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    CredentialRecord:
      properties:
        id:
          type: string
          title: Id
          description: Unique identifier for the credential.
        updated_at:
          type: string
          format: date-time
          title: Updated At
        created_at:
          type: string
          format: date-time
          title: Created At
        user_id:
          type: string
          title: User Id
        data:
          additionalProperties: true
          type: object
          title: Data
      type: object
      required:
        - data
      title: CredentialRecord
      description: The credential model used for storing credentials.
    EmbeddingModelCard:
      properties:
        type:
          type: string
          const: embedding_model
          title: Type
          default: embedding_model
        name:
          type: string
          title: Name
          description: The model name used in API calls.
        label:
          type: string
          title: Label
          description: Human-readable label for the frontend.
        status:
          type: string
          enum:
            - active
            - deprecated
            - sunset
          title: Status
          description: The model lifecycle status.
          default: active
        input_types:
          items:
            type: string
          type: array
          title: Input Types
          description: Supported input media types.
          default:
            - text/plain
        output_types:
          items:
            type: string
          type: array
          title: Output Types
          description: Supported output media types.
          default:
            - application/x-embedding
        dimensions:
          type: integer
          exclusiveMinimum: 0
          title: Dimensions
          description: Default output vector dimensions for this model.
        supported_dimensions:
          anyOf:
            - items:
                type: integer
              type: array
            - type: 'null'
          title: Supported Dimensions
          description: >-
            If set, the only dimensions this model can produce. ``None`` means
            dimensions are fixed at :attr:`dimensions` and cannot be overridden.
        context_size:
          anyOf:
            - type: integer
              exclusiveMinimum: 0
            - type: 'null'
          title: Context Size
          description: Maximum input length (in tokens) per request.
        parameter_schema:
          additionalProperties: true
          type: object
          title: Parameter Schema
          description: >-
            JSON Schema for user-configurable parameters (built from the
            Parameters class + YAML overrides).
        parameter_overrides:
          additionalProperties:
            additionalProperties: true
            type: object
          type: object
          title: Parameter Overrides
          description: Raw parameter overrides from the YAML file.
      type: object
      required:
        - name
        - label
        - dimensions
      title: EmbeddingModelCard
      description: |-
        A card describing an embedding model's capabilities.

        Mirrors :class:`~agentscope.model.ModelCard` but tailored for
        embedding models.  Uses ``input_types`` / ``output_types`` to
        describe model capabilities, and ``parameter_schema`` (built from
        the embedding class's ``Parameters`` + YAML ``parameter_overrides``)
        to tell the frontend which knobs the user can adjust.

        The output type ``application/x-embedding`` indicates that the
        model produces dense vector embeddings.
    DimensionPolicyKind:
      type: string
      enum:
        - any
        - fixed
        - locked_by_existing
      title: DimensionPolicyKind
      description: The kind of dimension policy the manager publishes.

````