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

# Build AF2, AF2-multimer, or AF3 query-anchored A3M artifacts with Tomato



## OpenAPI

````yaml /api-reference/openapi.json post /v1/sequences/msa/alphafold
openapi: 3.1.0
info:
  description: >-
    Deterministic biological evidence primitives. Every response is the same
    envelope: ok, data, warnings, provenance.
  title: Rafflesia API
  version: 0.1.0
servers:
  - description: Production
    url: https://api.rafflesia.ai
security:
  - bearerAuth: []
paths:
  /v1/sequences/msa/alphafold:
    post:
      tags:
        - MSA
      summary: Build AF2, AF2-multimer, or AF3 query-anchored A3M artifacts with Tomato
      operationId: sequences.msa.alphafold
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AlphaFoldMSABuildRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnvelopeAlphaFoldMSABuildData'
          description: OK
          headers:
            Rafflesia-Contract-Digest:
              schema:
                type: string
            Rafflesia-Version:
              schema:
                type: string
            X-Request-ID:
              schema:
                type: string
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnvelopeAlphaFoldMSABuildData'
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnvelopeAlphaFoldMSABuildData'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnvelopeAlphaFoldMSABuildData'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnvelopeAlphaFoldMSABuildData'
          description: Not Found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnvelopeAlphaFoldMSABuildData'
          description: Conflict
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnvelopeAlphaFoldMSABuildData'
          description: Unprocessable Entity
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnvelopeAlphaFoldMSABuildData'
          description: Too Many Requests
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnvelopeAlphaFoldMSABuildData'
          description: Internal Server Error
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnvelopeAlphaFoldMSABuildData'
          description: Service Unavailable
      x-codeSamples:
        - lang: bash
          source: |
            curl --request POST \
              --url "https://api.rafflesia.ai/v1/sequences/msa/alphafold" \
              --header "Authorization: Bearer $RAFFLESIA_API_KEY" \
              --header "Content-Type: application/json" \
              --data '{
                "databases": {
                  "mgnify": "<mgnify>",
                  "uniref90": "<uniref90>"
                },
                "profile": "af2",
                "query": {
                  "id": "<id>",
                  "kind": "protein_sequence",
                  "sequence": "<sequence>"
                }
              }'
