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

# Send Chat Message



## OpenAPI

````yaml /api-v2.json post /sessions/{session_id}/chat
openapi: 3.1.0
info:
  title: Meibel AI API
  summary: Meibel Gateway Service
  description: >-
    Our API allows you to interact with our services. Read the
    [docs](https://docs.meibel.ai) to learn how to use it.
  version: 0.6.4
servers:
  - url: https://api.meibel.ai/v2
    description: Meibel API (v2)
  - url: https://api.dev.meibel.ai/v2
    description: Meibel Dev API (v2)
  - url: http://localhost:8000/v2
    description: Local Development
security: []
tags:
  - name: Datasources
    description: v2 datasource management
  - name: Data Elements
    description: v2 data element CRUD and search
  - name: File Upload
    description: Upload files to a datasource and track upload progress
  - name: Ingest
    description: Trigger and monitor datasource ingestion
  - name: Datasource Downloads
    description: Export all datasource content as a zip archive
  - name: Table Descriptions
    description: v2 table and column descriptions
  - name: Metadata Model Catalog
    description: v2 metadata model catalog
  - name: Confidence Scoring
    description: v2 confidence scoring jobs and summaries
  - name: Documents
    description: Parse and transform documents into structured data
  - name: Agents
    description: Agent definition management
  - name: Sessions
    description: Agent session (execution) management and chat
  - name: Artifact Schemas
    description: Agent artifact schema management
paths:
  /sessions/{session_id}/chat:
    post:
      tags:
        - Sessions
      summary: Send Chat Message
      operationId: sendChatMessage
      parameters:
        - name: session_id
          in: path
          required: true
          schema:
            type: string
            title: Session Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatMessageRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatMessageResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
      x-codeSamples:
        - lang: Python
          label: Python
          source: >-
            from meibel import MeibelClient


            client = MeibelClient(api_key="your-api-key")


            # Create request body

            body = ChatMessageRequest(name="Example")


            result =
            client.agents.sessions.send_chat_message("session_id_value",
            body=body)

            print(result)
        - lang: TypeScript
          label: TypeScript
          source: >-
            import { MeibelClient } from 'meibel';


            const client = new MeibelClient({ apiKey: 'your-api-key' });


            // Create request body

            const body = { name: 'Example' };


            const result = await
            client.agents.sessions.sendChatMessage('session_id_value', body);

            console.log(result);
        - lang: Go
          label: Go
          source: >-
            import v2 "github.com/meibel-ai/meibel-go/v2"


            client := v2.NewClient(v2.WithAPIKey("your-api-key"))

            ctx := context.Background()


            // Create request body

            body := v2.ChatMessageRequest{
                Name: "Example",
            }


            result, err := client.Agents.Sessions.SendChatMessage(ctx,
            "session_id_value", body)

            if err != nil {
                log.Fatal(err)
            }

            fmt.Println(result)
components:
  schemas:
    ChatMessageRequest:
      properties:
        user_message:
          type: string
          title: User Message
          description: The user's chat message
        timeout_seconds:
          anyOf:
            - type: integer
            - type: 'null'
          title: Timeout Seconds
          description: Maximum time to wait for response (seconds)
        include_thinking:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Include Thinking
          description: Whether to include thinking content in response
        include_tool_activity:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Include Tool Activity
          description: Whether to include tool call/result activity
      type: object
      required:
        - user_message
      title: ChatMessageRequest
      description: Request body for chat message endpoints.
    ChatMessageResponse:
      properties:
        signal_id:
          type: string
          title: Signal Id
          description: Unique ID for this message exchange
        response:
          $ref: '#/components/schemas/ChatResponse'
          description: The structured response
        assistant_response:
          type: string
          title: Assistant Response
          description: The assistant response in text-format
        tool_activity:
          anyOf:
            - items:
                $ref: '#/components/schemas/ToolActivity'
              type: array
            - type: 'null'
          title: Tool Activity
          description: Tool calls made during response generation
        thinking:
          anyOf:
            - type: string
            - type: 'null'
          title: Thinking
          description: LLM thinking/reasoning content
        token_usage:
          anyOf:
            - additionalProperties:
                type: integer
              type: object
            - type: 'null'
          title: Token Usage
          description: Token usage statistics
      type: object
      required:
        - signal_id
        - response
        - assistant_response
      title: ChatMessageResponse
      description: Response from the non-streaming chat endpoint.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ChatResponse:
      properties:
        message:
          anyOf:
            - type: string
            - type: 'null'
          title: Message
          default: ''
        sources:
          anyOf:
            - items:
                $ref: '#/components/schemas/Source'
              type: array
            - type: 'null'
          title: Sources
        follow_up_questions:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Follow Up Questions
        call_to_actions:
          anyOf:
            - items:
                $ref: '#/components/schemas/CallToAction'
              type: array
            - type: 'null'
          title: Call To Actions
        artifacts:
          anyOf:
            - items:
                $ref: '#/components/schemas/Artifact'
              type: array
            - type: 'null'
          title: Artifacts
      type: object
      title: ChatResponse
      description: The structured chat response.
    ToolActivity:
      properties:
        tool_id:
          type: string
          title: Tool Id
        tool_name:
          type: string
          title: Tool Name
        arguments:
          additionalProperties: true
          type: object
          title: Arguments
        result:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Result
          description: Optional override for the tool's parameters schema
        timestamp:
          type: string
          title: Timestamp
      type: object
      required:
        - tool_id
        - tool_name
        - arguments
        - timestamp
      title: ToolActivity
      description: Record of a tool call and its result.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    Source:
      properties:
        title:
          type: string
          title: Title
        url:
          anyOf:
            - type: string
            - type: 'null'
          title: Url
        snippet:
          anyOf:
            - type: string
            - type: 'null'
          title: Snippet
        data_element_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Data Element Id
        relevance_score:
          anyOf:
            - type: number
            - type: integer
            - type: 'null'
          title: Relevance Score
      type: object
      required:
        - title
      title: Source
      description: A source/citation in the response.
    CallToAction:
      properties:
        label:
          type: string
          title: Label
        action:
          type: string
          title: Action
        action_data:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Action Data
          description: Optional override for the tool's parameters schema
      type: object
      required:
        - label
        - action
      title: CallToAction
      description: An action the user can take.
    Artifact:
      properties:
        artifact_id:
          type: string
          title: Artifact Id
        filename:
          type: string
          title: Filename
        mime_type:
          type: string
          title: Mime Type
        content:
          anyOf:
            - type: string
            - type: 'null'
          title: Content
        storage_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Storage Url
        size_bytes:
          anyOf:
            - type: integer
            - type: 'null'
          title: Size Bytes
        created_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Created At
      type: object
      required:
        - artifact_id
        - filename
        - mime_type
      title: Artifact
      description: A generated artifact/file from the chat agent.
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: Meibel-API-Key

````