v29

latestOpenAPI 3.1.0raw.githubusercontent.com2026-03-233765161.7 KB
v1 chat

Unified Chat Completions

Unified generation endpoint that accepts the Universal Schema plus configuration objects for any outputs (Text, Image, Audio, or all at once).

This is the "Omni" endpoint for the Elicit Labs Modal System.
It acts as a thin orchestrator:

**Flow:**
1. Extracts text + multimodal content from the messages array
2. Classifies the desired output modality via LLM (text / image / audio / agent)
3. Delegates to the appropriate handler:
   - text  → POST /v1/text/generations
   - image → POST /v1/images/generations
   - audio → POST /v1/audio/generations
   - agent → Agent tool-calling loop (multi-step orchestration)
4. Returns unified response with text + optional image/audio

All validation, memory retrieval, and generation logic lives in the
dedicated routers. This endpoint just classifies and dispatches.

**Authentication**: Requires valid API key or JWT token
post/v1/chat/completions

Request body

user_idstring required

The end-user ID

project_idstring nullable

The project ID

persona_idstring nullable

The specific system persona/voice to use

disabled_learningboolean

If true, this request is ignored by long-term memory

use_reasoningboolean

Enable Chain-of-Thought/Reasoning steps before answering

max_reasoning_iterationsinteger

Max reasoning steps if reasoning is enabled

streamboolean

Enable streaming response (SSE)

agent_modeboolean

Enable agent mode for multi-step tool-calling workflows. When True (or when the classifier detects agentic intent), the request is handled by the agent service which can orchestrate memory retrieval, video analysis, segmentation, image generation, and more.

auto_detect_agentboolean

When True (default), the modality classifier may auto-route to agent mode even if not explicitly requested. Set to False for deterministic routing (e.g. Instagram integration) where you want only the modalities you specify.

load_historyboolean

When True, loads prior conversation turns from the database using session_id and prepends them to messages. Use this for stateless callers (e.g. Instagram webhooks) that send only the latest message and rely on server-side history. Requires session_id to be set.

history_limitinteger

Maximum number of prior turns to load when load_history is True

modalitiesstring[]

List of desired outputs: 'text', 'image', 'audio'. When 'agent' is included or agent_mode is True, the agent loop handles the request.

modelstring

LLM model to use for generation

session_idstring nullable

Session ID for conversation context

skip_initial_retrievalboolean

When True, the agent skips the automatic memory retrieval at the start of each turn. Use this when the caller has already embedded user context in the system prompt (e.g. Instagram integration) and wants the agent to retrieve memories on-demand via the tool instead.

video_refsobject nullable

Map of video labels (video_0, video_1, …) to GCS S3 keys from conversation history.

Example request

{
  "summary": "Text-only chat",
  "value": {
    "messages": [
      {
        "content": "You are a helpful assistant.",
        "role": "system"
      },
      {
        "content": "Hello, how are you?",
        "role": "user"
      }
    ],
    "modalities": [
      "text"
    ],
    "model": "gpt-4.1-mini",
    "project_id": "proj_ABC",
    "user_id": "user_123"
  }
}

Response

Successful Response

session_idstring required

Session ID for conversation context

agent_traceobject[] nullable

Agent execution trace — present only when the request was handled by the agent service

Example response

{
  "assistant_output": {
    "image_base64": "<base64_encoded_image>"
  },
  "messages": [
    {
      "content": "Create an image of a sunset over mountains",
      "role": "user"
    },
    {
      "content": [
        {
          "content": "<base64_encoded_image>",
          "type": "image"
        }
      ],
      "role": "assistant"
    }
  ],
  "session_id": "550e8400-e29b-41d4-a716-446655440000"
}