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

# encode

> (ESM3, ESMC) Tokenize sequence, structure, or function annotations



## OpenAPI

````yaml openapi/biohub-platform-openapi.json POST /api/v1/encode
openapi: 3.1.0
info:
  title: Biohub Platform API
  version: 1.0.0
servers:
  - url: https://biohub.ai
security: []
paths:
  /api/v1/encode:
    post:
      tags:
        - v1
      summary: (ESM3, ESMC) Tokenize sequence, structure, or function annotations
      operationId: encode_api_v1_encode_post
      parameters:
        - name: accept
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Accept
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EncodeRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EncodeResponse'
            application/vnd.evolutionaryscale.pickle:
              schema:
                type: string
                format: binary
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    EncodeRequest:
      properties:
        model:
          type: string
          enum:
            - esm3-open-2024-03
            - esmc-300m-2024-12
            - esmc-600m-2024-12
            - esmc-6b-2024-12
          description: >-
            You may have access to additional, private models as well. These
            will be visible on the Rate Limits page under the Developer Console
        potential_sequence_of_concern:
          type: boolean
          description: >-
            Disclose potential sequences of concern. For approved users, such
            sequences will not go through additional safety filtering. Reach out
            if you are interested in using this.
          default: false
        inputs:
          $ref: '#/components/schemas/Tracks'
      type: object
      required:
        - model
        - inputs
    EncodeResponse:
      properties:
        model:
          type: string
          enum:
            - esm3-open-2024-03
            - esmc-300m-2024-12
            - esmc-600m-2024-12
            - esmc-6b-2024-12
          description: >-
            You may have access to additional, private models as well. These
            will be visible on the Rate Limits page under the Developer Console
        created:
          type: string
          description: ISO formatted date time
        potential_sequence_of_concern:
          type: boolean
          description: Indicate that the returned sequence may be of potential concerns.
          default: false
        warning_messages:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          description: Warning messages returned by FastAPI.
        outputs:
          $ref: '#/components/schemas/Tokens'
      type: object
      required:
        - model
        - created
        - tokens_used
        - outputs
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
      type: object
    Tracks:
      properties:
        sequence:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Sequence of amino acids. As input, this can be partially masked out
            with `_`, for example to get logprob over masked positions
        secondary_structure:
          anyOf:
            - type: string
            - type: 'null'
          description: Secondary structure in 8-class DSSP format.
        sasa:
          anyOf:
            - items:
                anyOf:
                  - type: integer
                  - type: number
                  - type: 'null'
              type: array
            - type: 'null'
          description: >-
            Solvent accessible surface area (SASA) as a list of floats. Nones
            are replaced with padding. 03/18/2025: A bug was fixed where 'inf'
            prior to this date was returned encoded as '-1', it will instead be
            1000 going forward
        function:
          anyOf:
            - items:
                prefixItems:
                  - type: string
                  - type: integer
                  - type: integer
                type: array
                maxItems: 3
                minItems: 3
              type: array
            - type: 'null'
          description: >-
            Function annotations, as a list of 3-tuples: (interpro tag, start,
            end). Start and end are 1-indexed, inclusive. We support interpro
            tags from version 95.0.
        coordinates:
          anyOf:
            - items:
                items:
                  items:
                    anyOf:
                      - type: number
                      - type: 'null'
                  type: array
                type: array
              type: array
            - type: 'null'
          description: Coordinates of the N, CA, C atom sequence as a Nx37x3 array.
        plddt:
          anyOf:
            - items:
                type: number
              type: array
            - type: 'null'
          description: >-
            Per position plddt predictions for a protein. Usually produced by
            structure decoder.
        ptm:
          anyOf:
            - type: number
            - type: 'null'
          description: >-
            Predicted TM score of a protein. Usually produced by structure
            decoder.
        crmsd:
          anyOf:
            - type: number
            - type: 'null'
          description: >-
            Constrained RMSD between the generated protein coordinates and the
            input protein coordinates. Produced by the generate endpoint.
        globularity:
          anyOf:
            - type: number
            - type: 'null'
          description: >-
            Globularity of the generated protein. Produced by the generate
            endpoint.
        interface:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          description: Annotations on residues that participate in a multimer interface.
        interface_ptm:
          anyOf:
            - type: number
            - type: 'null'
          description: Interface TM score of a protein.
        pae:
          anyOf:
            - items:
                items:
                  type: number
                type: array
              type: array
            - type: 'null'
          description: >-
            Predicted Aligned Error matrix for the protein. Shape is L x L.
            Values are rounded to 2 decimals (well within 0.5 A bin width)
      type: object
    Tokens:
      properties:
        sequence:
          anyOf:
            - items:
                type: integer
              type: array
            - type: 'null'
          description: Sequence as a list of tokens as integers.
        coordinates:
          anyOf:
            - items:
                items:
                  items:
                    anyOf:
                      - type: number
                      - type: 'null'
                  type: array
                type: array
              type: array
            - type: 'null'
          description: Coordinates of the N, CA, C atom sequence as a Nx37x3 array.
        structure:
          anyOf:
            - items:
                type: integer
              type: array
            - type: 'null'
          description: Structure output from the model as a list of integer tokens.
        secondary_structure:
          anyOf:
            - items:
                type: integer
              type: array
            - type: 'null'
          description: Secondary structure in 8-class DSSP format.
        sasa:
          anyOf:
            - items:
                anyOf:
                  - type: integer
                  - type: 'null'
              type: array
            - type: 'null'
          description: Solvent accessible surface area (SASA) as a list of integers.
        function:
          anyOf:
            - items:
                items:
                  type: integer
                type: array
              type: array
            - type: 'null'
          description: Function annotations, as a list of integers.
        residue_annotation:
          anyOf:
            - items:
                items:
                  type: integer
                type: array
              type: array
            - type: 'null'
          description: Residue annotations tokens, as a list of integers.
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
        msg:
          type: string
        type:
          type: string
        input: {}
        ctx:
          type: object
      type: object
      required:
        - loc
        - msg
        - type
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````