@breign/client 1.0.131 → 1.0.133

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.
Files changed (38) hide show
  1. package/dist/apis/AiGatewayApi.d.ts +108 -1
  2. package/dist/apis/AiGatewayApi.js +218 -1
  3. package/dist/apis/ConversationsApi.d.ts +28 -1
  4. package/dist/apis/ConversationsApi.js +59 -0
  5. package/dist/models/AgentChatOverviewEntryUio.d.ts +56 -0
  6. package/dist/models/AgentChatOverviewEntryUio.js +64 -0
  7. package/dist/models/AiGatewayV1CreditsUio.d.ts +38 -0
  8. package/dist/models/AiGatewayV1CreditsUio.js +52 -0
  9. package/dist/models/AiGatewayV1EndpointPricingUio.d.ts +50 -0
  10. package/dist/models/AiGatewayV1EndpointPricingUio.js +54 -0
  11. package/dist/models/AiGatewayV1EndpointUio.d.ts +111 -0
  12. package/dist/models/AiGatewayV1EndpointUio.js +85 -0
  13. package/dist/models/AiGatewayV1GenerationDataUio.d.ts +146 -0
  14. package/dist/models/AiGatewayV1GenerationDataUio.js +96 -0
  15. package/dist/models/AiGatewayV1GenerationUio.d.ts +33 -0
  16. package/dist/models/AiGatewayV1GenerationUio.js +51 -0
  17. package/dist/models/AiGatewayV1ModelEndpointsDataArchitectureUio.d.ts +56 -0
  18. package/dist/models/AiGatewayV1ModelEndpointsDataArchitectureUio.js +56 -0
  19. package/dist/models/AiGatewayV1ModelEndpointsDataUio.d.ts +70 -0
  20. package/dist/models/AiGatewayV1ModelEndpointsDataUio.js +72 -0
  21. package/dist/models/AiGatewayV1ModelEndpointsUio.d.ts +33 -0
  22. package/dist/models/AiGatewayV1ModelEndpointsUio.js +51 -0
  23. package/dist/models/AiGatewayV1ModelListUio.d.ts +46 -0
  24. package/dist/models/AiGatewayV1ModelListUio.js +62 -0
  25. package/dist/models/AiGatewayV1ModelPricingUio.d.ts +50 -0
  26. package/dist/models/AiGatewayV1ModelPricingUio.js +54 -0
  27. package/dist/models/AiGatewayV1ModelUio.d.ts +114 -0
  28. package/dist/models/AiGatewayV1ModelUio.js +99 -0
  29. package/dist/models/AiGatewayV1ReportRowUio.d.ts +140 -0
  30. package/dist/models/AiGatewayV1ReportRowUio.js +104 -0
  31. package/dist/models/AiGatewayV1ReportUio.d.ts +33 -0
  32. package/dist/models/AiGatewayV1ReportUio.js +51 -0
  33. package/dist/models/MarkConversationReadRequestUio.d.ts +32 -0
  34. package/dist/models/MarkConversationReadRequestUio.js +48 -0
  35. package/dist/models/index.d.ts +15 -0
  36. package/dist/models/index.js +15 -0
  37. package/dist/openapi.json +1242 -313
  38. package/package.json +1 -1
package/dist/openapi.json CHANGED
@@ -5103,6 +5103,85 @@
5103
5103
  "tags" : [ "conversations" ]
5104
5104
  }
5105
5105
  },
5106
+ "/organizations/{organizationId}/chat/overview" : {
5107
+ "get" : {
5108
+ "description" : "Pour chaque agent de l'organisation avec lequel l'utilisateur a une conversation, renvoie sa conversation la plus récente, le nombre de messages non lus et l'indication d'une réponse en cours de génération.",
5109
+ "operationId" : "getAgentChatOverview",
5110
+ "parameters" : [ {
5111
+ "description" : "ID of the organization",
5112
+ "in" : "path",
5113
+ "name" : "organizationId",
5114
+ "required" : true,
5115
+ "schema" : {
5116
+ "type" : "string"
5117
+ }
5118
+ } ],
5119
+ "responses" : {
5120
+ "200" : {
5121
+ "content" : {
5122
+ "application/json" : {
5123
+ "schema" : {
5124
+ "items" : {
5125
+ "$ref" : "#/components/schemas/AgentChatOverviewEntry"
5126
+ },
5127
+ "type" : "array"
5128
+ }
5129
+ }
5130
+ },
5131
+ "description" : "Chat overview retrieved successfully"
5132
+ },
5133
+ "401" : {
5134
+ "description" : "Unauthenticated"
5135
+ },
5136
+ "403" : {
5137
+ "description" : "Forbidden — the caller is not part of the organization"
5138
+ }
5139
+ },
5140
+ "summary" : "Get the multi-agent chat overview",
5141
+ "tags" : [ "conversations" ]
5142
+ }
5143
+ },
5144
+ "/conversations/{conversationId}/read" : {
5145
+ "post" : {
5146
+ "description" : "Positionne la marque de lecture de l'utilisateur sur la conversation.",
5147
+ "operationId" : "markConversationAsRead",
5148
+ "parameters" : [ {
5149
+ "description" : "The ID of the conversation",
5150
+ "in" : "path",
5151
+ "name" : "conversationId",
5152
+ "required" : true,
5153
+ "schema" : {
5154
+ "type" : "string"
5155
+ }
5156
+ } ],
5157
+ "requestBody" : {
5158
+ "content" : {
5159
+ "application/json" : {
5160
+ "schema" : {
5161
+ "$ref" : "#/components/schemas/MarkConversationReadRequest"
5162
+ }
5163
+ }
5164
+ },
5165
+ "required" : false
5166
+ },
5167
+ "responses" : {
5168
+ "204" : {
5169
+ "description" : "Read position updated"
5170
+ },
5171
+ "401" : {
5172
+ "description" : "Unauthenticated"
5173
+ },
5174
+ "403" : {
5175
+ "description" : "Forbidden"
5176
+ },
5177
+ "404" : {
5178
+ "description" : "CONVERSATION_NOT_FOUND"
5179
+ }
5180
+ },
5181
+ "summary" : "Mark a conversation as read",
5182
+ "tags" : [ "conversations" ]
5183
+ }
5184
+ },
5106
5185
  "/conversations" : {
5107
5186
  "delete" : {
5108
5187
  "description" : "Delete all conversations created by the authenticated user in the specified organization.",
@@ -12746,10 +12825,10 @@
12746
12825
  "tags" : [ "ai-gateway" ]
12747
12826
  }
12748
12827
  },
