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

# Create and start thread

> Create a new captain thread and immediately start execution, optionally assigning existing project tags.



## OpenAPI

````yaml POST /v1/threads
openapi: 3.1.0
info:
  title: Capy API
  version: 1.0.0
servers:
  - url: https://capy.ai/api
security:
  - bearerAuth: []
tags:
  - name: threads
  - name: sessions
  - name: tasks
  - name: projects
  - name: tags
  - name: models
  - name: usage
  - name: setup
  - name: snapshots
  - name: browser-snapshots
  - name: environment-variables
  - name: automations
paths:
  /v1/threads:
    post:
      tags:
        - threads
      summary: Create and start thread
      description: >-
        Create a new captain thread and immediately start execution, optionally
        assigning existing project tags.
      operationId: createAndStartThread
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateThreadBody'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateThreadResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/ValidationError'
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - bearerAuth: []
components:
  schemas:
    CreateThreadBody:
      $schema: https://json-schema.org/draft/2020-12/schema
      type: object
      properties:
        projectId:
          type: string
        impersonateUserEmail:
          type: string
          format: email
          pattern: >-
            ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
        prompt:
          type: string
          minLength: 1
        model:
          type: string
          enum:
            - claude-opus-4-8
            - claude-opus-4-7
            - claude-opus-4-6
            - claude-opus-4-5
            - claude-sonnet-4-6
            - claude-haiku-4-5
            - gpt-5.5
            - gpt-5.5-pro
            - gpt-5.4
            - gpt-5.4-mini
            - gpt-5.3-codex
            - gpt-5.3-codex-spark
            - gemini-3.1-pro-preview
            - gemini-3-flash-preview
            - grok-4-1-fast
            - glm-5.2
            - glm-5.1
            - glm-5v-turbo
            - glm-5
            - deepseek-v4-pro
            - glm-5-turbo
            - glm-4.7
            - kimi-k2.7-code
            - kimi-k2.6
            - qwen3-coder
            - claude-fable-5
        speed:
          type: string
          enum:
            - fast
            - standard
        reasoning:
          type: object
          properties:
            mode:
              type: string
              enum:
                - 'off'
                - 'on'
                - none
                - minimal
                - low
                - medium
                - high
                - xhigh
                - max
          required:
            - mode
          additionalProperties: false
        buildModel:
          type: string
          enum:
            - claude-opus-4-8
            - claude-opus-4-7
            - claude-opus-4-6
            - claude-opus-4-5
            - claude-sonnet-4-6
            - claude-haiku-4-5
            - gpt-5.5
            - gpt-5.5-pro
            - gpt-5.4
            - gpt-5.4-mini
            - gpt-5.3-codex
            - gpt-5.3-codex-spark
            - gemini-3.1-pro-preview
            - gemini-3-flash-preview
            - grok-4-1-fast
            - glm-5.2
            - glm-5.1
            - glm-5v-turbo
            - glm-5
            - deepseek-v4-pro
            - glm-5-turbo
            - glm-4.7
            - kimi-k2.7-code
            - kimi-k2.6
            - qwen3-coder
            - claude-fable-5
        buildSpeed:
          type: string
          enum:
            - fast
            - standard
        buildReasoning:
          type: object
          properties:
            mode:
              type: string
              enum:
                - 'off'
                - 'on'
                - none
                - minimal
                - low
                - medium
                - high
                - xhigh
                - max
          required:
            - mode
          additionalProperties: false
        repos:
          type: array
          items:
            type: object
            properties:
              repoFullName:
                type: string
              branch:
                type: string
            required:
              - repoFullName
              - branch
            additionalProperties: false
        browserSnapshotIds:
          type: array
          items:
            type: string
        attachmentUrls:
          type: array
          items:
            type: string
            format: uri
        tags:
          maxItems: 20
          type: array
          items:
            type: string
            minLength: 1
            maxLength: 64
            pattern: ^[a-z0-9][a-z0-9_-]{0,63}$
        slack:
          type: object
          properties:
            channel:
              type: string
              minLength: 1
          required:
            - channel
          additionalProperties: false
        reliabilityInvestigationId:
          type: string
          pattern: ^rel_[a-f0-9]{40}$
      required:
        - projectId
        - prompt
      additionalProperties: false
    CreateThreadResponse:
      $schema: https://json-schema.org/draft/2020-12/schema
      type: object
      properties:
        id:
          type: string
        projectId:
          type: string
        title:
          anyOf:
            - type: string
            - type: 'null'
        status:
          type: string
          enum:
            - active
            - idle
            - archived
          description: >-
            Coarse Captain run-loop status retained for compatibility. Prefer
            runState/waitingOn/blockedOn for completion and waiting UX.
        runState:
          type: string
          enum:
            - running
            - queued
            - waiting
            - blocked
            - ready
            - archived
          description: Full computed execution state for the agent thread.
        waitingOn:
          type: array
          items:
            type: string
            enum:
              - task
              - review
              - ci
              - timer
              - worker
          description: Async system dependencies expected to continue without user action.
        blockedOn:
          type: array
          items:
            type: string
            enum:
              - auth
              - permission
          description: User/integration gates required before progress can continue.
        pendingWakeups:
          type: integer
          minimum: 0
          maximum: 9007199254740991
          description: Pending append-and-resume notifications waiting to be processed.
        participants:
          type: array
          items:
            type: object
            properties:
              userId:
                type: string
              userType:
                type: string
                enum:
                  - human
                  - service_user
              firstParticipatedAt:
                type: string
              lastParticipatedAt:
                type: string
            required:
              - userId
              - userType
              - firstParticipatedAt
              - lastParticipatedAt
            additionalProperties: false
        tags:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
                minLength: 1
                maxLength: 64
                pattern: ^[a-z0-9][a-z0-9_-]{0,63}$
              color:
                type: string
                enum:
                  - default
                  - primary
                  - success
                  - warning
                  - destructive
                  - blue
                  - purple
                  - pink
                  - orange
                  - lime
            required:
              - name
              - color
            additionalProperties: false
        slack:
          type: object
          properties:
            teamId:
              type: string
            channelId:
              type: string
            threadTs:
              type: string
            url:
              type: string
          required:
            - teamId
            - channelId
            - threadTs
            - url
          additionalProperties: false
        createdAt:
          type: string
      required:
        - id
        - projectId
        - title
        - status
        - runState
        - waitingOn
        - blockedOn
        - pendingWakeups
        - participants
        - tags
        - createdAt
      additionalProperties: false
    ErrorResponse:
      $schema: https://json-schema.org/draft/2020-12/schema
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
            details: {}
          required:
            - code
            - message
          additionalProperties: false
      required:
        - error
      additionalProperties: false
  responses:
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Forbidden:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: Not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    ValidationError:
      description: Validation error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalError:
      description: Internal error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API token (capy_xxxx). Generate at capy.ai/settings/tokens

````