> ## 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 Code

> Endpoint to get details of a specific QEC code by slug.

Args:
    slug: The unique slug identifier of the QEC code.

Returns:
    The details of the QEC code if found, otherwise a 404 error.



## OpenAPI

````yaml https://api.haiqu.ai/openapi.json get /codes/{slug}
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.3.0
servers: []
security: []
paths:
  /codes/{slug}:
    get:
      summary: Get Code
      description: |-
        Endpoint to get details of a specific QEC code by slug.

        Args:
            slug: The unique slug identifier of the QEC code.

        Returns:
            The details of the QEC code if found, otherwise a 404 error.
      operationId: get_code_codes__slug__get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QECCodeModel'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyQuery: []
        - APIKeyHeader: []
components:
  schemas:
    QECCodeModel:
      properties:
        slug:
          type: string
          title: Slug
        name:
          type: string
          title: Name
        family:
          type: string
          title: Family
        sub_family:
          type: string
          title: Sub Family
          default: ''
        code_type:
          type: string
          title: Code Type
        'n':
          anyOf:
            - type: integer
            - type: 'null'
          title: 'N'
        k:
          anyOf:
            - type: integer
            - type: 'null'
          title: K
        d:
          anyOf:
            - type: integer
            - additionalProperties: true
              type: object
            - type: 'null'
          title: D
        completeness:
          type: string
          title: Completeness
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        stabilizers:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Stabilizers
        logical_operators:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Logical Operators
        layout_svg_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Layout Svg Url
        qecx_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Qecx Url
        references:
          anyOf:
            - items:
                $ref: '#/components/schemas/QECReferenceModel'
              type: array
            - type: 'null'
          title: References
      type: object
      required:
        - slug
        - name
        - family
        - code_type
        - completeness
      title: QECCodeModel
      description: Pydantic model for the QEC Code Library API responses.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    QECReferenceModel:
      properties:
        authors:
          items:
            type: string
          type: array
          title: Authors
        title:
          type: string
          title: Title
        year:
          type: integer
          title: Year
        doi:
          anyOf:
            - type: string
            - type: 'null'
          title: Doi
        annotation:
          anyOf:
            - type: string
            - type: 'null'
          title: Annotation
      type: object
      required:
        - authors
        - title
        - year
      title: QECReferenceModel
    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

````