Better Hub provides AI chat capabilities for interacting with GitHub repositories, pull requests, issues, and general GitHub operations.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/better-auth/better-hub/llms.txt
Use this file to discover all available pages before exploring further.
POST /api/ai/ghost
Create or continue an AI conversation with context-aware GitHub assistance. Supports streaming responses with tool execution.Array of conversation messages with role and content
Pull request context for PR-specific assistance
Repository owner
Repository name
Pull request number
Pull request title
Pull request description
Base branch name
Head branch name
Array of changed files with patches
Whether the PR has merge conflicts
Response (Streaming)
Returns a streaming response with AI-generated text and tool execution results.Server-sent events stream containing:
- Text chunks from the AI model
- Tool execution results
- Usage statistics
GET /api/ai/ghost/[id]/stream
Resume an existing AI conversation stream that was interrupted.Context key for the conversation
Stream position to resume from (in bytes)
Response
Continuation of the existing stream from the specified position
POST /api/ai/command
Execute AI-powered GitHub commands via natural language (used in command palette).Array of conversation messages
Response
Streaming response with command execution results
POST /api/ai/commit-message
Generate AI-powered commit messages from file changes or PR information.Generation mode:
"squash" for PR squash commits or omit for single file commitsFor Single File Commits
Name of the changed file
Original file content
Modified file content
For PR Squash Commits
Pull request title
Pull request description
Pull request number
Array of commit messages to squash (max 30)
Response
Generated commit message (for single file)
Generated commit title (for squash)
Generated commit description (for squash)
Chat History Endpoints
GET /api/ai/chat-history
Retrieve chat conversation history.Context key for a specific conversation
Set to
"ghost" to list all ghost chat conversationsResponse
Conversation metadata
Conversation ID
User ID
Type of chat (ghost, command, etc.)
Context identifier
Conversation title
Active stream ID if streaming
Creation timestamp
Last update timestamp
Array of conversation messages
POST /api/ai/chat-history
Save a message to a conversation.Context key for the conversation
Type of chat
Message to save
DELETE /api/ai/chat-history
Delete a conversation.ID of conversation to delete
Ghost Tab Management
GET /api/ai/ghost-tabs
Get the current state of Ghost chat tabs for the user.Response
Array of active tabs
Currently active tab ID
Tab counter for generating new tab IDs
POST /api/ai/ghost-tabs
Manage Ghost chat tabs.Action to perform:
"add", "close", "rename", or "switch"Tab ID (required for all actions)
Tab label (required for add and rename)
Counter value (required for add)
New default tab ID (for close action)