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

# generate_tensor

> (ESM3) Generates an output track conditioned on inputs. Accepts and returns raw tokens.



## OpenAPI

````yaml openapi/biohub-platform-openapi.json POST /api/v1/generate_tensor
openapi: 3.1.0
info:
  title: Biohub Platform API
  version: 1.0.0
servers:
  - url: https://biohub.ai
security: []
paths:
  /api/v1/generate_tensor:
    post:
      tags:
        - v1
      summary: >-
        (ESM3) Generates an output track conditioned on inputs. Accepts and
        returns raw tokens.
      operationId: generate_tensor_api_v1_generate_tensor_post
      parameters:
        - name: accept
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Accept
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GenerateTensorRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenerateTensorResponse'
            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:
    GenerateTensorRequest:
      properties:
        model:
          type: string
          enum:
            - esm3-open-2024-03
          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
        track:
          type: string
          description: >-
            Track to generate: sequence, structure, secondary_structure, sasa,
            or function.
        invalid_ids:
          items:
            type: integer
          type: array
          description: Token indices that should not be sampled.
          default: []
        schedule:
          type: string
          enum:
            - cosine
            - linear
          description: >-
            Unmasking schedule for generation. Controls the number of tokens to
            unmask during each round of iterative generation.
          default: cosine
        strategy:
          type: string
          enum:
            - random
            - entropy
          description: >-
            Unmasking strategy to use. Controls which tokens to unmask during
            each round of iterative generation. 'random' will unmask a correct
            number of tokens randomly. 'entropy' will unmask the tokens with the
            lowest logit entropy first. Default was random. Updated on
            02/14/2025.
          default: random
        num_steps:
          type: integer
          maximum: 100
          minimum: 1
          description: >-
            Number of steps for generation. There is diminishing return for
            decoding steps more than 20. Note that this needs to be less than or
            equal to the sequence length. Default was 8. Updated on 02/14/2025.
          default: 20
        temperature:
          type: number
          minimum: 0
          description: Temperature for sampling. Default was 1.0. Updated on 02/14/2025.
          default: 0.5
        temperature_annealing:
          type: boolean
          description: >-
            Whether temperature should be annealed during generation. Default
            was False. Updated on 02/14/2025.
          default: true
        top_p:
          type: number
          maximum: 1
          exclusiveMinimum: 0
          description: Top-p sampling.
          default: 1
        condition_on_coordinates_only:
          type: boolean
          description: >-
            Use coordinates instead of structure tokens as generation
            conditioning.
          default: true
        inputs:
          $ref: '#/components/schemas/Tokens'
      type: object
      required:
        - model
        - track
        - inputs
    GenerateTensorResponse:
      properties:
        model:
          type: string
          enum:
            - esm3-open-2024-03
          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:
          anyOf:
            - $ref: '#/components/schemas/Tokens'
            - type: 'null'
      type: object
      required:
        - model
        - created
        - tokens_used
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
      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

````