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

# Upload a file for model inputs

> Accepts arbitrary bytes and returns an ordinary URL string that can be passed to any compatible endpoint.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/files
openapi: 3.1.0
info:
  description: >-
    Deterministic biological evidence primitives with typed resource, list, and
    error responses. Each operation documents its own response shape,
    provenance, warnings, and transport headers.
  title: Rafflesia API
  version: 0.1.0
servers:
  - description: Production
    url: https://api.rafflesia.ai
security:
  - bearerAuth: []
paths:
  /v1/files:
    post:
      tags:
        - Files
      summary: Upload a file for model inputs
      description: >-
        Accepts arbitrary bytes and returns an ordinary URL string that can be
        passed to any compatible endpoint.
      operationId: storage.upload
      parameters:
        - description: >-
            Mutable management path for the file. A plain filename places it in
            the storage root.
          in: header
          name: X-Filename
          schema:
            maxLength: 1024
            type: string
        - description: >-
            Retry identity for this exact file, filename, content type, initial
            ACL, and requested lifetime.
          in: header
          name: Idempotency-Key
          schema:
            maxLength: 255
            type: string
        - description: >-
            JSON object whose initial_acl and expiration_duration_seconds apply
            to the uploaded file.
          in: header
          name: Rafflesia-Object-Lifecycle-Preference
          schema:
            maxLength: 8192
            type: string
      requestBody:
        content:
          '*/*':
            schema:
              contentMediaType: application/octet-stream
              format: binary
              type: string
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExecutionEnvelopeFileUpload'
          description: Uploaded file URL.
          headers:
            Rafflesia-Contract-Digest:
              schema:
                type: string
            Rafflesia-Version:
              schema:
                type: string
            X-Rafflesia-Runner-Hints:
              schema:
                type: string
            X-Rafflesia-Served-From:
              schema:
                type: string
            X-Request-ID:
              schema:
                type: string
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExecutionEnvelopeFileUpload'
          description: Bad Request
          headers:
            Rafflesia-Contract-Digest:
              schema:
                type: string
            Rafflesia-Error-Type:
              schema:
                type: string
            Rafflesia-Retryable:
              schema:
                enum:
                  - 'true'
                  - 'false'
                type: string
            Rafflesia-Version:
              schema:
                type: string
            X-Rafflesia-Runner-Hints:
              schema:
                type: string
            X-Rafflesia-Served-From:
              schema:
                type: string
            X-Request-ID:
              schema:
                type: string
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExecutionEnvelopeFileUpload'
          description: Unauthorized
          headers:
            Rafflesia-Contract-Digest:
              schema:
                type: string
            Rafflesia-Error-Type:
              schema:
                type: string
            Rafflesia-Retryable:
              schema:
                enum:
                  - 'true'
                  - 'false'
                type: string
            Rafflesia-Version:
              schema:
                type: string
            X-Rafflesia-Runner-Hints:
              schema:
                type: string
            X-Rafflesia-Served-From:
              schema:
                type: string
            X-Request-ID:
              schema:
                type: string
        '402':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExecutionEnvelopeFileUpload'
          description: Payment Required
          headers:
            Rafflesia-Contract-Digest:
              schema:
                type: string
            Rafflesia-Error-Type:
              schema:
                type: string
            Rafflesia-Retryable:
              schema:
                enum:
                  - 'true'
                  - 'false'
                type: string
            Rafflesia-Version:
              schema:
                type: string
            X-Rafflesia-Runner-Hints:
              schema:
                type: string
            X-Rafflesia-Served-From:
              schema:
                type: string
            X-Request-ID:
              schema:
                type: string
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExecutionEnvelopeFileUpload'
          description: Forbidden
          headers:
            Rafflesia-Contract-Digest:
              schema:
                type: string
            Rafflesia-Error-Type:
              schema:
                type: string
            Rafflesia-Retryable:
              schema:
                enum:
                  - 'true'
                  - 'false'
                type: string
            Rafflesia-Version:
              schema:
                type: string
            X-Rafflesia-Runner-Hints:
              schema:
                type: string
            X-Rafflesia-Served-From:
              schema:
                type: string
            X-Request-ID:
              schema:
                type: string
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExecutionEnvelopeFileUpload'
          description: Not Found
          headers:
            Rafflesia-Contract-Digest:
              schema:
                type: string
            Rafflesia-Error-Type:
              schema:
                type: string
            Rafflesia-Retryable:
              schema:
                enum:
                  - 'true'
                  - 'false'
                type: string
            Rafflesia-Version:
              schema:
                type: string
            X-Rafflesia-Runner-Hints:
              schema:
                type: string
            X-Rafflesia-Served-From:
              schema:
                type: string
            X-Request-ID:
              schema:
                type: string
        '405':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExecutionEnvelopeFileUpload'
          description: Method Not Allowed
          headers:
            Rafflesia-Contract-Digest:
              schema:
                type: string
            Rafflesia-Error-Type:
              schema:
                type: string
            Rafflesia-Retryable:
              schema:
                enum:
                  - 'true'
                  - 'false'
                type: string
            Rafflesia-Version:
              schema:
                type: string
            X-Rafflesia-Runner-Hints:
              schema:
                type: string
            X-Rafflesia-Served-From:
              schema:
                type: string
            X-Request-ID:
              schema:
                type: string
        '406':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExecutionEnvelopeFileUpload'
          description: Not Acceptable
          headers:
            Rafflesia-Contract-Digest:
              schema:
                type: string
            Rafflesia-Error-Type:
              schema:
                type: string
            Rafflesia-Retryable:
              schema:
                enum:
                  - 'true'
                  - 'false'
                type: string
            Rafflesia-Version:
              schema:
                type: string
            X-Rafflesia-Runner-Hints:
              schema:
                type: string
            X-Rafflesia-Served-From:
              schema:
                type: string
            X-Request-ID:
              schema:
                type: string
        '408':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExecutionEnvelopeFileUpload'
          description: Request Timeout
          headers:
            Rafflesia-Contract-Digest:
              schema:
                type: string
            Rafflesia-Error-Type:
              schema:
                type: string
            Rafflesia-Retryable:
              schema:
                enum:
                  - 'true'
                  - 'false'
                type: string
            Rafflesia-Version:
              schema:
                type: string
            X-Rafflesia-Runner-Hints:
              schema:
                type: string
            X-Rafflesia-Served-From:
              schema:
                type: string
            X-Request-ID:
              schema:
                type: string
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExecutionEnvelopeFileUpload'
          description: Conflict
          headers:
            Rafflesia-Contract-Digest:
              schema:
                type: string
            Rafflesia-Error-Type:
              schema:
                type: string
            Rafflesia-Retryable:
              schema:
                enum:
                  - 'true'
                  - 'false'
                type: string
            Rafflesia-Version:
              schema:
                type: string
            X-Rafflesia-Runner-Hints:
              schema:
                type: string
            X-Rafflesia-Served-From:
              schema:
                type: string
            X-Request-ID:
              schema:
                type: string
        '410':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExecutionEnvelopeFileUpload'
          description: Gone
          headers:
            Rafflesia-Contract-Digest:
              schema:
                type: string
            Rafflesia-Error-Type:
              schema:
                type: string
            Rafflesia-Retryable:
              schema:
                enum:
                  - 'true'
                  - 'false'
                type: string
            Rafflesia-Version:
              schema:
                type: string
            X-Rafflesia-Runner-Hints:
              schema:
                type: string
            X-Rafflesia-Served-From:
              schema:
                type: string
            X-Request-ID:
              schema:
                type: string
        '413':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExecutionEnvelopeFileUpload'
          description: File exceeds the upload limit.
          headers:
            Rafflesia-Contract-Digest:
              schema:
                type: string
            Rafflesia-Error-Type:
              schema:
                type: string
            Rafflesia-Retryable:
              schema:
                enum:
                  - 'true'
                  - 'false'
                type: string
            Rafflesia-Version:
              schema:
                type: string
            X-Rafflesia-Runner-Hints:
              schema:
                type: string
            X-Rafflesia-Served-From:
              schema:
                type: string
            X-Request-ID:
              schema:
                type: string
        '415':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExecutionEnvelopeFileUpload'
          description: Unsupported Media Type
          headers:
            Rafflesia-Contract-Digest:
              schema:
                type: string
            Rafflesia-Error-Type:
              schema:
                type: string
            Rafflesia-Retryable:
              schema:
                enum:
                  - 'true'
                  - 'false'
                type: string
            Rafflesia-Version:
              schema:
                type: string
            X-Rafflesia-Runner-Hints:
              schema:
                type: string
            X-Rafflesia-Served-From:
              schema:
                type: string
            X-Request-ID:
              schema:
                type: string
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExecutionEnvelopeFileUpload'
          description: Upload headers or bytes are invalid.
          headers:
            Rafflesia-Contract-Digest:
              schema:
                type: string
            Rafflesia-Error-Type:
              schema:
                type: string
            Rafflesia-Retryable:
              schema:
                enum:
                  - 'true'
                  - 'false'
                type: string
            Rafflesia-Version:
              schema:
                type: string
            X-Rafflesia-Runner-Hints:
              schema:
                type: string
            X-Rafflesia-Served-From:
              schema:
                type: string
            X-Request-ID:
              schema:
                type: string
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExecutionEnvelopeFileUpload'
          description: Too Many Requests
          headers:
            Rafflesia-Contract-Digest:
              schema:
                type: string
            Rafflesia-Error-Type:
              schema:
                type: string
            Rafflesia-Retryable:
              schema:
                enum:
                  - 'true'
                  - 'false'
                type: string
            Rafflesia-Version:
              schema:
                type: string
            RateLimit:
              schema:
                type: string
            RateLimit-Policy:
              schema:
                type: string
            Retry-After:
              schema:
                type: string
            X-Rafflesia-Runner-Hints:
              schema:
                type: string
            X-Rafflesia-Served-From:
              schema:
                type: string
            X-Request-ID:
              schema:
                type: string
        '499':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExecutionEnvelopeFileUpload'
          description: Client Closed Request
          headers:
            Rafflesia-Contract-Digest:
              schema:
                type: string
            Rafflesia-Error-Type:
              schema:
                type: string
            Rafflesia-Retryable:
              schema:
                enum:
                  - 'true'
                  - 'false'
                type: string
            Rafflesia-Version:
              schema:
                type: string
            X-Rafflesia-Runner-Hints:
              schema:
                type: string
            X-Rafflesia-Served-From:
              schema:
                type: string
            X-Request-ID:
              schema:
                type: string
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExecutionEnvelopeFileUpload'
          description: File storage failed.
          headers:
            Rafflesia-Contract-Digest:
              schema:
                type: string
            Rafflesia-Error-Type:
              schema:
                type: string
            Rafflesia-Retryable:
              schema:
                enum:
                  - 'true'
                  - 'false'
                type: string
            Rafflesia-Version:
              schema:
                type: string
            X-Rafflesia-Runner-Hints:
              schema:
                type: string
            X-Rafflesia-Served-From:
              schema:
                type: string
            X-Request-ID:
              schema:
                type: string
        '502':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExecutionEnvelopeFileUpload'
          description: Bad Gateway
          headers:
            Rafflesia-Contract-Digest:
              schema:
                type: string
            Rafflesia-Error-Type:
              schema:
                type: string
            Rafflesia-Retryable:
              schema:
                enum:
                  - 'true'
                  - 'false'
                type: string
            Rafflesia-Version:
              schema:
                type: string
            Retry-After:
              schema:
                type: string
            X-Rafflesia-Runner-Hints:
              schema:
                type: string
            X-Rafflesia-Served-From:
              schema:
                type: string
            X-Request-ID:
              schema:
                type: string
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExecutionEnvelopeFileUpload'
          description: Service Unavailable
          headers:
            Rafflesia-Contract-Digest:
              schema:
                type: string
            Rafflesia-Error-Type:
              schema:
                type: string
            Rafflesia-Retryable:
              schema:
                enum:
                  - 'true'
                  - 'false'
                type: string
            Rafflesia-Version:
              schema:
                type: string
            Retry-After:
              schema:
                type: string
            X-Rafflesia-Runner-Hints:
              schema:
                type: string
            X-Rafflesia-Served-From:
              schema:
                type: string
            X-Request-ID:
              schema:
                type: string
        '504':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExecutionEnvelopeFileUpload'
          description: Gateway Timeout
          headers:
            Rafflesia-Contract-Digest:
              schema:
                type: string
            Rafflesia-Error-Type:
              schema:
                type: string
            Rafflesia-Request-Timeout-Type:
              schema:
                enum:
                  - user
                type: string
            Rafflesia-Retryable:
              schema:
                enum:
                  - 'true'
                  - 'false'
                type: string
            Rafflesia-Version:
              schema:
                type: string
            Retry-After:
              schema:
                type: string
            X-Rafflesia-Runner-Hints:
              schema:
                type: string
            X-Rafflesia-Served-From:
              schema:
                type: string
            X-Request-ID:
              schema:
                type: string
      x-codeSamples:
        - lang: bash
          source: |
            curl --request POST \
              --url "https://api.rafflesia.ai/v1/files" \
              --header "Authorization: Bearer $RAFFLESIA_API_KEY" \
              --header "Content-Type: application/octet-stream" \
              --data-binary @<file-path>
