Documentation Index
Fetch the complete documentation index at: https://mintlify.com/TabbyAIKeyboard/tabby/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The/api/completion endpoint provides intelligent inline writing assistance for text completions, transformations, grammar fixes, and style adjustments. It’s designed for seamless integration into text editors and input fields, offering personalized suggestions based on user memory.
This endpoint returns Server-Sent Events (SSE) for streaming completions.
Endpoint
Authentication
Requires authentication via cookies or Authorization header. Alternatively, acceptsuserId in request body for internal calls.
Request Body
Array of messages containing the text to complete or transform. Typically contains a single user message with the input text.
The type of completion or transformation to perform.
Custom instructions to prepend to the system prompt. Used when
action is "custom" or when you want to provide additional context.User identifier. Used as fallback if authentication via cookies/headers is not available.
Response
Returns a Server-Sent Events (SSE) stream with JSON payloads:Event type (
text, tool-call, tool-result, reasoning, finish).Text chunk or event content. For completions, this contains the transformed/completed text.
Unique message or chunk ID.
Available Tools
The completion endpoint has access to memory tools for personalization:Behavior
The completion endpoint is designed to:
- Return only the final transformed text (no explanations or preambles)
- Always search memory first to personalize the output
- Match the user’s preferred writing style and tone
- Preserve formatting and capitalization preferences
- Store corrections and feedback for future improvements
Example Request
Example with Custom Prompt
Example Response Stream
Error Responses
Returned when
messages parameter is missing or invalid.Returned when authentication fails.
Use Cases
- Grammar Correction: Fix spelling and grammar errors inline
- Tone Adjustment: Convert between professional, casual, and friendly tones
- Email Writing: Transform quick notes into polished emails
- Text Expansion: Add detail and context to brief text
- Text Condensing: Shorten verbose text while preserving meaning
- Code Completion: Complete or format code snippets
- Translation: Translate and adapt text to different languages and styles
- Creative Writing: Continue stories or creative content