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

# Generate a seed

> Describes the starting state you want and answers immediately; a worker expands it into rows. Read the seed until it is `ready`, then pass its id as a twin's `seed` when you create an environment.



## OpenAPI

````yaml https://api.twinbay.ai/openapi.json post /seeds
openapi: 3.1.0
info:
  title: Twinbay
  description: Backend API
  version: 0.1.0
servers:
  - url: https://api.twinbay.ai
    description: Production
security: []
tags:
  - name: healthchecks
    description: Healthcheck endpoints
  - name: users
    description: >-
      The current user. Sign-up and sign-in happen in WorkOS AuthKit, which
      issues the access tokens this API accepts.
  - name: organizations
    description: >-
      Organizations the caller belongs to. Every authenticated request acts
      inside exactly one organization — the one its access token names — so
      these routes address it as `current`.
  - name: api-keys
    description: >-
      Long-lived credentials for callers that cannot hold an AuthKit session —
      agents, SDKs, CI. A key is accepted wherever an access token is, and acts
      with the role its creator holds when the request arrives.
  - name: environments
    description: >-
      Create and edit isolated provider environments. Each environment contains
      behavioural twins from the `twins` package.
  - name: twins
    description: Browse the digital twins available for new environments.
  - name: seeds
    description: >-
      Starting states for a twin. Describe the data you want in your own words,
      and a worker expands it into rows once; pass the seed's id when you create
      an environment to start a twin holding it.
paths:
  /seeds:
    post:
      tags:
        - seeds
      summary: Generate a seed
      description: >-
        Describes the starting state you want and answers immediately; a worker
        expands it into rows. Read the seed until it is `ready`, then pass its
        id as a twin's `seed` when you create an environment.
      operationId: create_seed
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSeedRequest'
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SeedResponse'
        '401':
          description: The credential is missing, malformed, expired, or not trusted
        '403':
          description: The credential does not act inside an organization
        '404':
          description: Unknown twin
        '422':
          description: This twin cannot be seeded
        '503':
          description: Seed generation is not configured
      security:
        - Access token: []
        - Organization API key: []
components:
  schemas:
    CreateSeedRequest:
      properties:
        name:
          type: string
          maxLength: 100
          minLength: 1
          title: Name
          description: Display name of the seed
        twin:
          type: string
          maxLength: 100
          minLength: 1
          title: Twin
          description: Slug of the twin this seed is for
        prompt:
          type: string
          maxLength: 2000
          minLength: 1
          title: Prompt
          description: >-
            The starting state you want, in your own words. "50 open tickets,
            half of them aging past 90 days."
      additionalProperties: false
      type: object
      required:
        - name
        - twin
        - prompt
      title: CreateSeedRequest
    SeedResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        name:
          type: string
          title: Name
        twin:
          type: string
          title: Twin
          description: The twin this seed can be loaded into.
        prompt:
          type: string
          title: Prompt
          description: The starting state this seed was asked for.
        status:
          type: string
          title: Status
          description: pending, running, ready or failed
        failure:
          anyOf:
            - type: string
            - type: 'null'
          title: Failure
          description: Why generation failed, if it did.
        twin_version:
          anyOf:
            - type: string
            - type: 'null'
          title: Twin Version
          description: The release this seed was generated against.
        usable:
          type: boolean
          title: Usable
          description: >-
            Whether the twin's current release can still load this seed. False
            means the twin's storage changed since it was generated, so it has
            to be generated again.
        size_bytes:
          anyOf:
            - type: integer
            - type: 'null'
          title: Size Bytes
        created_at:
          type: string
          format: date-time
          title: Created At
        completed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Completed At
      type: object
      required:
        - id
        - name
        - twin
        - prompt
        - status
        - usable
        - created_at
      title: SeedResponse
  securitySchemes:
    Access token:
      type: http
      description: Access token issued by WorkOS AuthKit.
      scheme: bearer
    Organization API key:
      type: apiKey
      description: >-
        An organization API key. Create one at
        https://console.twinbay.ai/api-keys
      in: header
      name: X-API-Key

````