qwksearch-api-client 0.0.13 → 0.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2781 @@
1
+ {
2
+ "openapi": "3.1.0",
3
+ "info": {
4
+ "title": "QwkSearch Research Agent API",
5
+ "version": "1.0.0",
6
+ "description": "API for QwkSearch — AI-powered research with search, document management, and multi-provider LLM support."
7
+ },
8
+ "servers": [
9
+ { "url": "https://qwksearch.com/api", "description": "Production" }
10
+ ],
11
+ "tags": [
12
+ { "name": "Admin", "description": "Diagnostics and admin utilities" },
13
+ { "name": "AI Agent", "description": "AI chat, search, voice, and content tools" },
14
+ { "name": "Auth", "description": "Authentication via better-auth" },
15
+ { "name": "Config", "description": "Application configuration" },
16
+ { "name": "Documents", "description": "Document management" },
17
+ { "name": "Favorites", "description": "Saved articles" },
18
+ { "name": "Google Docs", "description": "Google Drive / Docs integration" },
19
+ { "name": "MCP Servers", "description": "Model Context Protocol server management" },
20
+ { "name": "NotebookLM", "description": "Google NotebookLM integration" },
21
+ { "name": "Providers", "description": "LLM provider management" },
22
+ { "name": "Quotes", "description": "Quote and citation management" },
23
+ { "name": "Scraper", "description": "Web scraping" },
24
+ { "name": "Search Engines", "description": "Search engine sources and status" },
25
+ { "name": "Uploads", "description": "File upload to Cloudflare R2" },
26
+ { "name": "User", "description": "User profile, sessions, and account management" }
27
+ ],
28
+ "paths": {
29
+ "/agent/article-followups": {
30
+ "post": {
31
+ "tags": ["AI Agent"],
32
+ "summary": "Generate follow-up questions for an article",
33
+ "operationId": "articleFollowups",
34
+ "requestBody": {
35
+ "required": true,
36
+ "content": {
37
+ "application/json": {
38
+ "schema": {
39
+ "type": "object",
40
+ "required": ["article"],
41
+ "properties": {
42
+ "article": { "type": "string" },
43
+ "chatHistory": {
44
+ "type": "array",
45
+ "items": {
46
+ "type": "object",
47
+ "properties": {
48
+ "role": { "type": "string" },
49
+ "content": { "type": "string" }
50
+ }
51
+ }
52
+ },
53
+ "maxQuestions": { "type": "integer", "default": 5 },
54
+ "provider": { "type": "string" },
55
+ "chatModel": { "$ref": "#/components/schemas/ModelWithProvider" }
56
+ }
57
+ }
58
+ }
59
+ }
60
+ },
61
+ "responses": {
62
+ "200": {
63
+ "description": "Follow-up questions",
64
+ "content": {
65
+ "application/json": {
66
+ "schema": {
67
+ "type": "object",
68
+ "properties": {
69
+ "extract": { "type": "array", "items": { "type": "string" } },
70
+ "success": { "type": "boolean" }
71
+ }
72
+ }
73
+ }
74
+ }
75
+ },
76
+ "500": { "$ref": "#/components/responses/ServerError" }
77
+ }
78
+ }
79
+ },
80
+ "/agent/article-qa": {
81
+ "post": {
82
+ "tags": ["AI Agent"],
83
+ "summary": "Answer a question grounded in an article",
84
+ "operationId": "articleQA",
85
+ "requestBody": {
86
+ "required": true,
87
+ "content": {
88
+ "application/json": {
89
+ "schema": {
90
+ "type": "object",
91
+ "required": ["article", "question"],
92
+ "properties": {
93
+ "article": { "type": "string" },
94
+ "question": { "type": "string" },
95
+ "chatHistory": {
96
+ "type": "array",
97
+ "items": {
98
+ "type": "object",
99
+ "properties": {
100
+ "role": { "type": "string" },
101
+ "content": { "type": "string" }
102
+ }
103
+ }
104
+ },
105
+ "provider": { "type": "string" },
106
+ "chatModel": { "$ref": "#/components/schemas/ModelWithProvider" }
107
+ }
108
+ }
109
+ }
110
+ }
111
+ },
112
+ "responses": {
113
+ "200": {
114
+ "description": "Answer",
115
+ "content": {
116
+ "application/json": {
117
+ "schema": {
118
+ "type": "object",
119
+ "properties": {
120
+ "content": { "type": "string" },
121
+ "success": { "type": "boolean" }
122
+ }
123
+ }
124
+ }
125
+ }
126
+ },
127
+ "500": { "$ref": "#/components/responses/ServerError" }
128
+ }
129
+ }
130
+ },
131
+ "/agent/autocomplete": {
132
+ "get": {
133
+ "tags": ["AI Agent"],
134
+ "summary": "Query autocomplete suggestions",
135
+ "operationId": "autocomplete",
136
+ "parameters": [
137
+ { "name": "q", "in": "query", "required": true, "schema": { "type": "string" } },
138
+ { "name": "locale", "in": "query", "schema": { "type": "string", "default": "en-US" } },
139
+ { "name": "backends", "in": "query", "description": "Comma-separated: google, ddg, wikipedia", "schema": { "type": "string" } },
140
+ { "name": "limit", "in": "query", "schema": { "type": "integer", "default": 10 } }
141
+ ],
142
+ "responses": {
143
+ "200": {
144
+ "description": "Autocomplete results",
145
+ "content": {
146
+ "application/json": {
147
+ "schema": {
148
+ "type": "object",
149
+ "properties": {
150
+ "suggestions": { "type": "array", "items": { "type": "string" } },
151
+ "domains": {
152
+ "type": "array",
153
+ "items": { "$ref": "#/components/schemas/DomainSuggestion" }
154
+ }
155
+ }
156
+ }
157
+ }
158
+ }
159
+ }
160
+ }
161
+ }
162
+ },
163
+ "/agent/chat": {
164
+ "post": {
165
+ "tags": ["AI Agent"],
166
+ "summary": "Streaming research chat",
167
+ "operationId": "agentChat",
168
+ "requestBody": {
169
+ "required": true,
170
+ "content": {
171
+ "application/json": {
172
+ "schema": {
173
+ "type": "object",
174
+ "required": ["message", "optimizationMode", "focusMode", "chatModel"],
175
+ "properties": {
176
+ "message": {
177
+ "type": "object",
178
+ "required": ["messageId", "chatId", "content"],
179
+ "properties": {
180
+ "messageId": { "type": "string" },
181
+ "chatId": { "type": "string" },
182
+ "content": { "type": "string" }
183
+ }
184
+ },
185
+ "optimizationMode": { "type": "string", "enum": ["speed", "balanced", "quality"] },
186
+ "focusMode": { "type": "string", "example": "webSearch" },
187
+ "history": {
188
+ "type": "array",
189
+ "items": {
190
+ "type": "array",
191
+ "items": { "type": "string" },
192
+ "minItems": 2,
193
+ "maxItems": 2
194
+ }
195
+ },
196
+ "files": { "type": "array", "items": { "type": "string" } },
197
+ "chatModel": { "$ref": "#/components/schemas/ModelWithProvider" },
198
+ "systemInstructions": { "type": "string" }
199
+ }
200
+ }
201
+ }
202
+ }
203
+ },
204
+ "responses": {
205
+ "200": {
206
+ "description": "Server-sent events stream",
207
+ "content": { "text/event-stream": { "schema": { "type": "string" } } }
208
+ },
209
+ "400": { "$ref": "#/components/responses/BadRequest" },
210
+ "500": { "$ref": "#/components/responses/ServerError" }
211
+ }
212
+ }
213
+ },
214
+ "/agent/chats": {
215
+ "get": {
216
+ "tags": ["AI Agent"],
217
+ "summary": "List user's chats",
218
+ "operationId": "listChats",
219
+ "security": [{ "bearerAuth": [] }],
220
+ "responses": {
221
+ "200": {
222
+ "description": "Chat list",
223
+ "content": {
224
+ "application/json": {
225
+ "schema": {
226
+ "type": "object",
227
+ "properties": {
228
+ "chats": { "type": "array", "items": { "$ref": "#/components/schemas/Chat" } }
229
+ }
230
+ }
231
+ }
232
+ }
233
+ },
234
+ "401": { "$ref": "#/components/responses/Unauthorized" }
235
+ }
236
+ },
237
+ "delete": {
238
+ "tags": ["AI Agent"],
239
+ "summary": "Delete all user chats",
240
+ "operationId": "deleteAllChats",
241
+ "security": [{ "bearerAuth": [] }],
242
+ "responses": {
243
+ "200": {
244
+ "description": "All chats deleted",
245
+ "content": {
246
+ "application/json": {
247
+ "schema": {
248
+ "type": "object",
249
+ "properties": { "message": { "type": "string" } }
250
+ }
251
+ }
252
+ }
253
+ },
254
+ "401": { "$ref": "#/components/responses/Unauthorized" }
255
+ }
256
+ }
257
+ },
258
+ "/agent/chats/search": {
259
+ "get": {
260
+ "tags": ["AI Agent"],
261
+ "summary": "Search chats by title",
262
+ "operationId": "searchChats",
263
+ "security": [{ "bearerAuth": [] }],
264
+ "parameters": [
265
+ { "name": "q", "in": "query", "required": true, "schema": { "type": "string" } }
266
+ ],
267
+ "responses": {
268
+ "200": {
269
+ "description": "Matching chats",
270
+ "content": {
271
+ "application/json": {
272
+ "schema": {
273
+ "type": "object",
274
+ "properties": {
275
+ "chats": { "type": "array", "items": { "$ref": "#/components/schemas/Chat" } }
276
+ }
277
+ }
278
+ }
279
+ }
280
+ },
281
+ "401": { "$ref": "#/components/responses/Unauthorized" }
282
+ }
283
+ }
284
+ },
285
+ "/agent/chats/share": {
286
+ "post": {
287
+ "tags": ["AI Agent"],
288
+ "summary": "Share a chat",
289
+ "operationId": "shareChat",
290
+ "security": [{ "bearerAuth": [] }],
291
+ "requestBody": {
292
+ "required": true,
293
+ "content": {
294
+ "application/json": {
295
+ "schema": {
296
+ "type": "object",
297
+ "required": ["chatId"],
298
+ "properties": { "chatId": { "type": "string" } }
299
+ }
300
+ }
301
+ }
302
+ },
303
+ "responses": {
304
+ "200": {
305
+ "description": "Share URL",
306
+ "content": {
307
+ "application/json": {
308
+ "schema": {
309
+ "type": "object",
310
+ "properties": {
311
+ "success": { "type": "boolean" },
312
+ "data": {
313
+ "type": "object",
314
+ "properties": {
315
+ "chatId": { "type": "string" },
316
+ "shareUrl": { "type": "string" }
317
+ }
318
+ }
319
+ }
320
+ }
321
+ }
322
+ }
323
+ },
324
+ "401": { "$ref": "#/components/responses/Unauthorized" }
325
+ }
326
+ }
327
+ },
328
+ "/agent/chats/{id}": {
329
+ "get": {
330
+ "tags": ["AI Agent"],
331
+ "summary": "Get a chat with messages",
332
+ "operationId": "getChatById",
333
+ "parameters": [
334
+ { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }
335
+ ],
336
+ "responses": {
337
+ "200": {
338
+ "description": "Chat and messages",
339
+ "content": {
340
+ "application/json": {
341
+ "schema": {
342
+ "type": "object",
343
+ "properties": {
344
+ "chat": { "$ref": "#/components/schemas/Chat" },
345
+ "messages": { "type": "array", "items": { "type": "object" } }
346
+ }
347
+ }
348
+ }
349
+ }
350
+ },
351
+ "404": { "$ref": "#/components/responses/NotFound" }
352
+ }
353
+ },
354
+ "delete": {
355
+ "tags": ["AI Agent"],
356
+ "summary": "Delete a chat",
357
+ "operationId": "deleteChatById",
358
+ "security": [{ "bearerAuth": [] }],
359
+ "parameters": [
360
+ { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }
361
+ ],
362
+ "responses": {
363
+ "200": {
364
+ "description": "Deleted",
365
+ "content": {
366
+ "application/json": {
367
+ "schema": { "type": "object", "properties": { "message": { "type": "string" } } }
368
+ }
369
+ }
370
+ },
371
+ "401": { "$ref": "#/components/responses/Unauthorized" },
372
+ "404": { "$ref": "#/components/responses/NotFound" }
373
+ }
374
+ }
375
+ },
376
+ "/agent/discover": {
377
+ "get": {
378
+ "tags": ["AI Agent"],
379
+ "summary": "Discover curated content by topic",
380
+ "operationId": "discoverContent",
381
+ "parameters": [
382
+ {
383
+ "name": "topic",
384
+ "in": "query",
385
+ "schema": { "type": "string", "enum": ["tech", "finance", "art", "sports", "entertainment"], "default": "tech" }
386
+ },
387
+ {
388
+ "name": "mode",
389
+ "in": "query",
390
+ "schema": { "type": "string", "enum": ["normal", "preview"], "default": "normal" }
391
+ }
392
+ ],
393
+ "responses": {
394
+ "200": {
395
+ "description": "Discovered content",
396
+ "content": {
397
+ "application/json": {
398
+ "schema": {
399
+ "type": "object",
400
+ "properties": {
401
+ "blogs": { "type": "array", "items": { "$ref": "#/components/schemas/SearchResult" } }
402
+ }
403
+ }
404
+ }
405
+ }
406
+ },
407
+ "500": { "$ref": "#/components/responses/ServerError" }
408
+ }
409
+ }
410
+ },
411
+ "/agent/messages": {
412
+ "post": {
413
+ "tags": ["AI Agent"],
414
+ "summary": "Save a chat message",
415
+ "operationId": "saveMessage",
416
+ "security": [{ "bearerAuth": [] }],
417
+ "requestBody": {
418
+ "required": true,
419
+ "content": {
420
+ "application/json": {
421
+ "schema": {
422
+ "type": "object",
423
+ "required": ["chatId", "messageId", "role"],
424
+ "properties": {
425
+ "chatId": { "type": "string" },
426
+ "messageId": { "type": "string" },
427
+ "role": { "type": "string", "enum": ["user", "assistant"] },
428
+ "content": { "type": "string" },
429
+ "suggestions": { "type": "array", "items": { "type": "string" } },
430
+ "sources": { "type": "array", "items": { "type": "object" } }
431
+ }
432
+ }
433
+ }
434
+ }
435
+ },
436
+ "responses": {
437
+ "200": {
438
+ "description": "Saved",
439
+ "content": {
440
+ "application/json": {
441
+ "schema": { "type": "object", "properties": { "message": { "type": "string" } } }
442
+ }
443
+ }
444
+ },
445
+ "401": { "$ref": "#/components/responses/Unauthorized" }
446
+ }
447
+ }
448
+ },
449
+ "/agent/rewrite": {
450
+ "post": {
451
+ "tags": ["AI Agent"],
452
+ "summary": "Rewrite text with AI (Groq)",
453
+ "operationId": "rewriteText",
454
+ "requestBody": {
455
+ "required": true,
456
+ "content": {
457
+ "application/json": {
458
+ "schema": {
459
+ "type": "object",
460
+ "required": ["text"],
461
+ "properties": {
462
+ "text": { "type": "string" },
463
+ "prompt": { "type": "string" }
464
+ }
465
+ }
466
+ }
467
+ }
468
+ },
469
+ "responses": {
470
+ "200": {
471
+ "description": "Rewritten text",
472
+ "content": {
473
+ "application/json": {
474
+ "schema": { "type": "object", "properties": { "rewrittenText": { "type": "string" } } }
475
+ }
476
+ }
477
+ },
478
+ "500": { "$ref": "#/components/responses/ServerError" }
479
+ }
480
+ }
481
+ },
482
+ "/agent/search": {
483
+ "get": {
484
+ "tags": ["AI Agent"],
485
+ "summary": "Meta-search via SearXNG",
486
+ "operationId": "agentSearch",
487
+ "parameters": [
488
+ { "name": "q", "in": "query", "required": true, "schema": { "type": "string" } },
489
+ { "name": "cat", "in": "query", "schema": { "type": "string", "enum": ["general", "news", "images", "videos", "it", "science"], "default": "general" } },
490
+ { "name": "page", "in": "query", "schema": { "type": "integer", "default": 1 } },
491
+ { "name": "lang", "in": "query", "schema": { "type": "string", "default": "en-US" } },
492
+ { "name": "safesearch", "in": "query", "schema": { "type": "boolean", "default": false } },
493
+ { "name": "recency", "in": "query", "schema": { "type": "string", "enum": ["day", "week", "month", "year"] } },
494
+ { "name": "publicInstances", "in": "query", "schema": { "type": "boolean", "default": false } }
495
+ ],
496
+ "responses": {
497
+ "200": {
498
+ "description": "Search results",
499
+ "content": {
500
+ "application/json": {
501
+ "schema": {
502
+ "type": "object",
503
+ "properties": {
504
+ "results": { "type": "array", "items": { "$ref": "#/components/schemas/SearchResult" } },
505
+ "suggestions": { "type": "array", "items": { "type": "string" } },
506
+ "elapsedTime": { "type": "integer" }
507
+ }
508
+ }
509
+ }
510
+ }
511
+ },
512
+ "400": { "$ref": "#/components/responses/BadRequest" }
513
+ }
514
+ }
515
+ },
516
+ "/agent/suggestions": {
517
+ "post": {
518
+ "tags": ["AI Agent"],
519
+ "summary": "Generate follow-up suggestions for a chat",
520
+ "operationId": "generateSuggestions",
521
+ "requestBody": {
522
+ "required": true,
523
+ "content": {
524
+ "application/json": {
525
+ "schema": {
526
+ "type": "object",
527
+ "required": ["chatHistory", "chatModel"],
528
+ "properties": {
529
+ "chatHistory": { "type": "array", "items": { "type": "object" } },
530
+ "chatModel": { "$ref": "#/components/schemas/ModelWithProvider" },
531
+ "maxQuestions": { "type": "integer", "default": 3 }
532
+ }
533
+ }
534
+ }
535
+ }
536
+ },
537
+ "responses": {
538
+ "200": {
539
+ "description": "Suggestions",
540
+ "content": {
541
+ "application/json": {
542
+ "schema": {
543
+ "type": "object",
544
+ "properties": {
545
+ "suggestions": { "type": "array", "items": { "type": "string" } }
546
+ }
547
+ }
548
+ }
549
+ }
550
+ },
551
+ "500": { "$ref": "#/components/responses/ServerError" }
552
+ }
553
+ }
554
+ },
555
+ "/agent/test-models": {
556
+ "post": {
557
+ "tags": ["AI Agent"],
558
+ "summary": "Test which models are available for a provider",
559
+ "operationId": "testModels",
560
+ "requestBody": {
561
+ "required": true,
562
+ "content": {
563
+ "application/json": {
564
+ "schema": {
565
+ "type": "object",
566
+ "required": ["providerType", "apiKey"],
567
+ "properties": {
568
+ "providerType": { "type": "string" },
569
+ "apiKey": { "type": "string" },
570
+ "onlyFree": { "type": "boolean", "default": false }
571
+ }
572
+ }
573
+ }
574
+ }
575
+ },
576
+ "responses": {
577
+ "200": {
578
+ "description": "Test results",
579
+ "content": { "application/json": { "schema": { "type": "object" } } }
580
+ }
581
+ }
582
+ }
583
+ },
584
+ "/agent/transcript": {
585
+ "post": {
586
+ "tags": ["AI Agent"],
587
+ "summary": "Transcribe audio via Whisper (Cloudflare Workers AI)",
588
+ "operationId": "transcribeAudio",
589
+ "requestBody": {
590
+ "required": true,
591
+ "content": {
592
+ "multipart/form-data": {
593
+ "schema": {
594
+ "type": "object",
595
+ "required": ["file"],
596
+ "properties": {
597
+ "file": { "type": "string", "format": "binary" },
598
+ "model": { "type": "string", "enum": ["small", "fast", "medium", "turbo", "large"], "default": "turbo" }
599
+ }
600
+ }
601
+ }
602
+ }
603
+ },
604
+ "responses": {
605
+ "200": {
606
+ "description": "Transcript",
607
+ "content": {
608
+ "application/json": {
609
+ "schema": {
610
+ "type": "object",
611
+ "properties": {
612
+ "text": { "type": "string" },
613
+ "model": { "type": "string" }
614
+ }
615
+ }
616
+ }
617
+ }
618
+ }
619
+ }
620
+ }
621
+ },
622
+ "/agent/voice": {
623
+ "post": {
624
+ "tags": ["AI Agent"],
625
+ "summary": "Text-to-speech via Kokoro or Deepgram (10/day guest limit)",
626
+ "operationId": "textToSpeech",
627
+ "requestBody": {
628
+ "required": true,
629
+ "content": {
630
+ "application/json": {
631
+ "schema": {
632
+ "type": "object",
633
+ "required": ["text"],
634
+ "properties": {
635
+ "text": { "type": "string" },
636
+ "voice": { "type": "string" },
637
+ "provider": { "type": "string", "enum": ["kokoro", "deepgram"] }
638
+ }
639
+ }
640
+ }
641
+ }
642
+ },
643
+ "responses": {
644
+ "200": {
645
+ "description": "Audio binary",
646
+ "content": {
647
+ "audio/wav": { "schema": { "type": "string", "format": "binary" } },
648
+ "audio/mpeg": { "schema": { "type": "string", "format": "binary" } }
649
+ }
650
+ },
651
+ "429": { "$ref": "#/components/responses/RateLimited" }
652
+ }
653
+ }
654
+ },
655
+ "/config": {
656
+ "get": {
657
+ "tags": ["Config"],
658
+ "summary": "Get application configuration",
659
+ "operationId": "getConfig",
660
+ "responses": {
661
+ "200": {
662
+ "description": "Config values and UI field definitions",
663
+ "content": { "application/json": { "schema": { "type": "object" } } }
664
+ }
665
+ }
666
+ },
667
+ "post": {
668
+ "tags": ["Config"],
669
+ "summary": "Save a config value",
670
+ "operationId": "saveConfig",
671
+ "requestBody": {
672
+ "required": true,
673
+ "content": {
674
+ "application/json": {
675
+ "schema": {
676
+ "type": "object",
677
+ "required": ["key", "value"],
678
+ "properties": {
679
+ "key": { "type": "string" },
680
+ "value": { "type": "string" }
681
+ }
682
+ }
683
+ }
684
+ }
685
+ },
686
+ "responses": {
687
+ "200": {
688
+ "description": "Saved",
689
+ "content": {
690
+ "application/json": {
691
+ "schema": { "type": "object", "properties": { "message": { "type": "string" } } }
692
+ }
693
+ }
694
+ }
695
+ }
696
+ }
697
+ },
698
+ "/doc/article": {
699
+ "get": {
700
+ "tags": ["Documents"],
701
+ "summary": "Fetch and cache article from URL",
702
+ "operationId": "getArticle",
703
+ "parameters": [
704
+ { "name": "url", "in": "query", "required": true, "schema": { "type": "string", "format": "uri" } }
705
+ ],
706
+ "responses": {
707
+ "200": {
708
+ "description": "Article content",
709
+ "content": {
710
+ "application/json": {
711
+ "schema": {
712
+ "type": "object",
713
+ "properties": {
714
+ "cached": { "type": "boolean" },
715
+ "article": { "$ref": "#/components/schemas/Article" },
716
+ "isVideo": { "type": "boolean" }
717
+ }
718
+ }
719
+ }
720
+ }
721
+ },
722
+ "400": { "$ref": "#/components/responses/BadRequest" },
723
+ "500": { "$ref": "#/components/responses/ServerError" }
724
+ }
725
+ },
726
+ "post": {
727
+ "tags": ["Documents"],
728
+ "summary": "Store article Q&A or follow-up questions",
729
+ "operationId": "updateArticle",
730
+ "requestBody": {
731
+ "required": true,
732
+ "content": {
733
+ "application/json": {
734
+ "schema": {
735
+ "type": "object",
736
+ "required": ["url"],
737
+ "properties": {
738
+ "url": { "type": "string", "format": "uri" },
739
+ "question": { "type": "string" },
740
+ "answer": { "type": "string" },
741
+ "followUpQuestions": { "type": "array", "items": { "type": "string" } }
742
+ }
743
+ }
744
+ }
745
+ }
746
+ },
747
+ "responses": {
748
+ "200": {
749
+ "description": "Stored",
750
+ "content": {
751
+ "application/json": {
752
+ "schema": { "type": "object", "properties": { "success": { "type": "boolean" } } }
753
+ }
754
+ }
755
+ },
756
+ "400": { "$ref": "#/components/responses/BadRequest" }
757
+ }
758
+ }
759
+ },
760
+ "/doc/documents": {
761
+ "get": {
762
+ "tags": ["Documents"],
763
+ "summary": "List documents",
764
+ "operationId": "listDocuments",
765
+ "responses": {
766
+ "200": {
767
+ "description": "Document list",
768
+ "content": {
769
+ "application/json": {
770
+ "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Document" } }
771
+ }
772
+ }
773
+ }
774
+ }
775
+ },
776
+ "post": {
777
+ "tags": ["Documents"],
778
+ "summary": "Create a document",
779
+ "operationId": "createDocument",
780
+ "requestBody": {
781
+ "required": true,
782
+ "content": {
783
+ "application/json": {
784
+ "schema": {
785
+ "type": "object",
786
+ "properties": {
787
+ "name": { "type": "string" },
788
+ "title": { "type": "string" },
789
+ "content": { "type": "string" },
790
+ "parentId": { "type": "integer" },
791
+ "isFolder": { "type": "boolean" },
792
+ "metadata": { "type": "object" },
793
+ "tags": { "type": "array", "items": { "type": "string" } }
794
+ }
795
+ }
796
+ }
797
+ }
798
+ },
799
+ "responses": {
800
+ "201": {
801
+ "description": "Created document",
802
+ "content": {
803
+ "application/json": { "schema": { "$ref": "#/components/schemas/Document" } }
804
+ }
805
+ }
806
+ }
807
+ }
808
+ },
809
+ "/doc/documents/{id}": {
810
+ "get": {
811
+ "tags": ["Documents"],
812
+ "summary": "Get a document by ID",
813
+ "operationId": "getDocumentById",
814
+ "parameters": [
815
+ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } }
816
+ ],
817
+ "responses": {
818
+ "200": {
819
+ "description": "Document",
820
+ "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Document" } } }
821
+ },
822
+ "404": { "$ref": "#/components/responses/NotFound" }
823
+ }
824
+ },
825
+ "put": {
826
+ "tags": ["Documents"],
827
+ "summary": "Update a document",
828
+ "operationId": "updateDocument",
829
+ "parameters": [
830
+ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } }
831
+ ],
832
+ "requestBody": {
833
+ "required": true,
834
+ "content": {
835
+ "application/json": {
836
+ "schema": {
837
+ "type": "object",
838
+ "properties": {
839
+ "title": { "type": "string" },
840
+ "content": { "type": "string" },
841
+ "parentId": { "type": "integer" },
842
+ "isExpanded": { "type": "boolean" },
843
+ "metadata": { "type": "object" },
844
+ "name": { "type": "string" }
845
+ }
846
+ }
847
+ }
848
+ }
849
+ },
850
+ "responses": {
851
+ "200": {
852
+ "description": "Updated document",
853
+ "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Document" } } }
854
+ },
855
+ "404": { "$ref": "#/components/responses/NotFound" }
856
+ }
857
+ },
858
+ "delete": {
859
+ "tags": ["Documents"],
860
+ "summary": "Delete a document",
861
+ "operationId": "deleteDocument",
862
+ "parameters": [
863
+ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } }
864
+ ],
865
+ "responses": {
866
+ "200": {
867
+ "description": "Deleted",
868
+ "content": {
869
+ "application/json": {
870
+ "schema": { "type": "object", "properties": { "success": { "type": "boolean" } } }
871
+ }
872
+ }
873
+ },
874
+ "404": { "$ref": "#/components/responses/NotFound" }
875
+ }
876
+ }
877
+ },
878
+ "/doc/favorites": {
879
+ "get": {
880
+ "tags": ["Favorites"],
881
+ "summary": "List favorites",
882
+ "operationId": "listFavorites",
883
+ "security": [{ "bearerAuth": [] }],
884
+ "responses": {
885
+ "200": {
886
+ "description": "Favorites",
887
+ "content": {
888
+ "application/json": {
889
+ "schema": {
890
+ "type": "object",
891
+ "properties": {
892
+ "favorites": { "type": "array", "items": { "$ref": "#/components/schemas/Favorite" } }
893
+ }
894
+ }
895
+ }
896
+ }
897
+ },
898
+ "401": { "$ref": "#/components/responses/Unauthorized" }
899
+ }
900
+ },
901
+ "post": {
902
+ "tags": ["Favorites"],
903
+ "summary": "Add a favorite",
904
+ "operationId": "addFavorite",
905
+ "security": [{ "bearerAuth": [] }],
906
+ "requestBody": {
907
+ "required": true,
908
+ "content": {
909
+ "application/json": {
910
+ "schema": {
911
+ "type": "object",
912
+ "required": ["url"],
913
+ "properties": {
914
+ "url": { "type": "string", "format": "uri" },
915
+ "title": { "type": "string" },
916
+ "cite": { "type": "string" },
917
+ "author": { "type": "string" },
918
+ "author_cite": { "type": "string" },
919
+ "date": { "type": "string" },
920
+ "source": { "type": "string" },
921
+ "word_count": { "type": "integer" },
922
+ "html": { "type": "string" }
923
+ }
924
+ }
925
+ }
926
+ }
927
+ },
928
+ "responses": {
929
+ "200": {
930
+ "description": "Already favorited",
931
+ "content": {
932
+ "application/json": {
933
+ "schema": {
934
+ "type": "object",
935
+ "properties": {
936
+ "message": { "type": "string" },
937
+ "favorite": { "$ref": "#/components/schemas/Favorite" }
938
+ }
939
+ }
940
+ }
941
+ }
942
+ },
943
+ "201": {
944
+ "description": "Created",
945
+ "content": {
946
+ "application/json": {
947
+ "schema": {
948
+ "type": "object",
949
+ "properties": {
950
+ "message": { "type": "string" },
951
+ "favorite": { "$ref": "#/components/schemas/Favorite" }
952
+ }
953
+ }
954
+ }
955
+ }
956
+ },
957
+ "401": { "$ref": "#/components/responses/Unauthorized" }
958
+ }
959
+ },
960
+ "delete": {
961
+ "tags": ["Favorites"],
962
+ "summary": "Remove a favorite",
963
+ "operationId": "removeFavorite",
964
+ "security": [{ "bearerAuth": [] }],
965
+ "parameters": [
966
+ { "name": "url", "in": "query", "required": true, "schema": { "type": "string", "format": "uri" } }
967
+ ],
968
+ "responses": {
969
+ "200": {
970
+ "description": "Removed",
971
+ "content": {
972
+ "application/json": {
973
+ "schema": { "type": "object", "properties": { "message": { "type": "string" } } }
974
+ }
975
+ }
976
+ },
977
+ "401": { "$ref": "#/components/responses/Unauthorized" }
978
+ }
979
+ }
980
+ },
981
+ "/doc/google-docs/auth": {
982
+ "get": {
983
+ "tags": ["Google Docs"],
984
+ "summary": "Get Google OAuth consent URL",
985
+ "operationId": "googleDocsAuth",
986
+ "responses": {
987
+ "200": {
988
+ "description": "Auth URL",
989
+ "content": {
990
+ "application/json": {
991
+ "schema": {
992
+ "type": "object",
993
+ "properties": {
994
+ "success": { "type": "boolean" },
995
+ "data": {
996
+ "type": "object",
997
+ "properties": { "authUrl": { "type": "string" } }
998
+ }
999
+ }
1000
+ }
1001
+ }
1002
+ }
1003
+ }
1004
+ }
1005
+ }
1006
+ },
1007
+ "/doc/google-docs/auth/status": {
1008
+ "get": {
1009
+ "tags": ["Google Docs"],
1010
+ "summary": "Check Google Drive connection status",
1011
+ "operationId": "googleDocsAuthStatus",
1012
+ "responses": {
1013
+ "200": {
1014
+ "description": "Connection status",
1015
+ "content": {
1016
+ "application/json": {
1017
+ "schema": {
1018
+ "type": "object",
1019
+ "properties": {
1020
+ "success": { "type": "boolean" },
1021
+ "isConnected": { "type": "boolean" },
1022
+ "hasAccessToken": { "type": "boolean" },
1023
+ "hasRefreshToken": { "type": "boolean" }
1024
+ }
1025
+ }
1026
+ }
1027
+ }
1028
+ }
1029
+ }
1030
+ }
1031
+ },
1032
+ "/doc/google-docs/callback": {
1033
+ "get": {
1034
+ "tags": ["Google Docs"],
1035
+ "summary": "OAuth callback — exchanges code for tokens",
1036
+ "operationId": "googleDocsCallback",
1037
+ "parameters": [
1038
+ { "name": "code", "in": "query", "required": true, "schema": { "type": "string" } }
1039
+ ],
1040
+ "responses": {
1041
+ "200": {
1042
+ "description": "HTML popup-close page",
1043
+ "content": { "text/html": { "schema": { "type": "string" } } }
1044
+ }
1045
+ }
1046
+ }
1047
+ },
1048
+ "/doc/google-docs/export": {
1049
+ "post": {
1050
+ "tags": ["Google Docs"],
1051
+ "summary": "Export document to Google Docs",
1052
+ "operationId": "exportToGoogleDocs",
1053
+ "requestBody": {
1054
+ "required": true,
1055
+ "content": {
1056
+ "application/json": {
1057
+ "schema": {
1058
+ "type": "object",
1059
+ "required": ["documentId", "accessToken"],
1060
+ "properties": {
1061
+ "documentId": { "type": "string" },
1062
+ "accessToken": { "type": "string" },
1063
+ "refreshToken": { "type": "string" }
1064
+ }
1065
+ }
1066
+ }
1067
+ }
1068
+ },
1069
+ "responses": {
1070
+ "200": {
1071
+ "description": "Export result",
1072
+ "content": { "application/json": { "schema": { "type": "object" } } }
1073
+ }
1074
+ }
1075
+ }
1076
+ },
1077
+ "/doc/google-docs/files": {
1078
+ "get": {
1079
+ "tags": ["Google Docs"],
1080
+ "summary": "Download a Google Drive file by ID",
1081
+ "operationId": "getGoogleDriveFile",
1082
+ "parameters": [
1083
+ { "name": "fileId", "in": "query", "required": true, "schema": { "type": "string" } }
1084
+ ],
1085
+ "responses": {
1086
+ "200": {
1087
+ "description": "File content (base64)",
1088
+ "content": { "application/json": { "schema": { "type": "object" } } }
1089
+ }
1090
+ }
1091
+ }
1092
+ },
1093
+ "/doc/google-docs/import": {
1094
+ "post": {
1095
+ "tags": ["Google Docs"],
1096
+ "summary": "Import a Google Docs document",
1097
+ "operationId": "importFromGoogleDocs",
1098
+ "requestBody": {
1099
+ "required": true,
1100
+ "content": {
1101
+ "application/json": {
1102
+ "schema": {
1103
+ "type": "object",
1104
+ "required": ["googleDocId", "accessToken"],
1105
+ "properties": {
1106
+ "googleDocId": { "type": "string" },
1107
+ "accessToken": { "type": "string" },
1108
+ "refreshToken": { "type": "string" },
1109
+ "parentId": { "type": "string" }
1110
+ }
1111
+ }
1112
+ }
1113
+ }
1114
+ },
1115
+ "responses": {
1116
+ "201": {
1117
+ "description": "Imported",
1118
+ "content": {
1119
+ "application/json": {
1120
+ "schema": { "type": "object", "properties": { "success": { "type": "boolean" } } }
1121
+ }
1122
+ }
1123
+ }
1124
+ }
1125
+ }
1126
+ },
1127
+ "/doc/google-docs/refresh-token": {
1128
+ "post": {
1129
+ "tags": ["Google Docs"],
1130
+ "summary": "Refresh Google access token using stored refresh token",
1131
+ "operationId": "refreshGoogleToken",
1132
+ "responses": {
1133
+ "200": {
1134
+ "description": "Refresh result",
1135
+ "content": {
1136
+ "application/json": {
1137
+ "schema": {
1138
+ "type": "object",
1139
+ "properties": {
1140
+ "success": { "type": "boolean" },
1141
+ "message": { "type": "string" },
1142
+ "expiresAt": { "type": "string", "format": "date-time" },
1143
+ "error": { "type": "string" },
1144
+ "needsReauth": { "type": "boolean" }
1145
+ }
1146
+ }
1147
+ }
1148
+ }
1149
+ }
1150
+ }
1151
+ }
1152
+ },
1153
+ "/doc/google-docs/share": {
1154
+ "post": {
1155
+ "tags": ["Google Docs"],
1156
+ "summary": "Share a Google Doc",
1157
+ "operationId": "shareGoogleDoc",
1158
+ "requestBody": {
1159
+ "required": true,
1160
+ "content": {
1161
+ "application/json": {
1162
+ "schema": {
1163
+ "type": "object",
1164
+ "required": ["googleDocId", "accessToken"],
1165
+ "properties": {
1166
+ "googleDocId": { "type": "string" },
1167
+ "accessToken": { "type": "string" },
1168
+ "refreshToken": { "type": "string" },
1169
+ "emailAddress": { "type": "string", "format": "email" },
1170
+ "role": { "type": "string", "enum": ["reader", "commenter", "writer"] },
1171
+ "publicLink": { "type": "boolean" }
1172
+ }
1173
+ }
1174
+ }
1175
+ }
1176
+ },
1177
+ "responses": {
1178
+ "200": {
1179
+ "description": "Share result",
1180
+ "content": { "application/json": { "schema": { "type": "object" } } }
1181
+ }
1182
+ }
1183
+ }
1184
+ },
1185
+ "/doc/google-docs/token": {
1186
+ "get": {
1187
+ "tags": ["Google Docs"],
1188
+ "summary": "Get Google access token from cookies",
1189
+ "operationId": "getGoogleToken",
1190
+ "responses": {
1191
+ "200": {
1192
+ "description": "Access token",
1193
+ "content": {
1194
+ "application/json": {
1195
+ "schema": {
1196
+ "type": "object",
1197
+ "properties": {
1198
+ "success": { "type": "boolean" },
1199
+ "accessToken": { "type": "string" }
1200
+ }
1201
+ }
1202
+ }
1203
+ }
1204
+ }
1205
+ }
1206
+ }
1207
+ },
1208
+ "/doc/quotes": {
1209
+ "get": {
1210
+ "tags": ["Quotes"],
1211
+ "summary": "List quotes for a document",
1212
+ "operationId": "listQuotes",
1213
+ "parameters": [
1214
+ { "name": "documentId", "in": "query", "required": true, "schema": { "type": "string" } }
1215
+ ],
1216
+ "responses": {
1217
+ "200": {
1218
+ "description": "Quotes",
1219
+ "content": {
1220
+ "application/json": {
1221
+ "schema": {
1222
+ "type": "object",
1223
+ "properties": {
1224
+ "success": { "type": "boolean" },
1225
+ "data": { "type": "array", "items": { "$ref": "#/components/schemas/Quote" } }
1226
+ }
1227
+ }
1228
+ }
1229
+ }
1230
+ },
1231
+ "400": { "$ref": "#/components/responses/BadRequest" }
1232
+ }
1233
+ },
1234
+ "post": {
1235
+ "tags": ["Quotes"],
1236
+ "summary": "Create a quote",
1237
+ "operationId": "createQuote",
1238
+ "requestBody": {
1239
+ "required": true,
1240
+ "content": {
1241
+ "application/json": {
1242
+ "schema": {
1243
+ "type": "object",
1244
+ "required": ["documentId", "text"],
1245
+ "properties": {
1246
+ "documentId": { "type": "string" },
1247
+ "text": { "type": "string" },
1248
+ "source": { "type": "string" },
1249
+ "author": { "type": "string" },
1250
+ "url": { "type": "string" },
1251
+ "pageNumber": { "type": "integer" },
1252
+ "tags": { "type": "array", "items": { "type": "string" } }
1253
+ }
1254
+ }
1255
+ }
1256
+ }
1257
+ },
1258
+ "responses": {
1259
+ "201": {
1260
+ "description": "Created",
1261
+ "content": {
1262
+ "application/json": {
1263
+ "schema": {
1264
+ "type": "object",
1265
+ "properties": {
1266
+ "success": { "type": "boolean" },
1267
+ "data": { "$ref": "#/components/schemas/Quote" }
1268
+ }
1269
+ }
1270
+ }
1271
+ }
1272
+ }
1273
+ }
1274
+ }
1275
+ },
1276
+ "/doc/quotes/{id}": {
1277
+ "put": {
1278
+ "tags": ["Quotes"],
1279
+ "summary": "Update a quote",
1280
+ "operationId": "updateQuote",
1281
+ "parameters": [
1282
+ { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }
1283
+ ],
1284
+ "requestBody": {
1285
+ "required": true,
1286
+ "content": {
1287
+ "application/json": {
1288
+ "schema": {
1289
+ "type": "object",
1290
+ "required": ["text"],
1291
+ "properties": {
1292
+ "text": { "type": "string" },
1293
+ "source": { "type": "string" },
1294
+ "author": { "type": "string" },
1295
+ "url": { "type": "string" },
1296
+ "pageNumber": { "type": "integer" },
1297
+ "tags": { "type": "array", "items": { "type": "string" } }
1298
+ }
1299
+ }
1300
+ }
1301
+ }
1302
+ },
1303
+ "responses": {
1304
+ "200": {
1305
+ "description": "Updated",
1306
+ "content": {
1307
+ "application/json": {
1308
+ "schema": {
1309
+ "type": "object",
1310
+ "properties": {
1311
+ "success": { "type": "boolean" },
1312
+ "data": { "$ref": "#/components/schemas/Quote" }
1313
+ }
1314
+ }
1315
+ }
1316
+ }
1317
+ }
1318
+ }
1319
+ },
1320
+ "delete": {
1321
+ "tags": ["Quotes"],
1322
+ "summary": "Delete a quote",
1323
+ "operationId": "deleteQuote",
1324
+ "parameters": [
1325
+ { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }
1326
+ ],
1327
+ "responses": {
1328
+ "200": {
1329
+ "description": "Deleted",
1330
+ "content": {
1331
+ "application/json": {
1332
+ "schema": {
1333
+ "type": "object",
1334
+ "properties": {
1335
+ "success": { "type": "boolean" },
1336
+ "data": { "type": "object", "properties": { "id": { "type": "string" } } }
1337
+ }
1338
+ }
1339
+ }
1340
+ }
1341
+ }
1342
+ }
1343
+ }
1344
+ },
1345
+ "/doc/share": {
1346
+ "post": {
1347
+ "tags": ["Documents"],
1348
+ "summary": "Create or retrieve a share token for a document",
1349
+ "operationId": "shareDocument",
1350
+ "requestBody": {
1351
+ "required": true,
1352
+ "content": {
1353
+ "application/json": {
1354
+ "schema": {
1355
+ "type": "object",
1356
+ "required": ["documentId"],
1357
+ "properties": { "documentId": { "type": "string" } }
1358
+ }
1359
+ }
1360
+ }
1361
+ },
1362
+ "responses": {
1363
+ "200": {
1364
+ "description": "Share info",
1365
+ "content": {
1366
+ "application/json": {
1367
+ "schema": {
1368
+ "type": "object",
1369
+ "properties": {
1370
+ "success": { "type": "boolean" },
1371
+ "data": {
1372
+ "type": "object",
1373
+ "properties": {
1374
+ "shareId": { "type": "string" },
1375
+ "shareUrl": { "type": "string" }
1376
+ }
1377
+ }
1378
+ }
1379
+ }
1380
+ }
1381
+ }
1382
+ }
1383
+ }
1384
+ }
1385
+ },
1386
+ "/doc/share/{id}": {
1387
+ "get": {
1388
+ "tags": ["Documents"],
1389
+ "summary": "Resolve a share token to a document",
1390
+ "operationId": "getSharedDocument",
1391
+ "parameters": [
1392
+ { "name": "id", "in": "path", "required": true, "description": "Share token", "schema": { "type": "string" } }
1393
+ ],
1394
+ "responses": {
1395
+ "200": {
1396
+ "description": "Shared document",
1397
+ "content": {
1398
+ "application/json": {
1399
+ "schema": {
1400
+ "type": "object",
1401
+ "properties": {
1402
+ "success": { "type": "boolean" },
1403
+ "data": { "$ref": "#/components/schemas/Document" }
1404
+ }
1405
+ }
1406
+ }
1407
+ }
1408
+ },
1409
+ "404": { "$ref": "#/components/responses/NotFound" },
1410
+ "410": {
1411
+ "description": "Share link expired",
1412
+ "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
1413
+ }
1414
+ }
1415
+ }
1416
+ },
1417
+ "/doc/uploads": {
1418
+ "post": {
1419
+ "tags": ["Uploads"],
1420
+ "summary": "Upload files to Cloudflare R2 (PDF, DOCX, TXT, HTML)",
1421
+ "operationId": "uploadFiles",
1422
+ "requestBody": {
1423
+ "required": true,
1424
+ "content": {
1425
+ "multipart/form-data": {
1426
+ "schema": {
1427
+ "type": "object",
1428
+ "required": ["files"],
1429
+ "properties": {
1430
+ "files": { "type": "array", "items": { "type": "string", "format": "binary" } }
1431
+ }
1432
+ }
1433
+ }
1434
+ }
1435
+ },
1436
+ "responses": {
1437
+ "200": {
1438
+ "description": "Uploaded files",
1439
+ "content": {
1440
+ "application/json": {
1441
+ "schema": {
1442
+ "type": "object",
1443
+ "properties": {
1444
+ "files": { "type": "array", "items": { "$ref": "#/components/schemas/UploadedFile" } }
1445
+ }
1446
+ }
1447
+ }
1448
+ }
1449
+ }
1450
+ }
1451
+ },
1452
+ "get": {
1453
+ "tags": ["Uploads"],
1454
+ "summary": "Get extracted content for an uploaded file",
1455
+ "operationId": "getUploadedFile",
1456
+ "parameters": [
1457
+ { "name": "fileId", "in": "query", "required": true, "schema": { "type": "string" } }
1458
+ ],
1459
+ "responses": {
1460
+ "200": {
1461
+ "description": "File content",
1462
+ "content": {
1463
+ "application/json": {
1464
+ "schema": {
1465
+ "type": "object",
1466
+ "properties": {
1467
+ "title": { "type": "string" },
1468
+ "content": { "type": "string" }
1469
+ }
1470
+ }
1471
+ }
1472
+ }
1473
+ }
1474
+ }
1475
+ },
1476
+ "delete": {
1477
+ "tags": ["Uploads"],
1478
+ "summary": "Delete an uploaded file from R2",
1479
+ "operationId": "deleteUploadedFile",
1480
+ "parameters": [
1481
+ { "name": "fileId", "in": "query", "required": true, "schema": { "type": "string" } },
1482
+ { "name": "ext", "in": "query", "schema": { "type": "string" } },
1483
+ { "name": "sizeBytes", "in": "query", "schema": { "type": "integer" } }
1484
+ ],
1485
+ "responses": {
1486
+ "200": {
1487
+ "description": "Deleted",
1488
+ "content": {
1489
+ "application/json": {
1490
+ "schema": {
1491
+ "type": "object",
1492
+ "properties": {
1493
+ "success": { "type": "boolean" },
1494
+ "fileId": { "type": "string" },
1495
+ "deleted": {
1496
+ "type": "array",
1497
+ "items": {
1498
+ "type": "object",
1499
+ "properties": {
1500
+ "key": { "type": "string" },
1501
+ "success": { "type": "boolean" }
1502
+ }
1503
+ }
1504
+ }
1505
+ }
1506
+ }
1507
+ }
1508
+ }
1509
+ }
1510
+ }
1511
+ }
1512
+ },
1513
+ "/agent/mcpservers": {
1514
+ "get": {
1515
+ "tags": ["MCP Servers"],
1516
+ "summary": "List MCP servers",
1517
+ "operationId": "listMCPServers",
1518
+ "responses": {
1519
+ "200": {
1520
+ "description": "MCP server list",
1521
+ "content": {
1522
+ "application/json": {
1523
+ "schema": {
1524
+ "type": "object",
1525
+ "properties": {
1526
+ "servers": { "type": "array", "items": { "$ref": "#/components/schemas/MCPServer" } }
1527
+ }
1528
+ }
1529
+ }
1530
+ }
1531
+ }
1532
+ }
1533
+ },
1534
+ "post": {
1535
+ "tags": ["MCP Servers"],
1536
+ "summary": "Add an MCP server",
1537
+ "operationId": "addMCPServer",
1538
+ "requestBody": {
1539
+ "required": true,
1540
+ "content": {
1541
+ "application/json": {
1542
+ "schema": {
1543
+ "type": "object",
1544
+ "required": ["type", "name", "config"],
1545
+ "properties": {
1546
+ "type": { "type": "string" },
1547
+ "name": { "type": "string" },
1548
+ "config": { "type": "object" }
1549
+ }
1550
+ }
1551
+ }
1552
+ }
1553
+ },
1554
+ "responses": {
1555
+ "200": {
1556
+ "description": "Created server",
1557
+ "content": {
1558
+ "application/json": {
1559
+ "schema": {
1560
+ "type": "object",
1561
+ "properties": { "server": { "$ref": "#/components/schemas/MCPServer" } }
1562
+ }
1563
+ }
1564
+ }
1565
+ }
1566
+ }
1567
+ }
1568
+ },
1569
+ "/agent/mcpservers/{id}": {
1570
+ "delete": {
1571
+ "tags": ["MCP Servers"],
1572
+ "summary": "Delete an MCP server",
1573
+ "operationId": "deleteMCPServer",
1574
+ "parameters": [
1575
+ { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }
1576
+ ],
1577
+ "responses": {
1578
+ "200": {
1579
+ "description": "Deleted",
1580
+ "content": {
1581
+ "application/json": {
1582
+ "schema": { "type": "object", "properties": { "message": { "type": "string" } } }
1583
+ }
1584
+ }
1585
+ }
1586
+ }
1587
+ },
1588
+ "patch": {
1589
+ "tags": ["MCP Servers"],
1590
+ "summary": "Update an MCP server",
1591
+ "operationId": "updateMCPServer",
1592
+ "parameters": [
1593
+ { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }
1594
+ ],
1595
+ "requestBody": {
1596
+ "required": true,
1597
+ "content": {
1598
+ "application/json": {
1599
+ "schema": {
1600
+ "type": "object",
1601
+ "properties": {
1602
+ "name": { "type": "string" },
1603
+ "config": { "type": "object" }
1604
+ }
1605
+ }
1606
+ }
1607
+ }
1608
+ },
1609
+ "responses": {
1610
+ "200": {
1611
+ "description": "Updated server",
1612
+ "content": {
1613
+ "application/json": {
1614
+ "schema": { "type": "object", "properties": { "server": { "$ref": "#/components/schemas/MCPServer" } } }
1615
+ }
1616
+ }
1617
+ }
1618
+ }
1619
+ }
1620
+ },
1621
+ "/agent/mcpservers/{id}/toggle": {
1622
+ "post": {
1623
+ "tags": ["MCP Servers"],
1624
+ "summary": "Enable or disable an MCP server",
1625
+ "operationId": "toggleMCPServer",
1626
+ "parameters": [
1627
+ { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }
1628
+ ],
1629
+ "requestBody": {
1630
+ "required": true,
1631
+ "content": {
1632
+ "application/json": {
1633
+ "schema": {
1634
+ "type": "object",
1635
+ "required": ["enabled"],
1636
+ "properties": { "enabled": { "type": "boolean" } }
1637
+ }
1638
+ }
1639
+ }
1640
+ },
1641
+ "responses": {
1642
+ "200": {
1643
+ "description": "Updated server",
1644
+ "content": {
1645
+ "application/json": {
1646
+ "schema": { "type": "object", "properties": { "server": { "$ref": "#/components/schemas/MCPServer" } } }
1647
+ }
1648
+ }
1649
+ }
1650
+ }
1651
+ }
1652
+ },
1653
+ "/notebooklm/login": {
1654
+ "post": {
1655
+ "tags": ["NotebookLM"],
1656
+ "summary": "Connect NotebookLM with Google credentials",
1657
+ "operationId": "notebooklmLogin",
1658
+ "security": [{ "bearerAuth": [] }],
1659
+ "requestBody": {
1660
+ "required": true,
1661
+ "content": {
1662
+ "application/json": {
1663
+ "schema": {
1664
+ "type": "object",
1665
+ "required": ["email", "password"],
1666
+ "properties": {
1667
+ "email": { "type": "string", "format": "email" },
1668
+ "password": { "type": "string" }
1669
+ }
1670
+ }
1671
+ }
1672
+ }
1673
+ },
1674
+ "responses": {
1675
+ "200": {
1676
+ "description": "Login result",
1677
+ "content": {
1678
+ "application/json": {
1679
+ "schema": {
1680
+ "type": "object",
1681
+ "properties": {
1682
+ "success": { "type": "boolean" },
1683
+ "googleEmail": { "type": "string" },
1684
+ "message": { "type": "string" }
1685
+ }
1686
+ }
1687
+ }
1688
+ }
1689
+ },
1690
+ "401": { "$ref": "#/components/responses/Unauthorized" }
1691
+ }
1692
+ }
1693
+ },
1694
+ "/notebooklm/status": {
1695
+ "get": {
1696
+ "tags": ["NotebookLM"],
1697
+ "summary": "Get NotebookLM connection status",
1698
+ "operationId": "getNotebooklmStatus",
1699
+ "security": [{ "bearerAuth": [] }],
1700
+ "responses": {
1701
+ "200": {
1702
+ "description": "Connection status",
1703
+ "content": {
1704
+ "application/json": {
1705
+ "schema": {
1706
+ "type": "object",
1707
+ "properties": {
1708
+ "connected": { "type": "boolean" },
1709
+ "googleEmail": { "type": "string" },
1710
+ "createdAt": { "type": "string", "format": "date-time" },
1711
+ "expiresAt": { "type": "string", "format": "date-time" }
1712
+ }
1713
+ }
1714
+ }
1715
+ }
1716
+ },
1717
+ "401": { "$ref": "#/components/responses/Unauthorized" }
1718
+ }
1719
+ },
1720
+ "delete": {
1721
+ "tags": ["NotebookLM"],
1722
+ "summary": "Disconnect NotebookLM",
1723
+ "operationId": "disconnectNotebooklm",
1724
+ "security": [{ "bearerAuth": [] }],
1725
+ "responses": {
1726
+ "200": {
1727
+ "description": "Disconnected",
1728
+ "content": {
1729
+ "application/json": {
1730
+ "schema": {
1731
+ "type": "object",
1732
+ "properties": {
1733
+ "success": { "type": "boolean" },
1734
+ "message": { "type": "string" }
1735
+ }
1736
+ }
1737
+ }
1738
+ }
1739
+ },
1740
+ "401": { "$ref": "#/components/responses/Unauthorized" }
1741
+ }
1742
+ }
1743
+ },
1744
+ "/notebooklm/notebooks": {
1745
+ "get": {
1746
+ "tags": ["NotebookLM"],
1747
+ "summary": "List notebooks",
1748
+ "operationId": "listNotebooks",
1749
+ "security": [{ "bearerAuth": [] }],
1750
+ "responses": {
1751
+ "200": {
1752
+ "description": "Notebooks",
1753
+ "content": {
1754
+ "application/json": {
1755
+ "schema": {
1756
+ "type": "object",
1757
+ "properties": {
1758
+ "notebooks": { "type": "array", "items": { "$ref": "#/components/schemas/Notebook" } }
1759
+ }
1760
+ }
1761
+ }
1762
+ }
1763
+ },
1764
+ "401": { "$ref": "#/components/responses/Unauthorized" }
1765
+ }
1766
+ },
1767
+ "post": {
1768
+ "tags": ["NotebookLM"],
1769
+ "summary": "Create a notebook",
1770
+ "operationId": "createNotebook",
1771
+ "security": [{ "bearerAuth": [] }],
1772
+ "requestBody": {
1773
+ "required": true,
1774
+ "content": {
1775
+ "application/json": {
1776
+ "schema": {
1777
+ "type": "object",
1778
+ "required": ["title"],
1779
+ "properties": { "title": { "type": "string" } }
1780
+ }
1781
+ }
1782
+ }
1783
+ },
1784
+ "responses": {
1785
+ "201": {
1786
+ "description": "Created notebook",
1787
+ "content": {
1788
+ "application/json": {
1789
+ "schema": {
1790
+ "type": "object",
1791
+ "properties": { "notebook": { "$ref": "#/components/schemas/Notebook" } }
1792
+ }
1793
+ }
1794
+ }
1795
+ },
1796
+ "401": { "$ref": "#/components/responses/Unauthorized" }
1797
+ }
1798
+ }
1799
+ },
1800
+ "/notebooklm/notebooks/{id}": {
1801
+ "delete": {
1802
+ "tags": ["NotebookLM"],
1803
+ "summary": "Delete a notebook",
1804
+ "operationId": "deleteNotebook",
1805
+ "security": [{ "bearerAuth": [] }],
1806
+ "parameters": [
1807
+ { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }
1808
+ ],
1809
+ "responses": {
1810
+ "200": {
1811
+ "description": "Deleted",
1812
+ "content": {
1813
+ "application/json": {
1814
+ "schema": { "type": "object", "properties": { "success": { "type": "boolean" } } }
1815
+ }
1816
+ }
1817
+ },
1818
+ "401": { "$ref": "#/components/responses/Unauthorized" }
1819
+ }
1820
+ }
1821
+ },
1822
+ "/notebooklm/notebooks/{id}/ask": {
1823
+ "post": {
1824
+ "tags": ["NotebookLM"],
1825
+ "summary": "Ask a question against a notebook",
1826
+ "operationId": "askNotebook",
1827
+ "security": [{ "bearerAuth": [] }],
1828
+ "parameters": [
1829
+ { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }
1830
+ ],
1831
+ "requestBody": {
1832
+ "required": true,
1833
+ "content": {
1834
+ "application/json": {
1835
+ "schema": {
1836
+ "type": "object",
1837
+ "required": ["query"],
1838
+ "properties": { "query": { "type": "string" } }
1839
+ }
1840
+ }
1841
+ }
1842
+ },
1843
+ "responses": {
1844
+ "200": {
1845
+ "description": "Answer",
1846
+ "content": { "application/json": { "schema": { "type": "object" } } }
1847
+ },
1848
+ "401": { "$ref": "#/components/responses/Unauthorized" }
1849
+ }
1850
+ }
1851
+ },
1852
+ "/notebooklm/notebooks/{id}/audio": {
1853
+ "post": {
1854
+ "tags": ["NotebookLM"],
1855
+ "summary": "Generate audio overview for a notebook",
1856
+ "operationId": "generateNotebookAudio",
1857
+ "security": [{ "bearerAuth": [] }],
1858
+ "parameters": [
1859
+ { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }
1860
+ ],
1861
+ "requestBody": {
1862
+ "content": {
1863
+ "application/json": {
1864
+ "schema": {
1865
+ "type": "object",
1866
+ "properties": { "instructions": { "type": "string" } }
1867
+ }
1868
+ }
1869
+ }
1870
+ },
1871
+ "responses": {
1872
+ "200": {
1873
+ "description": "Audio result",
1874
+ "content": { "application/json": { "schema": { "type": "object" } } }
1875
+ },
1876
+ "401": { "$ref": "#/components/responses/Unauthorized" }
1877
+ }
1878
+ }
1879
+ },
1880
+ "/notebooklm/notebooks/{id}/sources": {
1881
+ "get": {
1882
+ "tags": ["NotebookLM"],
1883
+ "summary": "List notebook sources",
1884
+ "operationId": "listNotebookSources",
1885
+ "security": [{ "bearerAuth": [] }],
1886
+ "parameters": [
1887
+ { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }
1888
+ ],
1889
+ "responses": {
1890
+ "200": {
1891
+ "description": "Sources",
1892
+ "content": {
1893
+ "application/json": {
1894
+ "schema": {
1895
+ "type": "object",
1896
+ "properties": {
1897
+ "sources": { "type": "array", "items": { "$ref": "#/components/schemas/NotebookSource" } }
1898
+ }
1899
+ }
1900
+ }
1901
+ }
1902
+ },
1903
+ "401": { "$ref": "#/components/responses/Unauthorized" }
1904
+ }
1905
+ },
1906
+ "post": {
1907
+ "tags": ["NotebookLM"],
1908
+ "summary": "Add a source to a notebook",
1909
+ "operationId": "addNotebookSource",
1910
+ "security": [{ "bearerAuth": [] }],
1911
+ "parameters": [
1912
+ { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }
1913
+ ],
1914
+ "requestBody": {
1915
+ "required": true,
1916
+ "content": {
1917
+ "application/json": {
1918
+ "schema": {
1919
+ "type": "object",
1920
+ "properties": {
1921
+ "url": { "type": "string", "format": "uri" },
1922
+ "text": { "type": "string" },
1923
+ "title": { "type": "string" }
1924
+ }
1925
+ }
1926
+ }
1927
+ }
1928
+ },
1929
+ "responses": {
1930
+ "201": {
1931
+ "description": "Source added",
1932
+ "content": {
1933
+ "application/json": {
1934
+ "schema": {
1935
+ "type": "object",
1936
+ "properties": { "source": { "$ref": "#/components/schemas/NotebookSource" } }
1937
+ }
1938
+ }
1939
+ }
1940
+ },
1941
+ "401": { "$ref": "#/components/responses/Unauthorized" }
1942
+ }
1943
+ }
1944
+ },
1945
+ "/agent/providers": {
1946
+ "get": {
1947
+ "tags": ["Providers"],
1948
+ "summary": "List LLM providers",
1949
+ "operationId": "listProviders",
1950
+ "parameters": [
1951
+ { "name": "guest", "in": "query", "schema": { "type": "string", "enum": ["true"] } }
1952
+ ],
1953
+ "responses": {
1954
+ "200": {
1955
+ "description": "Provider list",
1956
+ "content": {
1957
+ "application/json": {
1958
+ "schema": {
1959
+ "type": "object",
1960
+ "properties": {
1961
+ "providers": { "type": "array", "items": { "$ref": "#/components/schemas/Provider" } },
1962
+ "isGuest": { "type": "boolean" }
1963
+ }
1964
+ }
1965
+ }
1966
+ }
1967
+ }
1968
+ }
1969
+ },
1970
+ "post": {
1971
+ "tags": ["Providers"],
1972
+ "summary": "Add a provider",
1973
+ "operationId": "addProvider",
1974
+ "requestBody": {
1975
+ "required": true,
1976
+ "content": {
1977
+ "application/json": {
1978
+ "schema": {
1979
+ "type": "object",
1980
+ "required": ["type", "config"],
1981
+ "properties": {
1982
+ "type": { "type": "string" },
1983
+ "config": { "type": "object" }
1984
+ }
1985
+ }
1986
+ }
1987
+ }
1988
+ },
1989
+ "responses": {
1990
+ "200": {
1991
+ "description": "Created provider",
1992
+ "content": {
1993
+ "application/json": {
1994
+ "schema": { "type": "object", "properties": { "provider": { "$ref": "#/components/schemas/Provider" } } }
1995
+ }
1996
+ }
1997
+ }
1998
+ }
1999
+ }
2000
+ },
2001
+ "/agent/providers/{id}": {
2002
+ "delete": {
2003
+ "tags": ["Providers"],
2004
+ "summary": "Delete a provider",
2005
+ "operationId": "deleteProvider",
2006
+ "parameters": [
2007
+ { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }
2008
+ ],
2009
+ "responses": {
2010
+ "200": {
2011
+ "description": "Deleted",
2012
+ "content": {
2013
+ "application/json": {
2014
+ "schema": { "type": "object", "properties": { "message": { "type": "string" } } }
2015
+ }
2016
+ }
2017
+ }
2018
+ }
2019
+ },
2020
+ "patch": {
2021
+ "tags": ["Providers"],
2022
+ "summary": "Update a provider",
2023
+ "operationId": "updateProvider",
2024
+ "parameters": [
2025
+ { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }
2026
+ ],
2027
+ "requestBody": {
2028
+ "required": true,
2029
+ "content": {
2030
+ "application/json": {
2031
+ "schema": {
2032
+ "type": "object",
2033
+ "properties": { "config": { "type": "object" } }
2034
+ }
2035
+ }
2036
+ }
2037
+ },
2038
+ "responses": {
2039
+ "200": {
2040
+ "description": "Updated provider",
2041
+ "content": {
2042
+ "application/json": {
2043
+ "schema": { "type": "object", "properties": { "provider": { "$ref": "#/components/schemas/Provider" } } }
2044
+ }
2045
+ }
2046
+ }
2047
+ }
2048
+ }
2049
+ },
2050
+ "/agent/providers/{id}/models": {
2051
+ "post": {
2052
+ "tags": ["Providers"],
2053
+ "summary": "Add a model to a provider",
2054
+ "operationId": "addProviderModel",
2055
+ "parameters": [
2056
+ { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }
2057
+ ],
2058
+ "requestBody": {
2059
+ "required": true,
2060
+ "content": {
2061
+ "application/json": {
2062
+ "schema": {
2063
+ "type": "object",
2064
+ "required": ["key", "type"],
2065
+ "properties": {
2066
+ "key": { "type": "string" },
2067
+ "name": { "type": "string" },
2068
+ "type": { "type": "string", "enum": ["chat"] }
2069
+ }
2070
+ }
2071
+ }
2072
+ }
2073
+ },
2074
+ "responses": {
2075
+ "200": {
2076
+ "description": "Model added",
2077
+ "content": {
2078
+ "application/json": {
2079
+ "schema": { "type": "object", "properties": { "message": { "type": "string" } } }
2080
+ }
2081
+ }
2082
+ }
2083
+ }
2084
+ },
2085
+ "delete": {
2086
+ "tags": ["Providers"],
2087
+ "summary": "Remove a model from a provider",
2088
+ "operationId": "deleteProviderModel",
2089
+ "parameters": [
2090
+ { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }
2091
+ ],
2092
+ "requestBody": {
2093
+ "required": true,
2094
+ "content": {
2095
+ "application/json": {
2096
+ "schema": {
2097
+ "type": "object",
2098
+ "required": ["key", "type"],
2099
+ "properties": {
2100
+ "key": { "type": "string" },
2101
+ "type": { "type": "string", "enum": ["chat"] }
2102
+ }
2103
+ }
2104
+ }
2105
+ }
2106
+ },
2107
+ "responses": {
2108
+ "200": {
2109
+ "description": "Model removed",
2110
+ "content": {
2111
+ "application/json": {
2112
+ "schema": { "type": "object", "properties": { "message": { "type": "string" } } }
2113
+ }
2114
+ }
2115
+ }
2116
+ }
2117
+ }
2118
+ },
2119
+ "/scraper": {
2120
+ "get": {
2121
+ "tags": ["Scraper"],
2122
+ "summary": "Scrape a URL (GET)",
2123
+ "operationId": "scrapeGet",
2124
+ "parameters": [
2125
+ { "name": "url", "in": "query", "required": true, "schema": { "type": "string", "format": "uri" } },
2126
+ { "name": "blockImages", "in": "query", "schema": { "type": "boolean" } },
2127
+ { "name": "bypassCaptcha", "in": "query", "schema": { "type": "boolean" } },
2128
+ { "name": "timeout", "in": "query", "schema": { "type": "integer" } },
2129
+ { "name": "format", "in": "query", "schema": { "type": "string", "enum": ["html", "json"] } }
2130
+ ],
2131
+ "responses": {
2132
+ "200": {
2133
+ "description": "Scraped content",
2134
+ "content": { "application/json": { "schema": { "type": "object" } } }
2135
+ }
2136
+ }
2137
+ },
2138
+ "post": {
2139
+ "tags": ["Scraper"],
2140
+ "summary": "Scrape a URL (POST)",
2141
+ "operationId": "scrapePost",
2142
+ "requestBody": {
2143
+ "required": true,
2144
+ "content": {
2145
+ "application/json": {
2146
+ "schema": {
2147
+ "type": "object",
2148
+ "required": ["url"],
2149
+ "properties": {
2150
+ "url": { "type": "string", "format": "uri" },
2151
+ "blockImages": { "type": "boolean" },
2152
+ "bypassCaptcha": { "type": "boolean" },
2153
+ "timeout": { "type": "integer" },
2154
+ "format": { "type": "string", "enum": ["html", "json"] }
2155
+ }
2156
+ }
2157
+ }
2158
+ }
2159
+ },
2160
+ "responses": {
2161
+ "200": {
2162
+ "description": "Scraped content",
2163
+ "content": { "application/json": { "schema": { "type": "object" } } }
2164
+ }
2165
+ }
2166
+ }
2167
+ },
2168
+ "/search/engines": {
2169
+ "get": {
2170
+ "tags": ["Search Engines"],
2171
+ "summary": "List all available search engines by category",
2172
+ "operationId": "listSearchEngines",
2173
+ "responses": {
2174
+ "200": {
2175
+ "description": "Engines grouped by category",
2176
+ "content": {
2177
+ "application/json": {
2178
+ "schema": {
2179
+ "type": "object",
2180
+ "properties": {
2181
+ "engines": {
2182
+ "type": "object",
2183
+ "additionalProperties": {
2184
+ "type": "array",
2185
+ "items": {
2186
+ "type": "object",
2187
+ "properties": {
2188
+ "name": { "type": "string" },
2189
+ "categories": { "type": "array", "items": { "type": "string" } }
2190
+ }
2191
+ }
2192
+ }
2193
+ }
2194
+ }
2195
+ }
2196
+ }
2197
+ }
2198
+ }
2199
+ }
2200
+ }
2201
+ },
2202
+ "/search/engines/status": {
2203
+ "get": {
2204
+ "tags": ["Search Engines"],
2205
+ "summary": "Get enabled search engines",
2206
+ "operationId": "getEngineStatus",
2207
+ "responses": {
2208
+ "200": {
2209
+ "description": "Enabled engines",
2210
+ "content": {
2211
+ "application/json": {
2212
+ "schema": {
2213
+ "type": "object",
2214
+ "properties": {
2215
+ "enabledEngines": { "type": "array", "items": { "type": "string" } }
2216
+ }
2217
+ }
2218
+ }
2219
+ }
2220
+ }
2221
+ }
2222
+ },
2223
+ "post": {
2224
+ "tags": ["Search Engines"],
2225
+ "summary": "Update enabled search engines",
2226
+ "operationId": "updateEngineStatus",
2227
+ "requestBody": {
2228
+ "required": true,
2229
+ "content": {
2230
+ "application/json": {
2231
+ "schema": {
2232
+ "type": "object",
2233
+ "required": ["enabledEngines"],
2234
+ "properties": {
2235
+ "enabledEngines": { "type": "array", "items": { "type": "string" } }
2236
+ }
2237
+ }
2238
+ }
2239
+ }
2240
+ },
2241
+ "responses": {
2242
+ "200": {
2243
+ "description": "Updated",
2244
+ "content": {
2245
+ "application/json": {
2246
+ "schema": { "type": "object", "properties": { "message": { "type": "string" } } }
2247
+ }
2248
+ }
2249
+ }
2250
+ }
2251
+ }
2252
+ },
2253
+ "/search/engines/test": {
2254
+ "post": {
2255
+ "tags": ["Search Engines"],
2256
+ "summary": "Test whether search engines are working",
2257
+ "operationId": "testSearchEngines",
2258
+ "requestBody": {
2259
+ "required": true,
2260
+ "content": {
2261
+ "application/json": {
2262
+ "schema": {
2263
+ "type": "object",
2264
+ "required": ["engines"],
2265
+ "properties": {
2266
+ "engines": { "type": "array", "items": { "type": "string" } }
2267
+ }
2268
+ }
2269
+ }
2270
+ }
2271
+ },
2272
+ "responses": {
2273
+ "200": {
2274
+ "description": "Test results per engine",
2275
+ "content": {
2276
+ "application/json": {
2277
+ "schema": {
2278
+ "type": "object",
2279
+ "properties": {
2280
+ "results": {
2281
+ "type": "object",
2282
+ "additionalProperties": {
2283
+ "type": "object",
2284
+ "properties": {
2285
+ "working": { "type": "boolean" },
2286
+ "error": { "type": "string" }
2287
+ }
2288
+ }
2289
+ }
2290
+ }
2291
+ }
2292
+ }
2293
+ }
2294
+ }
2295
+ }
2296
+ }
2297
+ },
2298
+ "/user": {
2299
+ "get": {
2300
+ "tags": ["User"],
2301
+ "summary": "Get current user profile",
2302
+ "operationId": "getUser",
2303
+ "security": [{ "bearerAuth": [] }],
2304
+ "responses": {
2305
+ "200": {
2306
+ "description": "User profile",
2307
+ "content": {
2308
+ "application/json": { "schema": { "$ref": "#/components/schemas/UserProfile" } }
2309
+ }
2310
+ },
2311
+ "401": { "$ref": "#/components/responses/Unauthorized" }
2312
+ }
2313
+ },
2314
+ "patch": {
2315
+ "tags": ["User"],
2316
+ "summary": "Update user profile",
2317
+ "operationId": "updateUser",
2318
+ "security": [{ "bearerAuth": [] }],
2319
+ "requestBody": {
2320
+ "required": true,
2321
+ "content": {
2322
+ "application/json": {
2323
+ "schema": {
2324
+ "type": "object",
2325
+ "properties": {
2326
+ "name": { "type": "string" },
2327
+ "email": { "type": "string", "format": "email" },
2328
+ "image": { "type": "string", "format": "uri" },
2329
+ "regenerateApiKey": { "type": "boolean" }
2330
+ }
2331
+ }
2332
+ }
2333
+ }
2334
+ },
2335
+ "responses": {
2336
+ "200": {
2337
+ "description": "Updated",
2338
+ "content": {
2339
+ "application/json": {
2340
+ "schema": { "type": "object", "properties": { "message": { "type": "string" } } }
2341
+ }
2342
+ }
2343
+ },
2344
+ "401": { "$ref": "#/components/responses/Unauthorized" }
2345
+ }
2346
+ },
2347
+ "delete": {
2348
+ "tags": ["User"],
2349
+ "summary": "Delete account",
2350
+ "operationId": "deleteUser",
2351
+ "security": [{ "bearerAuth": [] }],
2352
+ "responses": {
2353
+ "200": {
2354
+ "description": "Deleted",
2355
+ "content": {
2356
+ "application/json": {
2357
+ "schema": { "type": "object", "properties": { "message": { "type": "string" } } }
2358
+ }
2359
+ }
2360
+ },
2361
+ "401": { "$ref": "#/components/responses/Unauthorized" }
2362
+ }
2363
+ }
2364
+ },
2365
+ "/user/accounts": {
2366
+ "get": {
2367
+ "tags": ["User"],
2368
+ "summary": "List linked OAuth accounts",
2369
+ "operationId": "listUserAccounts",
2370
+ "security": [{ "bearerAuth": [] }],
2371
+ "responses": {
2372
+ "200": {
2373
+ "description": "Accounts",
2374
+ "content": {
2375
+ "application/json": {
2376
+ "schema": {
2377
+ "type": "array",
2378
+ "items": {
2379
+ "type": "object",
2380
+ "properties": {
2381
+ "id": { "type": "string" },
2382
+ "providerId": { "type": "string" },
2383
+ "accountId": { "type": "string" },
2384
+ "createdAt": { "type": "string", "format": "date-time" }
2385
+ }
2386
+ }
2387
+ }
2388
+ }
2389
+ }
2390
+ },
2391
+ "401": { "$ref": "#/components/responses/Unauthorized" }
2392
+ }
2393
+ },
2394
+ "delete": {
2395
+ "tags": ["User"],
2396
+ "summary": "Unlink an OAuth account",
2397
+ "operationId": "deleteUserAccount",
2398
+ "security": [{ "bearerAuth": [] }],
2399
+ "requestBody": {
2400
+ "required": true,
2401
+ "content": {
2402
+ "application/json": {
2403
+ "schema": {
2404
+ "type": "object",
2405
+ "required": ["accountId"],
2406
+ "properties": { "accountId": { "type": "string" } }
2407
+ }
2408
+ }
2409
+ }
2410
+ },
2411
+ "responses": {
2412
+ "200": {
2413
+ "description": "Unlinked",
2414
+ "content": {
2415
+ "application/json": {
2416
+ "schema": { "type": "object", "properties": { "success": { "type": "boolean" } } }
2417
+ }
2418
+ }
2419
+ },
2420
+ "400": { "$ref": "#/components/responses/BadRequest" },
2421
+ "401": { "$ref": "#/components/responses/Unauthorized" }
2422
+ }
2423
+ }
2424
+ },
2425
+ "/user/password": {
2426
+ "post": {
2427
+ "tags": ["User"],
2428
+ "summary": "Change password",
2429
+ "operationId": "changePassword",
2430
+ "security": [{ "bearerAuth": [] }],
2431
+ "requestBody": {
2432
+ "required": true,
2433
+ "content": {
2434
+ "application/json": {
2435
+ "schema": {
2436
+ "type": "object",
2437
+ "required": ["currentPassword", "newPassword"],
2438
+ "properties": {
2439
+ "currentPassword": { "type": "string" },
2440
+ "newPassword": { "type": "string" }
2441
+ }
2442
+ }
2443
+ }
2444
+ }
2445
+ },
2446
+ "responses": {
2447
+ "200": {
2448
+ "description": "Changed",
2449
+ "content": {
2450
+ "application/json": {
2451
+ "schema": { "type": "object", "properties": { "message": { "type": "string" } } }
2452
+ }
2453
+ }
2454
+ },
2455
+ "401": { "$ref": "#/components/responses/Unauthorized" }
2456
+ }
2457
+ }
2458
+ },
2459
+ "/user/sessions": {
2460
+ "get": {
2461
+ "tags": ["User"],
2462
+ "summary": "List active sessions",
2463
+ "operationId": "listSessions",
2464
+ "security": [{ "bearerAuth": [] }],
2465
+ "responses": {
2466
+ "200": {
2467
+ "description": "Sessions",
2468
+ "content": {
2469
+ "application/json": {
2470
+ "schema": { "type": "array", "items": { "$ref": "#/components/schemas/UserSession" } }
2471
+ }
2472
+ }
2473
+ },
2474
+ "401": { "$ref": "#/components/responses/Unauthorized" }
2475
+ }
2476
+ },
2477
+ "delete": {
2478
+ "tags": ["User"],
2479
+ "summary": "Revoke all other sessions",
2480
+ "operationId": "revokeOtherSessions",
2481
+ "security": [{ "bearerAuth": [] }],
2482
+ "responses": {
2483
+ "200": {
2484
+ "description": "Revoked",
2485
+ "content": {
2486
+ "application/json": {
2487
+ "schema": { "type": "object", "properties": { "message": { "type": "string" } } }
2488
+ }
2489
+ }
2490
+ },
2491
+ "401": { "$ref": "#/components/responses/Unauthorized" }
2492
+ }
2493
+ }
2494
+ },
2495
+ "/user/sessions/{id}": {
2496
+ "delete": {
2497
+ "tags": ["User"],
2498
+ "summary": "Revoke a specific session",
2499
+ "operationId": "revokeSession",
2500
+ "security": [{ "bearerAuth": [] }],
2501
+ "parameters": [
2502
+ { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }
2503
+ ],
2504
+ "responses": {
2505
+ "200": {
2506
+ "description": "Revoked",
2507
+ "content": {
2508
+ "application/json": {
2509
+ "schema": { "type": "object", "properties": { "message": { "type": "string" } } }
2510
+ }
2511
+ }
2512
+ },
2513
+ "401": { "$ref": "#/components/responses/Unauthorized" }
2514
+ }
2515
+ }
2516
+ },
2517
+ "/user/storage": {
2518
+ "get": {
2519
+ "tags": ["User"],
2520
+ "summary": "Get storage usage",
2521
+ "operationId": "getUserStorage",
2522
+ "security": [{ "bearerAuth": [] }],
2523
+ "responses": {
2524
+ "200": {
2525
+ "description": "Storage info",
2526
+ "content": {
2527
+ "application/json": { "schema": { "$ref": "#/components/schemas/StorageInfo" } }
2528
+ }
2529
+ },
2530
+ "401": { "$ref": "#/components/responses/Unauthorized" }
2531
+ }
2532
+ }
2533
+ }
2534
+ },
2535
+ "components": {
2536
+ "securitySchemes": {
2537
+ "bearerAuth": {
2538
+ "type": "http",
2539
+ "scheme": "bearer",
2540
+ "bearerFormat": "JWT"
2541
+ }
2542
+ },
2543
+ "responses": {
2544
+ "BadRequest": {
2545
+ "description": "Bad request",
2546
+ "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
2547
+ },
2548
+ "Unauthorized": {
2549
+ "description": "Authentication required",
2550
+ "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
2551
+ },
2552
+ "NotFound": {
2553
+ "description": "Not found",
2554
+ "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
2555
+ },
2556
+ "RateLimited": {
2557
+ "description": "Rate limit exceeded",
2558
+ "content": {
2559
+ "application/json": {
2560
+ "schema": {
2561
+ "type": "object",
2562
+ "properties": {
2563
+ "error": { "type": "string" },
2564
+ "rateLimited": { "type": "boolean" }
2565
+ }
2566
+ }
2567
+ }
2568
+ }
2569
+ },
2570
+ "ServerError": {
2571
+ "description": "Internal server error",
2572
+ "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
2573
+ }
2574
+ },
2575
+ "schemas": {
2576
+ "ErrorResponse": {
2577
+ "type": "object",
2578
+ "properties": {
2579
+ "error": { "type": "string" },
2580
+ "message": { "type": "string" }
2581
+ }
2582
+ },
2583
+ "ModelWithProvider": {
2584
+ "type": "object",
2585
+ "required": ["providerId", "key"],
2586
+ "properties": {
2587
+ "providerId": { "type": "string", "example": "openai" },
2588
+ "key": { "type": "string", "example": "gpt-4o" }
2589
+ }
2590
+ },
2591
+ "SearchResult": {
2592
+ "type": "object",
2593
+ "properties": {
2594
+ "title": { "type": "string" },
2595
+ "url": { "type": "string", "format": "uri" },
2596
+ "content": { "type": "string" },
2597
+ "img_src": { "type": "string", "format": "uri" },
2598
+ "engine": { "type": "string" },
2599
+ "parsed_url": { "type": "array", "items": { "type": "string" } }
2600
+ }
2601
+ },
2602
+ "DomainSuggestion": {
2603
+ "type": "object",
2604
+ "properties": {
2605
+ "domain": { "type": "string" },
2606
+ "name": { "type": "string" },
2607
+ "favicon": { "type": "string" }
2608
+ }
2609
+ },
2610
+ "Article": {
2611
+ "type": "object",
2612
+ "properties": {
2613
+ "url": { "type": "string", "format": "uri" },
2614
+ "title": { "type": "string" },
2615
+ "cite": { "type": "string" },
2616
+ "author": { "type": "string" },
2617
+ "author_cite": { "type": "string" },
2618
+ "author_short": { "type": "string" },
2619
+ "author_type": { "type": "string" },
2620
+ "date": { "type": "string" },
2621
+ "source": { "type": "string" },
2622
+ "word_count": { "type": "integer" },
2623
+ "html": { "type": "string" },
2624
+ "followUpQuestions": { "type": "array", "items": { "type": "string" } },
2625
+ "qaHistory": {
2626
+ "type": "array",
2627
+ "items": {
2628
+ "type": "object",
2629
+ "properties": {
2630
+ "question": { "type": "string" },
2631
+ "answer": { "type": "string" }
2632
+ }
2633
+ }
2634
+ }
2635
+ }
2636
+ },
2637
+ "Chat": {
2638
+ "type": "object",
2639
+ "properties": {
2640
+ "id": { "type": "string" },
2641
+ "title": { "type": "string" },
2642
+ "createdAt": { "type": "string", "format": "date-time" },
2643
+ "focusMode": { "type": "string" },
2644
+ "userId": { "type": "string" },
2645
+ "files": { "type": "array", "items": { "type": "string" } },
2646
+ "messageCount": { "type": "integer" }
2647
+ }
2648
+ },
2649
+ "Favorite": {
2650
+ "type": "object",
2651
+ "properties": {
2652
+ "id": { "type": "integer" },
2653
+ "userId": { "type": "string" },
2654
+ "url": { "type": "string", "format": "uri" },
2655
+ "title": { "type": "string" },
2656
+ "cite": { "type": "string" },
2657
+ "author": { "type": "string" },
2658
+ "author_cite": { "type": "string" },
2659
+ "date": { "type": "string" },
2660
+ "source": { "type": "string" },
2661
+ "word_count": { "type": "integer" },
2662
+ "html": { "type": "string" },
2663
+ "createdAt": { "type": "string", "format": "date-time" }
2664
+ }
2665
+ },
2666
+ "Document": {
2667
+ "type": "object",
2668
+ "properties": {
2669
+ "id": { "type": "integer" },
2670
+ "title": { "type": "string" },
2671
+ "name": { "type": "string" },
2672
+ "content": { "type": "string" },
2673
+ "parentId": { "type": "integer" },
2674
+ "isFolder": { "type": "boolean" },
2675
+ "isExpanded": { "type": "boolean" },
2676
+ "metadata": { "type": "object" },
2677
+ "tags": { "type": "array", "items": { "type": "string" } },
2678
+ "userId": { "type": "string" },
2679
+ "createdAt": { "type": "string", "format": "date-time" },
2680
+ "updatedAt": { "type": "string", "format": "date-time" }
2681
+ }
2682
+ },
2683
+ "Quote": {
2684
+ "type": "object",
2685
+ "required": ["id", "documentId", "text"],
2686
+ "properties": {
2687
+ "id": { "type": "string" },
2688
+ "documentId": { "type": "string" },
2689
+ "text": { "type": "string" },
2690
+ "source": { "type": "string" },
2691
+ "author": { "type": "string" },
2692
+ "url": { "type": "string" },
2693
+ "pageNumber": { "type": "integer" },
2694
+ "tags": { "type": "array", "items": { "type": "string" } },
2695
+ "createdAt": { "type": "string", "format": "date-time" }
2696
+ }
2697
+ },
2698
+ "Provider": {
2699
+ "type": "object",
2700
+ "properties": {
2701
+ "id": { "type": "string" },
2702
+ "type": { "type": "string" },
2703
+ "name": { "type": "string" },
2704
+ "config": { "type": "object" },
2705
+ "models": { "type": "array", "items": { "type": "object" } }
2706
+ }
2707
+ },
2708
+ "MCPServer": {
2709
+ "type": "object",
2710
+ "properties": {
2711
+ "id": { "type": "string" },
2712
+ "type": { "type": "string" },
2713
+ "name": { "type": "string" },
2714
+ "config": { "type": "object" },
2715
+ "enabled": { "type": "boolean" }
2716
+ }
2717
+ },
2718
+ "Notebook": {
2719
+ "type": "object",
2720
+ "properties": {
2721
+ "id": { "type": "string" },
2722
+ "title": { "type": "string" },
2723
+ "createdAt": { "type": "string", "format": "date-time" }
2724
+ }
2725
+ },
2726
+ "NotebookSource": {
2727
+ "type": "object",
2728
+ "properties": {
2729
+ "id": { "type": "string" },
2730
+ "title": { "type": "string" },
2731
+ "url": { "type": "string", "format": "uri" }
2732
+ }
2733
+ },
2734
+ "UploadedFile": {
2735
+ "type": "object",
2736
+ "properties": {
2737
+ "fileName": { "type": "string" },
2738
+ "fileExtension": { "type": "string" },
2739
+ "fileId": { "type": "string" },
2740
+ "sizeBytes": { "type": "integer" }
2741
+ }
2742
+ },
2743
+ "UserProfile": {
2744
+ "type": "object",
2745
+ "properties": {
2746
+ "id": { "type": "string" },
2747
+ "name": { "type": "string" },
2748
+ "email": { "type": "string", "format": "email" },
2749
+ "image": { "type": "string", "format": "uri" },
2750
+ "apiKey": { "type": "string" },
2751
+ "createdAt": { "type": "string", "format": "date-time" }
2752
+ }
2753
+ },
2754
+ "UserSession": {
2755
+ "type": "object",
2756
+ "properties": {
2757
+ "id": { "type": "string" },
2758
+ "token": { "type": "string" },
2759
+ "ipAddress": { "type": "string" },
2760
+ "userAgent": { "type": "string" },
2761
+ "createdAt": { "type": "string", "format": "date-time" },
2762
+ "expiresAt": { "type": "string", "format": "date-time" },
2763
+ "isCurrent": { "type": "boolean" }
2764
+ }
2765
+ },
2766
+ "StorageInfo": {
2767
+ "type": "object",
2768
+ "properties": {
2769
+ "used": { "type": "integer" },
2770
+ "quota": { "type": "integer" },
2771
+ "remaining": { "type": "integer" },
2772
+ "allowed": { "type": "boolean" },
2773
+ "usedMB": { "type": "number" },
2774
+ "quotaMB": { "type": "number" },
2775
+ "remainingMB": { "type": "number" },
2776
+ "percentage": { "type": "number" }
2777
+ }
2778
+ }
2779
+ }
2780
+ }
2781
+ }