/** * DeveloperApiClient - HTTP client for the RealtimeX v1 Developer API. * * Supports two authentication modes: * - API Key: Authorization: Bearer * - App ID: x-app-id header (for LocalApp / SDK agent authentication) * * When both are provided, x-app-id takes priority on the server side. */ declare class DeveloperApiClient { private readonly baseUrl; private readonly apiKey; private readonly appId?; constructor(baseUrl: string, apiKey: string, appId?: string); private getHeaders; private handleResponse; /** * Make a JSON request to the v1 API. */ request(method: string, path: string, body?: unknown): Promise; /** * Make a multipart/form-data request (e.g. file uploads). * Do NOT set Content-Type — browser/fetch will set it with the boundary. */ requestMultipart(method: string, path: string, form: FormData): Promise; /** * Make a raw request and return the Response object directly. * Used for streaming (SSE) endpoints. */ requestRaw(method: string, path: string, body?: unknown): Promise; } declare class V1ChatModule { private readonly client; constructor(client: DeveloperApiClient); /** * Stream a chat response for a workspace default thread. * @see POST /v1/workspace/{slug}/stream-chat */ streamWorkspaceChat(slug: string, body?: Record): Promise; /** * Stream a chat response for a workspace thread. * @see POST /v1/workspace/{slug}/thread/{threadSlug}/stream-chat */ streamThreadChat(slug: string, threadSlug: string, body?: Record): Promise; } declare class V1WorkspaceModule { private readonly client; constructor(client: DeveloperApiClient); /** * List workspaces using the app workspace list behavior. * @see GET /v1/workspaces */ listWorkspaces(): Promise; /** * Create a workspace using the app workspace creation behavior. * @see POST /v1/workspace/new */ createWorkspace(body?: Record): Promise; /** * Search workspaces and threads. * @see POST /v1/workspace/search */ searchWorkspaces(body?: Record): Promise; /** * Get a workspace by slug. * @see GET /v1/workspace/{slug} */ getWorkspace(slug: string): Promise; /** * Delete a workspace. * @see DELETE /v1/workspace/{slug} */ deleteWorkspace(slug: string): Promise; /** * Get document content for a workspace document. * @see GET /v1/workspace/{slug}/document/{docPath} */ getWorkspaceDocument(slug: string, docPath: string): Promise; /** * Get or create workspace config. * @see GET /v1/workspace/{slug}/config */ getWorkspaceConfig(slug: string): Promise; /** * Update workspace config. * @see POST /v1/workspace/{slug}/config */ updateWorkspaceConfig(slug: string, body?: Record): Promise; /** * Update workspace settings by slug. * @see POST /v1/workspace/{slug}/update */ updateWorkspace(slug: string, body?: Record): Promise; /** * Generate a local LLM tuning suggestion. * @see POST /v1/workspace/{slug}/local-llm-tuning-suggestion */ suggestWorkspaceLocalLlmTuning(slug: string, body?: Record): Promise; /** * Upload a document to workspace documents. * @see POST /v1/workspace/{slug}/upload */ uploadWorkspaceDocument(slug: string, form: FormData): Promise; /** * Upload a link to workspace documents. * @see POST /v1/workspace/{slug}/upload-link */ uploadWorkspaceLink(slug: string, body?: Record): Promise; /** * Update workspace document embeddings. * @see POST /v1/workspace/{slug}/update-embeddings */ updateWorkspaceEmbeddings(slug: string, body?: Record): Promise; /** * Reset workspace vector database records. * @see DELETE /v1/workspace/{slug}/reset-vector-db */ resetWorkspaceVectorDb(slug: string): Promise; /** * Get workspace LLM provider metadata. * @see GET /v1/workspace/{slug}/llm-provider */ getWorkspaceLlmProvider(slug: string): Promise; /** * Get workspace vision availability. * @see GET /v1/workspace/{slug}/vision-availability */ getWorkspaceVisionAvailability(slug: string): Promise; /** * Get workspace chats. * @see GET /v1/workspace/{slug}/chats */ getWorkspaceChats(slug: string): Promise; /** * Get workspace terminal session details. * @see GET /v1/workspace/{slug}/terminal-session-details */ getWorkspaceTerminalSessionDetails(slug: string): Promise; /** * Persist terminal UI events. * @see POST /v1/workspace/{slug}/terminal-ui-events */ persistWorkspaceTerminalUiEvents(slug: string, body?: Record): Promise; /** * Persist a linked terminal message. * @see POST /v1/workspace/{slug}/linked-terminal-message */ createWorkspaceLinkedTerminalMessage(slug: string, body?: Record): Promise; /** * Delete selected workspace chats. * @see DELETE /v1/workspace/{slug}/delete-chats */ deleteWorkspaceChats(slug: string, body?: Record): Promise; /** * Delete edited workspace chats from a starting id. * @see DELETE /v1/workspace/{slug}/delete-edited-chats */ deleteEditedWorkspaceChats(slug: string, body?: Record): Promise; /** * Update a workspace chat response. * @see POST /v1/workspace/{slug}/update-chat */ updateWorkspaceChat(slug: string, body?: Record): Promise; /** * Update workspace chat feedback. * @see POST /v1/workspace/{slug}/chat-feedback/{chatId} */ updateWorkspaceChatFeedback(slug: string, chatId: string, body?: Record): Promise; /** * Get suggested messages for a workspace. * @see GET /v1/workspace/{slug}/suggested-messages */ getWorkspaceSuggestedMessages(slug: string): Promise; /** * Save suggested messages for a workspace. * @see POST /v1/workspace/{slug}/suggested-messages */ saveWorkspaceSuggestedMessages(slug: string, body?: Record): Promise; /** * Update workspace document pin status. * @see POST /v1/workspace/{slug}/update-pin */ updateWorkspaceDocumentPin(slug: string, body?: Record): Promise; /** * Generate text-to-speech audio for a workspace chat. * @see GET /v1/workspace/{slug}/tts/{chatId} */ getWorkspaceChatTts(slug: string, chatId: string): Promise; /** * Get a workspace profile picture. * @see GET /v1/workspace/{slug}/pfp */ getWorkspaceProfilePicture(slug: string): Promise; /** * Upload a workspace profile picture. * @see POST /v1/workspace/{slug}/upload-pfp */ uploadWorkspaceProfilePicture(slug: string, form: FormData): Promise; /** * Remove a workspace profile picture. * @see DELETE /v1/workspace/{slug}/remove-pfp */ removeWorkspaceProfilePicture(slug: string): Promise; /** * Fork the workspace default thread. * @see POST /v1/workspace/{slug}/thread/fork */ forkThread(slug: string, body?: Record): Promise; /** * Hide a workspace chat. * @see PUT /v1/workspace/workspace-chats/{id} */ hideWorkspaceChat(id: string): Promise; /** * Upload and embed a document. * @see POST /v1/workspace/{slug}/upload-and-embed */ uploadAndEmbedWorkspaceDocument(slug: string, form: FormData): Promise; /** * Remove and unembed a document. * @see DELETE /v1/workspace/{slug}/remove-and-unembed */ removeAndUnembedWorkspaceDocument(slug: string, body?: Record): Promise; /** * Get workspace prompt history. * @see GET /v1/workspace/{slug}/prompt-history */ getWorkspacePromptHistory(slug: string): Promise; /** * Clear workspace prompt history. * @see DELETE /v1/workspace/{slug}/prompt-history */ deleteWorkspacePromptHistory(slug: string): Promise; /** * Delete a workspace prompt history entry. * @see DELETE /v1/workspace/{slug}/prompt-history/{id} */ deleteWorkspacePromptHistoryEntry(slug: string, id: string): Promise; /** * Validate search provider configuration. * @see POST /v1/workspace/{slug}/search/validate */ validateWorkspaceSearchProvider(slug: string, body?: Record): Promise; } declare class V1ThreadModule { private readonly client; constructor(client: DeveloperApiClient); /** * Create a workspace thread. * @see POST /v1/workspace/{slug}/thread/new */ createThread(slug: string): Promise; /** * List workspace threads. * @see GET /v1/workspace/{slug}/threads */ listThreads(slug: string): Promise; /** * Open an SSE stream for workspace thread events. * @see GET /v1/workspace/{slug}/thread-events */ openThreadEventsStream(slug: string): Promise; /** * Get a workspace thread. * @see GET /v1/workspace/{slug}/thread/{threadSlug} */ getThread(slug: string, threadSlug: string): Promise; /** * Delete a workspace thread. * @see DELETE /v1/workspace/{slug}/thread/{threadSlug} */ deleteThread(slug: string, threadSlug: string): Promise; /** * Get thread vision availability. * @see GET /v1/workspace/{slug}/thread/{threadSlug}/vision-availability */ getThreadVisionAvailability(slug: string, threadSlug: string): Promise; /** * Promote a thread into a tracked goal. * @see POST /v1/workspace/{slug}/thread/{threadSlug}/goal */ createThreadGoal(slug: string, threadSlug: string, body?: Record): Promise; /** * Draft a terminal goal for a workspace. * @see POST /v1/workspace/{slug}/terminal-goal-draft */ draftWorkspaceTerminalGoal(slug: string, body?: Record): Promise; /** * Create a terminal goal for a workspace. * @see POST /v1/workspace/{slug}/terminal-goal */ createWorkspaceTerminalGoal(slug: string, body?: Record): Promise; /** * Draft a terminal goal for a workspace thread. * @see POST /v1/workspace/{slug}/thread/{threadSlug}/terminal-goal-draft */ draftThreadTerminalGoal(slug: string, threadSlug: string, body?: Record): Promise; /** * Create a terminal goal for a workspace thread. * @see POST /v1/workspace/{slug}/thread/{threadSlug}/terminal-goal */ createThreadTerminalGoal(slug: string, threadSlug: string, body?: Record): Promise; /** * Bulk delete workspace threads. * @see DELETE /v1/workspace/{slug}/thread-bulk-delete */ bulkDeleteThreads(slug: string, body?: Record): Promise; /** * Get workspace thread chats. * @see GET /v1/workspace/{slug}/thread/{threadSlug}/chats */ getThreadChats(slug: string, threadSlug: string): Promise; /** * Get thread terminal session details. * @see GET /v1/workspace/{slug}/thread/{threadSlug}/terminal-session-details */ getThreadTerminalSessionDetails(slug: string, threadSlug: string): Promise; /** * Update a workspace thread. * @see POST /v1/workspace/{slug}/thread/{threadSlug}/update */ updateThread(slug: string, threadSlug: string, body?: Record): Promise; /** * Delete edited chats from a thread. * @see DELETE /v1/workspace/{slug}/thread/{threadSlug}/delete-edited-chats */ deleteEditedThreadChats(slug: string, threadSlug: string, body?: Record): Promise; /** * Update a thread chat response. * @see POST /v1/workspace/{slug}/thread/{threadSlug}/update-chat */ updateThreadChat(slug: string, threadSlug: string, body?: Record): Promise; /** * Persist terminal UI events for a workspace thread. * @see POST /v1/workspace/{slug}/thread/{threadSlug}/terminal-ui-events */ persistThreadTerminalUiEvents(slug: string, threadSlug: string, body?: Record): Promise; /** * Persist a linked terminal message for a workspace thread. * @see POST /v1/workspace/{slug}/thread/{threadSlug}/linked-terminal-message */ createThreadLinkedTerminalMessage(slug: string, threadSlug: string, body?: Record): Promise; /** * Coordinate a task into a workspace thread. * @see POST /v1/workspace/{slug}/thread/coordinate-task */ coordinateThreadTask(slug: string, body?: Record): Promise; /** * Open an SSE stream for external workspace thread chat events. * @see GET /v1/workspace/{slug}/thread/{threadSlug}/chat-stream */ openThreadChatStream(slug: string, threadSlug: string): Promise; } /** * V1ApiNamespace - Container for all RealtimeX Developer API (v1) modules. * * Usage: * const sdk = new RealtimeXSDK({ realtimex: { apiKey: 'sk-...' } }); * await sdk.v1?.workspace.listWorkspaces(); * await sdk.v1?.thread.createThread('workspace-slug'); * * Regenerate modules: node scripts/generate-v1-sdk.mjs --force */ declare class V1ApiNamespace { /** @internal Shared HTTP client used by all v1 modules */ readonly _client: DeveloperApiClient; chat: V1ChatModule; workspace: V1WorkspaceModule; thread: V1ThreadModule; constructor(baseUrl: string, apiKey: string, appId?: string); } /** * RealtimeX SDK - Developer API (v1) Error Classes */ declare class DeveloperApiError extends Error { readonly status: number; readonly code: string; constructor(status: number, code: string, message: string); } declare class AuthenticationError extends DeveloperApiError { constructor(message?: string); } declare class NotFoundError extends DeveloperApiError { constructor(message?: string); } declare class ValidationError extends DeveloperApiError { constructor(message: string); } declare class ServerError extends DeveloperApiError { constructor(message?: string); } export { AuthenticationError as A, DeveloperApiClient as D, NotFoundError as N, ServerError as S, V1ApiNamespace as V, DeveloperApiError as a, ValidationError as b, V1ChatModule as c, V1WorkspaceModule as d, V1ThreadModule as e };