{
"openapi": "3.1.0",
"info": {
"title": "Lonestone API",
"description": "The Lonestone API description",
"version": "1.0",
"contact": {}
},
"tags": [
{
"name": "@lonestone",
"description": ""
}
],
"servers": [],
"paths": {
"/api": {
"get": {
"operationId": "AppController_getHello",
"tags": ["App"],
"parameters": [],
"responses": {
"200": {
"description": ""
}
}
}
},
"/api/posts/{postSlug}/comments": {
"post": {
"operationId": "CommentsController_createComment",
"tags": ["Comments"],
"parameters": [
{
"name": "postSlug",
"required": true,
"in": "path",
"schema": {
"type": "string"
}
}
],
"requestBody": {
"required": true,
"description": "Schema for creating a comment",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"content": {
"type": "string",
"minLength": 1,
"maxLength": 1000
},
"parentId": {
"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)$"
}
},
"required": ["content"],
"additionalProperties": false,
"title": "CreateCommentSchema",
"description": "Schema for creating a comment"
}
}
}
},
"responses": {
"200": {
"description": "Schema for a comment",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CommentSchema"
}
}
}
}
}
},
"get": {
"operationId": "CommentsController_getComments",
"tags": ["Comments"],
"parameters": [
{
"name": "filter",
"required": false,
"in": "query",
"schema": {
"$ref": "#/components/schemas/CommentsController_getComments_filterArray"
},
"description": "Filtering query string, in the format of \"property:rule[:value];property:rule[:value];...\"\n
Available rules: eq, neq, gt, gte, lt, lte, like, nlike, in, nin, isnull, isnotnull \n
Available properties: content",
"style": "form",
"explode": false
},
{
"name": "sort",
"required": false,
"in": "query",
"schema": {
"$ref": "#/components/schemas/CommentsController_getComments_sortArray"
},
"description": "Schema for sorting items",
"style": "form",
"explode": false
},
{
"name": "offset",
"required": true,
"in": "query",
"schema": {
"default": 0,
"description": "Starting position of the query",
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
{
"name": "pageSize",
"required": true,
"in": "query",
"schema": {
"default": 20,
"description": "Number of items to return",
"type": "integer",
"minimum": 1,
"maximum": 100
}
},
{
"name": "postSlug",
"required": true,
"in": "path",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Schema for a paginated list of comments",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CommentsSchema"
}
}
}
}
}
}
},
"/api/posts/{postSlug}/comments/count": {
"get": {
"operationId": "CommentsController_getCommentCount",
"tags": ["Comments"],
"parameters": [
{
"name": "postSlug",
"required": true,
"in": "path",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": ""
}
}
}
},
"/api/posts/{postSlug}/comments/{commentId}/replies": {
"get": {
"operationId": "CommentsController_getCommentReplies",
"tags": ["Comments"],
"parameters": [
{
"name": "sort",
"required": false,
"in": "query",
"schema": {
"$ref": "#/components/schemas/CommentsController_getCommentReplies_sortArray"
},
"description": "Schema for sorting items",
"style": "form",
"explode": false
},
{
"name": "offset",
"required": true,
"in": "query",
"schema": {
"default": 0,
"description": "Starting position of the query",
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
{
"name": "pageSize",
"required": true,
"in": "query",
"schema": {
"default": 20,
"description": "Number of items to return",
"type": "integer",
"minimum": 1,
"maximum": 100
}
},
{
"name": "commentId",
"required": true,
"in": "path",
"schema": {
"type": "string"
}
},
{
"name": "postSlug",
"required": true,
"in": "path",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Schema for a paginated list of comments",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CommentsSchema"
}
}
}
}
}
}
},
"/api/posts/{postSlug}/comments/{commentId}": {
"delete": {
"operationId": "CommentsController_deleteComment",
"tags": ["Comments"],
"parameters": [
{
"name": "commentId",
"required": true,
"in": "path",
"schema": {
"type": "string"
}
},
{
"name": "postSlug",
"required": true,
"in": "path",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": ""
}
}
}
},
"/api/admin/posts": {
"post": {
"operationId": "PostController_createPost",
"tags": ["Admin Posts"],
"parameters": [],
"requestBody": {
"required": true,
"description": "Schema for creating/updating a post",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"title": {
"type": "string",
"minLength": 1
},
"content": {
"type": "array",
"items": {
"oneOf": [
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "text"
},
"data": {
"type": "string"
}
},
"required": ["type", "data"],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "image"
},
"data": {
"type": "string"
}
},
"required": ["type", "data"],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "video"
},
"data": {
"type": "string"
}
},
"required": ["type", "data"],
"additionalProperties": false
}
],
"title": "PostContentSchema",
"description": "Schema for content items (text, image, video)",
"type": "object"
}
},
"coverImage": {
"type": "string",
"format": "uri"
},
"tags": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": ["title", "content"],
"additionalProperties": false,
"title": "CreatePostSchema",
"description": "Schema for creating/updating a post"
}
}
}
},
"responses": {
"200": {
"description": "Schema for a user's post",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserPostSchema"
}
}
}
}
}
},
"get": {
"operationId": "PostController_getUserPosts",
"tags": ["Admin Posts"],
"parameters": [
{
"name": "filter",
"required": false,
"in": "query",
"schema": {
"$ref": "#/components/schemas/PostController_getUserPosts_filterArray"
},
"description": "Filtering query string, in the format of \"property:rule[:value];property:rule[:value];...\"\n
Available rules: eq, neq, gt, gte, lt, lte, like, nlike, in, nin, isnull, isnotnull \n
Available properties: title, tag",
"style": "form",
"explode": false
},
{
"name": "sort",
"required": false,
"in": "query",
"schema": {
"$ref": "#/components/schemas/PostController_getUserPosts_sortArray"
},
"description": "Schema for sorting items",
"style": "form",
"explode": false
},
{
"name": "offset",
"required": true,
"in": "query",
"schema": {
"default": 0,
"description": "Starting position of the query",
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
{
"name": "pageSize",
"required": true,
"in": "query",
"schema": {
"default": 20,
"description": "Number of items to return",
"type": "integer",
"minimum": 1,
"maximum": 100
}
}
],
"responses": {
"200": {
"description": "Schema for a list of user's posts",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserPostsSchema"
}
}
}
}
}
}
},
"/api/admin/posts/{id}": {
"put": {
"operationId": "PostController_updatePost",
"tags": ["Admin Posts"],
"parameters": [
{
"name": "id",
"required": true,
"in": "path",
"schema": {
"type": "string"
}
}
],
"requestBody": {
"required": true,
"description": "Schema for updating a post",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"title": {
"type": "string",
"minLength": 1
},
"content": {
"type": "array",
"items": {
"oneOf": [
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "text"
},
"data": {
"type": "string"
}
},
"required": ["type", "data"],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "image"
},
"data": {
"type": "string"
}
},
"required": ["type", "data"],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "video"
},
"data": {
"type": "string"
}
},
"required": ["type", "data"],
"additionalProperties": false
}
],
"title": "PostContentSchema",
"description": "Schema for content items (text, image, video)",
"type": "object"
}
},
"coverImage": {
"type": "string",
"format": "uri"
},
"tags": {
"type": "array",
"items": {
"type": "string"
}
}
},
"additionalProperties": false,
"title": "UpdatePostSchema",
"description": "Schema for updating a post"
}
}
}
},
"responses": {
"200": {
"description": "Schema for a user's post",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserPostSchema"
}
}
}
}
}
},
"get": {
"operationId": "PostController_getUserPost",
"tags": ["Admin Posts"],
"parameters": [
{
"name": "id",
"required": true,
"in": "path",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Schema for a user's post",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserPostSchema"
}
}
}
}
}
}
},
"/api/admin/posts/{id}/publish": {
"patch": {
"operationId": "PostController_publishPost",
"tags": ["Admin Posts"],
"parameters": [
{
"name": "id",
"required": true,
"in": "path",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": ""
}
}
}
},
"/api/admin/posts/{id}/unpublish": {
"patch": {
"operationId": "PostController_unpublishPost",
"tags": ["Admin Posts"],
"parameters": [
{
"name": "id",
"required": true,
"in": "path",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": ""
}
}
}
},
"/api/public/posts/random": {
"get": {
"operationId": "PublicPostController_getRandomPost",
"tags": ["Public Posts"],
"parameters": [],
"responses": {
"200": {
"description": "A public post",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PublicPostSchema"
}
}
}
}
}
}
},
"/api/public/posts/{slug}": {
"get": {
"operationId": "PublicPostController_getPost",
"tags": ["Public Posts"],
"parameters": [
{
"name": "slug",
"required": true,
"in": "path",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "A public post",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PublicPostSchema"
}
}
}
}
}
}
},
"/api/public/posts": {
"get": {
"operationId": "PublicPostController_getPosts",
"tags": ["Public Posts"],
"parameters": [
{
"name": "filter",
"required": false,
"in": "query",
"schema": {
"$ref": "#/components/schemas/PublicPostController_getPosts_filterArray"
},
"description": "Filtering query string, in the format of \"property:rule[:value];property:rule[:value];...\"\n
Available rules: eq, neq, gt, gte, lt, lte, like, nlike, in, nin, isnull, isnotnull \n
Available properties: title, tag",
"style": "form",
"explode": false
},
{
"name": "sort",
"required": false,
"in": "query",
"schema": {
"$ref": "#/components/schemas/PublicPostController_getPosts_sortArray"
},
"description": "Schema for sorting items",
"style": "form",
"explode": false
},
{
"name": "offset",
"required": true,
"in": "query",
"schema": {
"default": 0,
"description": "Starting position of the query",
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
{
"name": "pageSize",
"required": true,
"in": "query",
"schema": {
"default": 20,
"description": "Number of items to return",
"type": "integer",
"minimum": 1,
"maximum": 100
}
}
],
"responses": {
"200": {
"description": "A list of public posts",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PublicPostsSchema"
}
}
}
}
}
}
},
"/api/public/posts/{slug}/like": {
"post": {
"operationId": "PublicPostController_likePost",
"tags": ["Public Posts"],
"parameters": [
{
"name": "slug",
"required": true,
"in": "path",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "A public post",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PublicPostSchema"
}
}
}
}
}
}
},
"/api/public/authors/{slug}/posts": {
"get": {
"operationId": "PublicAuthorController_getAuthorPosts",
"tags": ["Public Authors"],
"parameters": [
{
"name": "sort",
"required": false,
"in": "query",
"schema": {
"$ref": "#/components/schemas/PublicAuthorController_getAuthorPosts_sortArray"
},
"description": "Schema for sorting items",
"style": "form",
"explode": false
},
{
"name": "offset",
"required": true,
"in": "query",
"schema": {
"default": 0,
"description": "Starting position of the query",
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
{
"name": "pageSize",
"required": true,
"in": "query",
"schema": {
"default": 20,
"description": "Number of items to return",
"type": "integer",
"minimum": 1,
"maximum": 100
}
},
{
"name": "slug",
"required": true,
"in": "path",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "A list of posts from a specific author",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PublicAuthorPostsSchema"
}
}
}
}
}
}
},
"/api/ai/generate-text": {
"post": {
"operationId": "AiExampleController_generateText",
"tags": ["AiExample"],
"parameters": [],
"requestBody": {
"required": true,
"description": "Request for simple text generation with a single prompt",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"prompt": {
"type": "string",
"minLength": 1
},
"model": {
"type": "string",
"enum": [
"OPENAI_GPT_5_NANO",
"GOOGLE_GEMINI_3_FLASH",
"CLAUDE_HAIKU_3_5",
"CLAUDE_OPUS_4_5",
"MISTRAL_SMALL"
]
},
"options": {
"type": "object",
"properties": {
"temperature": {
"type": "number",
"minimum": 0,
"maximum": 2
},
"maxTokens": {
"type": "number",
"exclusiveMinimum": 0
},
"topP": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"frequencyPenalty": {
"type": "number",
"minimum": -2,
"maximum": 2
},
"presencePenalty": {
"type": "number",
"minimum": -2,
"maximum": 2
},
"maxSteps": {
"type": "number",
"exclusiveMinimum": 0
},
"stopWhen": {
"type": "number",
"exclusiveMinimum": 0
},
"telemetry": {
"type": "object",
"properties": {
"traceMode": {
"description": "Trace strategy. Use \"inherit\" to keep the active OTEL trace, or \"split\" to create a new (Langfuse) trace for this LLM call.",
"type": "string",
"enum": ["inherit", "split"]
},
"traceId": {
"description": "Optional explicit (Langfuse) trace ID for split mode. Reuse the same value to group multiple LLM calls in one (Langfuse) trace.",
"type": "string"
},
"traceName": {
"description": "Display name used as root span name for the Langfuse trace. This does not control grouping.",
"type": "string"
},
"spanName": {
"description": "Name for the LLM span. This is forwarded to Vercel telemetry as functionId.",
"type": "string"
},
"sessionId": {
"description": "Optional Langfuse session identifier to group related (Langfuse) traces (e.g. chat thread or job run).",
"type": "string"
},
"metadata": {
"description": "Telemetry metadata attached to (Langfuse) trace/span.",
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {}
},
"langfuseOriginalPrompt": {
"description": "The original prompt that was used to generate the response. (Use prompt.toJSON())",
"type": "string"
}
},
"additionalProperties": false
},
"metadata": {
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {}
}
},
"additionalProperties": false,
"title": "AiGenerateOptions",
"description": "Options for an AI generation"
}
},
"required": ["prompt"],
"additionalProperties": false,
"title": "GenerateTextRequest",
"description": "Request for simple text generation with a single prompt"
}
}
}
},
"responses": {
"200": {
"description": "Response from text generation",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GenerateTextResponse"
}
}
}
}
}
}
},
"/api/ai/generate-object": {
"post": {
"operationId": "AiExampleController_generateObject",
"tags": ["AiExample"],
"parameters": [],
"requestBody": {
"required": true,
"description": "Request for structured object generation with a predefined schema type",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"prompt": {
"type": "string",
"minLength": 1
},
"schemaType": {
"type": "string",
"enum": ["userProfile", "task", "product", "recipe"]
},
"model": {
"type": "string",
"enum": [
"OPENAI_GPT_5_NANO",
"GOOGLE_GEMINI_3_FLASH",
"CLAUDE_HAIKU_3_5",
"CLAUDE_OPUS_4_5",
"MISTRAL_SMALL"
]
},
"options": {
"type": "object",
"properties": {
"temperature": {
"type": "number",
"minimum": 0,
"maximum": 2
},
"maxTokens": {
"type": "number",
"exclusiveMinimum": 0
},
"topP": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"frequencyPenalty": {
"type": "number",
"minimum": -2,
"maximum": 2
},
"presencePenalty": {
"type": "number",
"minimum": -2,
"maximum": 2
},
"maxSteps": {
"type": "number",
"exclusiveMinimum": 0
},
"stopWhen": {
"type": "number",
"exclusiveMinimum": 0
},
"telemetry": {
"type": "object",
"properties": {
"traceMode": {
"description": "Trace strategy. Use \"inherit\" to keep the active OTEL trace, or \"split\" to create a new (Langfuse) trace for this LLM call.",
"type": "string",
"enum": ["inherit", "split"]
},
"traceId": {
"description": "Optional explicit (Langfuse) trace ID for split mode. Reuse the same value to group multiple LLM calls in one (Langfuse) trace.",
"type": "string"
},
"traceName": {
"description": "Display name used as root span name for the Langfuse trace. This does not control grouping.",
"type": "string"
},
"spanName": {
"description": "Name for the LLM span. This is forwarded to Vercel telemetry as functionId.",
"type": "string"
},
"sessionId": {
"description": "Optional Langfuse session identifier to group related (Langfuse) traces (e.g. chat thread or job run).",
"type": "string"
},
"metadata": {
"description": "Telemetry metadata attached to (Langfuse) trace/span.",
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {}
},
"langfuseOriginalPrompt": {
"description": "The original prompt that was used to generate the response. (Use prompt.toJSON())",
"type": "string"
}
},
"additionalProperties": false
},
"metadata": {
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {}
}
},
"additionalProperties": false,
"title": "AiGenerateOptions",
"description": "Options for an AI generation"
}
},
"required": ["prompt", "schemaType"],
"additionalProperties": false,
"title": "GenerateObjectRequest",
"description": "Request for structured object generation with a predefined schema type"
}
}
}
},
"responses": {
"200": {
"description": "Response from structured object generation",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GenerateObjectResponse"
}
}
}
}
}
}
},
"/api/ai/chat": {
"post": {
"operationId": "AiExampleController_chat",
"tags": ["AiExample"],
"parameters": [],
"requestBody": {
"required": true,
"description": "Request for multi-turn AI conversation with message history. schemaType can be used to request structured output.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"messages": {
"minItems": 1,
"type": "array",
"items": {
"type": "object",
"properties": {
"role": {
"type": "string",
"enum": ["user", "assistant", "system", "tool"]
},
"content": {
"type": "string"
},
"metadata": {
"type": "object",
"properties": {
"isConsideredSystemMessage": {
"type": "boolean"
},
"usage": {
"description": "Total token usage for the message, including tools calls and reasoning steps",
"type": "object",
"properties": {
"promptTokens": {
"type": "number"
},
"completionTokens": {
"type": "number"
},
"totalTokens": {
"type": "number"
}
},
"required": ["promptTokens", "completionTokens", "totalTokens"],
"additionalProperties": false,
"title": "TokenUsage"
},
"finishReason": {
"type": "string"
},
"timestamp": {
"description": "ISO 8601 timestamp when the message was created",
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
},
"toolCalls": {
"description": "Tool calls made to generate the message",
"type": "array",
"items": {
"type": "object",
"properties": {
"toolCallId": {
"type": "string"
},
"toolName": {
"type": "string"
},
"args": {
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {}
}
},
"required": ["toolCallId", "toolName", "args"],
"additionalProperties": false,
"title": "ToolCall",
"description": "A tool call made by the AI"
}
},
"reasonning": {
"description": "Reasoning text for the message",
"type": "string"
},
"schemaType": {
"type": "string",
"enum": ["userProfile", "task", "product", "recipe", "none"],
"title": "ChatSchemaType",
"description": "Predefined schema types for testing structured output"
}
},
"additionalProperties": false
}
},
"required": ["role", "content"],
"additionalProperties": false,
"title": "ChatMessageWithSchemaType",
"description": "A message with optional schemaType metadata for identifying structured output"
}
},
"model": {
"type": "string",
"enum": [
"OPENAI_GPT_5_NANO",
"GOOGLE_GEMINI_3_FLASH",
"CLAUDE_HAIKU_3_5",
"CLAUDE_OPUS_4_5",
"MISTRAL_SMALL"
]
},
"options": {
"type": "object",
"properties": {
"temperature": {
"type": "number",
"minimum": 0,
"maximum": 2
},
"maxTokens": {
"type": "number",
"exclusiveMinimum": 0
},
"topP": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"frequencyPenalty": {
"type": "number",
"minimum": -2,
"maximum": 2
},
"presencePenalty": {
"type": "number",
"minimum": -2,
"maximum": 2
},
"maxSteps": {
"type": "number",
"exclusiveMinimum": 0
},
"stopWhen": {
"type": "number",
"exclusiveMinimum": 0
},
"telemetry": {
"type": "object",
"properties": {
"traceMode": {
"description": "Trace strategy. Use \"inherit\" to keep the active OTEL trace, or \"split\" to create a new (Langfuse) trace for this LLM call.",
"type": "string",
"enum": ["inherit", "split"]
},
"traceId": {
"description": "Optional explicit (Langfuse) trace ID for split mode. Reuse the same value to group multiple LLM calls in one (Langfuse) trace.",
"type": "string"
},
"traceName": {
"description": "Display name used as root span name for the Langfuse trace. This does not control grouping.",
"type": "string"
},
"spanName": {
"description": "Name for the LLM span. This is forwarded to Vercel telemetry as functionId.",
"type": "string"
},
"sessionId": {
"description": "Optional Langfuse session identifier to group related (Langfuse) traces (e.g. chat thread or job run).",
"type": "string"
},
"metadata": {
"description": "Telemetry metadata attached to (Langfuse) trace/span.",
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {}
},
"langfuseOriginalPrompt": {
"description": "The original prompt that was used to generate the response. (Use prompt.toJSON())",
"type": "string"
}
},
"additionalProperties": false
},
"metadata": {
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {}
}
},
"additionalProperties": false,
"title": "AiGenerateOptions",
"description": "Options for an AI generation"
},
"schemaType": {
"type": "string",
"enum": ["userProfile", "task", "product", "recipe", "none"],
"title": "ChatSchemaType",
"description": "Predefined schema types for testing structured output"
}
},
"required": ["messages"],
"additionalProperties": false,
"title": "ChatRequest",
"description": "Request for multi-turn AI conversation with message history. schemaType can be used to request structured output."
}
}
}
},
"responses": {
"200": {
"description": "Response from AI chat conversation",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ChatResponse"
}
}
}
}
}
}
},
"/api/ai/stream-text": {
"post": {
"operationId": "AiExampleController_streamText",
"tags": ["AiExample"],
"parameters": [],
"requestBody": {
"required": true,
"description": "Request for streaming text generation with a single prompt",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"prompt": {
"type": "string",
"minLength": 1
},
"model": {
"type": "string",
"enum": [
"OPENAI_GPT_5_NANO",
"GOOGLE_GEMINI_3_FLASH",
"CLAUDE_HAIKU_3_5",
"CLAUDE_OPUS_4_5",
"MISTRAL_SMALL"
]
},
"options": {
"type": "object",
"properties": {
"temperature": {
"type": "number",
"minimum": 0,
"maximum": 2
},
"maxTokens": {
"type": "number",
"exclusiveMinimum": 0
},
"topP": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"frequencyPenalty": {
"type": "number",
"minimum": -2,
"maximum": 2
},
"presencePenalty": {
"type": "number",
"minimum": -2,
"maximum": 2
},
"maxSteps": {
"type": "number",
"exclusiveMinimum": 0
},
"stopWhen": {
"type": "number",
"exclusiveMinimum": 0
},
"telemetry": {
"type": "object",
"properties": {
"traceMode": {
"description": "Trace strategy. Use \"inherit\" to keep the active OTEL trace, or \"split\" to create a new (Langfuse) trace for this LLM call.",
"type": "string",
"enum": ["inherit", "split"]
},
"traceId": {
"description": "Optional explicit (Langfuse) trace ID for split mode. Reuse the same value to group multiple LLM calls in one (Langfuse) trace.",
"type": "string"
},
"traceName": {
"description": "Display name used as root span name for the Langfuse trace. This does not control grouping.",
"type": "string"
},
"spanName": {
"description": "Name for the LLM span. This is forwarded to Vercel telemetry as functionId.",
"type": "string"
},
"sessionId": {
"description": "Optional Langfuse session identifier to group related (Langfuse) traces (e.g. chat thread or job run).",
"type": "string"
},
"metadata": {
"description": "Telemetry metadata attached to (Langfuse) trace/span.",
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {}
},
"langfuseOriginalPrompt": {
"description": "The original prompt that was used to generate the response. (Use prompt.toJSON())",
"type": "string"
}
},
"additionalProperties": false
},
"metadata": {
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {}
}
},
"additionalProperties": false,
"title": "AiGenerateOptions",
"description": "Options for an AI generation"
}
},
"required": ["prompt"],
"additionalProperties": false,
"title": "StreamTextRequest",
"description": "Request for streaming text generation with a single prompt"
}
}
}
},
"responses": {
"201": {
"description": ""
}
}
}
},
"/api/ai/stream-object": {
"post": {
"operationId": "AiExampleController_streamObject",
"tags": ["AiExample"],
"parameters": [],
"requestBody": {
"required": true,
"description": "Request for streaming structured object generation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"prompt": {
"type": "string",
"minLength": 1
},
"schemaType": {
"type": "string",
"enum": ["userProfile", "task", "product", "recipe"]
},
"model": {
"type": "string",
"enum": [
"OPENAI_GPT_5_NANO",
"GOOGLE_GEMINI_3_FLASH",
"CLAUDE_HAIKU_3_5",
"CLAUDE_OPUS_4_5",
"MISTRAL_SMALL"
]
},
"options": {
"type": "object",
"properties": {
"temperature": {
"type": "number",
"minimum": 0,
"maximum": 2
},
"maxTokens": {
"type": "number",
"exclusiveMinimum": 0
},
"topP": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"frequencyPenalty": {
"type": "number",
"minimum": -2,
"maximum": 2
},
"presencePenalty": {
"type": "number",
"minimum": -2,
"maximum": 2
},
"maxSteps": {
"type": "number",
"exclusiveMinimum": 0
},
"stopWhen": {
"type": "number",
"exclusiveMinimum": 0
},
"telemetry": {
"type": "object",
"properties": {
"traceMode": {
"description": "Trace strategy. Use \"inherit\" to keep the active OTEL trace, or \"split\" to create a new (Langfuse) trace for this LLM call.",
"type": "string",
"enum": ["inherit", "split"]
},
"traceId": {
"description": "Optional explicit (Langfuse) trace ID for split mode. Reuse the same value to group multiple LLM calls in one (Langfuse) trace.",
"type": "string"
},
"traceName": {
"description": "Display name used as root span name for the Langfuse trace. This does not control grouping.",
"type": "string"
},
"spanName": {
"description": "Name for the LLM span. This is forwarded to Vercel telemetry as functionId.",
"type": "string"
},
"sessionId": {
"description": "Optional Langfuse session identifier to group related (Langfuse) traces (e.g. chat thread or job run).",
"type": "string"
},
"metadata": {
"description": "Telemetry metadata attached to (Langfuse) trace/span.",
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {}
},
"langfuseOriginalPrompt": {
"description": "The original prompt that was used to generate the response. (Use prompt.toJSON())",
"type": "string"
}
},
"additionalProperties": false
},
"metadata": {
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {}
}
},
"additionalProperties": false,
"title": "AiGenerateOptions",
"description": "Options for an AI generation"
}
},
"required": ["prompt", "schemaType"],
"additionalProperties": false,
"title": "StreamObjectRequest",
"description": "Request for streaming structured object generation"
}
}
}
},
"responses": {
"201": {
"description": ""
}
}
}
},
"/api/ai/stream-chat": {
"post": {
"operationId": "AiExampleController_streamChat",
"tags": ["AiExample"],
"parameters": [],
"requestBody": {
"required": true,
"description": "Request for streaming multi-turn AI conversation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"messages": {
"minItems": 1,
"type": "array",
"items": {
"type": "object",
"properties": {
"role": {
"type": "string",
"enum": ["user", "assistant", "system", "tool"]
},
"content": {
"type": "string"
},
"metadata": {
"type": "object",
"properties": {
"isConsideredSystemMessage": {
"type": "boolean"
},
"usage": {
"description": "Total token usage for the message, including tools calls and reasoning steps",
"type": "object",
"properties": {
"promptTokens": {
"type": "number"
},
"completionTokens": {
"type": "number"
},
"totalTokens": {
"type": "number"
}
},
"required": ["promptTokens", "completionTokens", "totalTokens"],
"additionalProperties": false,
"title": "TokenUsage"
},
"finishReason": {
"type": "string"
},
"timestamp": {
"description": "ISO 8601 timestamp when the message was created",
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
},
"toolCalls": {
"description": "Tool calls made to generate the message",
"type": "array",
"items": {
"type": "object",
"properties": {
"toolCallId": {
"type": "string"
},
"toolName": {
"type": "string"
},
"args": {
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {}
}
},
"required": ["toolCallId", "toolName", "args"],
"additionalProperties": false,
"title": "ToolCall",
"description": "A tool call made by the AI"
}
},
"reasonning": {
"description": "Reasoning text for the message",
"type": "string"
},
"schemaType": {
"type": "string",
"enum": ["userProfile", "task", "product", "recipe", "none"],
"title": "ChatSchemaType",
"description": "Predefined schema types for testing structured output"
}
},
"additionalProperties": false
}
},
"required": ["role", "content"],
"additionalProperties": false,
"title": "ChatMessageWithSchemaType",
"description": "A message with optional schemaType metadata for identifying structured output"
}
},
"model": {
"type": "string",
"enum": [
"OPENAI_GPT_5_NANO",
"GOOGLE_GEMINI_3_FLASH",
"CLAUDE_HAIKU_3_5",
"CLAUDE_OPUS_4_5",
"MISTRAL_SMALL"
]
},
"options": {
"type": "object",
"properties": {
"temperature": {
"type": "number",
"minimum": 0,
"maximum": 2
},
"maxTokens": {
"type": "number",
"exclusiveMinimum": 0
},
"topP": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"frequencyPenalty": {
"type": "number",
"minimum": -2,
"maximum": 2
},
"presencePenalty": {
"type": "number",
"minimum": -2,
"maximum": 2
},
"maxSteps": {
"type": "number",
"exclusiveMinimum": 0
},
"stopWhen": {
"type": "number",
"exclusiveMinimum": 0
},
"telemetry": {
"type": "object",
"properties": {
"traceMode": {
"description": "Trace strategy. Use \"inherit\" to keep the active OTEL trace, or \"split\" to create a new (Langfuse) trace for this LLM call.",
"type": "string",
"enum": ["inherit", "split"]
},
"traceId": {
"description": "Optional explicit (Langfuse) trace ID for split mode. Reuse the same value to group multiple LLM calls in one (Langfuse) trace.",
"type": "string"
},
"traceName": {
"description": "Display name used as root span name for the Langfuse trace. This does not control grouping.",
"type": "string"
},
"spanName": {
"description": "Name for the LLM span. This is forwarded to Vercel telemetry as functionId.",
"type": "string"
},
"sessionId": {
"description": "Optional Langfuse session identifier to group related (Langfuse) traces (e.g. chat thread or job run).",
"type": "string"
},
"metadata": {
"description": "Telemetry metadata attached to (Langfuse) trace/span.",
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {}
},
"langfuseOriginalPrompt": {
"description": "The original prompt that was used to generate the response. (Use prompt.toJSON())",
"type": "string"
}
},
"additionalProperties": false
},
"metadata": {
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {}
}
},
"additionalProperties": false,
"title": "AiGenerateOptions",
"description": "Options for an AI generation"
}
},
"required": ["messages"],
"additionalProperties": false,
"title": "StreamChatRequest",
"description": "Request for streaming multi-turn AI conversation"
}
}
}
},
"responses": {
"201": {
"description": ""
}
}
}
},
"/api/ai/examples/use-case-1-single-generation": {
"post": {
"operationId": "AiExampleUseCasesController_useCase1SingleGeneration",
"tags": ["AiExampleUseCases"],
"parameters": [],
"requestBody": {
"required": true,
"description": "Single generation; trace is finalized with name/output so Langfuse shows them",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"prompt": {
"type": "string",
"minLength": 1
},
"model": {
"type": "string",
"enum": [
"OPENAI_GPT_5_NANO",
"GOOGLE_GEMINI_3_FLASH",
"CLAUDE_HAIKU_3_5",
"CLAUDE_OPUS_4_5",
"MISTRAL_SMALL"
]
},
"options": {
"type": "object",
"properties": {
"temperature": {
"type": "number",
"minimum": 0,
"maximum": 2
},
"maxTokens": {
"type": "number",
"exclusiveMinimum": 0
},
"topP": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"frequencyPenalty": {
"type": "number",
"minimum": -2,
"maximum": 2
},
"presencePenalty": {
"type": "number",
"minimum": -2,
"maximum": 2
},
"maxSteps": {
"type": "number",
"exclusiveMinimum": 0
},
"stopWhen": {
"type": "number",
"exclusiveMinimum": 0
},
"telemetry": {
"type": "object",
"properties": {
"traceMode": {
"description": "Trace strategy. Use \"inherit\" to keep the active OTEL trace, or \"split\" to create a new (Langfuse) trace for this LLM call.",
"type": "string",
"enum": ["inherit", "split"]
},
"traceId": {
"description": "Optional explicit (Langfuse) trace ID for split mode. Reuse the same value to group multiple LLM calls in one (Langfuse) trace.",
"type": "string"
},
"traceName": {
"description": "Display name used as root span name for the Langfuse trace. This does not control grouping.",
"type": "string"
},
"spanName": {
"description": "Name for the LLM span. This is forwarded to Vercel telemetry as functionId.",
"type": "string"
},
"sessionId": {
"description": "Optional Langfuse session identifier to group related (Langfuse) traces (e.g. chat thread or job run).",
"type": "string"
},
"metadata": {
"description": "Telemetry metadata attached to (Langfuse) trace/span.",
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {}
},
"langfuseOriginalPrompt": {
"description": "The original prompt that was used to generate the response. (Use prompt.toJSON())",
"type": "string"
}
},
"additionalProperties": false
},
"metadata": {
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {}
}
},
"additionalProperties": false,
"title": "AiGenerateOptions",
"description": "Options for an AI generation"
}
},
"required": ["prompt"],
"additionalProperties": false,
"title": "UseCase1SingleGenerationRequest",
"description": "Single generation; trace is finalized with name/output so Langfuse shows them"
}
}
}
},
"responses": {
"200": {
"description": "Response from text generation",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GenerateTextResponse"
}
}
}
}
}
}
},
"/api/ai/examples/use-case-2-grouped-calls": {
"post": {
"operationId": "AiExampleUseCasesController_useCase2GroupedCalls",
"tags": ["AiExampleUseCases"],
"parameters": [],
"requestBody": {
"required": true,
"description": "Multiple LLM calls in one request; one trace in Langfuse, finalized at end",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"prompts": {
"minItems": 1,
"maxItems": 5,
"type": "array",
"items": {
"type": "string",
"minLength": 1
},
"description": "Prompts for each step (same trace)"
},
"model": {
"type": "string",
"enum": [
"OPENAI_GPT_5_NANO",
"GOOGLE_GEMINI_3_FLASH",
"CLAUDE_HAIKU_3_5",
"CLAUDE_OPUS_4_5",
"MISTRAL_SMALL"
]
}
},
"required": ["prompts"],
"additionalProperties": false,
"title": "UseCase2GroupedCallsRequest",
"description": "Multiple LLM calls in one request; one trace in Langfuse, finalized at end"
}
}
}
},
"responses": {
"200": {
"description": "Combined results from grouped LLM calls",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UseCase2GroupedCallsResponse"
}
}
}
}
}
}
},
"/api/ai/examples/use-case-3-logical-units": {
"post": {
"operationId": "AiExampleUseCasesController_useCase3LogicalUnits",
"tags": ["AiExampleUseCases"],
"parameters": [],
"requestBody": {
"required": true,
"description": "Multiple workflows; each workflow gets its own Langfuse trace (split per unit)",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"workflowPrompts": {
"minItems": 1,
"maxItems": 5,
"type": "array",
"items": {
"type": "string",
"minLength": 1
},
"description": "One prompt per logical workflow; each gets its own trace"
},
"model": {
"type": "string",
"enum": [
"OPENAI_GPT_5_NANO",
"GOOGLE_GEMINI_3_FLASH",
"CLAUDE_HAIKU_3_5",
"CLAUDE_OPUS_4_5",
"MISTRAL_SMALL"
]
}
},
"required": ["workflowPrompts"],
"additionalProperties": false,
"title": "UseCase3LogicalUnitsRequest",
"description": "Multiple workflows; each workflow gets its own Langfuse trace (split per unit)"
}
}
}
},
"responses": {
"200": {
"description": "One result per workflow (each in its own trace)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UseCase3LogicalUnitsResponse"
}
}
}
}
}
}
},
"/api/ai/examples/use-case-4-chat-session": {
"post": {
"operationId": "AiExampleUseCasesController_useCase4ChatSession",
"tags": ["AiExampleUseCases"],
"parameters": [],
"requestBody": {
"required": true,
"description": "Simple generateText with sessionId for grouping traces across requests",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"prompt": {
"type": "string",
"minLength": 1
},
"sessionId": {
"type": "string",
"minLength": 1,
"description": "Session ID to group traces in Langfuse (e.g. conversation or thread)"
},
"model": {
"type": "string",
"enum": [
"OPENAI_GPT_5_NANO",
"GOOGLE_GEMINI_3_FLASH",
"CLAUDE_HAIKU_3_5",
"CLAUDE_OPUS_4_5",
"MISTRAL_SMALL"
]
}
},
"required": ["prompt", "sessionId"],
"additionalProperties": false,
"title": "UseCase4ChatSessionRequest",
"description": "Simple generateText with sessionId for grouping traces across requests"
}
}
}
},
"responses": {
"200": {
"description": "Response from text generation",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GenerateTextResponse"
}
}
}
}
}
}
},
"/api/ai/examples/use-case-5-chat-session-with-turns-merged": {
"post": {
"operationId": "AiExampleUseCasesController_useCase5ChatSessionWithTurnsMerged",
"tags": ["AiExampleUseCases"],
"parameters": [],
"requestBody": {
"required": true,
"description": "Simple generateText with sessionId for grouping traces across requests",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"prompt": {
"type": "string",
"minLength": 1
},
"sessionId": {
"type": "string",
"minLength": 1,
"description": "Session ID to group traces in Langfuse (e.g. conversation or thread)"
},
"model": {
"type": "string",
"enum": [
"OPENAI_GPT_5_NANO",
"GOOGLE_GEMINI_3_FLASH",
"CLAUDE_HAIKU_3_5",
"CLAUDE_OPUS_4_5",
"MISTRAL_SMALL"
]
}
},
"required": ["prompt", "sessionId"],
"additionalProperties": false,
"title": "UseCase4ChatSessionRequest",
"description": "Simple generateText with sessionId for grouping traces across requests"
}
}
}
},
"responses": {
"200": {
"description": "Response from text generation",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GenerateTextResponse"
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"UseCase1SingleGenerationRequest": {
"type": "object",
"properties": {
"prompt": {
"type": "string",
"minLength": 1
},
"model": {
"type": "string",
"enum": [
"OPENAI_GPT_5_NANO",
"GOOGLE_GEMINI_3_FLASH",
"CLAUDE_HAIKU_3_5",
"CLAUDE_OPUS_4_5",
"MISTRAL_SMALL"
]
},
"options": {
"$ref": "#/components/schemas/AiGenerateOptions"
}
},
"required": ["prompt"],
"additionalProperties": false,
"title": "UseCase1SingleGenerationRequest",
"description": "Single generation; trace is finalized with name/output so Langfuse shows them"
},
"UseCase2GroupedCallsRequest": {
"type": "object",
"properties": {
"prompts": {
"minItems": 1,
"maxItems": 5,
"type": "array",
"items": {
"type": "string",
"minLength": 1
},
"description": "Prompts for each step (same trace)"
},
"model": {
"type": "string",
"enum": [
"OPENAI_GPT_5_NANO",
"GOOGLE_GEMINI_3_FLASH",
"CLAUDE_HAIKU_3_5",
"CLAUDE_OPUS_4_5",
"MISTRAL_SMALL"
]
}
},
"required": ["prompts"],
"additionalProperties": false,
"title": "UseCase2GroupedCallsRequest",
"description": "Multiple LLM calls in one request; one trace in Langfuse, finalized at end"
},
"UseCase3LogicalUnitsRequest": {
"type": "object",
"properties": {
"workflowPrompts": {
"minItems": 1,
"maxItems": 5,
"type": "array",
"items": {
"type": "string",
"minLength": 1
},
"description": "One prompt per logical workflow; each gets its own trace"
},
"model": {
"type": "string",
"enum": [
"OPENAI_GPT_5_NANO",
"GOOGLE_GEMINI_3_FLASH",
"CLAUDE_HAIKU_3_5",
"CLAUDE_OPUS_4_5",
"MISTRAL_SMALL"
]
}
},
"required": ["workflowPrompts"],
"additionalProperties": false,
"title": "UseCase3LogicalUnitsRequest",
"description": "Multiple workflows; each workflow gets its own Langfuse trace (split per unit)"
},
"UseCase4ChatSessionRequest": {
"type": "object",
"properties": {
"prompt": {
"type": "string",
"minLength": 1
},
"sessionId": {
"type": "string",
"minLength": 1,
"description": "Session ID to group traces in Langfuse (e.g. conversation or thread)"
},
"model": {
"type": "string",
"enum": [
"OPENAI_GPT_5_NANO",
"GOOGLE_GEMINI_3_FLASH",
"CLAUDE_HAIKU_3_5",
"CLAUDE_OPUS_4_5",
"MISTRAL_SMALL"
]
}
},
"required": ["prompt", "sessionId"],
"additionalProperties": false,
"title": "UseCase4ChatSessionRequest",
"description": "Simple generateText with sessionId for grouping traces across requests"
},
"GenerateTextRequest": {
"type": "object",
"properties": {
"prompt": {
"type": "string",
"minLength": 1
},
"model": {
"type": "string",
"enum": [
"OPENAI_GPT_5_NANO",
"GOOGLE_GEMINI_3_FLASH",
"CLAUDE_HAIKU_3_5",
"CLAUDE_OPUS_4_5",
"MISTRAL_SMALL"
]
},
"options": {
"$ref": "#/components/schemas/AiGenerateOptions"
}
},
"required": ["prompt"],
"additionalProperties": false,
"title": "GenerateTextRequest",
"description": "Request for simple text generation with a single prompt"
},
"GenerateObjectRequest": {
"type": "object",
"properties": {
"prompt": {
"type": "string",
"minLength": 1
},
"schemaType": {
"type": "string",
"enum": ["userProfile", "task", "product", "recipe"]
},
"model": {
"type": "string",
"enum": [
"OPENAI_GPT_5_NANO",
"GOOGLE_GEMINI_3_FLASH",
"CLAUDE_HAIKU_3_5",
"CLAUDE_OPUS_4_5",
"MISTRAL_SMALL"
]
},
"options": {
"$ref": "#/components/schemas/AiGenerateOptions"
}
},
"required": ["prompt", "schemaType"],
"additionalProperties": false,
"title": "GenerateObjectRequest",
"description": "Request for structured object generation with a predefined schema type"
},
"ChatRequest": {
"type": "object",
"properties": {
"messages": {
"minItems": 1,
"type": "array",
"items": {
"$ref": "#/components/schemas/ChatMessageWithSchemaType"
}
},
"model": {
"type": "string",
"enum": [
"OPENAI_GPT_5_NANO",
"GOOGLE_GEMINI_3_FLASH",
"CLAUDE_HAIKU_3_5",
"CLAUDE_OPUS_4_5",
"MISTRAL_SMALL"
]
},
"options": {
"$ref": "#/components/schemas/AiGenerateOptions"
},
"schemaType": {
"$ref": "#/components/schemas/ChatSchemaType"
}
},
"required": ["messages"],
"additionalProperties": false,
"title": "ChatRequest",
"description": "Request for multi-turn AI conversation with message history. schemaType can be used to request structured output."
},
"StreamTextRequest": {
"type": "object",
"properties": {
"prompt": {
"type": "string",
"minLength": 1
},
"model": {
"type": "string",
"enum": [
"OPENAI_GPT_5_NANO",
"GOOGLE_GEMINI_3_FLASH",
"CLAUDE_HAIKU_3_5",
"CLAUDE_OPUS_4_5",
"MISTRAL_SMALL"
]
},
"options": {
"$ref": "#/components/schemas/AiGenerateOptions"
}
},
"required": ["prompt"],
"additionalProperties": false,
"title": "StreamTextRequest",
"description": "Request for streaming text generation with a single prompt"
},
"StreamObjectRequest": {
"type": "object",
"properties": {
"prompt": {
"type": "string",
"minLength": 1
},
"schemaType": {
"type": "string",
"enum": ["userProfile", "task", "product", "recipe"]
},
"model": {
"type": "string",
"enum": [
"OPENAI_GPT_5_NANO",
"GOOGLE_GEMINI_3_FLASH",
"CLAUDE_HAIKU_3_5",
"CLAUDE_OPUS_4_5",
"MISTRAL_SMALL"
]
},
"options": {
"$ref": "#/components/schemas/AiGenerateOptions"
}
},
"required": ["prompt", "schemaType"],
"additionalProperties": false,
"title": "StreamObjectRequest",
"description": "Request for streaming structured object generation"
},
"StreamChatRequest": {
"type": "object",
"properties": {
"messages": {
"minItems": 1,
"type": "array",
"items": {
"$ref": "#/components/schemas/ChatMessageWithSchemaType"
}
},
"model": {
"type": "string",
"enum": [
"OPENAI_GPT_5_NANO",
"GOOGLE_GEMINI_3_FLASH",
"CLAUDE_HAIKU_3_5",
"CLAUDE_OPUS_4_5",
"MISTRAL_SMALL"
]
},
"options": {
"$ref": "#/components/schemas/AiGenerateOptions"
}
},
"required": ["messages"],
"additionalProperties": false,
"title": "StreamChatRequest",
"description": "Request for streaming multi-turn AI conversation"
},
"CreateCommentSchema": {
"type": "object",
"properties": {
"content": {
"type": "string",
"minLength": 1,
"maxLength": 1000
},
"parentId": {
"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)$"
}
},
"required": ["content"],
"additionalProperties": false,
"title": "CreateCommentSchema",
"description": "Schema for creating a comment"
},
"CreatePostSchema": {
"type": "object",
"properties": {
"title": {
"type": "string",
"minLength": 1
},
"content": {
"type": "array",
"items": {
"$ref": "#/components/schemas/PostContentSchema"
}
},
"coverImage": {
"type": "string",
"format": "uri"
},
"tags": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": ["title", "content"],
"additionalProperties": false,
"title": "CreatePostSchema",
"description": "Schema for creating/updating a post"
},
"UpdatePostSchema": {
"type": "object",
"properties": {
"title": {
"type": "string",
"minLength": 1
},
"content": {
"type": "array",
"items": {
"$ref": "#/components/schemas/PostContentSchema"
}
},
"coverImage": {
"type": "string",
"format": "uri"
},
"tags": {
"type": "array",
"items": {
"type": "string"
}
}
},
"additionalProperties": false,
"title": "UpdatePostSchema",
"description": "Schema for updating a post"
},
"GenerateTextResponse": {
"type": "object",
"properties": {
"usage": {
"$ref": "#/components/schemas/TokenUsage"
},
"finishReason": {
"type": "string"
},
"toolCalls": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ToolCall"
}
},
"toolResults": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ToolResult"
}
},
"result": {
"type": "string"
}
},
"required": ["result"],
"additionalProperties": false,
"title": "GenerateTextResponse",
"description": "Response from text generation"
},
"TokenUsage": {
"type": "object",
"properties": {
"promptTokens": {
"type": "number"
},
"completionTokens": {
"type": "number"
},
"totalTokens": {
"type": "number"
}
},
"required": ["promptTokens", "completionTokens", "totalTokens"],
"additionalProperties": false,
"title": "TokenUsage",
"description": "Token usage information for an AI generation"
},
"ToolCall": {
"type": "object",
"properties": {
"toolCallId": {
"type": "string"
},
"toolName": {
"type": "string"
},
"args": {
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {}
}
},
"required": ["toolCallId", "toolName", "args"],
"additionalProperties": false,
"title": "ToolCall",
"description": "A tool call made by the AI"
},
"ToolResult": {
"type": "object",
"properties": {
"toolCallId": {
"type": "string"
},
"toolName": {
"type": "string"
},
"result": {}
},
"required": ["toolCallId", "toolName", "result"],
"additionalProperties": false,
"title": "ToolResult",
"description": "The result of a tool call"
},
"UseCase2GroupedCallsResponse": {
"type": "object",
"properties": {
"traceName": {
"type": "string"
},
"results": {
"type": "array",
"items": {
"type": "string"
}
},
"usage": {
"$ref": "#/components/schemas/TokenUsage"
}
},
"required": ["traceName", "results"],
"additionalProperties": false,
"title": "UseCase2GroupedCallsResponse",
"description": "Combined results from grouped LLM calls"
},
"UseCase3LogicalUnitsResponse": {
"type": "object",
"properties": {
"workflows": {
"type": "array",
"items": {
"type": "object",
"properties": {
"index": {
"type": "number"
},
"result": {
"type": "string"
},
"usage": {
"$ref": "#/components/schemas/TokenUsage"
}
},
"required": ["index", "result"],
"additionalProperties": false
}
}
},
"required": ["workflows"],
"additionalProperties": false,
"title": "UseCase3LogicalUnitsResponse",
"description": "One result per workflow (each in its own trace)"
},
"GenerateObjectResponse": {
"type": "object",
"properties": {
"usage": {
"$ref": "#/components/schemas/TokenUsage"
},
"finishReason": {
"type": "string"
},
"toolCalls": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ToolCall"
}
},
"toolResults": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ToolResult"
}
},
"result": {}
},
"required": ["result"],
"additionalProperties": false,
"title": "GenerateObjectResponse",
"description": "Response from structured object generation"
},
"ChatResponse": {
"type": "object",
"properties": {
"usage": {
"$ref": "#/components/schemas/TokenUsage"
},
"finishReason": {
"type": "string"
},
"toolCalls": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ToolCall"
}
},
"toolResults": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ToolResult"
}
},
"result": {
"type": "string"
},
"messages": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ChatMessageWithSchemaType"
}
}
},
"required": ["result", "messages"],
"additionalProperties": false,
"title": "ChatResponse",
"description": "Response from AI chat conversation"
},
"ChatMessageWithSchemaType": {
"type": "object",
"properties": {
"role": {
"type": "string",
"enum": ["user", "assistant", "system", "tool"]
},
"content": {
"type": "string"
},
"metadata": {
"type": "object",
"properties": {
"isConsideredSystemMessage": {
"type": "boolean"
},
"usage": {
"description": "Total token usage for the message, including tools calls and reasoning steps",
"type": "object",
"properties": {
"promptTokens": {
"type": "number"
},
"completionTokens": {
"type": "number"
},
"totalTokens": {
"type": "number"
}
},
"required": ["promptTokens", "completionTokens", "totalTokens"],
"additionalProperties": false,
"title": "TokenUsage"
},
"finishReason": {
"type": "string"
},
"timestamp": {
"description": "ISO 8601 timestamp when the message was created",
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
},
"toolCalls": {
"description": "Tool calls made to generate the message",
"type": "array",
"items": {
"type": "object",
"properties": {
"toolCallId": {
"type": "string"
},
"toolName": {
"type": "string"
},
"args": {
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {}
}
},
"required": ["toolCallId", "toolName", "args"],
"additionalProperties": false,
"title": "ToolCall",
"description": "A tool call made by the AI"
}
},
"reasonning": {
"description": "Reasoning text for the message",
"type": "string"
},
"schemaType": {
"type": "string",
"enum": ["userProfile", "task", "product", "recipe", "none"],
"title": "ChatSchemaType",
"description": "Predefined schema types for testing structured output"
}
},
"additionalProperties": false
}
},
"required": ["role", "content"],
"additionalProperties": false,
"title": "ChatMessageWithSchemaType",
"description": "A message with optional schemaType metadata for identifying structured output"
},
"ChatSchemaType": {
"type": "string",
"enum": ["userProfile", "task", "product", "recipe", "none"],
"title": "ChatSchemaType",
"description": "Predefined schema types for testing structured output"
},
"CommentSchema": {
"type": "object",
"properties": {
"id": {
"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)$"
},
"content": {
"type": "string"
},
"authorName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"createdAt": {
"type": "string"
},
"user": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"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)$"
},
"name": {
"type": "string"
}
},
"required": ["id", "name"],
"additionalProperties": false
},
{
"type": "null"
}
]
},
"parentId": {
"anyOf": [
{
"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)$"
},
{
"type": "null"
}
]
},
"replyIds": {
"type": "array",
"items": {
"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)$"
}
},
"replyCount": {
"type": "number"
}
},
"required": ["id", "content", "authorName", "createdAt", "user", "parentId"],
"additionalProperties": false,
"title": "CommentSchema",
"description": "Schema for a comment"
},
"CommentsSchema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/CommentSchema"
}
},
"meta": {
"type": "object",
"properties": {
"offset": {
"type": "number"
},
"pageSize": {
"type": "number"
},
"itemCount": {
"type": "number"
},
"hasMore": {
"type": "boolean"
}
},
"required": ["offset", "pageSize", "itemCount", "hasMore"],
"additionalProperties": false
}
},
"required": ["data", "meta"],
"additionalProperties": false,
"title": "CommentsSchema",
"description": "Schema for a paginated list of comments"
},
"UserPostSchema": {
"type": "object",
"properties": {
"id": {
"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)$"
},
"slug": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"title": {
"type": "string"
},
"content": {
"type": "array",
"items": {
"$ref": "#/components/schemas/PostContentSchema"
}
},
"versions": {
"type": "array",
"items": {
"$ref": "#/components/schemas/PostVersionSchema"
}
},
"publishedAt": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"type": {
"type": "string",
"enum": ["published", "draft"]
},
"commentCount": {
"type": "number"
},
"coverImage": {
"type": "string",
"format": "uri"
},
"tags": {
"type": "array",
"items": {
"$ref": "#/components/schemas/TagSchema"
}
}
},
"required": ["id", "title", "content", "versions", "type", "tags"],
"additionalProperties": false,
"title": "UserPostSchema",
"description": "Schema for a user's post"
},
"PostContentSchema": {
"oneOf": [
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "text"
},
"data": {
"type": "string"
}
},
"required": ["type", "data"],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "image"
},
"data": {
"type": "string"
}
},
"required": ["type", "data"],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "video"
},
"data": {
"type": "string"
}
},
"required": ["type", "data"],
"additionalProperties": false
}
],
"title": "PostContentSchema",
"description": "Schema for content items (text, image, video)",
"type": "object"
},
"PostVersionSchema": {
"type": "object",
"properties": {
"id": {
"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)$"
},
"title": {
"type": "string"
},
"createdAt": {
"type": "string"
}
},
"required": ["id", "title", "createdAt"],
"additionalProperties": false,
"title": "PostVersionSchema",
"description": "Schema for a post version"
},
"TagSchema": {
"type": "object",
"properties": {
"id": {
"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)$"
},
"name": {
"type": "string"
},
"slug": {
"type": "string"
}
},
"required": ["id", "name", "slug"],
"additionalProperties": false,
"title": "TagSchema",
"description": "A tag attached to a post"
},
"UserPostsSchema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"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)$"
},
"slug": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"title": {
"type": "string"
},
"versions": {
"type": "array",
"items": {
"$ref": "#/components/schemas/PostVersionSchema"
}
},
"publishedAt": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"type": {
"type": "string",
"enum": ["published", "draft"]
},
"commentCount": {
"type": "number"
},
"coverImage": {
"type": "string",
"format": "uri"
},
"tags": {
"type": "array",
"items": {
"$ref": "#/components/schemas/TagSchema"
}
},
"contentPreview": {
"$ref": "#/components/schemas/PostContentSchema"
}
},
"required": ["id", "title", "versions", "type", "tags", "contentPreview"],
"additionalProperties": false
}
},
"meta": {
"type": "object",
"properties": {
"offset": {
"type": "number"
},
"pageSize": {
"type": "number"
},
"itemCount": {
"type": "number"
},
"hasMore": {
"type": "boolean"
}
},
"required": ["offset", "pageSize", "itemCount", "hasMore"],
"additionalProperties": false
}
},
"required": ["data", "meta"],
"additionalProperties": false,
"title": "UserPostsSchema",
"description": "Schema for a list of user's posts"
},
"PublicPostSchema": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"author": {
"type": "object",
"properties": {
"name": {
"type": "string"
}
},
"required": ["name"],
"additionalProperties": false
},
"content": {
"type": "array",
"items": {
"$ref": "#/components/schemas/PostContentSchema"
}
},
"publishedAt": {
"type": "string"
},
"slug": {
"type": "string"
},
"commentCount": {
"type": "number"
},
"coverImage": {
"type": "string",
"format": "uri"
},
"likesCount": {
"type": "number"
},
"tags": {
"type": "array",
"items": {
"$ref": "#/components/schemas/TagSchema"
}
}
},
"required": ["title", "author", "content", "publishedAt", "likesCount", "tags"],
"additionalProperties": false,
"title": "PublicPostSchema",
"description": "A public post"
},
"PublicPostsSchema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"author": {
"type": "object",
"properties": {
"name": {
"type": "string"
}
},
"required": ["name"],
"additionalProperties": false
},
"publishedAt": {
"type": "string"
},
"slug": {
"type": "string"
},
"commentCount": {
"type": "number"
},
"coverImage": {
"type": "string",
"format": "uri"
},
"likesCount": {
"type": "number"
},
"tags": {
"type": "array",
"items": {
"$ref": "#/components/schemas/TagSchema"
}
},
"contentPreview": {
"$ref": "#/components/schemas/PostContentSchema"
}
},
"required": [
"title",
"author",
"publishedAt",
"likesCount",
"tags",
"contentPreview"
],
"additionalProperties": false
}
},
"meta": {
"type": "object",
"properties": {
"offset": {
"type": "number"
},
"pageSize": {
"type": "number"
},
"itemCount": {
"type": "number"
},
"hasMore": {
"type": "boolean"
}
},
"required": ["offset", "pageSize", "itemCount", "hasMore"],
"additionalProperties": false
}
},
"required": ["data", "meta"],
"additionalProperties": false,
"title": "PublicPostsSchema",
"description": "A list of public posts"
},
"PublicAuthorPostsSchema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"author": {
"type": "object",
"properties": {
"name": {
"type": "string"
}
},
"required": ["name"],
"additionalProperties": false
},
"publishedAt": {
"type": "string"
},
"slug": {
"type": "string"
},
"commentCount": {
"type": "number"
},
"coverImage": {
"type": "string",
"format": "uri"
},
"likesCount": {
"type": "number"
},
"tags": {
"type": "array",
"items": {
"$ref": "#/components/schemas/TagSchema"
}
},
"contentPreview": {
"$ref": "#/components/schemas/PostContentSchema"
}
},
"required": [
"title",
"author",
"publishedAt",
"likesCount",
"tags",
"contentPreview"
],
"additionalProperties": false
}
},
"meta": {
"type": "object",
"properties": {
"offset": {
"type": "number"
},
"pageSize": {
"type": "number"
},
"itemCount": {
"type": "number"
},
"hasMore": {
"type": "boolean"
}
},
"required": ["offset", "pageSize", "itemCount", "hasMore"],
"additionalProperties": false
}
},
"required": ["data", "meta"],
"additionalProperties": false,
"title": "PublicAuthorPostsSchema",
"description": "A list of posts from a specific author"
},
"AiCoreMessage": {
"type": "object",
"properties": {
"role": {
"type": "string",
"enum": ["user", "assistant", "system", "tool"]
},
"content": {
"type": "string"
},
"metadata": {
"type": "object",
"properties": {
"isConsideredSystemMessage": {
"type": "boolean"
},
"usage": {
"$ref": "#/components/schemas/TokenUsage"
},
"finishReason": {
"type": "string"
},
"timestamp": {
"description": "ISO 8601 timestamp when the message was created",
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
},
"toolCalls": {
"description": "Tool calls made to generate the message",
"type": "array",
"items": {
"$ref": "#/components/schemas/ToolCall"
}
},
"reasonning": {
"description": "Reasoning text for the message",
"type": "string"
}
},
"additionalProperties": false
}
},
"required": ["role", "content"],
"additionalProperties": false,
"title": "AiCoreMessage",
"description": "A message in the conversation history following Vercel AI SDK patterns"
},
"AiStreamEvent": {
"oneOf": [
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "chunk"
},
"text": {
"type": "string"
}
},
"required": ["type", "text"],
"additionalProperties": false,
"title": "AiStreamTextChunkEvent",
"description": "A text chunk event during streaming"
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "tool-call"
},
"toolCallId": {
"type": "string"
},
"toolName": {
"type": "string"
},
"args": {
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {}
}
},
"required": ["type", "toolCallId", "toolName", "args"],
"additionalProperties": false,
"title": "AiStreamToolCallEvent",
"description": "Event when a tool is being called during streaming"
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "tool-result"
},
"toolCallId": {
"type": "string"
},
"toolName": {
"type": "string"
},
"result": {}
},
"required": ["type", "toolCallId", "toolName", "result"],
"additionalProperties": false,
"title": "AiStreamToolResultEvent",
"description": "Event when a tool returns a result during streaming"
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "done"
},
"fullText": {
"type": "string"
},
"usage": {
"type": "object",
"properties": {
"promptTokens": {
"type": "number"
},
"completionTokens": {
"type": "number"
},
"totalTokens": {
"type": "number"
}
},
"required": ["promptTokens", "completionTokens", "totalTokens"],
"additionalProperties": false,
"title": "AiStreamUsage",
"description": "Token usage information for the stream"
},
"finishReason": {
"type": "string"
}
},
"required": ["type", "fullText"],
"additionalProperties": false,
"title": "AiStreamDoneEvent",
"description": "Final event when streaming is complete"
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "error"
},
"message": {
"type": "string"
}
},
"required": ["type", "message"],
"additionalProperties": false,
"title": "AiStreamErrorEvent",
"description": "Error event during streaming"
}
],
"title": "AiStreamEvent",
"description": "SSE event for AI text streaming with tool support",
"type": "object"
},
"Task": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"description": {
"type": "string"
},
"priority": {
"type": "string",
"enum": ["low", "medium", "high"]
},
"dueDate": {
"type": "string"
},
"tags": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": ["title", "description", "priority"],
"additionalProperties": false,
"title": "Task",
"description": "A task"
},
"Product": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"price": {
"type": "number"
},
"description": {
"type": "string"
},
"category": {
"type": "string"
},
"inStock": {
"type": "boolean"
},
"features": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": ["name", "price", "description", "category", "inStock"],
"additionalProperties": false,
"title": "Product",
"description": "A product"
},
"Recipe": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"prepTime": {
"type": "string"
},
"cookTime": {
"type": "string"
},
"servings": {
"type": "number"
},
"difficulty": {
"type": "string",
"enum": ["easy", "medium", "hard"]
},
"ingredients": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"quantity": {
"type": "string"
}
},
"required": ["name", "quantity"],
"additionalProperties": false
}
},
"instructions": {
"type": "array",
"items": {
"type": "string"
}
},
"tips": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"name",
"description",
"prepTime",
"cookTime",
"servings",
"difficulty",
"ingredients",
"instructions"
],
"additionalProperties": false,
"title": "Recipe",
"description": "A recipe"
},
"UserProfile": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"age": {
"type": "number"
},
"email": {
"type": "string",
"format": "email",
"pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
},
"bio": {
"type": "string"
},
"skills": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": ["name", "age", "email"],
"additionalProperties": false,
"title": "UserProfile",
"description": "A user profile"
},
"AiGenerateOptions": {
"type": "object",
"properties": {
"temperature": {
"type": "number",
"minimum": 0,
"maximum": 2
},
"maxTokens": {
"type": "number",
"exclusiveMinimum": 0
},
"topP": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"frequencyPenalty": {
"type": "number",
"minimum": -2,
"maximum": 2
},
"presencePenalty": {
"type": "number",
"minimum": -2,
"maximum": 2
},
"maxSteps": {
"type": "number",
"exclusiveMinimum": 0
},
"stopWhen": {
"type": "number",
"exclusiveMinimum": 0
},
"telemetry": {
"type": "object",
"properties": {
"traceMode": {
"description": "Trace strategy. Use \"inherit\" to keep the active OTEL trace, or \"split\" to create a new (Langfuse) trace for this LLM call.",
"type": "string",
"enum": ["inherit", "split"]
},
"traceId": {
"description": "Optional explicit (Langfuse) trace ID for split mode. Reuse the same value to group multiple LLM calls in one (Langfuse) trace.",
"type": "string"
},
"traceName": {
"description": "Display name used as root span name for the Langfuse trace. This does not control grouping.",
"type": "string"
},
"spanName": {
"description": "Name for the LLM span. This is forwarded to Vercel telemetry as functionId.",
"type": "string"
},
"sessionId": {
"description": "Optional Langfuse session identifier to group related (Langfuse) traces (e.g. chat thread or job run).",
"type": "string"
},
"metadata": {
"description": "Telemetry metadata attached to (Langfuse) trace/span.",
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {}
},
"langfuseOriginalPrompt": {
"description": "The original prompt that was used to generate the response. (Use prompt.toJSON())",
"type": "string"
}
},
"additionalProperties": false
},
"metadata": {
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {}
}
},
"additionalProperties": false,
"title": "AiGenerateOptions",
"description": "Options for an AI generation"
},
"PaginationQuerySchema": {
"type": "object",
"properties": {
"offset": {
"default": 0,
"description": "Starting position of the query",
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"pageSize": {
"default": 20,
"description": "Number of items to return",
"type": "integer",
"minimum": 1,
"maximum": 100
}
},
"required": ["offset", "pageSize"],
"additionalProperties": false,
"title": "PaginationQuerySchema",
"description": "Schema for pagination query"
},
"SortingQueryStringSchema": {
"title": "SortingQueryStringSchema",
"description": "Schema for sorting items",
"example": "name:asc,age:desc",
"type": "string",
"items": {
"title": "SortingStringSchema",
"description": "Schema for sorting items",
"type": "object",
"properties": {
"property": {
"anyOf": [
{
"type": "string",
"const": "title"
},
{
"type": "string",
"const": "createdAt"
}
]
},
"direction": {
"type": "string",
"enum": ["asc", "desc"]
}
},
"required": ["property", "direction"],
"additionalProperties": false
},
"format": "sort"
},
"FilterQueryStringSchema": {
"title": "FilterQueryStringSchema",
"description": "Filtering query string, in the format of \"property:rule[:value];property:rule[:value];...\"\n
Available rules: eq, neq, gt, gte, lt, lte, like, nlike, in, nin, isnull, isnotnull \n
Available properties: title, tag",
"example": "name:eq:John;age:gt:30",
"type": "string",
"items": {
"type": "object",
"properties": {
"property": {
"anyOf": [
{
"type": "string",
"const": "title"
},
{
"type": "string",
"const": "tag"
}
]
},
"rule": {
"type": "string",
"enum": [
"eq",
"neq",
"gt",
"gte",
"lt",
"lte",
"like",
"nlike",
"in",
"nin",
"isnull",
"isnotnull"
]
},
"value": {
"type": "string"
}
},
"required": ["property", "rule"],
"additionalProperties": false,
"title": "FilteringSchema",
"description": "Schema for a single filtering item"
},
"format": "filter"
},
"CommentsController_postSlug": {
"type": "string"
},
"CommentsController_getComments_filterItem": {
"type": "object",
"properties": {
"property": {
"anyOf": [
{
"type": "string",
"const": "content"
}
]
},
"rule": {
"type": "string",
"enum": [
"eq",
"neq",
"gt",
"gte",
"lt",
"lte",
"like",
"nlike",
"in",
"nin",
"isnull",
"isnotnull"
]
},
"value": {
"type": "string"
}
},
"required": ["property", "rule"],
"additionalProperties": false
},
"CommentsController_getComments_filterArray": {
"type": "array",
"items": {
"$ref": "#/components/schemas/CommentsController_getComments_filterItem"
}
},
"CommentsController_getComments_sortItem": {
"type": "object",
"properties": {
"property": {
"anyOf": [
{
"type": "string",
"const": "createdAt"
},
{
"type": "string",
"const": "authorName"
}
]
},
"direction": {
"type": "string",
"enum": ["asc", "desc"]
}
},
"required": ["property", "direction"],
"additionalProperties": false
},
"CommentsController_getComments_sortArray": {
"type": "array",
"items": {
"$ref": "#/components/schemas/CommentsController_getComments_sortItem"
}
},
"CommentsController_getCommentReplies_sortItem": {
"type": "object",
"properties": {
"property": {
"anyOf": [
{
"type": "string",
"const": "createdAt"
},
{
"type": "string",
"const": "authorName"
}
]
},
"direction": {
"type": "string",
"enum": ["asc", "desc"]
}
},
"required": ["property", "direction"],
"additionalProperties": false
},
"CommentsController_getCommentReplies_sortArray": {
"type": "array",
"items": {
"$ref": "#/components/schemas/CommentsController_getCommentReplies_sortItem"
}
},
"PostController_getUserPosts_filterItem": {
"type": "object",
"properties": {
"property": {
"anyOf": [
{
"type": "string",
"const": "title"
},
{
"type": "string",
"const": "tag"
}
]
},
"rule": {
"type": "string",
"enum": [
"eq",
"neq",
"gt",
"gte",
"lt",
"lte",
"like",
"nlike",
"in",
"nin",
"isnull",
"isnotnull"
]
},
"value": {
"type": "string"
}
},
"required": ["property", "rule"],
"additionalProperties": false
},
"PostController_getUserPosts_filterArray": {
"type": "array",
"items": {
"$ref": "#/components/schemas/PostController_getUserPosts_filterItem"
}
},
"PostController_getUserPosts_sortItem": {
"type": "object",
"properties": {
"property": {
"anyOf": [
{
"type": "string",
"const": "title"
},
{
"type": "string",
"const": "createdAt"
}
]
},
"direction": {
"type": "string",
"enum": ["asc", "desc"]
}
},
"required": ["property", "direction"],
"additionalProperties": false
},
"PostController_getUserPosts_sortArray": {
"type": "array",
"items": {
"$ref": "#/components/schemas/PostController_getUserPosts_sortItem"
}
},
"PublicPostController_getPosts_filterItem": {
"type": "object",
"properties": {
"property": {
"anyOf": [
{
"type": "string",
"const": "title"
},
{
"type": "string",
"const": "tag"
}
]
},
"rule": {
"type": "string",
"enum": [
"eq",
"neq",
"gt",
"gte",
"lt",
"lte",
"like",
"nlike",
"in",
"nin",
"isnull",
"isnotnull"
]
},
"value": {
"type": "string"
}
},
"required": ["property", "rule"],
"additionalProperties": false
},
"PublicPostController_getPosts_filterArray": {
"type": "array",
"items": {
"$ref": "#/components/schemas/PublicPostController_getPosts_filterItem"
}
},
"PublicPostController_getPosts_sortItem": {
"type": "object",
"properties": {
"property": {
"anyOf": [
{
"type": "string",
"const": "title"
},
{
"type": "string",
"const": "createdAt"
}
]
},
"direction": {
"type": "string",
"enum": ["asc", "desc"]
}
},
"required": ["property", "direction"],
"additionalProperties": false
},
"PublicPostController_getPosts_sortArray": {
"type": "array",
"items": {
"$ref": "#/components/schemas/PublicPostController_getPosts_sortItem"
}
},
"PublicAuthorController_getAuthorPosts_sortItem": {
"type": "object",
"properties": {
"property": {
"anyOf": [
{
"type": "string",
"const": "title"
},
{
"type": "string",
"const": "createdAt"
}
]
},
"direction": {
"type": "string",
"enum": ["asc", "desc"]
}
},
"required": ["property", "direction"],
"additionalProperties": false
},
"PublicAuthorController_getAuthorPosts_sortArray": {
"type": "array",
"items": {
"$ref": "#/components/schemas/PublicAuthorController_getAuthorPosts_sortItem"
}
}
}
}
}