-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.json
More file actions
2088 lines (2088 loc) · 56.2 KB
/
Copy pathopenapi.json
File metadata and controls
2088 lines (2088 loc) · 56.2 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": "AIgateway API",
"version": "1.0.0",
"summary": "AIgateway — one OpenAI-compatible endpoint, every model, every modality.",
"description": "Drop-in for the OpenAI SDK: set base_url to https://api.aigateway.sh/v1. Beyond the core endpoints, AIgateway exposes aggregator-native primitives — sub-accounts, eval-driven routing, replay + shadow A/B, cost-attribution tags, and hard budget caps.\n\n## Auto Router\n\nSet `model` to `\"auto\"` (or scope it to a modality with `\"auto/text\"`, `\"auto/image\"`, `\"auto/video\"`, `\"auto/tts\"`, `\"auto/stt\"`, `\"auto/music\"`, `\"auto/embedding\"`), or omit `model` entirely, and the gateway reads each request, picks the cheapest model in a curated, eval-covered pool that still clears the quality floor, and bills you less than the premium model you would otherwise have called. Every request carries a baseline (set it explicitly with `baseline_model`, or it defaults to the premium model for that modality); the baseline doubles as a hard cost ceiling, so the router only ever routes DOWN and you never pay more than the baseline. Bias the pick with `x-routing` (`cost` | `speed` | `quality` | `auto`). Routed responses return transparency headers (`X-Routing-Selected`, `X-Routing-Reason`, `X-Routing-Complexity`, `X-Routing-Quality`, `X-Auto-Baseline-Model`, `X-Auto-Baseline-Cost-Cents`, `X-Auto-Route-Fee-Cents`, `X-Auto-Savings-Cents`) showing what ran, why, and the exact savings. Everything else stays OpenAI-compatible — only the `model` value changes.",
"contact": {
"name": "AIgateway support",
"email": "support@aigateway.sh",
"url": "https://aigateway.sh/support"
}
},
"servers": [
{
"url": "https://api.aigateway.sh",
"description": "JSON API"
},
{
"url": "https://media.aigateway.sh",
"description": "Media / file downloads (for /v1/files/** paths)"
}
],
"security": [
{
"bearerAuth": []
}
],
"components": {
"securitySchemes": {
"bearerAuth": {
"type": "http",
"scheme": "bearer",
"bearerFormat": "sk-aig-..."
}
},
"schemas": {
"Error": {
"type": "object",
"properties": {
"error": {
"type": "object",
"properties": {
"message": {
"type": "string"
},
"type": {
"type": "string"
},
"code": {
"type": "integer"
},
"param": {
"type": "string",
"nullable": true
}
},
"required": [
"message",
"type",
"code"
]
}
}
},
"ChatMessage": {
"type": "object",
"properties": {
"role": {
"type": "string",
"enum": [
"system",
"user",
"assistant",
"tool"
]
},
"content": {
"type": "string"
},
"name": {
"type": "string"
}
},
"required": [
"role",
"content"
]
},
"ChatCompletionRequest": {
"type": "object",
"properties": {
"model": {
"type": "string",
"description": "An explicit provider/model slug (e.g. anthropic/claude-opus-4.8), or an Auto Router value: \"auto\" picks the cheapest model in the curated text pool that clears the quality floor and stays at or under your baseline; \"auto/<modality>\" scopes routing to a modality (text | image | video | tts | stt | music | embedding). Omitting the field entirely is treated as \"auto\". On routed calls you pay strictly less than the premium baseline, never more.",
"examples": [
"anthropic/claude-opus-4.8",
"auto",
"auto/text"
]
},
"baseline_model": {
"type": "string",
"description": "Auto Router only. The model you would otherwise have called. Sets the savings measuring-stick and the hard cost ceiling: auto candidates are filtered to those no more expensive than this, so the router only routes DOWN and you never pay above the baseline. Defaults to the premium model for the resolved modality when omitted. Also accepted as the x-baseline-model header.",
"example": "anthropic/claude-opus-4.8"
},
"x-routing": {
"type": "string",
"enum": [
"cost",
"speed",
"quality",
"auto"
],
"description": "Auto Router only. Biases model selection: \"cost\" favors the cheapest model that clears the floor; \"quality\" favors the strongest model still at or under your baseline; \"speed\" favors faster models; \"auto\" balances cost and quality from the complexity read. Defaults to \"auto\"."
},
"messages": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ChatMessage"
}
},
"stream": {
"type": "boolean",
"default": false
},
"max_tokens": {
"type": "integer"
},
"temperature": {
"type": "number"
},
"top_p": {
"type": "number"
},
"tools": {
"type": "array",
"items": {
"type": "object"
}
}
},
"required": [
"messages"
]
},
"SubAccount": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"external_ref": {
"type": "string",
"nullable": true
},
"spend_cap_cents": {
"type": "integer"
},
"rate_limit_rpm": {
"type": "integer"
},
"default_tag": {
"type": "string",
"nullable": true
},
"created_at": {
"type": "integer"
}
}
},
"EvalRun": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"candidate_models": {
"type": "array",
"items": {
"type": "string"
}
},
"dataset_size": {
"type": "integer"
},
"metric": {
"type": "string",
"enum": [
"quality",
"cost",
"speed"
]
},
"status": {
"type": "string",
"enum": [
"running",
"completed",
"failed"
]
},
"winner_model": {
"type": "string",
"nullable": true
},
"summary": {
"type": "object"
}
}
},
"Usage": {
"type": "object",
"properties": {
"prompt_tokens": {
"type": "integer"
},
"completion_tokens": {
"type": "integer"
},
"total_tokens": {
"type": "integer"
},
"prompt_tokens_details": {
"type": "object",
"properties": {
"cached_tokens": {
"type": "integer"
}
}
},
"cost": {
"type": "number",
"description": "Total cost of this request in USD."
}
}
},
"Replay": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"source_request_id": {
"type": "string"
},
"source_model": {
"type": "string"
},
"target_model": {
"type": "string"
},
"shadow": {
"type": "boolean"
},
"cost_source_cents": {
"type": "number"
},
"cost_target_cents": {
"type": "number"
},
"latency_source_ms": {
"type": "integer"
},
"latency_target_ms": {
"type": "integer"
},
"score_delta": {
"type": "number",
"nullable": true
},
"source_output": {
"type": "string",
"nullable": true
},
"target_output": {
"type": "string",
"nullable": true
}
}
},
"AnthropicMessage": {
"type": "object",
"properties": {
"role": {
"type": "string",
"enum": [
"user",
"assistant"
]
},
"content": {
"oneOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "object"
},
"description": "Content blocks (text, image, tool_use, tool_result)."
}
]
}
},
"required": [
"role",
"content"
]
},
"AnthropicMessagesRequest": {
"type": "object",
"properties": {
"model": {
"type": "string",
"description": "A bare Claude name (claude-opus-4.7, claude-sonnet-4.6, claude-haiku-4.5) resolves to the matching anthropic/* catalog slug, OR any AIgateway provider/model slug to run the Anthropic Messages shape on a non-Claude model (e.g. openai/gpt-5.4, moonshot/kimi-k2.7-code).",
"examples": [
"claude-opus-4.7",
"anthropic/claude-sonnet-4.6",
"openai/gpt-5.4"
]
},
"max_tokens": {
"type": "integer",
"description": "Maximum number of tokens to generate. Required by the Anthropic Messages API."
},
"messages": {
"type": "array",
"items": {
"$ref": "#/components/schemas/AnthropicMessage"
}
},
"system": {
"oneOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "object"
}
}
],
"description": "System prompt — a string or an array of content blocks."
},
"temperature": {
"type": "number"
},
"top_p": {
"type": "number"
},
"top_k": {
"type": "integer"
},
"stop_sequences": {
"type": "array",
"items": {
"type": "string"
}
},
"stream": {
"type": "boolean",
"default": false
},
"tools": {
"type": "array",
"items": {
"type": "object"
}
},
"tool_choice": {
"type": "object"
}
},
"required": [
"model",
"max_tokens",
"messages"
]
},
"AnthropicMessagesResponse": {
"type": "object",
"properties": {
"id": {
"type": "string",
"example": "msg_01..."
},
"type": {
"type": "string",
"enum": [
"message"
]
},
"role": {
"type": "string",
"enum": [
"assistant"
]
},
"model": {
"type": "string"
},
"content": {
"type": "array",
"items": {
"type": "object"
},
"description": "Array of content blocks — typically { type: \"text\", text } and/or { type: \"tool_use\", ... }."
},
"stop_reason": {
"type": "string",
"enum": [
"end_turn",
"max_tokens",
"stop_sequence",
"tool_use"
],
"nullable": true
},
"stop_sequence": {
"type": "string",
"nullable": true
},
"usage": {
"type": "object",
"properties": {
"input_tokens": {
"type": "integer"
},
"output_tokens": {
"type": "integer"
}
},
"required": [
"input_tokens",
"output_tokens"
]
}
}
}
},
"parameters": {
"XAigTag": {
"name": "x-aig-tag",
"in": "header",
"required": false,
"description": "Cost-attribution tag for the request. Surfaces in /v1/usage/by-tag.",
"schema": {
"type": "string",
"maxLength": 64
}
},
"XBaselineModel": {
"name": "x-baseline-model",
"in": "header",
"required": false,
"description": "Auto Router only. Header form of baseline_model: the model you would otherwise have called, used as the savings measuring-stick and the hard cost ceiling. The router only routes DOWN from it, so you never pay above the baseline. Defaults to the premium model for the resolved modality.",
"schema": {
"type": "string",
"example": "anthropic/claude-opus-4.8"
}
}
},
"headers": {
"XAutoRouted": {
"description": "Auto Router only. Present and \"true\" when the request was routed by model:\"auto\".",
"schema": {
"type": "string",
"enum": [
"true"
]
}
},
"XRoutingSelected": {
"description": "Auto Router only. The provider/model slug the router actually ran.",
"schema": {
"type": "string",
"example": "anthropic/claude-haiku-4.5"
}
},
"XRoutingReason": {
"description": "Auto Router only. Short human-readable reason the model was picked.",
"schema": {
"type": "string"
}
},
"XRoutingComplexity": {
"description": "Auto Router only. The complexity read of the request that drove the pick.",
"schema": {
"type": "string",
"enum": [
"simple",
"moderate",
"complex"
],
"example": "simple"
}
},
"XRoutingQuality": {
"description": "Auto Router only. The curated quality prior of the selected model, in [0,1].",
"schema": {
"type": "string",
"example": "0.780"
}
},
"XAutoBaselineModel": {
"description": "Auto Router only. The baseline (premium) model used as the cost ceiling and savings measuring-stick.",
"schema": {
"type": "string",
"example": "anthropic/claude-opus-4.8"
}
},
"XAutoBaselineCostCents": {
"description": "Auto Router only. What this request would have cost on the baseline model, in cents.",
"schema": {
"type": "string",
"example": "0.997"
}
},
"XAutoRouteFeeCents": {
"description": "Auto Router only. The Auto Router fee applied to this routed call, in cents.",
"schema": {
"type": "string"
}
},
"XAutoSavingsCents": {
"description": "Auto Router only. Dollars saved on this call versus the baseline model, in cents.",
"schema": {
"type": "string",
"example": "5.58"
}
},
"XCostCents": {
"description": "Cost of this request to the customer, in fractional cents (up to 6 decimal places).",
"schema": {
"type": "string",
"example": "0.4389"
}
},
"XCachedInputUnits": {
"description": "Number of input tokens served from the provider prompt cache. Present only when caching reduced the cost.",
"schema": {
"type": "string",
"example": "4500"
}
}
}
},
"paths": {
"/v1/chat/completions": {
"post": {
"summary": "Create a chat completion",
"description": "OpenAI-compatible chat completion. Set model to \"auto\" or \"auto/text\" (or omit it) to use the Auto Router: the gateway reads the request, routes down to the cheapest curated model that clears the quality floor, and bills you less than your baseline. See baseline_model and x-routing in the request body, and the X-Routing-*/X-Auto-* response headers. On streaming responses the routing-decision headers arrive up front.",
"tags": [
"core"
],
"parameters": [
{
"$ref": "#/components/parameters/XAigTag"
},
{
"$ref": "#/components/parameters/XBaselineModel"
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ChatCompletionRequest"
}
}
}
},
"responses": {
"200": {
"description": "Chat completion (OpenAI shape). On Auto Router calls, transparency headers disclose the pick and savings.",
"headers": {
"X-Auto-Routed": {
"$ref": "#/components/headers/XAutoRouted"
},
"X-Routing-Selected": {
"$ref": "#/components/headers/XRoutingSelected"
},
"X-Routing-Reason": {
"$ref": "#/components/headers/XRoutingReason"
},
"X-Routing-Complexity": {
"$ref": "#/components/headers/XRoutingComplexity"
},
"X-Routing-Quality": {
"$ref": "#/components/headers/XRoutingQuality"
},
"X-Auto-Baseline-Model": {
"$ref": "#/components/headers/XAutoBaselineModel"
},
"X-Auto-Baseline-Cost-Cents": {
"$ref": "#/components/headers/XAutoBaselineCostCents"
},
"X-Auto-Route-Fee-Cents": {
"$ref": "#/components/headers/XAutoRouteFeeCents"
},
"X-Auto-Savings-Cents": {
"$ref": "#/components/headers/XAutoSavingsCents"
},
"X-Cost-Cents": {
"$ref": "#/components/headers/XCostCents"
},
"X-Cached-Input-Units": {
"$ref": "#/components/headers/XCachedInputUnits"
}
}
},
"400": {
"description": "Invalid request",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "Auth error"
},
"402": {
"description": "Budget exceeded"
},
"429": {
"description": "Rate limited"
}
}
}
},
"/v1/messages": {
"post": {
"summary": "Create a message (Anthropic Messages API)",
"description": "Native Anthropic Messages API — the official Anthropic SDK and Claude Code work drop-in. For Claude Code: set ANTHROPIC_BASE_URL=https://api.aigateway.sh and ANTHROPIC_API_KEY=sk-aig-... The alias POST /anthropic/v1/messages is for the official Anthropic SDK (anthropic.Anthropic(base_url=\"https://api.aigateway.sh/anthropic\", api_key=\"sk-aig-...\")) — the SDK sends the key as the x-api-key header automatically. Bare Claude names (claude-opus-4.7, claude-sonnet-4.6, claude-haiku-4.5) resolve to the anthropic/* catalog slugs, or pass any AIgateway provider/model slug (e.g. openai/gpt-5.4, moonshot/kimi-k2.7-code) to run the Anthropic shape on any model. Set stream:true for the full Anthropic SSE event sequence (message_start, content_block_start/delta/stop, message_delta, message_stop). Send the sk-aig- key as x-api-key or Authorization: Bearer; the anthropic-version: 2023-06-01 header is required by the clients.",
"tags": [
"core"
],
"parameters": [
{
"$ref": "#/components/parameters/XAigTag"
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AnthropicMessagesRequest"
}
}
}
},
"responses": {
"200": {
"description": "Anthropic Messages response (or SSE event stream when stream=true).",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AnthropicMessagesResponse"
}
}
}
},
"400": {
"description": "Invalid request",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "Auth error"
},
"402": {
"description": "Budget exceeded"
},
"429": {
"description": "Rate limited"
}
}
}
},
"/v1/messages/count_tokens": {
"post": {
"summary": "Count tokens for a message (Anthropic Messages API)",
"description": "Returns the input token count for a Messages request without running inference. Same request shape as /v1/messages (max_tokens is ignored). Claude Code calls this. The alias POST /anthropic/v1/messages/count_tokens is available for the official Anthropic SDK.",
"tags": [
"core"
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AnthropicMessagesRequest"
}
}
}
},
"responses": {
"200": {
"description": "Input token count.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"input_tokens": {
"type": "integer"
}
},
"required": [
"input_tokens"
]
}
}
}
},
"400": {
"description": "Invalid request",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "Auth error"
}
}
}
},
"/v1/embeddings": {
"post": {
"summary": "Create embeddings",
"tags": [
"core"
],
"responses": {
"200": {
"description": "OK"
}
}
}
},
"/v1/images/generations": {
"post": {
"summary": "Generate an image",
"tags": [
"core"
],
"responses": {
"200": {
"description": "OK"
}
}
}
},
"/v1/images/edits": {
"post": {
"summary": "Edit an existing image with a text prompt (OpenAI-compatible).",
"tags": [
"core"
],
"parameters": [
{
"$ref": "#/components/parameters/XAigTag"
}
],
"requestBody": {
"required": true,
"content": {
"multipart/form-data": {
"schema": {
"type": "object",
"properties": {
"image": {
"type": "string",
"format": "binary"
},
"mask": {
"type": "string",
"format": "binary"
},
"prompt": {
"type": "string"
},
"model": {
"type": "string"
},
"n": {
"type": "integer"
},
"size": {
"type": "string"
},
"response_format": {
"type": "string",
"enum": [
"url",
"b64_json"
]
}
},
"required": [
"image",
"prompt"
]
}
},
"application/json": {
"schema": {
"type": "object",
"properties": {
"image_url": {
"type": "string"
},
"mask_url": {
"type": "string"
},
"prompt": {
"type": "string"
},
"model": {
"type": "string"
},
"n": {
"type": "integer"
},
"size": {
"type": "string"
}
},
"required": [
"image_url",
"prompt"
]
}
}
}
},
"responses": {
"200": {
"description": "Edited image (OpenAI shape: { created, data: [{ url | b64_json }] })"
},
"400": {
"description": "Invalid request"
},
"401": {
"description": "Auth error"
},
"402": {
"description": "Budget exceeded"
},
"413": {
"description": "Image exceeds 25 MB"
},
"429": {
"description": "Rate limited"
}
}
}
},
"/v1/audio/transcriptions": {
"post": {
"summary": "Transcribe audio (sync, or async via async:true / webhook_url)",
"description": "Speech-to-text. Synchronous by default. Pass async:true (then poll GET /v1/jobs/{id}) or a webhook_url to run as a batch job — best for long recordings (Deepgram Nova 3 / Flux). For live transcription, use the WebSocket endpoint GET /v1/realtime.",
"tags": [
"core"
],
"responses": {
"200": {
"description": "OK (sync transcript)"
},
"202": {
"description": "Accepted — async job created; poll /v1/jobs/{id}"
}
}
}
},
"/v1/realtime": {
"get": {
"summary": "Realtime streaming speech-to-text (WebSocket)",
"description": "WebSocket endpoint. Connect to wss://api.aigateway.sh/v1/realtime?model=deepgram/nova-3&encoding=linear16&sample_rate=16000&interim_results=true with ?api_key= (browsers) or Authorization: Bearer (servers). Stream raw audio frames; receive {type:\"Results\",...} then a final {type:\"Metadata\"}. End with {\"type\":\"CloseStream\"}. Billed per audio-minute. Models: deepgram/nova-3, deepgram/flux.",
"tags": [
"core"
],
"responses": {
"101": {
"description": "Switching Protocols — WebSocket established"
},
"426": {
"description": "Upgrade Required — connect with wss://"
}
}
}
},
"/v1/audio/speech": {
"post": {
"summary": "Synthesize speech",
"tags": [
"core"
],
"responses": {
"200": {
"description": "OK"
}
}
}
},
"/v1/moderations": {
"post": {
"summary": "Moderate content",
"tags": [
"core"
],
"responses": {
"200": {
"description": "OK"
}
}
}
},
"/v1/models": {
"get": {
"summary": "List models",
"description": "List models with pricing, context window, capabilities, and tier. Filter with ?modality= and ?provider=.",
"tags": [
"catalog"
],
"responses": {
"200": {
"description": "OK"
}
}
}
},
"/v1/models/{id}": {
"get": {
"summary": "Get a model (with invocation schema)",
"description": "Returns the model's metadata plus a `schema` block: the exact endpoint, a request example, a non-streaming and streaming response example, model-specific quirks (e.g. reasoning output, rejects temperature, max_completion_tokens), and runnable curl/Python/TypeScript snippets. This is the canonical \"how do I call this model\" call for agents.",
"tags": [
"catalog"
],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"example": "openai/gpt-5.4"
}
],
"responses": {
"200": {
"description": "OK"
},
"404": {
"description": "Not found"
}
}
}
},
"/v1/models/{id}/schema": {
"get": {
"summary": "Get just a model's invocation schema",
"description": "The `schema` block alone (endpoint, request/response/streaming examples, quirks, SDK snippets) for the given model id.",
"tags": [
"catalog"
],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"example": "anthropic/claude-opus-4.7"
}