v29

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

Generate Text

Dedicated text generation endpoint using the Universal Schema with flat parameters.

**Universal Base Schema:**
- user_id (str, required): The end-user ID
- project_id (str, required): The project ID
- persona_id (str, optional): The specific system persona/voice to use
- disabled_learning (bool, optional): If true, request is ignored by long-term memory
- use_reasoning (bool, optional): Enable reasoning loop for generation

**Input:**
- text_input (str, optional): The prompt/description for text generation
- session_id (str, optional): Session ID for conversation context

**Reference inputs:**
- image_base64 (str, optional): Base64 encoded reference image for context
- video_base64 (str, optional): Base64 encoded reference video for context
- audio_base64 (str, optional): Base64 encoded reference audio for context

**Text Params (Flat):**
- model (str, optional): LLM model to use (default: gpt-4.1-mini)

**Authentication**: Requires valid API key or JWT token
post/v1/text/generations

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 generation

max_reasoning_iterationsinteger

Max reasoning steps if reasoning is enabled

text_inputstring nullable

The prompt/description for text generation

session_idstring nullable

Session ID for conversation context

image_base64string nullable

Base64 encoded reference image for context

video_base64string nullable

Base64 encoded reference video for context

audio_base64string nullable

Base64 encoded reference audio for context

modelstring

LLM model to use for generation

output_schemaobject nullable

Optional JSON Schema describing the desired output structure. When provided, the LLM is forced to return a JSON object matching this schema instead of free-form text. The result is returned in the 'structured_output' field of the response.

Example request

{
  "model": "gpt-4.1-mini",
  "project_id": "proj_ABC",
  "text_input": "Write a blog post about AI",
  "use_reasoning": false,
  "user_id": "user_123"
}

Response

Successful Response

textstring nullable

Generated text response (when no output_schema is provided)

structured_outputobject nullable

Structured JSON output matching the requested output_schema (when output_schema is provided)

successboolean

Whether the request succeeded