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

# Get compiled Malloy model

> Retrieves a compiled Malloy model with its source information, queries, and metadata.
The model is compiled using the specified version of the Malloy compiler. This endpoint
provides access to the model's structure, sources, and named queries for use in applications.




## OpenAPI

````yaml /dataplane-public-api-doc.yaml get /projects/{projectName}/packages/{packageName}/models/{path}
openapi: 3.1.0
info:
  title: Malloy Publisher - Semantic Model Serving API
  description: >
    The Malloy Publisher - Semantic Model Serving API provides comprehensive
    access to Malloy packages and their associated resources.

    A Malloy package is a directory containing Malloy models (.malloy files),
    Malloy notebooks (.malloynb files), and embedded databases

    (.parquet files) with a malloy-publisher.json manifest at the package's root
    directory.


    ## Key Features


    - **Project Management**: Create and manage projects with their associated
    packages and connections

    - **Package Lifecycle**: Full CRUD operations for Malloy packages and their
    versions

    - **Model & Notebook Access**: Retrieve and execute Malloy models and
    notebooks

    - **Connection Management**: Secure database connection configuration and
    testing

    - **Query Execution**: Execute queries against models and retrieve results

    - **Watch Mode**: Real-time file watching for development workflows


    ## Resource Hierarchy


    The API follows a hierarchical resource structure:

    ```

    Projects

    ├── Connections

    └── Packages
        ├── Models
        ├── Notebooks
        └── Databases
    ```


    For examples, see the Malloy samples packages
    (https://github.com/malloydata/malloy-samples) repository.
  version: v0
servers:
  - url: https://{organization}.data.credibledata.com/api/v0/
    description: Production API server
    variables:
      organization:
        default: demo
        description: Your organization subdomain
security:
  - bearerAuth: []
tags:
  - name: publisher
    description: Publisher status and health check operations
  - name: projects
    description: >-
      Project lifecycle management including creation, configuration, and
      deletion of data modeling projects
  - name: connections
    description: >-
      Database connection management for secure data source configuration and
      access
  - name: packages
    description: >-
      Package management for Malloy data models, including versioning and
      distribution
  - name: models
    description: Malloy model access and compilation operations
  - name: notebooks
    description: Malloy notebook access and execution operations
  - name: databases
    description: Embedded database management and access
  - name: watch-mode
    description: Real-time file watching for development workflows
paths:
  /projects/{projectName}/packages/{packageName}/models/{path}:
    get:
      tags:
        - models
      summary: Get compiled Malloy model
      description: >
        Retrieves a compiled Malloy model with its source information, queries,
        and metadata.

        The model is compiled using the specified version of the Malloy
        compiler. This endpoint

        provides access to the model's structure, sources, and named queries for
        use in applications.
      operationId: get-model
      parameters:
        - name: projectName
          in: path
          description: Name of the project
          required: true
          schema:
            $ref: '#/components/schemas/IdentifierPattern'
        - name: packageName
          in: path
          description: Name of the package
          required: true
          schema:
            type: string
        - name: path
          in: path
          description: Path to the model within the package
          required: true
          schema:
            $ref: '#/components/schemas/PathPattern'
        - name: versionId
          in: query
          description: Version identifier for the package
          required: false
          schema:
            $ref: '#/components/schemas/VersionIdPattern'
      responses:
        '200':
          description: Compiled Malloy model
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompiledModel'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '424':
          $ref: '#/components/responses/ModelCompilationError'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '501':
          $ref: '#/components/responses/NotImplemented'
components:
  schemas:
    IdentifierPattern:
      type: string
      pattern: ^[a-zA-Z0-9_-]+$
      description: Standard identifier pattern for resource names
    PathPattern:
      type: string
      pattern: ^[a-zA-Z0-9_/.-]+$
      description: Path pattern supporting slashes, dots, and dashes
    VersionIdPattern:
      type: string
      pattern: ^[a-zA-Z0-9_.-]+$
      description: Version identifier pattern supporting dots and dashes
    CompiledModel:
      type: object
      description: Compiled Malloy model with sources, queries, and metadata
      properties:
        resource:
          type: string
          description: Resource path to the model
        packageName:
          type: string
          description: Name of the package containing this model
        path:
          type: string
          description: Relative path to the model file within its package directory
        malloyVersion:
          type: string
          description: Version of the Malloy compiler used to generate the model data
        modelInfo:
          type: string
          description: JSON string containing model metadata and structure information
        sourceInfos:
          type: array
          description: >-
            Array of JSON strings containing source information for each data
            source
          items:
            type: string
        queries:
          type: array
          description: Array of named queries defined in the model
          items:
            $ref: '#/components/schemas/Query'
        sources:
          type: array
          description: Sources defined in this model
          items:
            $ref: '#/components/schemas/Source'
    Query:
      type: object
      description: Named model query definition
      properties:
        name:
          type: string
          description: Name of the query
        sourceName:
          type: string
          description: Name of the source this query operates on
        annotations:
          type: array
          description: Annotations attached to the query
          items:
            type: string
    Source:
      type: object
      description: A Malloy source defined in a model
      properties:
        name:
          type: string
          description: Name of the source
        annotations:
          type: array
          description: Annotations attached to the source
          items:
            type: string
        views:
          type: array
          description: Views defined in this source
          items:
            $ref: '#/components/schemas/View'
        filters:
          type: array
          description: Filters declared on this source via
          items:
            $ref: '#/components/schemas/Filter'
    Error:
      type: object
      description: Standard error response format
      properties:
        message:
          type: string
          description: Human-readable error message describing what went wrong
        details:
          type: string
          description: Additional error details or context
      required:
        - message
    View:
      type: object
      description: Named model view definition
      properties:
        name:
          type: string
          description: Name of the view
        annotations:
          type: array
          description: Annotations attached to the view
          items:
            type: string
    Filter:
      type: object
      description: A filter declared via
      properties:
        name:
          type: string
          description: Display name of the filter
        dimension:
          type: string
          description: Dimension this filter targets
        type:
          type: string
          description: Comparator type
          enum:
            - equal
            - in
            - like
            - greater_than
            - less_than
        implicit:
          type: boolean
          description: Whether this filter is hidden from users
        required:
          type: boolean
          description: Whether a value must be provided
        dimensionType:
          type: string
          description: >-
            Malloy data type of the dimension (e.g. string, number, boolean,
            date, timestamp)
  responses:
    Unauthorized:
      description: Unauthorized - authentication required
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: The specified resource was not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ModelCompilationError:
      description: Model compilation failed due to syntax or semantic errors
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    InternalServerError:
      description: The server encountered an internal error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotImplemented:
      description: The requested operation is not implemented
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````