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

# Get Artifact In Experiment

> Get one normalized artifact descriptor by name from an experiment.

Use this tool when the caller already knows ``artifact_name`` and needs its
typed descriptor, such as a scalar value, timeseries, or binary metadata.
The returned shape reflects MCP read-side normalization rather than a
round-trip of the original write-time artifact kind.

When to Use:
    - Call this when the caller already knows the artifact key and needs
      the normalized MCP descriptor.
    - Call this before downloading binary data, so the workflow can inspect
      ``mime_type`` or ``content_url`` first.

Constraints:
    - This endpoint reads one entry from the experiment metrics map and
      does not reconstruct the original write-time artifact contract.
    - When the descriptor exposes ``content_url``, raw bytes still require
      a separate content request.

Notes:
    - This endpoint does not stream raw bytes.
    - Use ``get_artifact_content_in_experiment`` when the artifact should
      be served as binary content.

Args:
    experiment_id: Parent experiment identifier.
    artifact_name: Artifact key within experiment metrics.
    user: Authenticated user resolved from the API key.
    db: Active database session.

Returns:
    One normalized artifact descriptor.

Raises:
    HTTPException: Raised with ``404`` if the experiment is unavailable to
        the caller or the artifact key is absent.



## OpenAPI

````yaml https://api.haiqu.ai/openapi.json get /ai/{experiment_id}/artifact
openapi: 3.1.0
info:
  title: Haiqu API
  summary: Haiqu RESTful API service.
  description: Cloud service providing the access to Haiqu cloud runtime
  contact:
    name: Haiqu Inc.
    url: https://haiqu.ai/
    email: info@haiqu.ai
  version: 1.4.0
servers: []
security: []
paths:
  /ai/{experiment_id}/artifact:
    get:
      summary: Get Artifact In Experiment
      description: >-
        Get one normalized artifact descriptor by name from an experiment.


        Use this tool when the caller already knows ``artifact_name`` and needs
        its

        typed descriptor, such as a scalar value, timeseries, or binary
        metadata.

        The returned shape reflects MCP read-side normalization rather than a

        round-trip of the original write-time artifact kind.


        When to Use:
            - Call this when the caller already knows the artifact key and needs
              the normalized MCP descriptor.
            - Call this before downloading binary data, so the workflow can inspect
              ``mime_type`` or ``content_url`` first.

        Constraints:
            - This endpoint reads one entry from the experiment metrics map and
              does not reconstruct the original write-time artifact contract.
            - When the descriptor exposes ``content_url``, raw bytes still require
              a separate content request.

        Notes:
            - This endpoint does not stream raw bytes.
            - Use ``get_artifact_content_in_experiment`` when the artifact should
              be served as binary content.

        Args:
            experiment_id: Parent experiment identifier.
            artifact_name: Artifact key within experiment metrics.
            user: Authenticated user resolved from the API key.
            db: Active database session.

        Returns:
            One normalized artifact descriptor.

        Raises:
            HTTPException: Raised with ``404`` if the experiment is unavailable to
                the caller or the artifact key is absent.
      operationId: get_artifact_in_experiment
      parameters:
        - name: experiment_id
          in: path
          required: true
          schema:
            type: string
            title: Experiment Id
        - name: artifact_name
          in: query
          required: true
          schema:
            type: string
            title: Artifact Name
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContextExperimentArtifact'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyQuery: []
        - APIKeyHeader: []
components:
  schemas:
    ContextExperimentArtifact:
      properties:
        name:
          type: string
          title: Name
        kind:
          type: string
          title: Kind
        value:
          anyOf:
            - {}
            - type: 'null'
          title: Value
        mime_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Mime Type
        content_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Content Url
        auth_hint:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Auth Hint
        x:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: X
        'y':
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: 'Y'
        points:
          anyOf:
            - items: {}
              type: array
            - type: 'null'
          title: Points
      type: object
      required:
        - name
        - kind
      title: ContextExperimentArtifact
      description: |-
        Represent the normalized artifact shape returned by MCP read endpoints.

        Attributes:
            name: Artifact key in experiment metrics.
            kind: Normalized read-side artifact category, typically ``value``,
                ``timeseries``, or a base64-derived media family such as ``image``.
            value: Scalar or JSON-like artifact value.
            mime_type: MIME type for binary or base64-backed artifacts.
            content_url: Relative URL used to fetch raw bytes when needed.
            auth_hint: Header hint used by clients when dereferencing
                ``content_url``.
            x: X-axis metadata for timeseries payloads.
            y: Y-axis metadata for timeseries payloads.
            points: Ordered point list for timeseries payloads.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyQuery:
      type: apiKey
      in: query
      name: HAIQU_API_KEY
    APIKeyHeader:
      type: apiKey
      in: header
      name: authorization

````