12749
- "/organizations/{organizationId}/openai/chat/completions" : {
12750
- "post" : {
12751
- "description" : "OpenAI-compatible chat completion. Contrairement à `/ai-gateway/chat/completions`, la réponse OpenAI native est relayée sans transformation, `stream_options` est accepté, et la consommation de tokens est enregistrée dans les métriques de l'organisation.\n\nToutes les erreurs utilisent l'enveloppe OpenAI `{ error: { message } }`.",
12752
- "operationId" : "createOpenAiChatCompletion",
12828
+ "/organizations/{organizationId}/ai-gateway/v1/models" : {
12829
+ "get" : {
12830
+ "description" : "Équivalent de `GET /v1/models` de l'AI Gateway Vercel, monté sous le préfixe organisation. Liste les modèles des providers configurés pour l'organisation.",
12831
+ "operationId" : "listAiGatewayV1Models",
12753
12832
  "parameters" : [ {
12754
12833
  "description" : "ID of the organization",
12755
12834
  "in" : "path",
@@ -12759,34 +12838,18 @@
12759
12838
  "type" : "string"
12760
12839
  }
12761
12840
  } ],
12762
- "requestBody" : {
12763
- "content" : {
12764
- "application/json" : {
12765
- "schema" : {
12766
- "$ref" : "#/components/schemas/OpenAiChatCompletionRequest"
12767
- }
12768
- }
12769
- },
12770
- "required" : true
12771
- },
12772
12841
  "responses" : {
12773
12842
  "200" : {
12774
12843
  "content" : {
12775
12844
  "application/json" : {
12776
12845
  "schema" : {
12777
- "$ref" : "#/components/schemas/OpenAiChatCompletionResponse"
12778
- }
12779
- },
12780
- "text/plain" : {
12781
- "schema" : {
12782
- "description" : "Flux de chunks JSON, renvoyé lorsque `stream` vaut true.",
12783
- "type" : "string"
12846
+ "$ref" : "#/components/schemas/AiGatewayV1ModelList"
12784
12847
  }
12785
12848
  }
12786
12849
  },
12787
- "description" : "Completion générée. Avec `stream: true`, la réponse est un flux `text/plain` de chunks JSON OpenAI."
12850
+ "description" : "Model list"
12788
12851
  },
12789
- "400" : {
12852
+ "401" : {
12790
12853
  "content" : {
12791
12854
  "application/json" : {
12792
12855
  "schema" : {
@@ -12794,9 +12857,9 @@
12794
12857
  }
12795
12858
  }
12796
12859
  },
12797
- "description" : "Invalid request body"
12860
+ "description" : "Unauthenticated"
12798
12861
  },
12799
- "401" : {
12862
+ "403" : {
12800
12863
  "content" : {
12801
12864
  "application/json" : {
12802
12865
  "schema" : {
@@ -12804,9 +12867,54 @@
12804
12867
  }
12805
12868
  }
12806
12869
  },
12807
- "description" : "Unauthenticated — no caller identity could be established"
12870
+ "description" : "Forbidden — the caller is not part of the organization"
12871
+ }
12872
+ },
12873
+ "summary" : "List models (AI Gateway REST API)",
12874
+ "tags" : [ "ai-gateway" ]
12875
+ }
12876
+ },
12877
+ "/organizations/{organizationId}/ai-gateway/v1/models/{creator}/{model}/endpoints" : {
12878
+ "get" : {
12879
+ "description" : "Équivalent de `GET /v1/models/{creator}/{model}/endpoints`. Un modèle n'étant servi que par le provider qui le déclare dans l'organisation, la liste contient toujours un seul endpoint. Les identifiants Breign n'ayant pas toujours de créateur, `{creator}/{model}` est résolu d'abord tel quel, puis sur le seul segment `{model}`.",
12880
+ "operationId" : "getAiGatewayV1ModelEndpoints",
12881
+ "parameters" : [ {
12882
+ "description" : "ID of the organization",
12883
+ "in" : "path",
12884
+ "name" : "organizationId",
12885
+ "required" : true,
12886
+ "schema" : {
12887
+ "type" : "string"
12888
+ }
12889
+ }, {
12890
+ "description" : "Premier segment de l'identifiant de modèle",
12891
+ "in" : "path",
12892
+ "name" : "creator",
12893
+ "required" : true,
12894
+ "schema" : {
12895
+ "type" : "string"
12896
+ }
12897
+ }, {
12898
+ "description" : "Second segment de l'identifiant de modèle",
12899
+ "in" : "path",
12900
+ "name" : "model",
12901
+ "required" : true,
12902
+ "schema" : {
12903
+ "type" : "string"
12904
+ }
12905
+ } ],
12906
+ "responses" : {
12907
+ "200" : {
12908
+ "content" : {
12909
+ "application/json" : {
12910
+ "schema" : {
12911
+ "$ref" : "#/components/schemas/AiGatewayV1ModelEndpoints"
12912
+ }
12913
+ }
12914
+ },
12915
+ "description" : "Model endpoints"
12808
12916
  },
12809
- "403" : {
12917
+ "401" : {
12810
12918
  "content" : {
12811
12919
  "application/json" : {
12812
12920
  "schema" : {
@@ -12814,9 +12922,9 @@
12814
12922
  }
12815
12923
  }
12816
12924
  },
12817
- "description" : "Forbidden — the caller is not part of the organization"
12925
+ "description" : "Unauthenticated"
12818
12926
  },
12819
- "404" : {
12927
+ "403" : {
12820
12928
  "content" : {
12821
12929
  "application/json" : {
12822
12930
  "schema" : {
@@ -12824,9 +12932,9 @@
12824
12932
  }
12825
12933
  }
12826
12934
  },
12827
- "description" : "Model not found — aucun provider de l'organisation n'expose ce modèle"
12935
+ "description" : "Forbidden — the caller is not part of the organization"
12828
12936
  },
12829
- "500" : {
12937
+ "404" : {
12830
12938
  "content" : {
12831
12939
  "application/json" : {
12832
12940
  "schema" : {
@@ -12834,72 +12942,81 @@
12834
12942
  }
12835
12943
  }
12836
12944
  },
12837
- "description" : "Internal server error"
12945
+ "description" : "Model not found"
12838
12946
  }
12839
12947
  },
12840
- "summary" : "Create a chat completion using the native OpenAI client",
12948
+ "summary" : "Get model endpoints (AI Gateway REST API)",
12841
12949
  "tags" : [ "ai-gateway" ]
12842
12950
  }
12843
12951
  },
12844
- "/admin/tool-presets" : {
12845
- "delete" : {
12846
- "description" : "Clears the shared tool library",
12847
- "operationId" : "deleteAllAdminToolPresets",
12952
+ "/organizations/{organizationId}/ai-gateway/v1/credits" : {
12953
+ "get" : {
12954
+ "description" : "Équivalent de `GET /v1/credits`. `total_used` est la dépense cumulée de l'organisation, calculée depuis la configuration de prix. `balance` est toujours null : Breign n'a pas de notion de crédits prépayés.",
12955
+ "operationId" : "getAiGatewayV1Credits",
12956
+ "parameters" : [ {
12957
+ "description" : "ID of the organization",
12958
+ "in" : "path",
12959
+ "name" : "organizationId",
12960
+ "required" : true,
12961
+ "schema" : {
12962
+ "type" : "string"
12963
+ }
12964
+ } ],
12848
12965
  "responses" : {
12849
12966
  "200" : {
12850
12967
  "content" : {
12851
12968
  "application/json" : {
12852
12969
  "schema" : {
12853
- "$ref" : "#/components/schemas/ToolPresetDeleteAllResponse"
12970
+ "$ref" : "#/components/schemas/AiGatewayV1Credits"
12854
12971
  }
12855
12972
  }
12856
12973
  },
12857
- "description" : "Tool library cleared"
12974
+ "description" : "Credit balance"
12858
12975
  },
12859
12976
  "401" : {
12860
- "description" : "Unauthorized"
12977
+ "content" : {
12978
+ "application/json" : {
12979
+ "schema" : {
12980
+ "$ref" : "#/components/schemas/AiGatewayError"
12981
+ }
12982
+ }
12983
+ },
12984
+ "description" : "Unauthenticated"
12861
12985
  },
12862
12986
  "403" : {
12863
- "description" : "Forbidden"
12987
+ "content" : {
12988
+ "application/json" : {
12989
+ "schema" : {
12990
+ "$ref" : "#/components/schemas/AiGatewayError"
12991
+ }
12992
+ }
12993
+ },
12994
+ "description" : "Forbidden — the caller is not part of the organization"
12864
12995
  }
12865
12996
  },
12866
- "summary" : "Delete every tool preset",
12867
- "tags" : [ "admin" ]
12868
- },
12997
+ "summary" : "Check credit balance (AI Gateway REST API)",
12998
+ "tags" : [ "ai-gateway" ]
12999
+ }
13000
+ },
13001
+ "/organizations/{organizationId}/ai-gateway/v1/generation" : {
12869
13002
  "get" : {
12870
- "description" : "Returns a page of the shared tool library, including inactive presets. Use /admin/tool-presets/export to retrieve the whole library at once.",
12871
- "operationId" : "getAdminToolPresets",
13003
+ "description" : "Équivalent de `GET /v1/generation`. L'identifiant est renvoyé comme `id` des complétions compatibles OpenAI, injecté dans le premier chunk en streaming, et exposé dans `providerMetadata.gateway.generationId` sur les routes AI SDK.",
13004
+ "operationId" : "getAiGatewayV1Generation",
12872
13005
  "parameters" : [ {
12873
- "description" : "Page number, starting at 1",
12874
- "in" : "query",
12875
- "name" : "page",
12876
- "schema" : {
12877
- "default" : 1,
12878
- "minimum" : 1,
12879
- "type" : "integer"
12880
- }
12881
- }, {
12882
- "description" : "Maximum number of tool presets to return",
12883
- "in" : "query",
12884
- "name" : "limit",
12885
- "schema" : {
12886
- "default" : 25,
12887
- "maximum" : 100,
12888
- "minimum" : 1,
12889
- "type" : "integer"
12890
- }
12891
- }, {
12892
- "description" : "Search tool presets by name, slug, url or description",
12893
- "in" : "query",
12894
- "name" : "search",
13006
+ "description" : "ID of the organization",
13007
+ "in" : "path",
13008
+ "name" : "organizationId",
13009
+ "required" : true,
12895
13010
  "schema" : {
12896
13011
  "type" : "string"
12897
13012
  }
12898
13013
  }, {
12899
- "description" : "Filter tool presets by category",
13014
+ "description" : "Identifiant de génération, au format `gen_<ulid>`",
12900
13015
  "in" : "query",
12901
- "name" : "category",
13016
+ "name" : "id",
13017
+ "required" : true,
12902
13018
  "schema" : {
13019
+ "pattern" : "^gen_[0-9A-HJKMNP-TV-Z]{26}$",
12903
13020
  "type" : "string"
12904
13021
  }
12905
13022
  } ],
@@ -12908,55 +13025,394 @@
12908
13025
  "content" : {
12909
13026
  "application/json" : {
12910
13027
  "schema" : {
12911
- "$ref" : "#/components/schemas/ToolPresetPage"
13028
+ "$ref" : "#/components/schemas/AiGatewayV1Generation"
12912
13029
  }
12913
13030
  }
12914
13031
  },
12915
- "description" : "Tool presets retrieved successfully"
12916
- },
12917
- "401" : {
12918
- "description" : "Unauthorized"
12919
- },
12920
- "403" : {
12921
- "description" : "Forbidden"
12922
- }
12923
- },
12924
- "summary" : "List tool presets",
12925
- "tags" : [ "admin" ]
12926
- },
12927
- "post" : {
12928
- "operationId" : "createAdminToolPreset",
12929
- "requestBody" : {
12930
- "content" : {
12931
- "application/json" : {
12932
- "schema" : {
12933
- "$ref" : "#/components/schemas/ToolPresetCreateRequest"
12934
- }
12935
- }
13032
+ "description" : "Generation details"
12936
13033
  },
12937
- "required" : true
12938
- },
12939
- "responses" : {
12940
- "201" : {
13034
+ "400" : {
12941
13035
  "content" : {
12942
13036
  "application/json" : {
12943
13037
  "schema" : {
12944
- "$ref" : "#/components/schemas/ToolPreset"
13038
+ "$ref" : "#/components/schemas/AiGatewayError"
12945
13039
  }
12946
13040
  }
12947
13041
  },
12948
- "description" : "Tool preset created"
12949
- },
12950
- "400" : {
12951
- "description" : "Invalid payload"
13042
+ "description" : "Invalid or missing id parameter"
12952
13043
  },
12953
13044
  "401" : {
12954
- "description" : "Unauthorized"
13045
+ "content" : {
13046
+ "application/json" : {
13047
+ "schema" : {
13048
+ "$ref" : "#/components/schemas/AiGatewayError"
13049
+ }
13050
+ }
13051
+ },
13052
+ "description" : "Unauthenticated"
12955
13053
  },
12956
13054
  "403" : {
12957
- "description" : "Forbidden"
12958
- },
12959
- "409" : {
13055
+ "content" : {
13056
+ "application/json" : {
13057
+ "schema" : {
13058
+ "$ref" : "#/components/schemas/AiGatewayError"
13059
+ }
13060
+ }
13061
+ },
13062
+ "description" : "Forbidden — the caller is not part of the organization"
13063
+ },
13064
+ "404" : {
13065
+ "content" : {
13066
+ "application/json" : {
13067
+ "schema" : {
13068
+ "$ref" : "#/components/schemas/AiGatewayError"
13069
+ }
13070
+ }
13071
+ },
13072
+ "description" : "Usage event not found"
13073
+ }
13074
+ },
13075
+ "summary" : "Look up a generation (AI Gateway REST API)",
13076
+ "tags" : [ "ai-gateway" ]
13077
+ }
13078
+ },
13079
+ "/organizations/{organizationId}/ai-gateway/v1/report" : {
13080
+ "get" : {
13081
+ "description" : "Équivalent de `GET /v1/report`. L'attribution applicative provient des en-têtes `ai-reporting-user` et `ai-reporting-tags` posés sur les appels d'inférence. Réservé aux administrateurs de l'organisation.",
13082
+ "operationId" : "getAiGatewayV1Report",
13083
+ "parameters" : [ {
13084
+ "description" : "ID of the organization",
13085
+ "in" : "path",
13086
+ "name" : "organizationId",
13087
+ "required" : true,
13088
+ "schema" : {
13089
+ "type" : "string"
13090
+ }
13091
+ }, {
13092
+ "description" : "Début de période inclus, au format YYYY-MM-DD (UTC)",
13093
+ "in" : "query",
13094
+ "name" : "start_date",
13095
+ "required" : true,
13096
+ "schema" : {
13097
+ "type" : "string"
13098
+ }
13099
+ }, {
13100
+ "description" : "Fin de période incluse, au format YYYY-MM-DD (UTC)",
13101
+ "in" : "query",
13102
+ "name" : "end_date",
13103
+ "required" : true,
13104
+ "schema" : {
13105
+ "type" : "string"
13106
+ }
13107
+ }, {
13108
+ "description" : "Dimension d'agrégation. `credential_type` vaut toujours `system` et `zero_data_retention` toujours `false` : Breign ne sert pas d'appels BYOK et n'expose pas d'option ZDR.",
13109
+ "in" : "query",
13110
+ "name" : "group_by",
13111
+ "schema" : {
13112
+ "default" : "day",
13113
+ "enum" : [ "day", "user", "model", "tag", "provider", "credential_type", "zero_data_retention", "api_key_name" ],
13114
+ "type" : "string"
13115
+ }
13116
+ }, {
13117
+ "description" : "Granularité temporelle, applicable seulement à group_by=day",
13118
+ "in" : "query",
13119
+ "name" : "date_part",
13120
+ "schema" : {
13121
+ "default" : "day",
13122
+ "enum" : [ "day", "hour" ],
13123
+ "type" : "string"
13124
+ }
13125
+ }, {
13126
+ "in" : "query",
13127
+ "name" : "user_id",
13128
+ "schema" : {
13129
+ "type" : "string"
13130
+ }
13131
+ }, {
13132
+ "in" : "query",
13133
+ "name" : "model",
13134
+ "schema" : {
13135
+ "type" : "string"
13136
+ }
13137
+ }, {
13138
+ "in" : "query",
13139
+ "name" : "provider",
13140
+ "schema" : {
13141
+ "type" : "string"
13142
+ }
13143
+ }, {
13144
+ "description" : "Étiquettes séparées par des virgules",
13145
+ "in" : "query",
13146
+ "name" : "tags",
13147
+ "schema" : {
13148
+ "type" : "string"
13149
+ }
13150
+ }, {
13151
+ "in" : "query",
13152
+ "name" : "tags_match",
13153
+ "schema" : {
13154
+ "default" : "any",
13155
+ "enum" : [ "any", "all" ],
13156
+ "type" : "string"
13157
+ }
13158
+ } ],
13159
+ "responses" : {
13160
+ "200" : {
13161
+ "content" : {
13162
+ "application/json" : {
13163
+ "schema" : {
13164
+ "$ref" : "#/components/schemas/AiGatewayV1Report"
13165
+ }
13166
+ }
13167
+ },
13168
+ "description" : "Spend report"
13169
+ },
13170
+ "400" : {
13171
+ "content" : {
13172
+ "application/json" : {
13173
+ "schema" : {
13174
+ "$ref" : "#/components/schemas/AiGatewayError"
13175
+ }
13176
+ }
13177
+ },
13178
+ "description" : "Missing or invalid parameters"
13179
+ },
13180
+ "401" : {
13181
+ "content" : {
13182
+ "application/json" : {
13183
+ "schema" : {
13184
+ "$ref" : "#/components/schemas/AiGatewayError"
13185
+ }
13186
+ }
13187
+ },
13188
+ "description" : "Unauthenticated"
13189
+ },
13190
+ "403" : {
13191
+ "content" : {
13192
+ "application/json" : {
13193
+ "schema" : {
13194
+ "$ref" : "#/components/schemas/AiGatewayError"
13195
+ }
13196
+ }
13197
+ },
13198
+ "description" : "Forbidden — the caller is not an admin of the organization"
13199
+ }
13200
+ },
13201
+ "summary" : "Query spend report (AI Gateway REST API)",
13202
+ "tags" : [ "ai-gateway" ]
13203
+ }
13204
+ },
13205
+ "/organizations/{organizationId}/openai/chat/completions" : {
13206
+ "post" : {
13207
+ "description" : "OpenAI-compatible chat completion. Contrairement à `/ai-gateway/chat/completions`, la réponse OpenAI native est relayée sans transformation, `stream_options` est accepté, et la consommation de tokens est enregistrée dans les métriques de l'organisation.\n\nToutes les erreurs utilisent l'enveloppe OpenAI `{ error: { message } }`.",
13208
+ "operationId" : "createOpenAiChatCompletion",
13209
+ "parameters" : [ {
13210
+ "description" : "ID of the organization",
13211
+ "in" : "path",
13212
+ "name" : "organizationId",
13213
+ "required" : true,
13214
+ "schema" : {
13215
+ "type" : "string"
13216
+ }
13217
+ } ],
13218
+ "requestBody" : {
13219
+ "content" : {
13220
+ "application/json" : {
13221
+ "schema" : {
13222
+ "$ref" : "#/components/schemas/OpenAiChatCompletionRequest"
13223
+ }
13224
+ }
13225
+ },
13226
+ "required" : true
13227
+ },
13228
+ "responses" : {
13229
+ "200" : {
13230
+ "content" : {
13231
+ "application/json" : {
13232
+ "schema" : {
13233
+ "$ref" : "#/components/schemas/OpenAiChatCompletionResponse"
13234
+ }
13235
+ },
13236
+ "text/plain" : {
13237
+ "schema" : {
13238
+ "description" : "Flux de chunks JSON, renvoyé lorsque `stream` vaut true.",
13239
+ "type" : "string"
13240
+ }
13241
+ }
13242
+ },
13243
+ "description" : "Completion générée. Avec `stream: true`, la réponse est un flux `text/plain` de chunks JSON OpenAI."
13244
+ },
13245
+ "400" : {
13246
+ "content" : {
13247
+ "application/json" : {
13248
+ "schema" : {
13249
+ "$ref" : "#/components/schemas/AiGatewayError"
13250
+ }
13251
+ }
13252
+ },
13253
+ "description" : "Invalid request body"
13254
+ },
13255
+ "401" : {
13256
+ "content" : {
13257
+ "application/json" : {
13258
+ "schema" : {
13259
+ "$ref" : "#/components/schemas/AiGatewayError"
13260
+ }
13261
+ }
13262
+ },
13263
+ "description" : "Unauthenticated — no caller identity could be established"
13264
+ },
13265
+ "403" : {
13266
+ "content" : {
13267
+ "application/json" : {
13268
+ "schema" : {
13269
+ "$ref" : "#/components/schemas/AiGatewayError"
13270
+ }
13271
+ }
13272
+ },
13273
+ "description" : "Forbidden — the caller is not part of the organization"
13274
+ },
13275
+ "404" : {
13276
+ "content" : {
13277
+ "application/json" : {
13278
+ "schema" : {
13279
+ "$ref" : "#/components/schemas/AiGatewayError"
13280
+ }
13281
+ }
13282
+ },
13283
+ "description" : "Model not found — aucun provider de l'organisation n'expose ce modèle"
13284
+ },
13285
+ "500" : {
13286
+ "content" : {
13287
+ "application/json" : {
13288
+ "schema" : {
13289
+ "$ref" : "#/components/schemas/AiGatewayError"
13290
+ }
13291
+ }
13292
+ },
13293
+ "description" : "Internal server error"
13294
+ }
13295
+ },
13296
+ "summary" : "Create a chat completion using the native OpenAI client",
13297
+ "tags" : [ "ai-gateway" ]
13298
+ }
13299
+ },
13300
+ "/admin/tool-presets" : {
13301
+ "delete" : {
13302
+ "description" : "Clears the shared tool library",
13303
+ "operationId" : "deleteAllAdminToolPresets",
13304
+ "responses" : {
13305
+ "200" : {
13306
+ "content" : {
13307
+ "application/json" : {
13308
+ "schema" : {
13309
+ "$ref" : "#/components/schemas/ToolPresetDeleteAllResponse"
13310
+ }
13311
+ }
13312
+ },
13313
+ "description" : "Tool library cleared"
13314
+ },
13315
+ "401" : {
13316
+ "description" : "Unauthorized"
13317
+ },
13318
+ "403" : {
13319
+ "description" : "Forbidden"
13320
+ }
13321
+ },
13322
+ "summary" : "Delete every tool preset",
13323
+ "tags" : [ "admin" ]
13324
+ },
13325
+ "get" : {
13326
+ "description" : "Returns a page of the shared tool library, including inactive presets. Use /admin/tool-presets/export to retrieve the whole library at once.",
13327
+ "operationId" : "getAdminToolPresets",
13328
+ "parameters" : [ {
13329
+ "description" : "Page number, starting at 1",
13330
+ "in" : "query",
13331
+ "name" : "page",
13332
+ "schema" : {
13333
+ "default" : 1,
13334
+ "minimum" : 1,
13335
+ "type" : "integer"
13336
+ }
13337
+ }, {
13338
+ "description" : "Maximum number of tool presets to return",
13339
+ "in" : "query",
13340
+ "name" : "limit",
13341
+ "schema" : {
13342
+ "default" : 25,
13343
+ "maximum" : 100,
13344
+ "minimum" : 1,
13345
+ "type" : "integer"
13346
+ }
13347
+ }, {
13348
+ "description" : "Search tool presets by name, slug, url or description",
13349
+ "in" : "query",
13350
+ "name" : "search",
13351
+ "schema" : {
13352
+ "type" : "string"
13353
+ }
13354
+ }, {
13355
+ "description" : "Filter tool presets by category",
13356
+ "in" : "query",
13357
+ "name" : "category",
13358
+ "schema" : {
13359
+ "type" : "string"
13360
+ }
13361
+ } ],
13362
+ "responses" : {
13363
+ "200" : {
13364
+ "content" : {
13365
+ "application/json" : {
13366
+ "schema" : {
13367
+ "$ref" : "#/components/schemas/ToolPresetPage"
13368
+ }
13369
+ }
13370
+ },
13371
+ "description" : "Tool presets retrieved successfully"
13372
+ },
13373
+ "401" : {
13374
+ "description" : "Unauthorized"
13375
+ },
13376
+ "403" : {
13377
+ "description" : "Forbidden"
13378
+ }
13379
+ },
13380
+ "summary" : "List tool presets",
13381
+ "tags" : [ "admin" ]
13382
+ },
13383
+ "post" : {
13384
+ "operationId" : "createAdminToolPreset",
13385
+ "requestBody" : {
13386
+ "content" : {
13387
+ "application/json" : {
13388
+ "schema" : {
13389
+ "$ref" : "#/components/schemas/ToolPresetCreateRequest"
13390
+ }
13391
+ }
13392
+ },
13393
+ "required" : true
13394
+ },
13395
+ "responses" : {
13396
+ "201" : {
13397
+ "content" : {
13398
+ "application/json" : {
13399
+ "schema" : {
13400
+ "$ref" : "#/components/schemas/ToolPreset"
13401
+ }
13402
+ }
13403
+ },
13404
+ "description" : "Tool preset created"
13405
+ },
13406
+ "400" : {
13407
+ "description" : "Invalid payload"
13408
+ },
13409
+ "401" : {
13410
+ "description" : "Unauthorized"
13411
+ },
13412
+ "403" : {
13413
+ "description" : "Forbidden"
13414
+ },
13415
+ "409" : {
12960
13416
  "description" : "TOOL_PRESET_SLUG_ALREADY_EXISTS"
12961
13417
  }
12962
13418
  },
@@ -13451,20 +13907,20 @@
13451
13907
  "type" : "string"
13452
13908
  }
13453
13909
  },
13454
- "workspacePathQuery" : {
13455
- "description" : "Absolute path of the workspace file, always under /home/user. Rejected with 400 when it leaves that root, contains a traversal, or uses characters outside [A-Za-z0-9._-].",
13456
- "example" : "/home/user/rapport.md",
13457
- "in" : "query",
13458
- "name" : "path",
13910
+ "organizationIdPath" : {
13911
+ "description" : "ID of the organization",
13912
+ "in" : "path",
13913
+ "name" : "organizationId",
13459
13914
  "required" : true,
13460
13915
  "schema" : {
13461
13916
  "type" : "string"
13462
13917
  }
13463
13918
  },
13464
- "organizationIdPath" : {
13465
- "description" : "ID of the organization",
13466
- "in" : "path",
13467
- "name" : "organizationId",
13919
+ "workspacePathQuery" : {
13920
+ "description" : "Absolute path of the workspace file, always under /home/user. Rejected with 400 when it leaves that root, contains a traversal, or uses characters outside [A-Za-z0-9._-].",
13921
+ "example" : "/home/user/rapport.md",
13922
+ "in" : "query",
13923
+ "name" : "path",
13468
13924
  "required" : true,
13469
13925
  "schema" : {
13470
13926
  "type" : "string"
@@ -17019,6 +17475,44 @@
17019
17475
  "$ref" : "#/components/schemas/AudioFile"
17020
17476
  } ]
17021
17477
  },
17478
+ "AgentChatOverviewEntry" : {
17479
+ "description" : "État de la conversation d'un agent pour l'utilisateur courant. Le nombre de non-lus est dérivé des messages postérieurs à sa marque de lecture.",
17480
+ "properties" : {
17481
+ "agentId" : {
17482
+ "format" : "uuid",
17483
+ "type" : "string"
17484
+ },
17485
+ "conversationId" : {
17486
+ "format" : "uuid",
17487
+ "type" : "string"
17488
+ },
17489
+ "lastMessageAt" : {
17490
+ "description" : "Horodatage du dernier message, null si la conversation est vide",
17491
+ "nullable" : true,
17492
+ "type" : "string"
17493
+ },
17494
+ "unreadCount" : {
17495
+ "description" : "Messages non lus, hors messages de l'utilisateur lui-même",
17496
+ "type" : "integer"
17497
+ },
17498
+ "isGenerating" : {
17499
+ "description" : "Vrai tant qu'une réponse est en cours de génération",
17500
+ "type" : "boolean"
17501
+ }
17502
+ },
17503
+ "required" : [ "agentId", "conversationId", "isGenerating", "unreadCount" ],
17504
+ "type" : "object"
17505
+ },
17506
+ "MarkConversationReadRequest" : {
17507
+ "properties" : {
17508
+ "readAt" : {
17509
+ "description" : "Position de lecture ; par défaut l'instant courant",
17510
+ "format" : "date-time",
17511
+ "type" : "string"
17512
+ }
17513
+ },
17514
+ "type" : "object"
17515
+ },
17022
17516
  "ConversationSummary" : {
17023
17517
  "properties" : {
17024
17518
  "id" : {
@@ -19422,92 +19916,342 @@
19422
19916
  "type" : "number"
19423
19917
  }
19424
19918
  },
19425
- "required" : [ "canCreateAgents", "user" ],
19919
+ "required" : [ "canCreateAgents", "user" ],
19920
+ "type" : "object"
19921
+ },
19922
+ "UserIdentifierRequest" : {
19923
+ "additionalProperties" : false,
19924
+ "properties" : {
19925
+ "email" : {
19926
+ "type" : "string"
19927
+ }
19928
+ },
19929
+ "required" : [ "email" ],
19930
+ "type" : "object"
19931
+ },
19932
+ "UserUpdateRequest" : {
19933
+ "additionalProperties" : false,
19934
+ "properties" : {
19935
+ "user" : {
19936
+ "$ref" : "#/components/schemas/UserIdentifierRequest"
19937
+ },
19938
+ "isAdmin" : {
19939
+ "nullable" : true,
19940
+ "type" : "boolean"
19941
+ },
19942
+ "canCreateAgents" : {
19943
+ "nullable" : true,
19944
+ "type" : "boolean"
19945
+ },
19946
+ "maxAgents" : {
19947
+ "nullable" : true,
19948
+ "type" : "number"
19949
+ },
19950
+ "agents" : {
19951
+ "items" : {
19952
+ "type" : "string"
19953
+ },
19954
+ "nullable" : true,
19955
+ "type" : "array"
19956
+ },
19957
+ "allAgents" : {
19958
+ "nullable" : true,
19959
+ "type" : "boolean"
19960
+ }
19961
+ },
19962
+ "type" : "object"
19963
+ },
19964
+ "UserLockRequest" : {
19965
+ "additionalProperties" : false,
19966
+ "properties" : {
19967
+ "locked" : {
19968
+ "description" : "true pour verrouiller le compte, false pour le déverrouiller",
19969
+ "type" : "boolean"
19970
+ }
19971
+ },
19972
+ "required" : [ "locked" ],
19973
+ "type" : "object"
19974
+ },
19975
+ "ApiKeyCreateRequest" : {
19976
+ "additionalProperties" : false,
19977
+ "properties" : {
19978
+ "name" : {
19979
+ "description" : "Nom descriptif de la clé",
19980
+ "maxLength" : 50,
19981
+ "minLength" : 1,
19982
+ "type" : "string"
19983
+ }
19984
+ },
19985
+ "required" : [ "name" ],
19986
+ "type" : "object"
19987
+ },
19988
+ "ApiKeyCreated" : {
19989
+ "properties" : {
19990
+ "id" : {
19991
+ "type" : "string"
19992
+ },
19993
+ "name" : {
19994
+ "type" : "string"
19995
+ },
19996
+ "keySecret" : {
19997
+ "description" : "Valeur de la clé. Renvoyée uniquement à la création.",
19998
+ "type" : "string"
19999
+ }
20000
+ },
20001
+ "required" : [ "id", "keySecret", "name" ],
20002
+ "type" : "object"
20003
+ },
20004
+ "AiGatewayModelList" : {
20005
+ "properties" : {
20006
+ "object" : {
20007
+ "enum" : [ "list" ],
20008
+ "type" : "string"
20009
+ },
20010
+ "data" : {
20011
+ "items" : {
20012
+ "$ref" : "#/components/schemas/AiGatewayModelList_data_inner"
20013
+ },
20014
+ "type" : "array"
20015
+ }
20016
+ },
20017
+ "required" : [ "data", "object" ],
20018
+ "type" : "object"
20019
+ },
20020
+ "AiGatewayError" : {
20021
+ "properties" : {
20022
+ "error" : {
20023
+ "$ref" : "#/components/schemas/deleteMessageAudio_200_response"
20024
+ }
20025
+ },
20026
+ "required" : [ "error" ],
20027
+ "type" : "object"
20028
+ },
20029
+ "AiGatewayModel" : {
20030
+ "properties" : {
20031
+ "id" : {
20032
+ "type" : "string"
20033
+ },
20034
+ "object" : {
20035
+ "enum" : [ "model" ],
20036
+ "type" : "string"
20037
+ },
20038
+ "created" : {
20039
+ "description" : "Horodatage Unix généré à chaque appel, pas une date de création réelle.",
20040
+ "type" : "integer"
20041
+ },
20042
+ "owned_by" : {
20043
+ "description" : "Nom du provider qui expose le modèle.",
20044
+ "type" : "string"
20045
+ }
20046
+ },
20047
+ "required" : [ "created", "id", "object", "owned_by" ],
20048
+ "type" : "object"
20049
+ },
20050
+ "AiGatewayChatCompletionRequest" : {
20051
+ "additionalProperties" : false,
20052
+ "properties" : {
20053
+ "model" : {
20054
+ "minLength" : 1,
20055
+ "type" : "string"
20056
+ },
20057
+ "messages" : {
20058
+ "items" : {
20059
+ "$ref" : "#/components/schemas/AiGatewayMessage"
20060
+ },
20061
+ "minItems" : 1,
20062
+ "type" : "array"
20063
+ },
20064
+ "maxTokens" : {
20065
+ "description" : "Nombre maximum de tokens générés.",
20066
+ "minimum" : 1,
20067
+ "type" : "number"
20068
+ },
20069
+ "temperature" : {
20070
+ "description" : "Température d'échantillonnage.",
20071
+ "maximum" : 1,
20072
+ "minimum" : 0,
20073
+ "type" : "number"
20074
+ },
20075
+ "stream" : {
20076
+ "description" : "Si true, la réponse est un flux de texte brut au lieu d'un objet JSON.",
20077
+ "type" : "boolean"
20078
+ }
20079
+ },
20080
+ "required" : [ "messages", "model" ],
20081
+ "type" : "object"
20082
+ },
20083
+ "AiGatewayMessage" : {
20084
+ "additionalProperties" : false,
20085
+ "properties" : {
20086
+ "role" : {
20087
+ "enum" : [ "user", "system", "assistant" ],
20088
+ "type" : "string"
20089
+ },
20090
+ "content" : {
20091
+ "minLength" : 1,
20092
+ "type" : "string"
20093
+ }
20094
+ },
20095
+ "required" : [ "content", "role" ],
20096
+ "type" : "object"
20097
+ },
20098
+ "AiGatewayChatCompletionResponse" : {
20099
+ "additionalProperties" : true,
20100
+ "properties" : {
20101
+ "text" : {
20102
+ "type" : "string"
20103
+ },
20104
+ "finishReason" : {
20105
+ "type" : "string"
20106
+ },
20107
+ "usage" : {
20108
+ "additionalProperties" : true,
20109
+ "type" : "object"
20110
+ }
20111
+ },
20112
+ "type" : "object"
20113
+ },
20114
+ "AiGatewayEmbeddingRequest" : {
20115
+ "additionalProperties" : false,
20116
+ "properties" : {
20117
+ "model" : {
20118
+ "minLength" : 1,
20119
+ "type" : "string"
20120
+ },
20121
+ "input" : {
20122
+ "minLength" : 1,
20123
+ "type" : "string"
20124
+ }
20125
+ },
20126
+ "required" : [ "input", "model" ],
19426
20127
  "type" : "object"
19427
20128
  },
19428
- "UserIdentifierRequest" : {
19429
- "additionalProperties" : false,
20129
+ "AiGatewayEmbeddingResponse" : {
20130
+ "additionalProperties" : true,
19430
20131
  "properties" : {
19431
- "email" : {
20132
+ "embedding" : {
20133
+ "items" : {
20134
+ "type" : "number"
20135
+ },
20136
+ "type" : "array"
20137
+ },
20138
+ "value" : {
19432
20139
  "type" : "string"
20140
+ },
20141
+ "usage" : {
20142
+ "additionalProperties" : true,
20143
+ "type" : "object"
19433
20144
  }
19434
20145
  },
19435
- "required" : [ "email" ],
19436
20146
  "type" : "object"
19437
20147
  },
19438
- "UserUpdateRequest" : {
19439
- "additionalProperties" : false,
20148
+ "AiGatewayUsage" : {
19440
20149
  "properties" : {
19441
- "user" : {
19442
- "$ref" : "#/components/schemas/UserIdentifierRequest"
19443
- },
19444
- "isAdmin" : {
19445
- "nullable" : true,
19446
- "type" : "boolean"
20150
+ "total" : {
20151
+ "$ref" : "#/components/schemas/AiGatewayUsageTotal"
19447
20152
  },
19448
- "canCreateAgents" : {
19449
- "nullable" : true,
19450
- "type" : "boolean"
20153
+ "series" : {
20154
+ "items" : {
20155
+ "$ref" : "#/components/schemas/AiGatewayUsagePoint"
20156
+ },
20157
+ "type" : "array"
19451
20158
  },
19452
- "maxAgents" : {
19453
- "nullable" : true,
19454
- "type" : "number"
20159
+ "byModel" : {
20160
+ "items" : {
20161
+ "$ref" : "#/components/schemas/AiGatewayUsageBreakdownItem"
20162
+ },
20163
+ "type" : "array"
19455
20164
  },
19456
- "agents" : {
20165
+ "byProvider" : {
19457
20166
  "items" : {
19458
- "type" : "string"
20167
+ "$ref" : "#/components/schemas/AiGatewayUsageBreakdownItem"
19459
20168
  },
19460
- "nullable" : true,
19461
20169
  "type" : "array"
19462
20170
  },
19463
- "allAgents" : {
19464
- "nullable" : true,
19465
- "type" : "boolean"
20171
+ "byUser" : {
20172
+ "items" : {
20173
+ "$ref" : "#/components/schemas/AiGatewayUsageBreakdownItem"
20174
+ },
20175
+ "type" : "array"
19466
20176
  }
19467
20177
  },
20178
+ "required" : [ "byModel", "byProvider", "byUser", "series", "total" ],
19468
20179
  "type" : "object"
19469
20180
  },
19470
- "UserLockRequest" : {
19471
- "additionalProperties" : false,
20181
+ "AiGatewayUsageTotal" : {
19472
20182
  "properties" : {
19473
- "locked" : {
19474
- "description" : "true pour verrouiller le compte, false pour le déverrouiller",
19475
- "type" : "boolean"
20183
+ "requests" : {
20184
+ "type" : "integer"
20185
+ },
20186
+ "inputTokens" : {
20187
+ "type" : "integer"
20188
+ },
20189
+ "outputTokens" : {
20190
+ "type" : "integer"
20191
+ },
20192
+ "reasoningTokens" : {
20193
+ "type" : "integer"
20194
+ },
20195
+ "totalTokens" : {
20196
+ "type" : "integer"
20197
+ },
20198
+ "uniqueUsers" : {
20199
+ "type" : "integer"
19476
20200
  }
19477
20201
  },
19478
- "required" : [ "locked" ],
20202
+ "required" : [ "inputTokens", "outputTokens", "reasoningTokens", "requests", "totalTokens", "uniqueUsers" ],
19479
20203
  "type" : "object"
19480
20204
  },
19481
- "ApiKeyCreateRequest" : {
19482
- "additionalProperties" : false,
20205
+ "AiGatewayUsagePoint" : {
19483
20206
  "properties" : {
19484
- "name" : {
19485
- "description" : "Nom descriptif de la clé",
19486
- "maxLength" : 50,
19487
- "minLength" : 1,
20207
+ "bucket" : {
20208
+ "description" : "Clé de regroupement temporel, dépendante de la granularité demandée",
20209
+ "type" : "string"
20210
+ },
20211
+ "label" : {
19488
20212
  "type" : "string"
20213
+ },
20214
+ "requests" : {
20215
+ "type" : "integer"
20216
+ },
20217
+ "inputTokens" : {
20218
+ "type" : "integer"
20219
+ },
20220
+ "outputTokens" : {
20221
+ "type" : "integer"
19489
20222
  }
19490
20223
  },
19491
- "required" : [ "name" ],
20224
+ "required" : [ "bucket", "inputTokens", "label", "outputTokens", "requests" ],
19492
20225
  "type" : "object"
19493
20226
  },
19494
- "ApiKeyCreated" : {
20227
+ "AiGatewayUsageBreakdownItem" : {
20228
+ "description" : "Consommation agrégée sur une dimension (modèle, provider ou utilisateur).",
19495
20229
  "properties" : {
19496
- "id" : {
20230
+ "key" : {
20231
+ "description" : "Identifiant brut de la dimension (id de modèle, de provider ou d'utilisateur)",
19497
20232
  "type" : "string"
19498
20233
  },
19499
- "name" : {
20234
+ "label" : {
20235
+ "description" : "Libellé affichable ; pour un utilisateur, son email lorsqu'il est connu",
19500
20236
  "type" : "string"
19501
20237
  },
19502
- "keySecret" : {
19503
- "description" : "Valeur de la clé. Renvoyée uniquement à la création.",
19504
- "type" : "string"
20238
+ "requests" : {
20239
+ "type" : "integer"
20240
+ },
20241
+ "inputTokens" : {
20242
+ "type" : "integer"
20243
+ },
20244
+ "outputTokens" : {
20245
+ "type" : "integer"
20246
+ },
20247
+ "totalTokens" : {
20248
+ "type" : "integer"
19505
20249
  }
19506
20250
  },
19507
- "required" : [ "id", "keySecret", "name" ],
20251
+ "required" : [ "inputTokens", "key", "label", "outputTokens", "requests", "totalTokens" ],
19508
20252
  "type" : "object"
19509
20253
  },
19510
- "AiGatewayModelList" : {
20254
+ "AiGatewayV1ModelList" : {
19511
20255
  "properties" : {
19512
20256
  "object" : {
19513
20257
  "enum" : [ "list" ],
@@ -19515,7 +20259,7 @@
19515
20259
  },
19516
20260
  "data" : {
19517
20261
  "items" : {
19518
- "$ref" : "#/components/schemas/AiGatewayModelList_data_inner"
20262
+ "$ref" : "#/components/schemas/AiGatewayV1Model"
19519
20263
  },
19520
20264
  "type" : "array"
19521
20265
  }
@@ -19523,16 +20267,7 @@
19523
20267
  "required" : [ "data", "object" ],
19524
20268
  "type" : "object"
19525
20269
  },
19526
- "AiGatewayError" : {
19527
- "properties" : {
19528
- "error" : {
19529
- "$ref" : "#/components/schemas/deleteMessageAudio_200_response"
19530
- }
19531
- },
19532
- "required" : [ "error" ],
19533
- "type" : "object"
19534
- },
19535
- "AiGatewayModel" : {
20270
+ "AiGatewayV1Model" : {
19536
20271
  "properties" : {
19537
20272
  "id" : {
19538
20273
  "type" : "string"
@@ -19542,219 +20277,255 @@
19542
20277
  "type" : "string"
19543
20278
  },
19544
20279
  "created" : {
19545
- "description" : "Horodatage Unix généré à chaque appel, pas une date de création réelle.",
20280
+ "type" : "integer"
20281
+ },
20282
+ "released" : {
20283
+ "description" : "Toujours null — date de sortie non conservée par Breign",
20284
+ "nullable" : true,
19546
20285
  "type" : "integer"
19547
20286
  },
19548
20287
  "owned_by" : {
19549
- "description" : "Nom du provider qui expose le modèle.",
19550
20288
  "type" : "string"
19551
- }
19552
- },
19553
- "required" : [ "created", "id", "object", "owned_by" ],
19554
- "type" : "object"
19555
- },
19556
- "AiGatewayChatCompletionRequest" : {
19557
- "additionalProperties" : false,
19558
- "properties" : {
19559
- "model" : {
19560
- "minLength" : 1,
20289
+ },
20290
+ "name" : {
19561
20291
  "type" : "string"
19562
20292
  },
19563
- "messages" : {
20293
+ "description" : {
20294
+ "description" : "Toujours null — description non conservée par Breign",
20295
+ "nullable" : true,
20296
+ "type" : "string"
20297
+ },
20298
+ "context_window" : {
20299
+ "description" : "Toujours null — taille de contexte non conservée par Breign",
20300
+ "nullable" : true,
20301
+ "type" : "integer"
20302
+ },
20303
+ "max_tokens" : {
20304
+ "nullable" : true,
20305
+ "type" : "integer"
20306
+ },
20307
+ "type" : {
20308
+ "enum" : [ "language", "embedding" ],
20309
+ "type" : "string"
20310
+ },
20311
+ "tags" : {
19564
20312
  "items" : {
19565
- "$ref" : "#/components/schemas/AiGatewayMessage"
20313
+ "type" : "string"
19566
20314
  },
19567
- "minItems" : 1,
19568
20315
  "type" : "array"
19569
20316
  },
19570
- "maxTokens" : {
19571
- "description" : "Nombre maximum de tokens générés.",
19572
- "minimum" : 1,
19573
- "type" : "number"
19574
- },
19575
- "temperature" : {
19576
- "description" : "Température d'échantillonnage.",
19577
- "maximum" : 1,
19578
- "minimum" : 0,
19579
- "type" : "number"
19580
- },
19581
- "stream" : {
19582
- "description" : "Si true, la réponse est un flux de texte brut au lieu d'un objet JSON.",
19583
- "type" : "boolean"
20317
+ "pricing" : {
20318
+ "allOf" : [ {
20319
+ "$ref" : "#/components/schemas/AiGatewayV1ModelPricing"
20320
+ } ],
20321
+ "nullable" : true
19584
20322
  }
19585
20323
  },
19586
- "required" : [ "messages", "model" ],
20324
+ "required" : [ "created", "id", "name", "object", "owned_by", "tags", "type" ],
19587
20325
  "type" : "object"
19588
20326
  },
19589
- "AiGatewayMessage" : {
19590
- "additionalProperties" : false,
20327
+ "AiGatewayV1ModelPricing" : {
19591
20328
  "properties" : {
19592
- "role" : {
19593
- "enum" : [ "user", "system", "assistant" ],
20329
+ "input" : {
20330
+ "description" : "Coût par token en entrée",
20331
+ "nullable" : true,
19594
20332
  "type" : "string"
19595
20333
  },
19596
- "content" : {
19597
- "minLength" : 1,
20334
+ "output" : {
20335
+ "description" : "Coût par token en sortie",
20336
+ "nullable" : true,
20337
+ "type" : "string"
20338
+ },
20339
+ "input_cache_read" : {
20340
+ "description" : "Toujours null — Breign ne tarife pas la lecture de cache",
20341
+ "nullable" : true,
20342
+ "type" : "string"
20343
+ },
20344
+ "input_cache_write" : {
20345
+ "description" : "Toujours null — Breign ne tarife pas l'écriture de cache",
20346
+ "nullable" : true,
19598
20347
  "type" : "string"
19599
20348
  }
19600
20349
  },
19601
- "required" : [ "content", "role" ],
19602
20350
  "type" : "object"
19603
20351
  },
19604
- "AiGatewayChatCompletionResponse" : {
19605
- "additionalProperties" : true,
20352
+ "AiGatewayV1ModelEndpoints" : {
19606
20353
  "properties" : {
19607
- "text" : {
20354
+ "data" : {
20355
+ "$ref" : "#/components/schemas/AiGatewayV1ModelEndpoints_data"
20356
+ }
20357
+ },
20358
+ "required" : [ "data" ],
20359
+ "type" : "object"
20360
+ },
20361
+ "AiGatewayV1Endpoint" : {
20362
+ "properties" : {
20363
+ "name" : {
20364
+ "type" : "string"
20365
+ },
20366
+ "model_name" : {
20367
+ "type" : "string"
20368
+ },
20369
+ "context_length" : {
20370
+ "nullable" : true,
20371
+ "type" : "integer"
20372
+ },
20373
+ "pricing" : {
20374
+ "$ref" : "#/components/schemas/AiGatewayV1Endpoint_pricing"
20375
+ },
20376
+ "provider_name" : {
19608
20377
  "type" : "string"
19609
20378
  },
19610
- "finishReason" : {
19611
- "type" : "string"
20379
+ "max_completion_tokens" : {
20380
+ "nullable" : true,
20381
+ "type" : "integer"
20382
+ },
20383
+ "supported_parameters" : {
20384
+ "items" : {
20385
+ "type" : "string"
20386
+ },
20387
+ "type" : "array"
20388
+ },
20389
+ "status" : {
20390
+ "description" : "0 lorsque l'endpoint est actif",
20391
+ "type" : "integer"
20392
+ },
20393
+ "uptime_last_15m" : {
20394
+ "description" : "Toujours null — Breign ne collecte pas de télémétrie de disponibilité",
20395
+ "nullable" : true,
20396
+ "type" : "number"
20397
+ },
20398
+ "uptime_last_1h" : {
20399
+ "description" : "Toujours null — Breign ne collecte pas de télémétrie de disponibilité",
20400
+ "nullable" : true,
20401
+ "type" : "number"
20402
+ },
20403
+ "uptime_last_1d" : {
20404
+ "description" : "Toujours null — Breign ne collecte pas de télémétrie de disponibilité",
20405
+ "nullable" : true,
20406
+ "type" : "number"
20407
+ },
20408
+ "throughput_last_1h" : {
20409
+ "description" : "Toujours null — débit non mesuré par endpoint provider",
20410
+ "nullable" : true,
20411
+ "type" : "object"
19612
20412
  },
19613
- "usage" : {
19614
- "additionalProperties" : true,
20413
+ "latency_last_1h" : {
20414
+ "description" : "Toujours null — latence non mesurée par endpoint provider",
20415
+ "nullable" : true,
19615
20416
  "type" : "object"
20417
+ },
20418
+ "supports_implicit_caching" : {
20419
+ "nullable" : true,
20420
+ "type" : "boolean"
19616
20421
  }
19617
20422
  },
20423
+ "required" : [ "model_name", "name", "provider_name", "status", "supported_parameters" ],
19618
20424
  "type" : "object"
19619
20425
  },
19620
- "AiGatewayEmbeddingRequest" : {
19621
- "additionalProperties" : false,
20426
+ "AiGatewayV1Credits" : {
19622
20427
  "properties" : {
19623
- "model" : {
19624
- "minLength" : 1,
20428
+ "balance" : {
20429
+ "description" : "Toujours null — Breign n'a pas de notion de crédits prépayés",
20430
+ "nullable" : true,
19625
20431
  "type" : "string"
19626
20432
  },
19627
- "input" : {
19628
- "minLength" : 1,
20433
+ "total_used" : {
20434
+ "description" : "Dépense cumulée de l'organisation, calculée depuis la configuration de prix",
19629
20435
  "type" : "string"
19630
20436
  }
19631
20437
  },
19632
- "required" : [ "input", "model" ],
20438
+ "required" : [ "total_used" ],
19633
20439
  "type" : "object"
19634
20440
  },
19635
- "AiGatewayEmbeddingResponse" : {
19636
- "additionalProperties" : true,
20441
+ "AiGatewayV1Generation" : {
19637
20442
  "properties" : {
19638
- "embedding" : {
19639
- "items" : {
19640
- "type" : "number"
19641
- },
19642
- "type" : "array"
19643
- },
19644
- "value" : {
19645
- "type" : "string"
19646
- },
19647
- "usage" : {
19648
- "additionalProperties" : true,
19649
- "type" : "object"
20443
+ "data" : {
20444
+ "$ref" : "#/components/schemas/AiGatewayV1Generation_data"
19650
20445
  }
19651
20446
  },
20447
+ "required" : [ "data" ],
19652
20448
  "type" : "object"
19653
20449
  },
19654
- "AiGatewayUsage" : {
20450
+ "AiGatewayV1Report" : {
19655
20451
  "properties" : {
19656
- "total" : {
19657
- "$ref" : "#/components/schemas/AiGatewayUsageTotal"
19658
- },
19659
- "series" : {
19660
- "items" : {
19661
- "$ref" : "#/components/schemas/AiGatewayUsagePoint"
19662
- },
19663
- "type" : "array"
19664
- },
19665
- "byModel" : {
19666
- "items" : {
19667
- "$ref" : "#/components/schemas/AiGatewayUsageBreakdownItem"
19668
- },
19669
- "type" : "array"
19670
- },
19671
- "byProvider" : {
19672
- "items" : {
19673
- "$ref" : "#/components/schemas/AiGatewayUsageBreakdownItem"
19674
- },
19675
- "type" : "array"
19676
- },
19677
- "byUser" : {
20452
+ "results" : {
19678
20453
  "items" : {
19679
- "$ref" : "#/components/schemas/AiGatewayUsageBreakdownItem"
20454
+ "$ref" : "#/components/schemas/AiGatewayV1ReportRow"
19680
20455
  },
19681
20456
  "type" : "array"
19682
20457
  }
19683
20458
  },
19684
- "required" : [ "byModel", "byProvider", "byUser", "series", "total" ],
20459
+ "required" : [ "results" ],
19685
20460
  "type" : "object"
19686
20461
  },
19687
- "AiGatewayUsageTotal" : {
20462
+ "AiGatewayV1ReportRow" : {
20463
+ "description" : "Porte la seule clé de regroupement correspondant au group_by demandé, plus les métriques agrégées.",
19688
20464
  "properties" : {
19689
- "requests" : {
19690
- "type" : "integer"
19691
- },
19692
- "inputTokens" : {
19693
- "type" : "integer"
19694
- },
19695
- "outputTokens" : {
19696
- "type" : "integer"
20465
+ "day" : {
20466
+ "type" : "string"
19697
20467
  },
19698
- "reasoningTokens" : {
19699
- "type" : "integer"
20468
+ "hour" : {
20469
+ "type" : "string"
19700
20470
  },
19701
- "totalTokens" : {
19702
- "type" : "integer"
20471
+ "user" : {
20472
+ "nullable" : true,
20473
+ "type" : "string"
19703
20474
  },
19704
- "uniqueUsers" : {
19705
- "type" : "integer"
19706
- }
19707
- },
19708
- "required" : [ "inputTokens", "outputTokens", "reasoningTokens", "requests", "totalTokens", "uniqueUsers" ],
19709
- "type" : "object"
19710
- },
19711
- "AiGatewayUsagePoint" : {
19712
- "properties" : {
19713
- "bucket" : {
19714
- "description" : "Clé de regroupement temporel, dépendante de la granularité demandée",
20475
+ "model" : {
19715
20476
  "type" : "string"
19716
20477
  },
19717
- "label" : {
20478
+ "tag" : {
19718
20479
  "type" : "string"
19719
20480
  },
19720
- "requests" : {
19721
- "type" : "integer"
20481
+ "provider" : {
20482
+ "type" : "string"
19722
20483
  },
19723
- "inputTokens" : {
19724
- "type" : "integer"
20484
+ "credential_type" : {
20485
+ "type" : "string"
19725
20486
  },
19726
- "outputTokens" : {
19727
- "type" : "integer"
19728
- }
19729
- },
19730
- "required" : [ "bucket", "inputTokens", "label", "outputTokens", "requests" ],
19731
- "type" : "object"
19732
- },
19733
- "AiGatewayUsageBreakdownItem" : {
19734
- "description" : "Consommation agrégée sur une dimension (modèle, provider ou utilisateur).",
19735
- "properties" : {
19736
- "key" : {
19737
- "description" : "Identifiant brut de la dimension (id de modèle, de provider ou d'utilisateur)",
20487
+ "zero_data_retention" : {
19738
20488
  "type" : "string"
19739
20489
  },
19740
- "label" : {
19741
- "description" : "Libellé affichable ; pour un utilisateur, son email lorsqu'il est connu",
20490
+ "api_key_name" : {
20491
+ "nullable" : true,
19742
20492
  "type" : "string"
19743
20493
  },
19744
- "requests" : {
19745
- "type" : "integer"
20494
+ "total_cost" : {
20495
+ "type" : "number"
19746
20496
  },
19747
- "inputTokens" : {
19748
- "type" : "integer"
20497
+ "market_cost" : {
20498
+ "description" : "Égal à total_cost — Breign ne sert pas d'appels BYOK",
20499
+ "type" : "number"
19749
20500
  },
19750
- "outputTokens" : {
19751
- "type" : "integer"
20501
+ "surcharge_cost" : {
20502
+ "description" : "Toujours 0 — aucune capacité facturée en supplément",
20503
+ "type" : "number"
19752
20504
  },
19753
- "totalTokens" : {
19754
- "type" : "integer"
20505
+ "gateway_cost" : {
20506
+ "description" : "Toujours 0 — la passerelle ne facture pas de coût propre",
20507
+ "type" : "number"
20508
+ },
20509
+ "input_tokens" : {
20510
+ "type" : "number"
20511
+ },
20512
+ "output_tokens" : {
20513
+ "type" : "number"
20514
+ },
20515
+ "cached_input_tokens" : {
20516
+ "type" : "number"
20517
+ },
20518
+ "cache_creation_input_tokens" : {
20519
+ "type" : "number"
20520
+ },
20521
+ "reasoning_tokens" : {
20522
+ "type" : "number"
20523
+ },
20524
+ "request_count" : {
20525
+ "type" : "number"
19755
20526
  }
19756
20527
  },
19757
- "required" : [ "inputTokens", "key", "label", "outputTokens", "requests", "totalTokens" ],
20528
+ "required" : [ "cache_creation_input_tokens", "cached_input_tokens", "gateway_cost", "input_tokens", "market_cost", "output_tokens", "reasoning_tokens", "request_count", "surcharge_cost", "total_cost" ],
19758
20529
  "type" : "object"
19759
20530
  },
19760
20531
  "OpenAiChatCompletionRequest" : {
@@ -22030,6 +22801,164 @@
22030
22801
  "required" : [ "created", "id", "object", "owned_by" ],
22031
22802
  "type" : "object"
22032
22803
  },
22804
+ "AiGatewayV1ModelEndpoints_data_architecture" : {
22805
+ "properties" : {
22806
+ "tokenizer" : {
22807
+ "nullable" : true,
22808
+ "type" : "string"
22809
+ },
22810
+ "instruct_type" : {
22811
+ "nullable" : true,
22812
+ "type" : "string"
22813
+ },
22814
+ "modality" : {
22815
+ "type" : "string"
22816
+ },
22817
+ "input_modalities" : {
22818
+ "items" : {
22819
+ "type" : "string"
22820
+ },
22821
+ "type" : "array"
22822
+ },
22823
+ "output_modalities" : {
22824
+ "items" : {
22825
+ "type" : "string"
22826
+ },
22827
+ "type" : "array"
22828
+ }
22829
+ },
22830
+ "type" : "object"
22831
+ },
22832
+ "AiGatewayV1ModelEndpoints_data" : {
22833
+ "properties" : {
22834
+ "id" : {
22835
+ "type" : "string"
22836
+ },
22837
+ "name" : {
22838
+ "type" : "string"
22839
+ },
22840
+ "created" : {
22841
+ "type" : "integer"
22842
+ },
22843
+ "released" : {
22844
+ "nullable" : true,
22845
+ "type" : "integer"
22846
+ },
22847
+ "description" : {
22848
+ "nullable" : true,
22849
+ "type" : "string"
22850
+ },
22851
+ "architecture" : {
22852
+ "$ref" : "#/components/schemas/AiGatewayV1ModelEndpoints_data_architecture"
22853
+ },
22854
+ "endpoints" : {
22855
+ "items" : {
22856
+ "$ref" : "#/components/schemas/AiGatewayV1Endpoint"
22857
+ },
22858
+ "type" : "array"
22859
+ }
22860
+ },
22861
+ "required" : [ "architecture", "created", "endpoints", "id", "name" ],
22862
+ "type" : "object"
22863
+ },
22864
+ "AiGatewayV1Endpoint_pricing" : {
22865
+ "nullable" : true,
22866
+ "properties" : {
22867
+ "prompt" : {
22868
+ "nullable" : true,
22869
+ "type" : "string"
22870
+ },
22871
+ "completion" : {
22872
+ "nullable" : true,
22873
+ "type" : "string"
22874
+ },
22875
+ "input_cache_read" : {
22876
+ "nullable" : true,
22877
+ "type" : "string"
22878
+ },
22879
+ "input_cache_write" : {
22880
+ "nullable" : true,
22881
+ "type" : "string"
22882
+ }
22883
+ },
22884
+ "type" : "object"
22885
+ },
22886
+ "AiGatewayV1Generation_data" : {
22887
+ "properties" : {
22888
+ "id" : {
22889
+ "type" : "string"
22890
+ },
22891
+ "total_cost" : {
22892
+ "description" : "Null lorsque le modèle n'est pas tarifé",
22893
+ "nullable" : true,
22894
+ "type" : "number"
22895
+ },
22896
+ "upstream_inference_cost" : {
22897
+ "description" : "Toujours 0 — Breign ne sert pas d'appels BYOK",
22898
+ "type" : "number"
22899
+ },
22900
+ "usage" : {
22901
+ "nullable" : true,
22902
+ "type" : "number"
22903
+ },
22904
+ "created_at" : {
22905
+ "format" : "date-time",
22906
+ "type" : "string"
22907
+ },
22908
+ "model" : {
22909
+ "type" : "string"
22910
+ },
22911
+ "is_byok" : {
22912
+ "type" : "boolean"
22913
+ },
22914
+ "provider_name" : {
22915
+ "type" : "string"
22916
+ },
22917
+ "streamed" : {
22918
+ "type" : "boolean"
22919
+ },
22920
+ "finish_reason" : {
22921
+ "nullable" : true,
22922
+ "type" : "string"
22923
+ },
22924
+ "latency" : {
22925
+ "description" : "Temps jusqu'au premier token ; null hors streaming",
22926
+ "nullable" : true,
22927
+ "type" : "integer"
22928
+ },
22929
+ "generation_time" : {
22930
+ "nullable" : true,
22931
+ "type" : "integer"
22932
+ },
22933
+ "tokens_prompt" : {
22934
+ "type" : "integer"
22935
+ },
22936
+ "tokens_completion" : {
22937
+ "type" : "integer"
22938
+ },
22939
+ "native_tokens_prompt" : {
22940
+ "type" : "integer"
22941
+ },
22942
+ "native_tokens_completion" : {
22943
+ "type" : "integer"
22944
+ },
22945
+ "native_tokens_reasoning" : {
22946
+ "type" : "integer"
22947
+ },
22948
+ "native_tokens_cached" : {
22949
+ "type" : "integer"
22950
+ },
22951
+ "native_tokens_cache_creation" : {
22952
+ "type" : "integer"
22953
+ },
22954
+ "billable_web_search_calls" : {
22955
+ "description" : "Toujours 0 — la recherche web n'est pas proposée",
22956
+ "type" : "integer"
22957
+ }
22958
+ },
22959
+ "required" : [ "created_at", "id", "model", "provider_name", "streamed" ],
22960
+ "type" : "object"
22961
+ },
22033
22962
  "OpenAiChatCompletionRequest_stream_options" : {
22034
22963
  "additionalProperties" : false,
22035
22964
  "properties" : {