components:
  schemas:
    AlphaFoldMSABuildRequest:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
            - https://example.com/schemas/AlphaFoldMSABuildRequest.json
          format: uri
          readOnly: true
          type: string
        databases:
          $ref: '#/components/schemas/AlphaFoldMSADatabaseReleases'
        limits:
          $ref: '#/components/schemas/AlphaFoldMSASearchLimits'
          description: >-
            Optional per-lane result limits. Omitted values resolve to the
            profile defaults and are recorded in the manifest.
        profile:
          description: >-
            AlphaFold assembly policy. af2_multimer adds the UniProt
            pairing-source MSA used by AlphaFold-Multimer.
          enum:
            - af2
            - af2_multimer
            - af3
          type: string
        query:
          $ref: '#/components/schemas/MSAPlacementQuery'
          description: >-
            One protein chain. AlphaFold's protein data pipeline runs
            independently per unique chain sequence; complex-wide species
            pairing happens later.
      required:
        - profile
        - query
        - databases
      type: object
    EnvelopeAlphaFoldMSABuildData:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
            - https://example.com/schemas/EnvelopeAlphaFoldMSABuildData.json
          format: uri
          readOnly: true
          type: string
        data:
          $ref: '#/components/schemas/AlphaFoldMSABuildData'
          description: Operation result data.
        error:
          $ref: '#/components/schemas/APIError'
          description: Structured error information.
        evidence:
          $ref: '#/components/schemas/EvidenceSummary'
          description: Mechanical evidence summary for agent inspection and chaining.
        ok:
          description: Whether the operation succeeded.
          type: boolean
        provenance:
          $ref: '#/components/schemas/Provenance'
          description: Execution provenance.
        warnings:
          description: Non-fatal warnings.
          items:
            $ref: '#/components/schemas/Warning'
          type:
            - array
            - 'null'
      required:
        - ok
        - warnings
        - provenance
      type: object
    AlphaFoldMSADatabaseReleases:
      additionalProperties: false
      properties:
        bfd_uniref30:
          description: >-
            Immutable combined BFD plus UniRef30 release used by the full AF2
            profile.
          pattern: ^dbr_[0-9a-f]{64}$
          type: string
        mgnify:
          description: Immutable Tomato-backed MGnify release.
          pattern: ^dbr_[0-9a-f]{64}$
          type: string
        small_bfd:
          description: Immutable small-BFD release used by AF2-small or AF3.
          pattern: ^dbr_[0-9a-f]{64}$
          type: string
        uniprot:
          description: >-
            Immutable UniProt release used as the species-pairing source by
            AF2-multimer and AF3.
          pattern: ^dbr_[0-9a-f]{64}$
          type: string
        uniref90:
          description: Immutable Tomato-backed UniRef90 release.
          pattern: ^dbr_[0-9a-f]{64}$
          type: string
      required:
        - uniref90
        - mgnify
      type: object
    AlphaFoldMSASearchLimits:
      additionalProperties: false
      properties:
        bfd_uniref30:
          format: int64
          maximum: 1000
          minimum: 1
          type: integer
        mgnify:
          format: int64
          maximum: 1000
          minimum: 1
          type: integer
        small_bfd:
          format: int64
          maximum: 1000
          minimum: 1
          type: integer
        uniprot:
          format: int64
          maximum: 1000
          minimum: 1
          type: integer
        uniref90:
          format: int64
          maximum: 1000
          minimum: 1
          type: integer
      type: object
    MSAPlacementQuery:
      additionalProperties: false
      properties:
        id:
          description: Caller-supplied FASTA record identifier for the placed query.
          maxLength: 256
          minLength: 1
          type: string
        kind:
          description: Always protein_sequence.
          enum:
            - protein_sequence
          type: string
        sequence:
          description: Protein sequence used by the referenced homology outcome.
          maxLength: 100000
          minLength: 1
          type: string
      required:
        - id
        - kind
        - sequence
      type: object
    AlphaFoldMSABuildData:
      additionalProperties: false
      properties:
        assembly_algorithm:
          enum:
            - query_anchored_a3m_v1
          type: string
        homology_engine:
          enum:
            - tomato
          type: string
        id:
          pattern: ^afmsa_[0-9a-f]{64}$
          type: string
        is_upstream_byte_exact:
          type: boolean
        lanes:
          items:
            $ref: '#/components/schemas/AlphaFoldMSALaneData'
          maxItems: 4
          minItems: 3
          type:
            - array
            - 'null'
        manifest_download_url:
          type: string
        manifest_object:
          $ref: '#/components/schemas/ObjectRef'
        object:
          enum:
            - alphafold_msa_build
          type: string
        paired_source_a3m:
          $ref: '#/components/schemas/AlphaFoldMSAArtifact'
        pairing:
          $ref: '#/components/schemas/AlphaFoldMSAPairingMeasurements'
        profile:
          enum:
            - af2
            - af2_multimer
            - af3
          type: string
        query:
          $ref: '#/components/schemas/MSAPlacementQuery'
        unpaired_a3m:
          $ref: '#/components/schemas/AlphaFoldMSAArtifact'
      required:
        - object
        - id
        - profile
        - query
        - homology_engine
        - assembly_algorithm
        - is_upstream_byte_exact
        - lanes
        - unpaired_a3m
        - manifest_object
        - manifest_download_url
      type: object
    APIError:
      additionalProperties: false
      properties:
        code:
          description: Stable specific error code.
          type: string
        details:
          additionalProperties: {}
          description: Additional structured error details.
          type: object
        doc_url:
          description: Stable documentation URL for this error code.
          type: string
        message:
          description: Human-readable error message.
          type: string
        param:
          description: Request field responsible for the error when known.
          type: string
        type:
          description: Stable coarse error category.
          enum:
            - invalid_request_error
            - resource_missing
            - resource_expired
            - conflict_error
            - rate_limit_error
            - authentication_error
            - permission_error
            - billing_error
            - api_error
          type: string
      required:
        - type
        - code
        - message
        - doc_url
      type: object
    EvidenceSummary:
      additionalProperties: false
      properties:
        duration_ms:
          description: >-
            Primary elapsed duration in milliseconds when the response exposes
            one.
          format: int64
          type: integer
        input_refs:
          description: >-
            Input references detected from request fields such as object_id,
            structure_id, target_id, and sequence_id.
          items:
            type: string
          type:
            - array
            - 'null'
        object_refs:
          description: Object ids or object refs visible in the response/provenance.
          items:
            type: string
          type:
            - array
            - 'null'
        output_refs:
          description: Output references detected from response data and generated objects.
          items:
            type: string
          type:
            - array
            - 'null'
        row_count:
          description: >-
            Primary row count or returned row count when the response exposes
            one.
          format: int64
          type: integer
        warnings_count:
          description: Number of non-fatal warnings in the envelope.
          format: int64
          type: integer
      required:
        - warnings_count
      type: object
    Provenance:
      additionalProperties: false
      properties:
        cache_hit:
          description: Whether cached output was reused.
          type: boolean
        created_at:
          description: UTC timestamp.
          type: string
        database_snapshots:
          description: Database snapshots used.
          items:
            $ref: '#/components/schemas/DatabaseSnapshot'
          type:
            - array
            - 'null'
        generated_object_ids:
          description: Object ids created by the operation.
          items:
            type: string
          type:
            - array
            - 'null'
        input_hash:
          description: SHA-256 hash of canonical request input.
          type: string
        operation:
          description: Primitive operation id.
          type: string
        parameters_hash:
          description: SHA-256 hash of parameters.
          type: string
        request_id:
          description: Unique request identifier.
          type: string
        server_version:
          description: Server version.
          type: string
        tool_versions:
          description: Tool versions used.
          items:
            $ref: '#/components/schemas/ToolVersion'
          type:
            - array
            - 'null'
      required:
        - request_id
        - operation
        - created_at
        - server_version
      type: object
    Warning:
      additionalProperties: false
      properties:
        code:
          description: Stable warning code.
          type: string
        details:
          additionalProperties: {}
          description: Additional structured warning details.
          type: object
        message:
          description: Human-readable warning message.
          type: string
      required:
        - code
        - message
      type: object
    AlphaFoldMSALaneData:
      additionalProperties: false
      properties:
        a3m:
          $ref: '#/components/schemas/AlphaFoldMSAArtifact'
        candidate_count:
          format: int64
          type: integer
        database_release_id:
          type: string
        is_upstream_limit_unbounded:
          type: boolean
        projected_row_count:
          format: int64
          type: integer
        receipt:
          $ref: '#/components/schemas/AlphaFoldMSALaneReceipt'
        requested_max_results:
          format: int64
          type: integer
        role:
          enum:
            - uniref90
            - mgnify
            - bfd_uniref30
            - small_bfd
            - uniprot
          type: string
        search_id:
          type: string
        search_policy_id:
          type: string
        skipped_alignment_count:
          format: int64
          type: integer
        upstream_max_results:
          description: >-
            AlphaFold upstream cap. Omitted when upstream does not impose a lane
            cap.
          format: int64
          type: integer
      required:
        - role
        - database_release_id
        - search_id
        - search_policy_id
        - requested_max_results
        - is_upstream_limit_unbounded
        - candidate_count
        - projected_row_count
        - skipped_alignment_count
        - receipt
        - a3m
      type: object
    ObjectRef:
      additionalProperties: false
      properties:
        bucket:
          type: string
        content_type:
          type: string
        kind:
          type: string
        object_id:
          type: string
        object_key:
          type: string
        path:
          type: string
        sha256:
          type: string
        size_bytes:
          format: int64
          type: integer
        storage_backend:
          type: string
        uri:
          type: string
      required:
        - object_id
        - kind
        - size_bytes
        - sha256
      type: object
    AlphaFoldMSAArtifact:
      additionalProperties: false
      properties:
        download_url:
          type: string
        object:
          $ref: '#/components/schemas/ObjectRef'
        query_length:
          format: int64
          minimum: 1
          type: integer
        role:
          enum:
            - lane
            - unpaired
            - paired_source
            - manifest
          type: string
        sequence_count:
          format: int64
          minimum: 1
          type: integer
      required:
        - role
        - object
        - download_url
        - sequence_count
        - query_length
      type: object
    AlphaFoldMSAPairingMeasurements:
      additionalProperties: false
      properties:
        header_auxiliary_taxonomy_count:
          description: >-
            Headers carrying OX= or TaxID= metadata. This metadata is measured
            separately because the stock AlphaFold species parser does not
            consume it.
          format: int64
          type: integer
        header_species_id_count:
          description: >-
            Headers matching AlphaFold's standard UniProt
            sp|accession|entry_species or tr|accession|entry_species parser.
          format: int64
          type: integer
        is_species_pairing_ready:
          description: >-
            True when at least one header has a species id consumable by the
            stock AlphaFold parser.
          type: boolean
      required:
        - header_species_id_count
        - header_auxiliary_taxonomy_count
        - is_species_pairing_ready
      type: object
    DatabaseSnapshot:
      additionalProperties: false
      properties:
        digest:
          type: string
        kind:
          type: string
        name:
          type: string
        version:
          type: string
      required:
        - name
        - version
      type: object
    ToolVersion:
      additionalProperties: false
      properties:
        name:
          type: string
        path:
          type: string
        version:
          type: string
      required:
        - name
        - version
      type: object
    AlphaFoldMSALaneReceipt:
      additionalProperties: false
      properties:
        execution_receipt_id:
          type: string
        execution_receipt_sha256:
          type: string
        outcome_id:
          type: string
        outcome_sha256:
          type: string
        result_sha256:
          type: string
      required:
        - outcome_id
        - outcome_sha256
        - execution_receipt_id
        - execution_receipt_sha256
        - result_sha256
      type: object
  securitySchemes:
    bearerAuth:
      description: 'A Rafflesia API key, sent as `Authorization: Bearer <key>`.'
      scheme: bearer
      type: http

````