components:
  schemas:
    ExecutionEnvelopeFileUpload:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
            - https://example.com/schemas/ExecutionEnvelopeFileUpload.json
          format: uri
          readOnly: true
          type: string
        data:
          $ref: '#/components/schemas/FileUpload'
          description: Operation result data. Absent when the operation did not succeed.
        error:
          $ref: '#/components/schemas/ExecutionAPIError'
          description: Structured execution 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
    FileUpload:
      additionalProperties: false
      properties:
        url:
          format: uri
          type: string
      required:
        - url
      type: object
    ExecutionAPIError:
      additionalProperties: false
      properties:
        code:
          description: Stable specific error code. Branch on this value instead of message.
          type: string
        details:
          additionalProperties: {}
          description: Additional structured error details retained for compatibility.
          type: object
        doc_url:
          description: Stable documentation URL for this error code.
          type: string
        errors:
          description: >-
            One or more exact validation or execution failures. Machine logic
            should use type, loc, and ctx; msg is for people.
          items:
            $ref: '#/components/schemas/APIErrorDetail'
          type: array
        is_retryable:
          description: >-
            Whether retrying the identical pinned request may succeed without
            changing its input.
          type: boolean
        message:
          description: Human-readable actionable explanation. Do not parse this value.
          type: string
        param:
          description: Request field responsible for the error when known.
          type: string
        request_id:
          description: Request identifier to provide when reporting this occurrence.
          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
        - is_retryable
      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
    APIErrorDetail:
      additionalProperties: false
      properties:
        ctx:
          additionalProperties: {}
          description: Structured constraint or failure context.
          type: object
        input:
          description: Offending non-sensitive scalar when it is safe and useful to echo.
        loc:
          description: >-
            Path to the failing value, beginning with body, query, path, or
            header.
          items:
            type: string
          type: array
        msg:
          description: Human-readable explanation. Do not parse this value.
          type: string
        type:
          description: Stable machine-readable failure type.
          type: string
        url:
          description: Documentation URL for this failure type.
          type: string
      required:
        - loc
        - msg
        - type
        - url
      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
  securitySchemes:
    bearerAuth:
      description: 'A Rafflesia API key, sent as `Authorization: Bearer <key>`.'
      scheme: bearer
      type: http

````