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

# Get Available Models

> Retrieve the list of available models by type. Primarily used to query `text-embedding` and `rerank` models for knowledge base configuration.



## OpenAPI

````yaml /en/api-reference/openapi_knowledge.json get /workspaces/current/models/model-types/{model_type}
openapi: 3.0.1
info:
  title: Knowledge API
  description: >-
    API for managing knowledge bases, documents, chunks, metadata, and tags,
    including creation, retrieval, and configuration. **Note:** A single
    Knowledge Base API key has permission to operate on all visible knowledge
    bases under the same account. Please pay attention to data security.
  version: 1.0.0
servers:
  - url: '{apiBaseUrl}'
    description: The base URL for the Knowledge API.
    variables:
      apiBaseUrl:
        default: https://api.dify.ai/v1
        description: Actual base URL of the API
security:
  - ApiKeyAuth: []
tags:
  - name: Knowledge Bases
    description: >-
      Operations for managing knowledge bases, including creation,
      configuration, and retrieval.
  - name: Documents
    description: >-
      Operations for creating, updating, and managing documents within a
      knowledge base.
  - name: Chunks
    description: Operations for managing document chunks and child chunks.
  - name: Metadata
    description: >-
      Operations for managing knowledge base metadata fields and document
      metadata values.
  - name: Tags
    description: Operations for managing knowledge base tags and tag bindings.
  - name: Models
    description: Operations for retrieving available models.
  - name: Knowledge Pipeline
    description: >-
      Operations for managing and running knowledge pipelines, including
      datasource plugins and pipeline execution.
paths:
  /workspaces/current/models/model-types/{model_type}:
    get:
      tags:
        - Models
      summary: Get Available Models
      description: >-
        Retrieve the list of available models by type. Primarily used to query
        `text-embedding` and `rerank` models for knowledge base configuration.
      operationId: getAvailableModels
      parameters:
        - name: model_type
          in: path
          required: true
          schema:
            type: string
            enum:
              - text-embedding
              - rerank
              - llm
              - tts
              - speech2text
              - moderation
          description: >-
            Type of model to retrieve. For knowledge base configuration, use
            `text-embedding` for embedding models or `rerank` for reranking
            models.
      responses:
        '200':
          description: Available models for the specified type.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    description: List of model providers with their available models.
                    items:
                      type: object
                      properties:
                        provider:
                          type: string
                          description: Model provider identifier, e.g. `openai`, `cohere`.
                        label:
                          type: object
                          description: Localized display name of the provider.
                          properties:
                            en_US:
                              type: string
                              description: English display name.
                            zh_Hans:
                              type: string
                              description: Chinese display name.
                        icon_small:
                          type: object
                          description: URL of the provider's small icon.
                          properties:
                            en_US:
                              type: string
                              description: Small icon URL.
                        icon_large:
                          type: object
                          description: URL of the provider's large icon.
                          properties:
                            en_US:
                              type: string
                              description: Large icon URL.
                        status:
                          type: string
                          description: >-
                            Provider status. `active` when credentials are
                            configured and valid.
                        models:
                          type: array
                          description: List of available models from this provider.
                          items:
                            type: object
                            properties:
                              model:
                                type: string
                                description: >-
                                  Model identifier. Use this as the
                                  `embedding_model` value when creating or
                                  updating a knowledge base.
                              label:
                                type: object
                                description: Localized display name of the model.
                                properties:
                                  en_US:
                                    type: string
                                    description: English model name.
                                  zh_Hans:
                                    type: string
                                    description: Chinese model name.
                              model_type:
                                type: string
                                description: >-
                                  Type of the model, matching the `model_type`
                                  path parameter.
                              features:
                                type: array
                                nullable: true
                                description: >-
                                  Supported features of the model, `null` if
                                  none.
                                items:
                                  type: string
                              fetch_from:
                                type: string
                                description: >-
                                  Where the model definition comes from.
                                  `predefined-model` for built-in models,
                                  `customizable-model` for user-configured
                                  models.
                              model_properties:
                                type: object
                                description: >-
                                  Model-specific properties such as
                                  `context_size`.
                              status:
                                type: string
                                description: >-
                                  Model availability status. `active` when ready
                                  to use.
              examples:
                success:
                  summary: Response Example
                  value:
                    data:
                      - provider: openai
                        label:
                          en_US: OpenAI
                          zh_Hans: OpenAI
                        icon_small:
                          en_US: https://example.com/openai-small.svg
                        icon_large:
                          en_US: https://example.com/openai-large.svg
                        status: active
                        models:
                          - model: text-embedding-3-small
                            label:
                              en_US: text-embedding-3-small
                              zh_Hans: text-embedding-3-small
                            model_type: text-embedding
                            features: null
                            fetch_from: predefined-model
                            model_properties:
                              context_size: 8191
                            status: active
components:
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: API_KEY
      description: >-
        API Key authentication. For all API requests, include your API Key in
        the `Authorization` HTTP Header, prefixed with `Bearer `. Example:
        `Authorization: Bearer {API_KEY}`. **Strongly recommend storing your API
        Key on the server-side, not shared or stored on the client-side, to
        avoid possible API-Key leakage that can lead to serious consequences.**

````