> ## Documentation Index
> Fetch the complete documentation index at: https://magica-adi.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create an empty chat

> Optional. To send a first message without this step, use `POST /completions` and omit `chatId`.



## OpenAPI

````yaml /openapi.yaml post /chats
openapi: 3.1.0
info:
  title: Galaxy Agent API
  version: 1.0.0
  description: |
    Public REST for agent chats, Magica tools, and run status.
    Authenticate with `Authorization: Bearer gxk_live_…`.
servers:
  - url: https://magica-backend-oda9.onrender.com/api/v1
    description: Production
  - url: http://localhost:4000/api/v1
    description: Local
security:
  - bearerAuth: []
tags:
  - name: Chats
  - name: Messages
  - name: Runs
  - name: Magica
paths:
  /chats:
    post:
      tags:
        - Chats
      summary: Create an empty chat
      description: >-
        Optional. To send a first message without this step, use `POST
        /completions` and omit `chatId`.
      operationId: createChat
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                  maxLength: 120
      responses:
        '201':
          description: Created chat
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Chat'
components:
  schemas:
    Chat:
      type: object
      required:
        - id
        - title
        - isFavorite
        - lastMessageAt
        - lastMessageId
        - createdAt
        - updatedAt
      properties:
        id:
          type: string
          format: uuid
        title:
          type: string
        isFavorite:
          type: boolean
        lastMessageAt:
          type: string
          format: date-time
        lastMessageId:
          type: string
          format: uuid
          nullable: true
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key created in the product. Shown once, prefix `gxk_live_`.

````

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