forked from diegosouzapw/OmniRoute
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.yaml
More file actions
6690 lines (6424 loc) · 186 KB
/
Copy pathopenapi.yaml
File metadata and controls
6690 lines (6424 loc) · 186 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.1.0
info:
title: OmniRoute API
version: 3.8.34
description: |
OmniRoute is a local-first AI API proxy router. It provides an OpenAI-compatible
endpoint that routes requests to multiple AI providers with load balancing,
failover, and usage tracking.
## Base URLs
- **Local**: `http://localhost:20128`
## Authentication
All proxy endpoints require a Bearer token (API key managed via the dashboard).
Management endpoints are protected when `requireLogin` is enabled.
contact:
name: OmniRoute
license:
name: MIT
servers:
- url: http://localhost:20128
description: Local development
tags:
- name: Playground
description: Playground Studio — preset management and prompt improvement
- name: Memory
description: Conversational memory management — CRUD, engine status, playground preview, summarization, reindex, and Qdrant settings (plan 21 — v3.8.6). All routes require management auth.
- name: Chat
description: OpenAI-compatible chat completions
- name: Messages
description: Anthropic-compatible messages
- name: Responses
description: OpenAI Responses API
- name: Embeddings
description: Text embedding generation
- name: Images
description: Image generation
- name: Audio
description: Audio speech and transcription
- name: Moderations
description: Content moderation
- name: Rerank
description: Document reranking
- name: Models
description: Available model listing
- name: Providers
description: Provider connection management
- name: Provider Nodes
description: Provider node configuration
- name: API Keys
description: API key management
- name: Combos
description: Routing combo management
- name: Settings
description: Application settings
- name: Compression
description: Prompt compression, RTK filters, Caveman rules, and compression combos
- name: Usage
description: Usage analytics and logs
- name: Translator
description: Format translation debug & testing
- name: CLI Tools
description: CLI tool configuration management
- name: Embedded Services
description: >-
Install, start, stop, and monitor locally-running embedded services (9Router, CLIProxyAPI).
All routes are LOCAL_ONLY — accessible from loopback only (hard rule #17).
- name: OAuth
description: OAuth flows for provider authentication
- name: System
description: System management (restart, shutdown, backup)
- name: Pricing
description: Model pricing configuration
- name: Cloud
description: Cloud worker authentication and sync
- name: Fallback
description: Fallback chain management
- name: Telemetry
description: Telemetry and token health monitoring
- name: Agent Skills
description: >-
Agent Skills catalog — 42 SKILL.md files (22 REST API + 20 CLI) for external agents,
MCP clients, and A2A orchestrators to discover OmniRoute capabilities.
- name: AgentBridge
description: >-
MITM proxy manager for 9 IDE agents (Antigravity, Kiro, Copilot, Codex, Cursor, Zed,
Claude Code, Open Code, Trae). Controls server lifecycle, DNS/model mappings, bypass list,
and cert management. All routes are LOCAL_ONLY + SPAWN_CAPABLE (hard rules #15, #17).
See docs/frameworks/AGENTBRIDGE.md.
- name: Traffic Inspector
description: >-
LLM-aware HTTPS traffic debugger with 4 capture modes (AgentBridge, Custom Hosts,
HTTP_PROXY :8080, System-wide). Provides real-time WebSocket stream, session recording,
HAR export, SSE merge, and conversation normalization.
All routes are LOCAL_ONLY + SPAWN_CAPABLE (hard rules #15, #17).
See docs/frameworks/TRAFFIC_INSPECTOR.md.
paths:
# --- Playground + Search Tools (plans 17+18) ---
/api/playground/improve-prompt:
post:
tags:
- Playground
summary: Improve prompt via LLM
description: |
Rewrites the supplied system prompt and/or user prompt using a meta-prompt
(inspired by Anthropic Console Prompt Improver). Internally calls
`/v1/chat/completions` with the model specified in the request body.
Quota is consumed from the caller's account.
security:
- BearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- model
properties:
system:
type: string
maxLength: 50000
description: System prompt to improve (at least one of system/prompt required)
prompt:
type: string
maxLength: 50000
description: User prompt to improve
model:
type: string
description: Model to use for the improvement call (e.g. openai/gpt-4o)
tone:
type: string
enum:
- concise
- detailed
default: concise
responses:
"200":
description: Improved prompt(s)
content:
application/json:
schema:
type: object
properties:
improvedSystem:
type: string
improvedPrompt:
type: string
tokensIn:
type: integer
tokensOut:
type: integer
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
/api/playground/presets:
get:
tags:
- Playground
summary: List playground presets
description: Returns all saved playground presets ordered by creation date (newest first).
security:
- BearerAuth: []
responses:
"200":
description: Preset list
content:
application/json:
schema:
type: object
properties:
presets:
type: array
items:
$ref: "#/components/schemas/PlaygroundPreset"
"401":
$ref: "#/components/responses/Unauthorized"
post:
tags:
- Playground
summary: Create playground preset
description: Saves the current playground configuration as a named preset in the database.
security:
- BearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/PlaygroundPresetCreate"
responses:
"201":
description: Created preset
content:
application/json:
schema:
$ref: "#/components/schemas/PlaygroundPreset"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
/api/playground/presets/{id}:
parameters:
- name: id
in: path
required: true
schema:
type: string
format: uuid
get:
tags:
- Playground
summary: Get playground preset
security:
- BearerAuth: []
responses:
"200":
description: Preset found
content:
application/json:
schema:
$ref: "#/components/schemas/PlaygroundPreset"
"401":
$ref: "#/components/responses/Unauthorized"
"404":
description: Preset not found
put:
tags:
- Playground
summary: Update playground preset
security:
- BearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/PlaygroundPresetCreate"
responses:
"200":
description: Updated preset
content:
application/json:
schema:
$ref: "#/components/schemas/PlaygroundPreset"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"404":
description: Preset not found
delete:
tags:
- Playground
summary: Delete playground preset
security:
- BearerAuth: []
responses:
"204":
description: Deleted
"401":
$ref: "#/components/responses/Unauthorized"
"404":
description: Preset not found
# --- Memory Engine (plan 21) ---
/api/memory:
get:
tags:
- Memory
summary: List memory entries
security:
- ManagementSessionAuth: []
parameters:
- name: apiKeyId
in: query
schema:
type: string
- name: type
in: query
schema:
type: string
enum:
- factual
- episodic
- procedural
- semantic
- name: sessionId
in: query
schema:
type: string
- name: q
in: query
schema:
type: string
- name: limit
in: query
schema:
type: integer
minimum: 1
maximum: 200
default: 50
- name: page
in: query
schema:
type: integer
minimum: 1
default: 1
- name: offset
in: query
schema:
type: integer
minimum: 0
responses:
"200":
description: Paginated list of memories with stats
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: "#/components/schemas/MemoryEntry"
total:
type: integer
totalPages:
type: integer
stats:
type: object
properties:
total:
type: integer
tokensUsed:
type: integer
hitRate:
type: number
cacheStats:
type: object
properties:
hits:
type: integer
misses:
type: integer
"401":
$ref: "#/components/responses/Unauthorized"
post:
tags:
- Memory
summary: Create a memory entry
security:
- ManagementSessionAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- content
- key
properties:
content:
type: string
minLength: 1
key:
type: string
minLength: 1
type:
type: string
enum:
- factual
- episodic
- procedural
- semantic
default: factual
sessionId:
type: string
nullable: true
apiKeyId:
type: string
metadata:
type: object
additionalProperties: true
expiresAt:
type: string
format: date-time
nullable: true
responses:
"201":
description: Created memory entry
content:
application/json:
schema:
$ref: "#/components/schemas/MemoryEntry"
"400":
description: Validation error
"401":
$ref: "#/components/responses/Unauthorized"
/api/memory/{id}:
parameters:
- name: id
in: path
required: true
schema:
type: string
description: Memory UUID
get:
tags:
- Memory
summary: Get a single memory entry
security:
- ManagementSessionAuth: []
responses:
"200":
description: Memory entry
content:
application/json:
schema:
$ref: "#/components/schemas/MemoryEntry"
"401":
$ref: "#/components/responses/Unauthorized"
"404":
description: Memory not found
put:
tags:
- Memory
summary: Update a memory entry
description: Update `type`, `key`, `content`, and/or `metadata` of an existing memory. If an embedding source is available, the vector in `vec_memories` is also regenerated. Corresponds to `MemoryUpdatePutSchema`.
security:
- ManagementSessionAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
type:
type: string
enum:
- factual
- episodic
- procedural
- semantic
key:
type: string
minLength: 1
content:
type: string
minLength: 1
metadata:
type: object
additionalProperties: true
additionalProperties: false
responses:
"200":
description: Updated memory entry
content:
application/json:
schema:
$ref: "#/components/schemas/MemoryEntry"
"400":
description: Validation error
"401":
$ref: "#/components/responses/Unauthorized"
"404":
description: Memory not found
delete:
tags:
- Memory
summary: Delete a memory entry
description: Deletes the SQLite row, removes the vector from `vec_memories`, and best-effort deletes the point from Qdrant.
security:
- ManagementSessionAuth: []
responses:
"200":
description: Deleted
content:
application/json:
schema:
type: object
properties:
success:
type: boolean
"401":
$ref: "#/components/responses/Unauthorized"
"404":
description: Memory not found
/api/memory/health:
get:
tags:
- Memory
summary: Memory store health check
description: Round-trip create→list→delete to verify the store is alive.
security:
- ManagementSessionAuth: []
responses:
"200":
description: Health result
content:
application/json:
schema:
type: object
properties:
working:
type: boolean
latencyMs:
type: number
error:
type: string
nullable: true
"401":
$ref: "#/components/responses/Unauthorized"
/api/memory/retrieve-preview:
post:
tags:
- Memory
summary: Dry-run memory retrieval (Playground)
description: Simulates `retrieveMemories()` for a given query and returns the ranked results with score, tier, and token count. Does NOT modify any memory. Corresponds to `RetrievePreviewSchema`.
security:
- ManagementSessionAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- query
properties:
query:
type: string
minLength: 1
strategy:
type: string
enum:
- exact
- semantic
- hybrid
default: hybrid
maxTokens:
type: integer
minimum: 1
maximum: 16000
default: 2000
apiKeyId:
type: string
description: Optional — tests global pool when omitted
limit:
type: integer
minimum: 1
maximum: 100
default: 20
additionalProperties: false
responses:
"200":
description: Preview results
content:
application/json:
schema:
type: object
properties:
memories:
type: array
items:
type: object
properties:
id:
type: string
type:
type: string
enum:
- factual
- episodic
- procedural
- semantic
key:
type: string
content:
type: string
score:
type: number
tokens:
type: integer
tier:
type: string
enum:
- fts5
- vector
- hybrid-rrf
- qdrant
vecScore:
type: number
nullable: true
ftsScore:
type: number
nullable: true
resolution:
type: object
properties:
embeddingSource:
type: string
enum:
- remote
- static
- transformers
nullable: true
embeddingModel:
type: string
nullable: true
vectorStore:
type: string
enum:
- sqlite-vec
- qdrant
- none
strategyUsed:
type: string
enum:
- exact
- semantic
- hybrid
rerankApplied:
type: boolean
fallbackReason:
type: string
nullable: true
totalTokensUsed:
type: integer
budgetMaxTokens:
type: integer
"400":
description: Validation error
"401":
$ref: "#/components/responses/Unauthorized"
/api/memory/embedding-providers:
get:
tags:
- Memory
summary: List embedding providers
description: Returns all providers that have embedding-capable models, indicating which have an active API key configured.
security:
- ManagementSessionAuth: []
responses:
"200":
description: Provider list
content:
application/json:
schema:
type: object
properties:
providers:
type: array
items:
type: object
properties:
provider:
type: string
hasKey:
type: boolean
models:
type: array
items:
type: object
properties:
id:
type: string
description: "Format: provider/model"
name:
type: string
dimensions:
type: integer
nullable: true
"401":
$ref: "#/components/responses/Unauthorized"
/api/memory/engine-status:
get:
tags:
- Memory
summary: Memory engine status
description: Returns the full engine status including keyword tier availability, embedding resolution, vector store statistics (sqlite-vec), Qdrant health, and rerank configuration. Corresponds to `MemoryEngineStatusSchema`.
security:
- ManagementSessionAuth: []
responses:
"200":
description: Engine status
content:
application/json:
schema:
type: object
properties:
keyword:
type: object
properties:
available:
type: boolean
backend:
type: string
enum:
- FTS5
embedding:
type: object
properties:
source:
type: string
enum:
- remote
- static
- transformers
nullable: true
model:
type: string
nullable: true
dimensions:
type: integer
nullable: true
available:
type: boolean
reason:
type: string
cacheStats:
type: object
properties:
hits:
type: integer
misses:
type: integer
size:
type: integer
vectorStore:
type: object
properties:
backend:
type: string
enum:
- sqlite-vec
- qdrant
- none
available:
type: boolean
rowCount:
type: integer
needsReindex:
type: integer
reason:
type: string
qdrant:
type: object
properties:
enabled:
type: boolean
healthy:
type: boolean
nullable: true
latencyMs:
type: number
nullable: true
error:
type: string
nullable: true
rerank:
type: object
properties:
enabled:
type: boolean
provider:
type: string
nullable: true
model:
type: string
nullable: true
available:
type: boolean
reason:
type: string
"401":
$ref: "#/components/responses/Unauthorized"
/api/memory/summarize:
post:
tags:
- Memory
summary: Compact old memories
description: "Manually triggers memory compaction for memories older than `olderThanDays`. Use `dryRun: true` to preview candidates. Corresponds to `MemorySummarizeSchema`."
security:
- ManagementSessionAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
olderThanDays:
type: integer
minimum: 1
maximum: 365
default: 30
apiKeyId:
type: string
description: Optional — compacts all keys when omitted
dryRun:
type: boolean
default: false
additionalProperties: false
responses:
"200":
description: Summarization result
content:
application/json:
schema:
type: object
properties:
candidates:
type: integer
tokensSaved:
type: integer
dryRun:
type: boolean
"400":
description: Validation error
"401":
$ref: "#/components/responses/Unauthorized"
/api/memory/reindex:
post:
tags:
- Memory
summary: Trigger vector reindex
description: "Starts background reindexing of memories with `needs_reindex = 1`. Use `force: true` to regenerate ALL vectors regardless of index status. Corresponds to `MemoryReindexSchema`."
security:
- ManagementSessionAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
force:
type: boolean
default: false
description: When true, marks all memories needs_reindex=1 before running.
additionalProperties: false
responses:
"200":
description: Reindex started
content:
application/json:
schema:
type: object
properties:
started:
type: boolean
pending:
type: integer
description: Memories still pending after this batch
"400":
description: Validation error
"401":
$ref: "#/components/responses/Unauthorized"
/api/settings/memory:
get:
tags:
- Memory
- Settings
summary: Get memory settings
description: Returns the extended memory settings including 7 new fields added in plan 21 (embeddingSource, embeddingProviderModel, transformersEnabled, staticEnabled, rerankEnabled, rerankProviderModel, vectorStore).
security:
- ManagementSessionAuth: []
responses:
"200":
description: Extended memory settings
content:
application/json:
schema:
$ref: "#/components/schemas/MemorySettingsExtended"
"401":
$ref: "#/components/responses/Unauthorized"
put:
tags:
- Memory
- Settings
summary: Update memory settings
description: "Update any subset of the extended memory settings. All fields are optional; only provided fields are updated. Schema: `MemorySettingsExtendedSchema`."
security:
- ManagementSessionAuth: []
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/MemorySettingsExtended"
responses:
"200":
description: Updated memory settings
content:
application/json:
schema:
$ref: "#/components/schemas/MemorySettingsExtended"
"400":
description: Validation error
"401":
$ref: "#/components/responses/Unauthorized"
/api/settings/qdrant:
get:
tags:
- Memory
- Settings
summary: Get Qdrant settings
description: Returns current Qdrant configuration. The `apiKey` field is never returned raw — use `hasApiKey` / `apiKeyMasked` instead.
security:
- ManagementSessionAuth: []
responses:
"200":
description: Qdrant settings
content:
application/json:
schema:
$ref: "#/components/schemas/QdrantSettings"
"401":
$ref: "#/components/responses/Unauthorized"
put:
tags:
- Memory
- Settings
summary: Update Qdrant settings
description: 'Update Qdrant configuration. Pass `apiKey: ""` to remove the stored key. Schema: `QdrantSettingsUpdateSchema`.'
security:
- ManagementSessionAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
enabled:
type: boolean
host:
type: string
port:
type: integer
minimum: 1
maximum: 65535
collection:
type: string
minLength: 1
embeddingModel:
type: string
minLength: 1
apiKey:
type: string
description: Empty string removes the key
additionalProperties: false
responses:
"200":
description: Updated Qdrant settings
content:
application/json:
schema:
$ref: "#/components/schemas/QdrantSettings"
"400":
description: Validation error
"401":
$ref: "#/components/responses/Unauthorized"
/api/settings/qdrant/health:
get:
tags:
- Memory
summary: Qdrant health probe
description: Performs a liveness check against the configured Qdrant instance. Returns latency and any connection error (sanitized — no stack traces).
security:
- ManagementSessionAuth: []
responses:
"200":
description: Health result
content:
application/json:
schema:
$ref: "#/components/schemas/QdrantHealthResult"
"401":
$ref: "#/components/responses/Unauthorized"
/api/settings/qdrant/search:
post:
tags:
- Memory
summary: Qdrant semantic search test
description: "Performs a test semantic search against the Qdrant collection. Useful for validating that the integration works end-to-end. Schema: `QdrantSearchSchema`."
security:
- ManagementSessionAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: object