> ## 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.

# Send Agent Message

> Start a Krea Agent session or send a follow-up turn by passing sessionId. Returns immediately while the Agent works in the background. Sessions are visible at the returned url and billed to the workspace's compute unit balance. The Agent does not ask questions, and cost and permission prompts are approved automatically: include all requirements in the prompt. A session runs one turn at a time. Attachments accept http(s) URLs and authorized Krea Files URIs (file:<uuid>). Model pins must be included in the workspace plan.



## OpenAPI

````yaml https://api.krea.ai/openapi.json post /agent/send-message
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: Utilities
    description: Miscellaneous utility endpoints
paths:
  /agent/send-message:
    post:
      tags:
        - Agent
      summary: Send Agent Message
      description: >-
        Start a Krea Agent session or send a follow-up turn by passing
        sessionId. Returns immediately while the Agent works in the background.
        Sessions are visible at the returned url and billed to the workspace's
        compute unit balance. The Agent does not ask questions, and cost and
        permission prompts are approved automatically: include all requirements
        in the prompt. A session runs one turn at a time. Attachments accept
        http(s) URLs and authorized Krea Files URIs (file:<uuid>). Model pins
        must be included in the workspace plan.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                sessionId:
                  description: >-
                    Omit to start a new session; pass an existing id to continue
                    it
                  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)$
                prompt:
                  default: ''
                  type: string
                  maxLength: 100000
                attachments:
                  default: []
                  description: >-
                    Transfer reference files that are not otherwise accessible
                    to the Agent here. Usable URLs in the prompt, existing Krea
                    context, and prior session files need not be repeated in
                    attachments. The Agent does not inherit your conversation or
                    attachments. Mentioning OpenAI file_ IDs in prompt text does
                    not transfer their bytes, and those IDs cannot be converted
                    to Krea file URIs.
                  maxItems: 20
                  type: array
                  items:
                    type: object
                    properties:
                      url:
                        anyOf:
                          - type: string
                            format: uri
                          - type: string
                            pattern: >-
                              ^(file):([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$
                        description: >-
                          An accessible http(s) URL, or an authorized Krea Files
                          URI "file:<uuid>" from list_files or write_files.
                          OpenAI file_ IDs and caller-local paths are not
                          supported; transfer the actual file first.
                      name:
                        type: string
                        minLength: 1
                        maxLength: 255
                      contentType:
                        type: string
                        minLength: 1
                        maxLength: 255
                    required:
                      - url
                model:
                  description: >-
                    Pin an LLM. Omit for Auto. Must be included in the workspace
                    plan.
                  type: string
                  enum:
                    - openai/gpt-6-astra
                    - openai/gpt-6.1-sol
                    - openai/gpt-6-sol
                    - openai/gpt-6-luna
                    - openai/gpt-5.6-sol
                    - openai/gpt-5.6-terra
                    - openai/gpt-5.6-luna
                    - openai/gpt-5.5
                    - anthropic/claude-opus-5.5
                    - anthropic/claude-opus-5
                    - anthropic/claude-fable-5.1
                    - anthropic/claude-fable-5
                    - anthropic/claude-opus-4.8
                    - anthropic/claude-sonnet-5
                    - anthropic/claude-sonnet-4.5
                    - anthropic/claude-opus-4.5
                    - google/gemini-4-argon
                    - google/gemini-3.8-flash
                    - google/gemini-3.5-flash
                    - google/gemini-3.5-flash-lite
                    - google/gemini-3.1-pro-preview
                    - google/gemini-3.1-flash-lite
                    - google/gemini-2.5-flash-lite
                    - xai/grok-4.5
                    - zai/glm-5.2
                    - moonshotai/kimi-k3
                effort:
                  type: string
                  enum:
                    - fast
                    - default
                    - high
                    - xhigh
                name:
                  description: Session name, new sessions only
                  type: string
                  minLength: 1
                  maxLength: 120
                desktopAppId:
                  description: >-
                    An appId from list_desktop_apps. The Agent then works inside
                    that desktop app for this turn.
                  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)$
      responses:
        '200':
          description: The Agent session result.
          content:
            application/json:
              schema:
                type: object
                properties:
                  sessionId:
                    type: string
                  threadId:
                    type: string
                  runId:
                    type: string
                  status:
                    type: string
                    enum:
                      - running
                  url:
                    type: string
                required:
                  - sessionId
                  - threadId
                  - runId
                  - status
                  - url
        '400':
          description: Invalid JSON body.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
                  allowedModels:
                    type: array
                    items:
                      type: string
                required:
                  - error
                additionalProperties: false
        '401':
          description: Authentication required.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
                  allowedModels:
                    type: array
                    items:
                      type: string
                required:
                  - error
                additionalProperties: false
        '402':
          description: Insufficient compute unit balance or free message limit reached.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
                  allowedModels:
                    type: array
                    items:
                      type: string
                required:
                  - error
                additionalProperties: false
        '403':
          description: The requested model is not included in the workspace plan.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
                  allowedModels:
                    type: array
                    items:
                      type: string
                required:
                  - error
                additionalProperties: false
        '404':
          description: Session or attachment not found or not accessible.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
                  allowedModels:
                    type: array
                    items:
                      type: string
                required:
                  - error
                additionalProperties: false
        '409':
          description: A turn is already in progress.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
                  allowedModels:
                    type: array
                    items:
                      type: string
                required:
                  - error
                additionalProperties: false
        '422':
          description: Invalid input or desktop app unavailable.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
                  allowedModels:
                    type: array
                    items:
                      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.