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

# Start Bot Chat

> Open a chat. One bot, no `title` and no members: the caller's direct chat with the bot, reused when it exists. A `title`, several `bot_ids` or any `member_ids` make a new group chat. A `message` starts the first turn, billed to the workspace's compute units like a turn in the app. In a group it goes to the bots it names as `@Name`, or to the lead when it names none.



## OpenAPI

````yaml https://api.krea.ai/openapi.json post /bots/chats
openapi: 3.1.0
info:
  title: Krea API
  version: v1
servers:
  - url: https://api.krea.ai
    description: Krea API
security:
  - bearerAuth: []
tags:
  - name: General
    description: Core API operations including job management and billing information
  - name: Krea
    description: Krea-owned generation models including Krea 2
  - name: Assets
    description: >-
      Asset management endpoints for uploading and managing images, videos,
      audio files, and 3D models
  - name: Styles
    description: Style (LoRA) generation and management endpoints
  - name: Node Apps
    description: Executing custom node apps built in our nodes tool
  - name: Image
    description: Image generation endpoints
  - name: Image Enhance
    description: Image enhance endpoints
  - name: Video
    description: Video generation endpoints
  - name: Video Enhance
    description: Video enhance and upscale endpoints
  - name: 3D
    description: 3D model generation endpoints
  - name: Audio
    description: Speech and audio generation endpoints
  - name: Usage
    description: Workspace usage reporting
  - name: Agent
    description: Krea Agent sessions
  - name: Bots
    description: 'Krea Bots: chats with the bots in a workspace'
  - name: Utilities
    description: Miscellaneous utility endpoints
paths:
  /bots/chats:
    post:
      tags:
        - Bots
      summary: Start Bot Chat
      description: >-
        Open a chat. One bot, no `title` and no members: the caller's direct
        chat with the bot, reused when it exists. A `title`, several `bot_ids`
        or any `member_ids` make a new group chat. A `message` starts the first
        turn, billed to the workspace's compute units like a turn in the app. In
        a group it goes to the bots it names as `@Name`, or to the lead when it
        names none.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                bot_id:
                  description: A bot from `GET /bots`.
                  type: string
                  format: uuid
                  pattern: >-
                    ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                bot_ids:
                  default: []
                  description: >-
                    Several bots, for a group chat. The first leads: it answers
                    a message that names no bot. Pass this, `bot_id`, or both.
                  maxItems: 20
                  type: array
                  items:
                    type: string
                    format: uuid
                    pattern: >-
                      ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                member_ids:
                  default: []
                  description: >-
                    People in the workspace to bring into the chat, by user id.
                    Every bot in the chat has to be shared with the workspace,
                    or owned by the one person it is not shared with.
                  maxItems: 50
                  type: array
                  items:
                    type: string
                    format: uuid
                    pattern: >-
                      ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                message:
                  default: ''
                  description: >-
                    The first message. Without one, a new chat opens with the
                    bot saying hi.
                  type: string
                  maxLength: 8000
                title:
                  description: >-
                    Opens a new chat with this name. Without a title, one bot
                    and no members, the request opens the caller's one direct
                    chat with the bot, which is reused when it already exists.
                  type: string
                  minLength: 1
                  maxLength: 80
                attachments:
                  default: []
                  maxItems: 10
                  type: array
                  items:
                    type: object
                    properties:
                      url:
                        type: string
                        minLength: 1
                        maxLength: 2048
                        description: >-
                          An `http(s)` URL, such as an asset URL from `/assets`,
                          or a Krea Files URI `file:<uuid>`.
                      name:
                        type: string
                        minLength: 1
                        maxLength: 255
                      content_type:
                        type: string
                        minLength: 1
                        maxLength: 255
                    required:
                      - url
                    additionalProperties: false
                idempotency_key:
                  description: >-
                    A key of your choosing that names this request. Repeating
                    the request with the same key, for example after a timeout,
                    sends nothing again: it answers with the same chat, message
                    and cursor as the first. A start without a message sends
                    nothing either way, and its cursor always follows your
                    newest message.
                  type: string
                  minLength: 1
                  maxLength: 200
              additionalProperties: false
      responses:
        '201':
          description: The chat, and where to read from.
          content:
            application/json:
              schema:
                type: object
                properties:
                  chat_id:
                    type: string
                  title:
                    type: string
                  message_id:
                    anyOf:
                      - type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                      - type: 'null'
                    description: >-
                      The message just sent. Null when a chat was opened without
                      one.
                  cursor:
                    type: string
                    description: Pass to `GET /bots/chats/{chat_id}/messages`.
                  bots:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        name:
                          type: string
                        role:
                          type: string
                          description: What it does, in a few words.
                        description:
                          type: string
                        color:
                          type: string
                          description: Its body color as a hex string.
                        owner:
                          type: object
                          properties:
                            id:
                              type: string
                            name:
                              type: string
                          required:
                            - id
                            - name
                          additionalProperties: false
                        is_owner:
                          type: boolean
                        shared:
                          type: boolean
                          description: Shared with everyone in the workspace.
                        status:
                          type: string
                          enum:
                            - idle
                            - working
                      required:
                        - id
                        - name
                        - role
                        - description
                        - color
                        - owner
                        - is_owner
                        - shared
                        - status
                      additionalProperties: false
                  url:
                    type: string
                required:
                  - chat_id
                  - title
                  - message_id
                  - cursor
                  - bots
                  - url
                additionalProperties: false
        '400':
          description: Invalid JSON body, or a request the chat refuses.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
                  required_plan:
                    type: string
                required:
                  - error
                additionalProperties: false
        '401':
          description: Authentication required.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
                  required_plan:
                    type: string
                required:
                  - error
                additionalProperties: false
        '403':
          description: >-
            Bots is not included in the workspace plan, not open to this
            account, or the caller may not make this change to the chat.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
                  required_plan:
                    type: string
                required:
                  - error
                additionalProperties: false
        '404':
          description: Bot, chat, question or attachment not found or not accessible.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
                  required_plan:
                    type: string
                required:
                  - error
                additionalProperties: false
        '409':
          description: The chat changed under the request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
                  required_plan:
                    type: string
                required:
                  - error
                additionalProperties: false
        '422':
          description: Invalid input.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
                  required_plan:
                    type: string
                required:
                  - error
                additionalProperties: false
        '429':
          description: Too many requests.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
                  required_plan:
                    type: string
                required:
                  - error
                additionalProperties: false
components:
  securitySchemes:
    bearerAuth:
      scheme: bearer
      bearerFormat: Bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.