Repository navigation
Expand file tree
/
Copy pathopenapi.yaml
More file actions
5208 lines (5170 loc) · 186 KB
/
Copy pathopenapi.yaml
File metadata and controls
5208 lines (5170 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: Inference Gateway API
description: |
The API for interacting with various language models and other AI services.
OpenAI, Groq, Ollama, and other providers are supported.
OpenAI compatible API for using with existing clients.
Unified API for all providers.
contact:
name: Inference Gateway
url: https://inference-gateway.github.io/docs/
version: 1.0.0
license:
name: Apache-2.0
url: https://github.com/inference-gateway/inference-gateway/blob/main/LICENSE
servers:
- url: http://localhost:8080
description: Default server without version prefix for healthcheck and proxy and points
x-server-tags:
- Health
- Proxy
- MCP
- url: http://localhost:8080/v1
description: Default server with version prefix for listing models and chat completions
x-server-tags:
- Models
- Completions
- Responses
- Messages
- Images
- Audio
- Videos
- Metrics
- url: https://api.inference-gateway.local/v1
description: Local server with version prefix for listing models and chat completions
x-server-tags:
- Models
- Completions
- Responses
- Images
- Audio
- Videos
tags:
- name: Models
description: List and describe the various models available in the API.
- name: Completions
description: Generate completions from the models.
- name: Responses
description: Generate model responses using the OpenAI-compatible Responses API.
- name: Messages
description: Generate messages using the Anthropic-compatible Messages API.
- name: Images
description: Generate images using the OpenAI-compatible Images API.
- name: Audio
description: Generate speech audio from text using the OpenAI-compatible Speech API.
- name: Videos
description: Generate videos using the OpenAI-compatible Videos API.
- name: MCP
description: |
Model Context Protocol surface. The gateway aggregates every server in
`MCP_SERVERS` behind a single JSON-RPC endpoint at `POST /mcp`, so an MCP
client configures one entry and gets the whole fleet.
Tools are namespaced `mcp_<server alias>_<tool name>` - see the
`MCPJSONRPCRequest` schema for the naming rules.
- name: Proxy
description: Proxy requests to provider endpoints.
- name: Metrics
description: Push metrics to the gateway (OTLP/HTTP).
- name: Health
description: Health check
paths:
/models:
get:
operationId: listModels
tags:
- Models
description: |
Lists the currently available models, and provides basic information
about each one such as the owner and availability.
summary:
Lists the currently available models, and provides basic information
about each one such as the owner and availability.
security:
- bearerAuth: []
parameters:
- name: provider
in: query
required: false
schema:
$ref: '#/components/schemas/Provider'
description: Specific provider to query (optional)
- name: include
in: query
required: false
style: form
explode: false
schema:
type: array
items:
type: string
enum:
- context_window
- modalities
- pricing
description: |
Comma-separated list of metadata keys to include in the response.
Supported values: `pricing`, `context_window`, `modalities`.
When omitted, the response remains unchanged (backward compatible).
responses:
'200':
description: List of available models
content:
application/json:
schema:
$ref: '#/components/schemas/ListModelsResponse'
examples:
allProviders:
summary: Models from all providers
value:
object: 'list'
data:
- id: 'openai/gpt-4o'
object: 'model'
created: 1686935002
owned_by: 'openai'
served_by: 'openai'
- id: 'openai/llama-3.3-70b-versatile'
object: 'model'
created: 1723651281
owned_by: 'groq'
served_by: 'groq'
- id: 'cohere/claude-3-opus-20240229'
object: 'model'
created: 1708905600
owned_by: 'anthropic'
served_by: 'anthropic'
- id: 'cohere/command-r'
object: 'model'
created: 1707868800
owned_by: 'cohere'
served_by: 'cohere'
- id: 'ollama/phi3:3.8b'
object: 'model'
created: 1718441600
owned_by: 'ollama'
served_by: 'ollama'
- id: 'ollama_cloud/gpt-oss:20b'
object: 'model'
created: 1730419200
owned_by: 'ollama_cloud'
served_by: 'ollama_cloud'
- id: 'mistral/mistral-large-latest'
object: 'model'
created: 1698019200
owned_by: 'mistral'
served_by: 'mistral'
singleProvider:
summary: Models from a specific provider
value:
object: 'list'
data:
- id: 'openai/gpt-4o'
object: 'model'
created: 1686935002
owned_by: 'openai'
served_by: 'openai'
- id: 'openai/gpt-4-turbo'
object: 'model'
created: 1687882410
owned_by: 'openai'
served_by: 'openai'
- id: 'openai/gpt-3.5-turbo'
object: 'model'
created: 1677649963
owned_by: 'openai'
served_by: 'openai'
includePricing:
summary: Models with pricing metadata
value:
object: 'list'
data:
- id: 'openai/gpt-4o'
object: 'model'
created: 1686935002
owned_by: 'openai'
served_by: 'openai'
pricing:
currency: 'USD'
input_per_token: '0.0000025'
output_per_token: '0.00001'
cache_read_per_token: '0.00000125'
cache_write_per_token: '0.0000025'
source: 'provider'
updated_at: '2025-01-01T00:00:00Z'
- id: 'openai/gpt-4-turbo'
object: 'model'
created: 1687882410
owned_by: 'openai'
served_by: 'openai'
pricing:
currency: 'USD'
input_per_token: '0.00001'
output_per_token: '0.00003'
source: 'provider'
updated_at: '2025-01-01T00:00:00Z'
includeContextWindow:
summary: Models with context window metadata
value:
object: 'list'
data:
- id: 'openai/gpt-4o'
object: 'model'
created: 1686935002
owned_by: 'openai'
served_by: 'openai'
context_window:
tokens: 128000
source: 'provider'
- id: 'openai/gpt-4-turbo'
object: 'model'
created: 1687882410
owned_by: 'openai'
served_by: 'openai'
context_window:
tokens: 128000
source: 'provider'
includePricingContextWindow:
summary: Models with pricing and context window metadata
value:
object: 'list'
data:
- id: 'openai/gpt-4o'
object: 'model'
created: 1686935002
owned_by: 'openai'
served_by: 'openai'
pricing:
currency: 'USD'
input_per_token: '0.0000025'
output_per_token: '0.00001'
cache_read_per_token: '0.00000125'
cache_write_per_token: '0.0000025'
source: 'provider'
updated_at: '2025-01-01T00:00:00Z'
context_window:
tokens: 128000
source: 'provider'
- id: 'openai/gpt-4-turbo'
object: 'model'
created: 1687882410
owned_by: 'openai'
served_by: 'openai'
pricing:
currency: 'USD'
input_per_token: '0.00001'
output_per_token: '0.00003'
source: 'provider'
updated_at: '2025-01-01T00:00:00Z'
context_window:
tokens: 128000
source: 'provider'
includeModalities:
summary: Models with modalities metadata
value:
object: 'list'
data:
- id: 'openai/gpt-4o'
object: 'model'
created: 1686935002
owned_by: 'openai'
served_by: 'openai'
modalities:
input:
- text
- image
output:
- text
- id: 'openai/gpt-image-2'
object: 'model'
created: 1687882410
owned_by: 'openai'
served_by: 'openai'
modalities:
input:
- text
- image
output:
- image
'400':
description: Bad request - unsupported include value
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error: "Unsupported include value: 'unsupported'. Supported values: pricing, context_window, modalities"
'401':
$ref: '#/components/responses/Unauthorized'
'500':
$ref: '#/components/responses/InternalError'
/chat/completions:
post:
operationId: createChatCompletion
tags:
- Completions
description: |
Generates a chat completion based on the provided input.
The completion can be streamed to the client as it is generated.
summary: Create a chat completion
security:
- bearerAuth: []
parameters:
- name: provider
in: query
required: false
schema:
$ref: '#/components/schemas/Provider'
description: Specific provider to use (default determined by model)
requestBody:
$ref: '#/components/requestBodies/CreateChatCompletionRequest'
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/CreateChatCompletionResponse'
text/event-stream:
schema:
description: |
Server-Sent Events stream. Each frame is an `SSEvent` whose
`data` field contains the JSON-serialized payload for that
event. For content/message chunk events the payload is a
`CreateChatCompletionStreamResponse`. The `oneOf` here makes
the streaming payload schemas reachable from this operation
so that code generators emit types for them.
oneOf:
- $ref: '#/components/schemas/SSEvent'
- $ref: '#/components/schemas/CreateChatCompletionStreamResponse'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'500':
$ref: '#/components/responses/InternalError'
/responses:
post:
operationId: createResponse
tags:
- Responses
description: |
Creates a model response using the OpenAI-compatible Responses API.
The request accepts either a single text input or a list of input
items (allowing batched, multi-turn input in one request), and the
result can be streamed to the client as it is generated.
Not every provider implements the Responses API. Requests routed to a
provider that does not support it return `400 Bad Request` with an
explanatory error message; use `/chat/completions` for those providers.
summary: Create a model response
security:
- bearerAuth: []
parameters:
- name: provider
in: query
required: false
schema:
$ref: '#/components/schemas/Provider'
description: Specific provider to use (default determined by model)
requestBody:
$ref: '#/components/requestBodies/CreateResponseRequest'
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/Response'
text/event-stream:
schema:
description: |
Server-Sent Events stream. Each frame is an `SSEvent` whose
`data` field contains the JSON-serialized payload for that
event. For Responses streaming the payload is a
`ResponseStreamEvent`. The `oneOf` here makes the streaming
payload schemas reachable from this operation so that code
generators emit types for them.
oneOf:
- $ref: '#/components/schemas/SSEvent'
- $ref: '#/components/schemas/ResponseStreamEvent'
'400':
$ref: '#/components/responses/ResponsesNotSupported'
'401':
$ref: '#/components/responses/Unauthorized'
'500':
$ref: '#/components/responses/InternalError'
/messages:
post:
operationId: createMessage
tags:
- Messages
description: |
Creates a message using the Anthropic-compatible Messages API.
The request follows the Anthropic Messages API format with `model`,
`max_tokens`, `messages`, optional `system`, `tools`, and streaming
support.
Not every provider implements the Messages API. Requests routed to a
provider that does not support it return `400 Bad Request` with an
explanatory error message; use `/chat/completions` for those providers.
summary: Create a message
security:
- bearerAuth: []
parameters:
- name: provider
in: query
required: false
schema:
$ref: '#/components/schemas/Provider'
description: Specific provider to use (default determined by model)
requestBody:
$ref: '#/components/requestBodies/CreateMessagesRequest'
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/MessagesResponse'
text/event-stream:
schema:
description: |
Server-Sent Events stream. Each frame is an `SSEvent` whose
`data` field contains the JSON-serialized payload for that
event. For Messages streaming the payload is a
`MessagesStreamEvent`. The `oneOf` here makes the streaming
payload schemas reachable from this operation so that code
generators emit types for them.
oneOf:
- $ref: '#/components/schemas/SSEvent'
- $ref: '#/components/schemas/MessagesStreamEvent'
'400':
$ref: '#/components/responses/MessagesNotSupported'
'401':
$ref: '#/components/responses/Unauthorized'
'500':
$ref: '#/components/responses/InternalError'
/mcp:
post:
operationId: mcpJsonRpc
tags:
- MCP
description: |
JSON-RPC 2.0 endpoint exposing the gateway itself as an MCP server. It
aggregates every server configured in `MCP_SERVERS` behind one URL, so
MCP clients (opencode, `infer`, IDE assistants) configure a single entry
and get the whole fleet, with the gateway's auth, metrics and guardrails
applied to every tool call.
The endpoint lives at the root, not under `/v1` - `/v1/*` is the
OpenAI-compatible surface, MCP is its own protocol and clients expect a
plain `/mcp`.
Gated by `MCP_EXPOSE=true` (and `MCP_ENABLED=true`); otherwise the
gateway answers `403`. Gateway auth is global, so when `AUTH_ENABLE=true`
this endpoint requires a bearer token like every other route except
`/health`.
The endpoint speaks MCP protocol version `2026-07-28` only, over the
stateless Streamable HTTP transport with `application/json` responses.
There is no `initialize` handshake and no session: every request carries
its protocol version in `params._meta["io.modelcontextprotocol/protocolVersion"]`
(alongside the required `io.modelcontextprotocol/clientInfo` and
`io.modelcontextprotocol/clientCapabilities`), mirrored in the
`MCP-Protocol-Version`, `Mcp-Method` and, for `tools/call`, `Mcp-Name`
headers. `Mcp-Name` may use the `=?base64?<value>?=` encoding.
Supported methods:
| Method | Params | Result |
| --- | --- | --- |
| `server/discover` | `_meta` only | `DiscoverResult` - `supportedVersions` (`["2026-07-28"]`), `capabilities` (`tools`) |
| `tools/list` | optional `cursor` | `ListToolsResult` - the aggregated, namespaced tools of every healthy MCP server |
| `tools/call` | `CallToolRequestParams` (`name`, `arguments`) | `CallToolResult` |
Every result carries `resultType: "complete"` and identifies the gateway
in `_meta["io.modelcontextprotocol/serverInfo"]`.
Param and result shapes are the vendored MCP spec types in
[`mcp/mcp-schema.yaml`](https://github.com/inference-gateway/schemas/blob/main/mcp/mcp-schema.yaml)
(`RequestMetaObject`, `DiscoverResult`, `ServerCapabilities`,
`ListToolsResult`, `CallToolRequestParams`, `CallToolResult`); this spec
only describes the JSON-RPC envelopes the gateway puts them in.
`tools/list` tolerates partial availability: when one of the configured
MCP servers is unreachable its tools are omitted and the healthy servers'
tools are still returned, rather than failing the whole call. A
`tools/call` routed to an unavailable server fails with JSON-RPC error
code `-32603`.
Errors use JSON-RPC error envelopes:
| Code | Meaning | HTTP status |
| --- | --- | --- |
| `-32020` | header mismatch - a required header is missing, malformed or disagrees with the body; a legacy `initialize` request lands here | `400` |
| `-32022` | unsupported protocol version; `data` carries `requested` and `supported` | `400` |
| `-32601` | method not found | `404` |
| `-32700` | parse error | `200` |
| `-32600` | invalid request | `200` |
| `-32602` | invalid params (unknown tool name, bad arguments) | `200` |
| `-32603` | internal error (upstream MCP server failure) | `200` |
A request carrying an `Origin` header is rejected with `403`: MCP
clients are not browsers, and this blocks DNS-rebinding attacks. `GET`
and `DELETE` answer `405` - there is no standalone stream and no session
to terminate.
summary: JSON-RPC 2.0 endpoint for the gateway's MCP server
security:
- bearerAuth: []
parameters:
- name: MCP-Protocol-Version
in: header
required: true
description: Must equal `params._meta["io.modelcontextprotocol/protocolVersion"]`.
schema:
type: string
example: '2026-07-28'
- name: Mcp-Method
in: header
required: true
description: Must equal the JSON-RPC `method`.
schema:
type: string
example: 'tools/call'
- name: Mcp-Name
in: header
required: false
description: |
Required for `tools/call`; must equal `params.name`. Values that are
not plain ASCII are sent as `=?base64?<value>?=`.
schema:
type: string
example: 'mcp_deepwiki_ask_question'
requestBody:
required: true
description: A single JSON-RPC 2.0 request or notification
content:
application/json:
schema:
$ref: '#/components/schemas/MCPJSONRPCRequest'
responses:
'200':
description: |
JSON-RPC response envelope, carrying either a `result` or an `error`.
content:
application/json:
schema:
$ref: '#/components/schemas/MCPJSONRPCResponse'
'202':
description: Notification accepted; no response body
'400':
description: |
Header mismatch (`-32020`) or unsupported protocol version
(`-32022`), as a JSON-RPC error envelope.
content:
application/json:
schema:
$ref: '#/components/schemas/MCPJSONRPCResponse'
'404':
description: Method not found (`-32601`), as a JSON-RPC error envelope.
content:
application/json:
schema:
$ref: '#/components/schemas/MCPJSONRPCResponse'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/MCPNotExposed'
'500':
$ref: '#/components/responses/InternalError'
/.well-known/oauth-protected-resource/mcp:
get:
operationId: getMCPProtectedResourceMetadata
tags:
- MCP
description: |
OAuth 2.0 Protected Resource Metadata ([RFC 9728](https://datatracker.ietf.org/doc/html/rfc9728))
for `POST /mcp`, which MCP `2026-07-28` requires every protected MCP
server to publish so a client can discover the authorization server on
its own instead of being handed a pre-configured token.
Served without a token - it is the one route besides `/health` that
skips gateway auth, since a client fetches it precisely because it has
no credentials yet. Every `401` from `POST /mcp` points here through the
`resource_metadata` parameter of its `WWW-Authenticate` challenge.
Returns `404` unless `AUTH_ENABLED=true` and the MCP endpoint is exposed
(`MCP_ENABLED=true` and `MCP_EXPOSE=true`): with no authorization server
there is nothing to advertise.
`resource` is `MCP_RESOURCE_URL` when set, and otherwise the request
scheme (honouring `X-Forwarded-Proto`) and `Host` with `/mcp` appended.
Behind an ingress that rewrites either, set `MCP_RESOURCE_URL` to the
canonical public URL clients use.
Tokens must be issued for that resource (RFC 8707): when the IdP stamps
the resource indicator into `aud`, list the same value in
`AUTH_OIDC_AUDIENCE`.
summary: OAuth 2.0 Protected Resource Metadata for the MCP endpoint
security: []
responses:
'200':
description: The Protected Resource Metadata document
content:
application/json:
schema:
$ref: '#/components/schemas/OAuthProtectedResourceMetadata'
example:
resource: 'https://gateway.example.com/mcp'
authorization_servers:
- 'https://keycloak.example.com/realms/inference-gateway-realm'
bearer_methods_supported:
- 'header'
'404':
$ref: '#/components/responses/NotFound'
/metrics:
post:
operationId: pushMetrics
tags:
- Metrics
description: |
OTLP/HTTP metrics push endpoint. Accepts an OTLP ExportMetricsServiceRequest
encoded as protobuf or JSON. Only accessible when TELEMETRY_ENABLED and
TELEMETRY_METRICS_PUSH_ENABLED are enabled.
summary: Push metrics to the gateway (OTLP/HTTP)
security:
- bearerAuth: []
requestBody:
required: true
description: OTLP ExportMetricsServiceRequest payload
content:
application/x-protobuf:
schema:
type: string
format: binary
application/json:
schema:
type: object
responses:
'200':
description: OTLP ExportMetricsServiceResponse, possibly with partial success details
content:
application/x-protobuf:
schema:
type: string
format: binary
application/json:
schema:
type: object
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
description: Metrics push is not enabled
'413':
description: Payload too large
'415':
description: Unsupported content type
/proxy/{provider}/{path}:
parameters:
- name: provider
in: path
required: true
schema:
$ref: '#/components/schemas/Provider'
- name: path
in: path
required: true
style: simple
explode: false
schema:
type: string
description: The remaining path to proxy to the provider
get:
operationId: proxyGet
tags:
- Proxy
description: |
Proxy GET request to provider
The request body depends on the specific provider and endpoint being called.
If you decide to use this approach, please follow the provider-specific documentations.
summary: Proxy GET request to provider
responses:
'200':
$ref: '#/components/responses/ProviderResponse'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'500':
$ref: '#/components/responses/InternalError'
security:
- bearerAuth: []
post:
operationId: proxyPost
tags:
- Proxy
description: |
Proxy POST request to provider
The request body depends on the specific provider and endpoint being called.
If you decide to use this approach, please follow the provider-specific documentations.
summary: Proxy POST request to provider
requestBody:
$ref: '#/components/requestBodies/ProviderRequest'
responses:
'200':
$ref: '#/components/responses/ProviderResponse'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'500':
$ref: '#/components/responses/InternalError'
security:
- bearerAuth: []
put:
operationId: proxyPut
tags:
- Proxy
description: |
Proxy PUT request to provider
The request body depends on the specific provider and endpoint being called.
If you decide to use this approach, please follow the provider-specific documentations.
summary: Proxy PUT request to provider
requestBody:
$ref: '#/components/requestBodies/ProviderRequest'
responses:
'200':
$ref: '#/components/responses/ProviderResponse'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'500':
$ref: '#/components/responses/InternalError'
security:
- bearerAuth: []
delete:
operationId: proxyDelete
tags:
- Proxy
description: |
Proxy DELETE request to provider
The request body depends on the specific provider and endpoint being called.
If you decide to use this approach, please follow the provider-specific documentations.
summary: Proxy DELETE request to provider
responses:
'200':
$ref: '#/components/responses/ProviderResponse'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'500':
$ref: '#/components/responses/InternalError'
security:
- bearerAuth: []
patch:
operationId: proxyPatch
tags:
- Proxy
description: |
Proxy PATCH request to provider
The request body depends on the specific provider and endpoint being called.
If you decide to use this approach, please follow the provider-specific documentations.
summary: Proxy PATCH request to provider
requestBody:
$ref: '#/components/requestBodies/ProviderRequest'
responses:
'200':
$ref: '#/components/responses/ProviderResponse'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'500':
$ref: '#/components/responses/InternalError'
security:
- bearerAuth: []
/images/generations:
post:
operationId: createImage
tags:
- Images
description: |
Creates an image given a prompt using the OpenAI-compatible Images API.
The request returns one or more generated images as URLs or base64-encoded
JSON data.
Not every provider implements the Images API. Requests routed to a
provider that does not support it return `400 Bad Request` with an
explanatory error message; use `/chat/completions` for those providers.
summary: Create an image
security:
- bearerAuth: []
parameters:
- name: provider
in: query
required: false
schema:
$ref: '#/components/schemas/Provider'
description: Specific provider to use (default determined by model)
requestBody:
$ref: '#/components/requestBodies/CreateImageRequest'
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/ImagesResponse'
'400':
$ref: '#/components/responses/ImagesNotSupported'
'401':
$ref: '#/components/responses/Unauthorized'
'500':
$ref: '#/components/responses/InternalError'
/images/edits:
post:
operationId: createImageEdit
tags:
- Images
description: |
Creates an edited or extended image given an original image and a prompt
using the OpenAI-compatible Images API. The request is sent as
`multipart/form-data` with the image file as a binary upload.
Not every provider implements the Images API. Requests routed to a
provider that does not support it return `400 Bad Request` with an
explanatory error message; use `/chat/completions` for those providers.
summary: Create an image edit or extension
security:
- bearerAuth: []
parameters:
- name: provider
in: query
required: false
schema:
$ref: '#/components/schemas/Provider'
description: Specific provider to use (default determined by model)
requestBody:
$ref: '#/components/requestBodies/CreateImageEditRequest'
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/ImagesResponse'
'400':
$ref: '#/components/responses/ImagesNotSupported'
'401':
$ref: '#/components/responses/Unauthorized'
'500':
$ref: '#/components/responses/InternalError'
/audio/speech:
post:
operationId: createSpeech
tags:
- Audio
description: |
Generates audio from the provided text using the OpenAI-compatible
Audio API. Mirrors the OpenAI `POST /v1/audio/speech` request body.
The response is the synthesized audio as raw binary bytes; the actual
`Content-Type` header of the response reflects the requested
`response_format` (e.g. `audio/mpeg` for `mp3`).
Not every provider implements the Audio API. Requests routed to a
provider that does not support it return `400 Bad Request` with an
explanatory error message; use `/chat/completions` for those providers.
summary: Generate speech audio from text
security:
- bearerAuth: []
parameters:
- name: provider
in: query
required: false
schema:
$ref: '#/components/schemas/Provider'
description: Specific provider to use (default determined by model)
requestBody:
$ref: '#/components/requestBodies/CreateSpeechRequest'
responses:
'200':
description: |
The synthesized audio as raw binary bytes. The actual `Content-Type`
header of the response reflects the requested `response_format`.
content:
application/octet-stream:
schema:
type: string
format: binary
'400':
$ref: '#/components/responses/SpeechNotSupported'
'401':
$ref: '#/components/responses/Unauthorized'
'500':
$ref: '#/components/responses/InternalError'
/audio/sfx:
post:
operationId: createSFX
tags:
- Audio
description: |
Generates a non-speech audio clip - a sound effect or ambience - from
a text prompt. Gateway extension: OpenAI has no sound-effects
endpoint, so this mirrors the shape of `POST /audio/speech` (JSON in,
raw audio bytes out) rather than an upstream OpenAI operation. The
response is the generated audio as raw binary bytes; the actual
`Content-Type` header of the response reflects the requested
`response_format` (e.g. `audio/mpeg` for `mp3`).
Not every provider implements sound-effect generation. Requests routed
to a provider that does not support it return `400 Bad Request` with an
explanatory error message.
summary: Generate a sound effect from a text prompt
security:
- bearerAuth: []
parameters:
- name: provider
in: query
required: false
schema:
$ref: '#/components/schemas/Provider'
description: Specific provider to use (default determined by model)
requestBody:
$ref: '#/components/requestBodies/CreateSFXRequest'
responses:
'200':
description: |
The generated audio as raw binary bytes. The actual `Content-Type`
header of the response reflects the requested `response_format`.
content:
application/octet-stream:
schema:
type: string
format: binary
'400':
$ref: '#/components/responses/SFXNotSupported'
'401':
$ref: '#/components/responses/Unauthorized'
'500':
$ref: '#/components/responses/InternalError'
/audio/music:
post:
operationId: createMusic
tags:
- Audio
description: |
Composes a music clip from a text prompt. Gateway extension: OpenAI has
no music endpoint, so this mirrors `POST /audio/sfx` (JSON in, raw
audio bytes out) rather than an upstream OpenAI operation. The response
is the generated audio as raw binary bytes; the actual `Content-Type`
header of the response reflects the requested `response_format` (e.g.
`audio/mpeg` for `mp3`).
Not every provider implements music generation. Requests routed to a
provider that does not support it return `400 Bad Request` with an
explanatory error message.
summary: Compose a music clip from a text prompt
security:
- bearerAuth: []
parameters:
- name: provider
in: query
required: false
schema:
$ref: '#/components/schemas/Provider'
description: Specific provider to use (default determined by model)
requestBody:
$ref: '#/components/requestBodies/CreateMusicRequest'
responses:
'200':
description: |
The generated audio as raw binary bytes. The actual `Content-Type`
header of the response reflects the requested `response_format`.
content:
application/octet-stream:
schema:
type: string
format: binary
'400':
$ref: '#/components/responses/MusicNotSupported'
'401':
$ref: '#/components/responses/Unauthorized'
'500':
$ref: '#/components/responses/InternalError'