This guide shows you how to log any type of LLM request to Keywords AI using the universal input/output design that supports all span types.Documentation Index
Fetch the complete documentation index at: https://docs.keywordsai.co/llms.txt
Use this file to discover all available pages before exploring further.
input and output fields across all span types.
input and output fields in any structure (string, object, array, etc.)log_type to indicate span type ("chat", "embedding", "workflow", etc.)log_type specifications, see log types.
log_type:Example for Chat
Example for Embedding
Example for Workflow
log_type:Example for Chat
Example for Embedding
input and output are parsed.Supported types:"chat" - Chat completion requests (default)"completion" - Legacy completion requests"response" - OpenAI Response API"embedding" - Embedding generation"transcription" - Speech-to-text"speech" - Text-to-speech"workflow" or "agent" - Workflow/agent execution"task" or "tool" - Task/tool execution"function" - Function call"generation" - Generation span"handoff" - Agent handoff"guardrail" - Safety check"custom" - Custom span typeDefault Behavior
"chat". For chat types, the system automatically extracts prompt_messages and completion_message from input and output for backward compatibility.For complete specifications of each type, see log types.Example
Properties
Example
generation_time).generation_time. For backward compatibility, both field names are supported.ttft. Both field names are supported.Example
Example
metadata, but indexed for faster querying.Example
"none", "auto", or an object specifying a specific tool.Example
{ "type": "json_schema", "json_schema": {...} } enables Structured Outputs.Possible types
{ "type": "text" } - Default response format{ "type": "json_schema", "json_schema": {...} } - Structured outputs{ "type": "json_object" } - Legacy JSON formatSupported status codes
200, 201, 400, 401, 403, 404, 429, 500, 502, 503, 504, etc."success", "error".true if using custom prompt_id.Example
full_request.Example
Example
Properties
false, the server immediately returns initialization status without waiting for log completion.Example
true means positive feedback.