relay.json 106 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110
  1. {
  2. "openapi": "3.0.1",
  3. "info": {
  4. "title": "AI模型接口",
  5. "description": "",
  6. "version": "1.0.0"
  7. },
  8. "tags": [
  9. {
  10. "name": "获取模型列表"
  11. },
  12. {
  13. "name": "OpenAI格式(Chat)"
  14. },
  15. {
  16. "name": "OpenAI格式(Responses)"
  17. },
  18. {
  19. "name": "图片生成/编辑(Images)"
  20. },
  21. {
  22. "name": "图片生成/编辑(Images)/OpenAI兼容格式"
  23. },
  24. {
  25. "name": "图片生成/编辑(Images)/Qwen千问"
  26. },
  27. {
  28. "name": "视频生成"
  29. },
  30. {
  31. "name": "视频生成/Sora兼容格式"
  32. },
  33. {
  34. "name": "视频生成/Kling格式"
  35. },
  36. {
  37. "name": "视频生成/即梦格式"
  38. },
  39. {
  40. "name": "Claude格式(Messages)"
  41. },
  42. {
  43. "name": "Gemini格式"
  44. },
  45. {
  46. "name": "OpenAI格式Embeddings"
  47. },
  48. {
  49. "name": "文本补全(Completions)"
  50. },
  51. {
  52. "name": "OpenAI音频(Audio)"
  53. },
  54. {
  55. "name": "重排序(Rerank)"
  56. },
  57. {
  58. "name": "Moderations"
  59. },
  60. {
  61. "name": "Realtime"
  62. },
  63. {
  64. "name": "未实现"
  65. },
  66. {
  67. "name": "未实现/Fine-tunes"
  68. },
  69. {
  70. "name": "未实现/Files"
  71. },
  72. {
  73. "name": "Models"
  74. },
  75. {
  76. "name": "Gemini"
  77. },
  78. {
  79. "name": "Chat"
  80. },
  81. {
  82. "name": "Responses"
  83. },
  84. {
  85. "name": "Images"
  86. },
  87. {
  88. "name": "视频生成-Kling"
  89. },
  90. {
  91. "name": "视频生成-即梦"
  92. },
  93. {
  94. "name": "Messages"
  95. },
  96. {
  97. "name": "Embeddings"
  98. },
  99. {
  100. "name": "Completions"
  101. },
  102. {
  103. "name": "Audio"
  104. },
  105. {
  106. "name": "Rerank"
  107. },
  108. {
  109. "name": "Fine-tunes"
  110. },
  111. {
  112. "name": "Files"
  113. }
  114. ],
  115. "paths": {
  116. "/v1/models": {
  117. "get": {
  118. "summary": "获取模型列表",
  119. "deprecated": false,
  120. "description": "获取当前可用的模型列表。\n\n根据请求头自动识别返回格式:\n- 包含 `x-api-key` 和 `anthropic-version` 头时返回 Anthropic 格式\n- 包含 `x-goog-api-key` 头或 `key` 查询参数时返回 Gemini 格式\n- 其他情况返回 OpenAI 格式\n",
  121. "operationId": "listModels",
  122. "tags": [
  123. "获取模型列表",
  124. "Models"
  125. ],
  126. "parameters": [
  127. {
  128. "name": "key",
  129. "in": "query",
  130. "description": "Google API Key (用于 Gemini 格式)",
  131. "required": false,
  132. "schema": {
  133. "type": "string"
  134. }
  135. },
  136. {
  137. "name": "x-api-key",
  138. "in": "header",
  139. "description": "Anthropic API Key (用于 Claude 格式)",
  140. "required": false,
  141. "example": "",
  142. "schema": {
  143. "type": "string"
  144. }
  145. },
  146. {
  147. "name": "anthropic-version",
  148. "in": "header",
  149. "description": "Anthropic API 版本",
  150. "required": false,
  151. "example": "",
  152. "schema": {
  153. "type": "string",
  154. "example": "2023-06-01"
  155. }
  156. },
  157. {
  158. "name": "x-goog-api-key",
  159. "in": "header",
  160. "description": "Google API Key (用于 Gemini 格式)",
  161. "required": false,
  162. "example": "",
  163. "schema": {
  164. "type": "string"
  165. }
  166. }
  167. ],
  168. "responses": {
  169. "200": {
  170. "description": "成功获取模型列表",
  171. "content": {
  172. "application/json": {
  173. "schema": {
  174. "$ref": "#/components/schemas/ModelsResponse"
  175. }
  176. }
  177. },
  178. "headers": {}
  179. },
  180. "401": {
  181. "description": "认证失败",
  182. "content": {
  183. "application/json": {
  184. "schema": {
  185. "$ref": "#/components/schemas/ErrorResponse"
  186. }
  187. }
  188. },
  189. "headers": {}
  190. }
  191. },
  192. "security": [
  193. {
  194. "BearerAuth": []
  195. }
  196. ]
  197. }
  198. },
  199. "/v1beta/models": {
  200. "get": {
  201. "summary": "Gemini 格式获取",
  202. "deprecated": false,
  203. "description": "以 Gemini API 格式返回可用模型列表",
  204. "operationId": "listModelsGemini",
  205. "tags": [
  206. "获取模型列表",
  207. "Models",
  208. "Gemini"
  209. ],
  210. "parameters": [],
  211. "responses": {
  212. "200": {
  213. "description": "成功获取模型列表",
  214. "content": {
  215. "application/json": {
  216. "schema": {
  217. "$ref": "#/components/schemas/GeminiModelsResponse"
  218. }
  219. }
  220. },
  221. "headers": {}
  222. }
  223. },
  224. "security": [
  225. {
  226. "BearerAuth": []
  227. }
  228. ]
  229. }
  230. },
  231. "/v1/chat/completions": {
  232. "post": {
  233. "summary": "创建聊天对话",
  234. "deprecated": false,
  235. "description": "根据对话历史创建模型响应。支持流式和非流式响应。\n\n兼容 OpenAI Chat Completions API。\n",
  236. "operationId": "createChatCompletion",
  237. "tags": [
  238. "OpenAI格式(Chat)",
  239. "Chat"
  240. ],
  241. "parameters": [],
  242. "requestBody": {
  243. "content": {
  244. "application/json": {
  245. "schema": {
  246. "$ref": "#/components/schemas/ChatCompletionRequest"
  247. }
  248. }
  249. },
  250. "required": true
  251. },
  252. "responses": {
  253. "200": {
  254. "description": "成功创建响应",
  255. "content": {
  256. "application/json": {
  257. "schema": {
  258. "$ref": "#/components/schemas/ChatCompletionResponse"
  259. }
  260. }
  261. },
  262. "headers": {}
  263. },
  264. "400": {
  265. "description": "请求参数错误",
  266. "content": {
  267. "application/json": {
  268. "schema": {
  269. "$ref": "#/components/schemas/ErrorResponse"
  270. }
  271. }
  272. },
  273. "headers": {}
  274. },
  275. "429": {
  276. "description": "请求频率限制",
  277. "content": {
  278. "application/json": {
  279. "schema": {
  280. "$ref": "#/components/schemas/ErrorResponse"
  281. }
  282. }
  283. },
  284. "headers": {}
  285. }
  286. },
  287. "security": [
  288. {
  289. "BearerAuth": []
  290. }
  291. ]
  292. }
  293. },
  294. "/v1/responses": {
  295. "post": {
  296. "summary": "创建响应 (OpenAI Responses API)",
  297. "deprecated": false,
  298. "description": "OpenAI Responses API,用于创建模型响应。\n支持多轮对话、工具调用、推理等功能。\n",
  299. "operationId": "createResponse",
  300. "tags": [
  301. "OpenAI格式(Responses)",
  302. "Responses"
  303. ],
  304. "parameters": [],
  305. "requestBody": {
  306. "content": {
  307. "application/json": {
  308. "schema": {
  309. "$ref": "#/components/schemas/ResponsesRequest"
  310. }
  311. }
  312. },
  313. "required": true
  314. },
  315. "responses": {
  316. "200": {
  317. "description": "成功创建响应",
  318. "content": {
  319. "application/json": {
  320. "schema": {
  321. "$ref": "#/components/schemas/ResponsesResponse"
  322. }
  323. }
  324. },
  325. "headers": {}
  326. }
  327. },
  328. "security": [
  329. {
  330. "BearerAuth": []
  331. }
  332. ]
  333. }
  334. },
  335. "/v1/images/generations": {
  336. "post": {
  337. "summary": "生成图像(qwen-image)",
  338. "deprecated": false,
  339. "description": " 百炼qwen-image系列图片生成",
  340. "operationId": "createImage",
  341. "tags": [
  342. "图片生成/编辑(Images)/Qwen千问",
  343. "Images"
  344. ],
  345. "parameters": [],
  346. "requestBody": {
  347. "content": {
  348. "application/json": {
  349. "schema": {
  350. "type": "object",
  351. "properties": {
  352. "model": {
  353. "type": "string"
  354. },
  355. "input": {
  356. "type": "object",
  357. "properties": {
  358. "messages": {
  359. "type": "array",
  360. "items": {
  361. "type": "object",
  362. "properties": {
  363. "role": {
  364. "type": "string"
  365. },
  366. "content": {
  367. "type": "array",
  368. "items": {
  369. "type": "object",
  370. "properties": {
  371. "text": {
  372. "type": "string"
  373. }
  374. }
  375. }
  376. }
  377. }
  378. }
  379. }
  380. },
  381. "required": [
  382. "messages"
  383. ]
  384. },
  385. "parameters": {
  386. "type": "object",
  387. "properties": {
  388. "negative_prompt": {
  389. "type": "string"
  390. },
  391. "prompt_extend": {
  392. "type": "boolean"
  393. },
  394. "watermark": {
  395. "type": "boolean"
  396. },
  397. "size": {
  398. "type": "string"
  399. }
  400. }
  401. }
  402. },
  403. "required": [
  404. "model",
  405. "input"
  406. ]
  407. },
  408. "example": {
  409. "model": "qwen-image-plus",
  410. "input": {
  411. "messages": [
  412. {
  413. "role": "user",
  414. "content": [
  415. {
  416. "text": "一副典雅庄重的对联悬挂于厅堂之中,房间是个安静古典的中式布置,桌子上放着一些青花瓷,对联上左书“义本生知人机同道善思新”,右书“通云赋智乾坤启数高志远”, 横批“智启通义”,字体飘逸,在中间挂着一幅中国风的画作,内容是岳阳楼。"
  417. }
  418. ]
  419. }
  420. ]
  421. },
  422. "parameters": {
  423. "negative_prompt": "",
  424. "prompt_extend": true,
  425. "watermark": false,
  426. "size": "1328*1328"
  427. }
  428. }
  429. }
  430. }
  431. },
  432. "responses": {
  433. "200": {
  434. "description": "成功生成图像",
  435. "content": {
  436. "application/json": {
  437. "schema": {
  438. "$ref": "#/components/schemas/ImageResponse"
  439. }
  440. }
  441. },
  442. "headers": {}
  443. }
  444. },
  445. "security": [
  446. {
  447. "BearerAuth": []
  448. }
  449. ]
  450. }
  451. },
  452. "/v1/images/edits": {
  453. "post": {
  454. "summary": "编辑图像(qwen-image-edit)",
  455. "deprecated": false,
  456. "description": " 百炼qwen-image系列图片生成",
  457. "operationId": "createImage",
  458. "tags": [
  459. "图片生成/编辑(Images)/Qwen千问",
  460. "Images"
  461. ],
  462. "parameters": [],
  463. "requestBody": {
  464. "content": {
  465. "application/json": {
  466. "schema": {
  467. "type": "object",
  468. "properties": {
  469. "model": {
  470. "type": "string"
  471. },
  472. "input": {
  473. "type": "object",
  474. "properties": {
  475. "messages": {
  476. "type": "array",
  477. "items": {
  478. "type": "object",
  479. "properties": {
  480. "role": {
  481. "type": "string"
  482. },
  483. "content": {
  484. "type": "array",
  485. "items": {
  486. "type": "object",
  487. "properties": {
  488. "image": {
  489. "type": "string"
  490. },
  491. "text": {
  492. "type": "string"
  493. }
  494. }
  495. }
  496. }
  497. }
  498. }
  499. }
  500. },
  501. "required": [
  502. "messages"
  503. ]
  504. },
  505. "parameters": {
  506. "type": "object",
  507. "properties": {
  508. "n": {
  509. "type": "integer"
  510. },
  511. "negative_prompt": {
  512. "type": "string"
  513. },
  514. "prompt_extend": {
  515. "type": "boolean"
  516. },
  517. "watermark": {
  518. "type": "boolean"
  519. },
  520. "size": {
  521. "type": "string"
  522. }
  523. }
  524. }
  525. },
  526. "required": [
  527. "model",
  528. "input"
  529. ]
  530. },
  531. "example": "{\n \"model\": \"qwen-image-edit-plus\",\n \"input\": {\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"image\": \"https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/fpakfo/image36.webp\"\n },\n {\n \"text\": \"生成一张符合深度图的图像,遵循以下描述:一辆红色的破旧的自行车停在一条泥泞的小路上,背景是茂密的原始森林\"\n }\n ]\n }\n ]\n },\n \"parameters\": {\n \"n\": 2,\n \"negative_prompt\": \" \",\n \"prompt_extend\": true,\n \"watermark\": false\n }"
  532. }
  533. }
  534. },
  535. "responses": {
  536. "200": {
  537. "description": "成功生成图像",
  538. "content": {
  539. "application/json": {
  540. "schema": {
  541. "$ref": "#/components/schemas/ImageResponse"
  542. }
  543. }
  544. },
  545. "headers": {}
  546. }
  547. },
  548. "security": [
  549. {
  550. "BearerAuth": []
  551. }
  552. ]
  553. }
  554. },
  555. "/v1/videos": {
  556. "post": {
  557. "summary": "创建视频 ",
  558. "deprecated": false,
  559. "description": "OpenAI 兼容的视频生成接口。\n\n参考文档: https://platform.openai.com/docs/api-reference/videos/create\n",
  560. "operationId": "createVideo",
  561. "tags": [
  562. "视频生成/Sora兼容格式",
  563. "视频生成"
  564. ],
  565. "parameters": [],
  566. "requestBody": {
  567. "content": {
  568. "multipart/form-data": {
  569. "schema": {
  570. "type": "object",
  571. "properties": {
  572. "model": {
  573. "description": "模型名称",
  574. "example": "sora-2",
  575. "type": "string"
  576. },
  577. "prompt": {
  578. "description": "提示词",
  579. "example": "cute cat dance",
  580. "type": "string"
  581. },
  582. "seconds": {
  583. "description": "生成秒数",
  584. "example": "8",
  585. "type": "string"
  586. },
  587. "input_reference": {
  588. "format": "binary",
  589. "type": "string",
  590. "description": "参考图片文件",
  591. "example": ""
  592. }
  593. }
  594. },
  595. "examples": {}
  596. }
  597. }
  598. },
  599. "responses": {
  600. "200": {
  601. "description": "成功创建视频任务",
  602. "content": {
  603. "application/json": {
  604. "schema": {
  605. "type": "object",
  606. "properties": {
  607. "id": {
  608. "type": "string",
  609. "description": "视频 ID"
  610. },
  611. "object": {
  612. "type": "string",
  613. "description": "对象类型"
  614. },
  615. "model": {
  616. "type": "string",
  617. "description": "使用的模型"
  618. },
  619. "status": {
  620. "type": "string",
  621. "description": "任务状态"
  622. },
  623. "progress": {
  624. "type": "integer",
  625. "description": "进度百分比"
  626. },
  627. "created_at": {
  628. "type": "integer",
  629. "description": "创建时间戳"
  630. },
  631. "seconds": {
  632. "type": "string",
  633. "description": "视频时长"
  634. },
  635. "completed_at": {
  636. "type": "integer",
  637. "description": "完成时间戳"
  638. },
  639. "expires_at": {
  640. "type": "integer",
  641. "description": "过期时间戳"
  642. },
  643. "size": {
  644. "type": "string",
  645. "description": "视频尺寸"
  646. },
  647. "error": {
  648. "$ref": "#/components/schemas/OpenAIVideoError"
  649. },
  650. "metadata": {
  651. "type": "object",
  652. "description": "额外元数据",
  653. "additionalProperties": true,
  654. "properties": {}
  655. }
  656. },
  657. "required": [
  658. "id",
  659. "object",
  660. "model",
  661. "status",
  662. "progress",
  663. "created_at",
  664. "seconds"
  665. ]
  666. },
  667. "example": {
  668. "id": "sora-2-123456",
  669. "object": "video",
  670. "model": "sora-2",
  671. "status": "queued",
  672. "progress": 0,
  673. "created_at": 1764347090922,
  674. "seconds": "8"
  675. }
  676. }
  677. },
  678. "headers": {}
  679. },
  680. "400": {
  681. "description": "请求参数错误",
  682. "content": {
  683. "application/json": {
  684. "schema": {
  685. "$ref": "#/components/schemas/ErrorResponse"
  686. }
  687. }
  688. },
  689. "headers": {}
  690. }
  691. },
  692. "security": [
  693. {
  694. "BearerAuth": []
  695. }
  696. ]
  697. }
  698. },
  699. "/v1/videos/{task_id}": {
  700. "get": {
  701. "summary": "获取视频任务状态 ",
  702. "deprecated": false,
  703. "description": "OpenAI 兼容的视频任务状态查询接口。\n\n返回视频任务的详细状态信息。\n",
  704. "operationId": "getVideo",
  705. "tags": [
  706. "视频生成/Sora兼容格式",
  707. "视频生成"
  708. ],
  709. "parameters": [
  710. {
  711. "name": "task_id",
  712. "in": "path",
  713. "description": "视频任务 ID",
  714. "required": true,
  715. "example": "sora-2-123456",
  716. "schema": {
  717. "type": "string"
  718. }
  719. }
  720. ],
  721. "responses": {
  722. "200": {
  723. "description": "成功获取视频任务状态",
  724. "content": {
  725. "application/json": {
  726. "schema": {
  727. "type": "object",
  728. "properties": {
  729. "id": {
  730. "type": "string"
  731. },
  732. "object": {
  733. "type": "string"
  734. },
  735. "model": {
  736. "type": "string"
  737. },
  738. "status": {
  739. "type": "string"
  740. },
  741. "progress": {
  742. "type": "integer"
  743. },
  744. "created_at": {
  745. "type": "integer"
  746. },
  747. "seconds": {
  748. "type": "string"
  749. }
  750. },
  751. "required": [
  752. "id",
  753. "object",
  754. "model",
  755. "status",
  756. "progress",
  757. "created_at",
  758. "seconds"
  759. ]
  760. },
  761. "example": {
  762. "id": "sora-2-123456",
  763. "object": "video",
  764. "model": "sora-2",
  765. "status": "queued",
  766. "progress": 0,
  767. "created_at": 1764347090922,
  768. "seconds": "8"
  769. }
  770. }
  771. },
  772. "headers": {}
  773. },
  774. "404": {
  775. "description": "任务不存在",
  776. "content": {
  777. "application/json": {
  778. "schema": {
  779. "$ref": "#/components/schemas/ErrorResponse"
  780. }
  781. }
  782. },
  783. "headers": {}
  784. }
  785. },
  786. "security": [
  787. {
  788. "BearerAuth": []
  789. }
  790. ]
  791. }
  792. },
  793. "/v1/videos/{task_id}/content": {
  794. "get": {
  795. "summary": "获取视频内容",
  796. "deprecated": false,
  797. "description": "获取已完成视频任务的视频文件内容。\n\n此接口会代理返回视频文件流。\n",
  798. "operationId": "getVideoContent",
  799. "tags": [
  800. "视频生成/Sora兼容格式",
  801. "视频生成"
  802. ],
  803. "parameters": [
  804. {
  805. "name": "task_id",
  806. "in": "path",
  807. "description": "视频任务 ID",
  808. "required": true,
  809. "example": "video-abc123",
  810. "schema": {
  811. "type": "string"
  812. }
  813. }
  814. ],
  815. "responses": {
  816. "200": {
  817. "description": "成功获取视频内容",
  818. "content": {
  819. "video/mp4": {
  820. "schema": {
  821. "type": "string",
  822. "format": "binary"
  823. }
  824. }
  825. },
  826. "headers": {}
  827. },
  828. "404": {
  829. "description": "视频不存在或未完成",
  830. "content": {
  831. "application/json": {
  832. "schema": {
  833. "$ref": "#/components/schemas/ErrorResponse"
  834. }
  835. }
  836. },
  837. "headers": {}
  838. }
  839. },
  840. "security": [
  841. {
  842. "BearerAuth": []
  843. }
  844. ]
  845. }
  846. },
  847. "/kling/v1/videos/text2video": {
  848. "post": {
  849. "summary": "Kling 文生视频",
  850. "deprecated": false,
  851. "description": "使用 Kling 模型从文本描述生成视频。\n\n支持的模型:kling-v1, kling-v1-5 等\n",
  852. "operationId": "createKlingText2Video",
  853. "tags": [
  854. "视频生成/Kling格式",
  855. "视频生成-Kling"
  856. ],
  857. "parameters": [],
  858. "requestBody": {
  859. "content": {
  860. "application/json": {
  861. "schema": {
  862. "$ref": "#/components/schemas/VideoRequest"
  863. },
  864. "example": {
  865. "model": "kling-v1",
  866. "prompt": "宇航员站起身走了",
  867. "duration": 5,
  868. "width": 1280,
  869. "height": 720,
  870. "fps": 30
  871. }
  872. }
  873. },
  874. "required": true
  875. },
  876. "responses": {
  877. "200": {
  878. "description": "成功创建视频生成任务",
  879. "content": {
  880. "application/json": {
  881. "schema": {
  882. "$ref": "#/components/schemas/VideoResponse"
  883. }
  884. }
  885. },
  886. "headers": {}
  887. },
  888. "400": {
  889. "description": "请求参数错误",
  890. "content": {
  891. "application/json": {
  892. "schema": {
  893. "$ref": "#/components/schemas/ErrorResponse"
  894. }
  895. }
  896. },
  897. "headers": {}
  898. }
  899. },
  900. "security": [
  901. {
  902. "BearerAuth": []
  903. }
  904. ]
  905. }
  906. },
  907. "/kling/v1/videos/text2video/{task_id}": {
  908. "get": {
  909. "summary": "获取 Kling 文生视频任务状态",
  910. "deprecated": false,
  911. "description": "查询 Kling 文生视频任务的状态和结果。",
  912. "operationId": "getKlingText2Video",
  913. "tags": [
  914. "视频生成/Kling格式",
  915. "视频生成-Kling"
  916. ],
  917. "parameters": [
  918. {
  919. "name": "task_id",
  920. "in": "path",
  921. "description": "任务 ID",
  922. "required": true,
  923. "example": "task-abc123",
  924. "schema": {
  925. "type": "string"
  926. }
  927. }
  928. ],
  929. "responses": {
  930. "200": {
  931. "description": "成功获取任务状态",
  932. "content": {
  933. "application/json": {
  934. "schema": {
  935. "$ref": "#/components/schemas/VideoTaskResponse"
  936. }
  937. }
  938. },
  939. "headers": {}
  940. },
  941. "404": {
  942. "description": "任务不存在",
  943. "content": {
  944. "application/json": {
  945. "schema": {
  946. "$ref": "#/components/schemas/ErrorResponse"
  947. }
  948. }
  949. },
  950. "headers": {}
  951. }
  952. },
  953. "security": [
  954. {
  955. "BearerAuth": []
  956. }
  957. ]
  958. }
  959. },
  960. "/kling/v1/videos/image2video": {
  961. "post": {
  962. "summary": "Kling 图生视频",
  963. "deprecated": false,
  964. "description": "使用 Kling 模型从图片生成视频。\n\n支持通过 image 参数传入图片 URL 或 Base64 编码的图片数据。\n",
  965. "operationId": "createKlingImage2Video",
  966. "tags": [
  967. "视频生成/Kling格式",
  968. "视频生成-Kling"
  969. ],
  970. "parameters": [],
  971. "requestBody": {
  972. "content": {
  973. "application/json": {
  974. "schema": {
  975. "$ref": "#/components/schemas/VideoRequest"
  976. },
  977. "example": {
  978. "model": "kling-v1",
  979. "prompt": "人物转身走开",
  980. "image": "https://example.com/image.jpg",
  981. "duration": 5,
  982. "width": 1280,
  983. "height": 720
  984. }
  985. }
  986. },
  987. "required": true
  988. },
  989. "responses": {
  990. "200": {
  991. "description": "成功创建视频生成任务",
  992. "content": {
  993. "application/json": {
  994. "schema": {
  995. "$ref": "#/components/schemas/VideoResponse"
  996. }
  997. }
  998. },
  999. "headers": {}
  1000. },
  1001. "400": {
  1002. "description": "请求参数错误",
  1003. "content": {
  1004. "application/json": {
  1005. "schema": {
  1006. "$ref": "#/components/schemas/ErrorResponse"
  1007. }
  1008. }
  1009. },
  1010. "headers": {}
  1011. }
  1012. },
  1013. "security": [
  1014. {
  1015. "BearerAuth": []
  1016. }
  1017. ]
  1018. }
  1019. },
  1020. "/kling/v1/videos/image2video/{task_id}": {
  1021. "get": {
  1022. "summary": "获取 Kling 图生视频任务状态",
  1023. "deprecated": false,
  1024. "description": "查询 Kling 图生视频任务的状态和结果。",
  1025. "operationId": "getKlingImage2Video",
  1026. "tags": [
  1027. "视频生成/Kling格式",
  1028. "视频生成-Kling"
  1029. ],
  1030. "parameters": [
  1031. {
  1032. "name": "task_id",
  1033. "in": "path",
  1034. "description": "任务 ID",
  1035. "required": true,
  1036. "example": "task-abc123",
  1037. "schema": {
  1038. "type": "string"
  1039. }
  1040. }
  1041. ],
  1042. "responses": {
  1043. "200": {
  1044. "description": "成功获取任务状态",
  1045. "content": {
  1046. "application/json": {
  1047. "schema": {
  1048. "$ref": "#/components/schemas/VideoTaskResponse"
  1049. }
  1050. }
  1051. },
  1052. "headers": {}
  1053. },
  1054. "404": {
  1055. "description": "任务不存在",
  1056. "content": {
  1057. "application/json": {
  1058. "schema": {
  1059. "$ref": "#/components/schemas/ErrorResponse"
  1060. }
  1061. }
  1062. },
  1063. "headers": {}
  1064. }
  1065. },
  1066. "security": [
  1067. {
  1068. "BearerAuth": []
  1069. }
  1070. ]
  1071. }
  1072. },
  1073. "/jimeng/": {
  1074. "post": {
  1075. "summary": "即梦视频生成",
  1076. "deprecated": false,
  1077. "description": "即梦官方 API 格式的视频生成接口。\n\n支持通过 Action 参数指定操作类型:\n- `CVSync2AsyncSubmitTask`: 提交视频生成任务\n- `CVSync2AsyncGetResult`: 获取任务结果\n\n需要在查询参数中指定 Action 和 Version。\n",
  1078. "operationId": "createJimengVideo",
  1079. "tags": [
  1080. "视频生成/即梦格式",
  1081. "视频生成-即梦"
  1082. ],
  1083. "parameters": [
  1084. {
  1085. "name": "Action",
  1086. "in": "query",
  1087. "description": "API 操作类型",
  1088. "required": true,
  1089. "schema": {
  1090. "type": "string",
  1091. "enum": [
  1092. "CVSync2AsyncSubmitTask",
  1093. "CVSync2AsyncGetResult"
  1094. ]
  1095. }
  1096. },
  1097. {
  1098. "name": "Version",
  1099. "in": "query",
  1100. "description": "API 版本",
  1101. "required": true,
  1102. "example": "2022-08-31",
  1103. "schema": {
  1104. "type": "string"
  1105. }
  1106. }
  1107. ],
  1108. "requestBody": {
  1109. "content": {
  1110. "application/json": {
  1111. "schema": {
  1112. "type": "object",
  1113. "description": "即梦官方 API 请求格式",
  1114. "properties": {
  1115. "req_key": {
  1116. "type": "string",
  1117. "description": "请求类型标识"
  1118. },
  1119. "prompt": {
  1120. "type": "string",
  1121. "description": "文本描述"
  1122. },
  1123. "binary_data_base64": {
  1124. "type": "array",
  1125. "items": {
  1126. "type": "string"
  1127. },
  1128. "description": "Base64 编码的图片数据"
  1129. }
  1130. }
  1131. },
  1132. "example": {
  1133. "req_key": "jimeng_video_generation",
  1134. "prompt": "一只猫在弹钢琴"
  1135. }
  1136. }
  1137. }
  1138. },
  1139. "responses": {
  1140. "200": {
  1141. "description": "成功处理请求",
  1142. "content": {
  1143. "application/json": {
  1144. "schema": {
  1145. "type": "object",
  1146. "properties": {
  1147. "code": {
  1148. "type": "integer",
  1149. "description": "响应码"
  1150. },
  1151. "message": {
  1152. "type": "string",
  1153. "description": "响应消息"
  1154. },
  1155. "data": {
  1156. "type": "object",
  1157. "description": "响应数据",
  1158. "properties": {}
  1159. }
  1160. }
  1161. }
  1162. }
  1163. },
  1164. "headers": {}
  1165. },
  1166. "400": {
  1167. "description": "请求参数错误",
  1168. "content": {
  1169. "application/json": {
  1170. "schema": {
  1171. "$ref": "#/components/schemas/ErrorResponse"
  1172. }
  1173. }
  1174. },
  1175. "headers": {}
  1176. }
  1177. },
  1178. "security": [
  1179. {
  1180. "BearerAuth": []
  1181. }
  1182. ]
  1183. }
  1184. },
  1185. "/v1/video/generations": {
  1186. "post": {
  1187. "summary": "创建视频生成任务",
  1188. "deprecated": false,
  1189. "description": "提交视频生成任务,支持文生视频和图生视频。\n\n返回任务 ID,可通过 GET 接口查询任务状态。\n",
  1190. "operationId": "createVideoGeneration",
  1191. "tags": [
  1192. "视频生成"
  1193. ],
  1194. "parameters": [],
  1195. "requestBody": {
  1196. "content": {
  1197. "application/json": {
  1198. "schema": {
  1199. "$ref": "#/components/schemas/VideoRequest"
  1200. },
  1201. "example": {
  1202. "model": "kling-v1",
  1203. "prompt": "宇航员在月球上漫步",
  1204. "duration": 5,
  1205. "width": 1280,
  1206. "height": 720
  1207. }
  1208. }
  1209. },
  1210. "required": true
  1211. },
  1212. "responses": {
  1213. "200": {
  1214. "description": "成功创建视频生成任务",
  1215. "content": {
  1216. "application/json": {
  1217. "schema": {
  1218. "$ref": "#/components/schemas/VideoResponse"
  1219. }
  1220. }
  1221. },
  1222. "headers": {}
  1223. },
  1224. "400": {
  1225. "description": "请求参数错误",
  1226. "content": {
  1227. "application/json": {
  1228. "schema": {
  1229. "$ref": "#/components/schemas/ErrorResponse"
  1230. }
  1231. }
  1232. },
  1233. "headers": {}
  1234. }
  1235. },
  1236. "security": [
  1237. {
  1238. "BearerAuth": []
  1239. }
  1240. ]
  1241. }
  1242. },
  1243. "/v1/video/generations/{task_id}": {
  1244. "get": {
  1245. "summary": "获取视频生成任务状态",
  1246. "deprecated": false,
  1247. "description": "查询视频生成任务的状态和结果。\n\n任务状态:\n- `queued`: 排队中\n- `in_progress`: 生成中\n- `completed`: 已完成\n- `failed`: 失败\n",
  1248. "operationId": "getVideoGeneration",
  1249. "tags": [
  1250. "视频生成"
  1251. ],
  1252. "parameters": [
  1253. {
  1254. "name": "task_id",
  1255. "in": "path",
  1256. "description": "任务 ID",
  1257. "required": true,
  1258. "example": "abcd1234efgh",
  1259. "schema": {
  1260. "type": "string"
  1261. }
  1262. }
  1263. ],
  1264. "responses": {
  1265. "200": {
  1266. "description": "成功获取任务状态",
  1267. "content": {
  1268. "application/json": {
  1269. "schema": {
  1270. "$ref": "#/components/schemas/VideoTaskResponse"
  1271. }
  1272. }
  1273. },
  1274. "headers": {}
  1275. },
  1276. "404": {
  1277. "description": "任务不存在",
  1278. "content": {
  1279. "application/json": {
  1280. "schema": {
  1281. "$ref": "#/components/schemas/ErrorResponse"
  1282. }
  1283. }
  1284. },
  1285. "headers": {}
  1286. }
  1287. },
  1288. "security": [
  1289. {
  1290. "BearerAuth": []
  1291. }
  1292. ]
  1293. }
  1294. },
  1295. "/v1/messages": {
  1296. "post": {
  1297. "summary": "Claude 聊天",
  1298. "deprecated": false,
  1299. "description": "Anthropic Claude Messages API 格式的请求。\n需要在请求头中包含 `anthropic-version`。\n",
  1300. "operationId": "createMessage",
  1301. "tags": [
  1302. "Claude格式(Messages)",
  1303. "Messages"
  1304. ],
  1305. "parameters": [
  1306. {
  1307. "name": "anthropic-version",
  1308. "in": "header",
  1309. "description": "Anthropic API 版本",
  1310. "required": true,
  1311. "example": "",
  1312. "schema": {
  1313. "type": "string",
  1314. "example": "2023-06-01"
  1315. }
  1316. },
  1317. {
  1318. "name": "x-api-key",
  1319. "in": "header",
  1320. "description": "Anthropic API Key (可选,也可使用 Bearer Token)",
  1321. "required": false,
  1322. "example": "",
  1323. "schema": {
  1324. "type": "string"
  1325. }
  1326. }
  1327. ],
  1328. "requestBody": {
  1329. "content": {
  1330. "application/json": {
  1331. "schema": {
  1332. "$ref": "#/components/schemas/ClaudeRequest"
  1333. },
  1334. "examples": {}
  1335. }
  1336. }
  1337. },
  1338. "responses": {
  1339. "200": {
  1340. "description": "成功创建响应",
  1341. "content": {
  1342. "application/json": {
  1343. "schema": {
  1344. "$ref": "#/components/schemas/ClaudeResponse"
  1345. }
  1346. }
  1347. },
  1348. "headers": {}
  1349. }
  1350. },
  1351. "security": [
  1352. {
  1353. "BearerAuth": []
  1354. }
  1355. ]
  1356. }
  1357. },
  1358. "/v1beta/models/{model}:generateContent": {
  1359. "post": {
  1360. "summary": "Gemini 图片(Nano Banana)",
  1361. "deprecated": false,
  1362. "description": "Gemini 图片生成",
  1363. "operationId": "geminiRelayV1Beta",
  1364. "tags": [
  1365. "Gemini格式",
  1366. "Gemini"
  1367. ],
  1368. "parameters": [
  1369. {
  1370. "name": "model",
  1371. "in": "path",
  1372. "description": "模型名称",
  1373. "required": true,
  1374. "example": "gemini-3-pro-image-preview",
  1375. "schema": {
  1376. "type": "string"
  1377. }
  1378. }
  1379. ],
  1380. "requestBody": {
  1381. "content": {
  1382. "application/json": {
  1383. "schema": {
  1384. "type": "object",
  1385. "properties": {
  1386. "contents": {
  1387. "type": "array",
  1388. "items": {
  1389. "type": "object",
  1390. "properties": {
  1391. "role": {
  1392. "type": "string"
  1393. },
  1394. "parts": {
  1395. "type": "array",
  1396. "items": {
  1397. "type": "object",
  1398. "properties": {
  1399. "text": {
  1400. "type": "string"
  1401. }
  1402. }
  1403. }
  1404. }
  1405. }
  1406. }
  1407. },
  1408. "generationConfig": {
  1409. "type": "object",
  1410. "properties": {
  1411. "responseModalities": {
  1412. "type": "array",
  1413. "items": {
  1414. "type": "string"
  1415. }
  1416. },
  1417. "imageConfig": {
  1418. "type": "object",
  1419. "properties": {
  1420. "aspectRatio": {
  1421. "type": "string"
  1422. },
  1423. "imageSize": {
  1424. "type": "string"
  1425. }
  1426. }
  1427. }
  1428. },
  1429. "required": [
  1430. "responseModalities"
  1431. ]
  1432. }
  1433. },
  1434. "required": [
  1435. "contents",
  1436. "generationConfig"
  1437. ]
  1438. },
  1439. "example": {
  1440. "contents": [
  1441. {
  1442. "role": "user",
  1443. "parts": [
  1444. {
  1445. "text": "draw a cat"
  1446. }
  1447. ]
  1448. }
  1449. ],
  1450. "generationConfig": {
  1451. "responseModalities": [
  1452. "TEXT",
  1453. "IMAGE"
  1454. ],
  1455. "imageConfig": {
  1456. "aspectRatio": "16:9",
  1457. "imageSize": "4K"
  1458. }
  1459. }
  1460. }
  1461. }
  1462. }
  1463. },
  1464. "responses": {
  1465. "200": {
  1466. "description": "成功",
  1467. "content": {
  1468. "application/json": {
  1469. "schema": {
  1470. "$ref": "#/components/schemas/GeminiResponse"
  1471. }
  1472. }
  1473. },
  1474. "headers": {}
  1475. }
  1476. },
  1477. "security": [
  1478. {
  1479. "BearerAuth": []
  1480. }
  1481. ]
  1482. }
  1483. },
  1484. "/v1/engines/{model}/embeddings": {
  1485. "post": {
  1486. "summary": "Gemini 嵌入(Embeddings)",
  1487. "deprecated": false,
  1488. "description": "使用指定引擎/模型创建嵌入",
  1489. "operationId": "createEngineEmbedding",
  1490. "tags": [
  1491. "Gemini格式",
  1492. "Embeddings",
  1493. "Gemini"
  1494. ],
  1495. "parameters": [
  1496. {
  1497. "name": "model",
  1498. "in": "path",
  1499. "description": "模型/引擎 ID",
  1500. "required": true,
  1501. "example": "",
  1502. "schema": {
  1503. "type": "string"
  1504. }
  1505. }
  1506. ],
  1507. "requestBody": {
  1508. "content": {
  1509. "application/json": {
  1510. "schema": {
  1511. "$ref": "#/components/schemas/EmbeddingRequest"
  1512. },
  1513. "examples": {}
  1514. }
  1515. }
  1516. },
  1517. "responses": {
  1518. "200": {
  1519. "description": "成功创建嵌入",
  1520. "content": {
  1521. "application/json": {
  1522. "schema": {
  1523. "$ref": "#/components/schemas/EmbeddingResponse"
  1524. }
  1525. }
  1526. },
  1527. "headers": {}
  1528. }
  1529. },
  1530. "security": [
  1531. {
  1532. "BearerAuth": []
  1533. }
  1534. ]
  1535. }
  1536. },
  1537. "/v1/embeddings": {
  1538. "post": {
  1539. "summary": "创建文本嵌入",
  1540. "deprecated": false,
  1541. "description": "将文本转换为向量嵌入",
  1542. "operationId": "createEmbedding",
  1543. "tags": [
  1544. "OpenAI格式Embeddings",
  1545. "Embeddings"
  1546. ],
  1547. "parameters": [],
  1548. "requestBody": {
  1549. "content": {
  1550. "application/json": {
  1551. "schema": {
  1552. "$ref": "#/components/schemas/EmbeddingRequest"
  1553. }
  1554. }
  1555. },
  1556. "required": true
  1557. },
  1558. "responses": {
  1559. "200": {
  1560. "description": "成功创建嵌入",
  1561. "content": {
  1562. "application/json": {
  1563. "schema": {
  1564. "$ref": "#/components/schemas/EmbeddingResponse"
  1565. }
  1566. }
  1567. },
  1568. "headers": {}
  1569. }
  1570. },
  1571. "security": [
  1572. {
  1573. "BearerAuth": []
  1574. }
  1575. ]
  1576. }
  1577. },
  1578. "/v1/completions": {
  1579. "post": {
  1580. "summary": "创建文本补全",
  1581. "deprecated": false,
  1582. "description": "基于给定提示创建文本补全",
  1583. "operationId": "createCompletion",
  1584. "tags": [
  1585. "文本补全(Completions)",
  1586. "Completions"
  1587. ],
  1588. "parameters": [],
  1589. "requestBody": {
  1590. "content": {
  1591. "application/json": {
  1592. "schema": {
  1593. "$ref": "#/components/schemas/CompletionRequest"
  1594. }
  1595. }
  1596. },
  1597. "required": true
  1598. },
  1599. "responses": {
  1600. "200": {
  1601. "description": "成功创建响应",
  1602. "content": {
  1603. "application/json": {
  1604. "schema": {
  1605. "$ref": "#/components/schemas/CompletionResponse"
  1606. }
  1607. }
  1608. },
  1609. "headers": {}
  1610. }
  1611. },
  1612. "security": [
  1613. {
  1614. "BearerAuth": []
  1615. }
  1616. ]
  1617. }
  1618. },
  1619. "/v1/audio/transcriptions": {
  1620. "post": {
  1621. "summary": "音频转录",
  1622. "deprecated": false,
  1623. "description": "将音频转换为文本",
  1624. "operationId": "createTranscription",
  1625. "tags": [
  1626. "OpenAI音频(Audio)",
  1627. "Audio"
  1628. ],
  1629. "parameters": [],
  1630. "requestBody": {
  1631. "content": {
  1632. "multipart/form-data": {
  1633. "schema": {
  1634. "type": "object",
  1635. "properties": {
  1636. "file": {
  1637. "type": "string",
  1638. "format": "binary",
  1639. "description": "音频文件",
  1640. "example": ""
  1641. },
  1642. "model": {
  1643. "type": "string",
  1644. "example": "whisper-1"
  1645. },
  1646. "language": {
  1647. "type": "string",
  1648. "description": "ISO-639-1 语言代码",
  1649. "example": ""
  1650. },
  1651. "prompt": {
  1652. "type": "string",
  1653. "example": ""
  1654. },
  1655. "response_format": {
  1656. "type": "string",
  1657. "enum": [
  1658. "json",
  1659. "text",
  1660. "srt",
  1661. "verbose_json",
  1662. "vtt"
  1663. ],
  1664. "default": "json",
  1665. "example": "json"
  1666. },
  1667. "temperature": {
  1668. "type": "number",
  1669. "example": 0
  1670. },
  1671. "timestamp_granularities": {
  1672. "type": "array",
  1673. "items": {
  1674. "type": "string",
  1675. "enum": [
  1676. "word",
  1677. "segment"
  1678. ]
  1679. },
  1680. "example": ""
  1681. }
  1682. },
  1683. "required": [
  1684. "file",
  1685. "model"
  1686. ]
  1687. }
  1688. }
  1689. },
  1690. "required": true
  1691. },
  1692. "responses": {
  1693. "200": {
  1694. "description": "成功转录",
  1695. "content": {
  1696. "application/json": {
  1697. "schema": {
  1698. "$ref": "#/components/schemas/AudioTranscriptionResponse"
  1699. }
  1700. }
  1701. },
  1702. "headers": {}
  1703. }
  1704. },
  1705. "security": [
  1706. {
  1707. "BearerAuth": []
  1708. }
  1709. ]
  1710. }
  1711. },
  1712. "/v1/audio/translations": {
  1713. "post": {
  1714. "summary": "音频翻译",
  1715. "deprecated": false,
  1716. "description": "将音频翻译为英文文本",
  1717. "operationId": "createTranslation",
  1718. "tags": [
  1719. "OpenAI音频(Audio)",
  1720. "Audio"
  1721. ],
  1722. "parameters": [],
  1723. "requestBody": {
  1724. "content": {
  1725. "multipart/form-data": {
  1726. "schema": {
  1727. "type": "object",
  1728. "properties": {
  1729. "file": {
  1730. "type": "string",
  1731. "format": "binary",
  1732. "example": ""
  1733. },
  1734. "model": {
  1735. "type": "string",
  1736. "example": ""
  1737. },
  1738. "prompt": {
  1739. "type": "string",
  1740. "example": ""
  1741. },
  1742. "response_format": {
  1743. "type": "string",
  1744. "example": ""
  1745. },
  1746. "temperature": {
  1747. "type": "number",
  1748. "example": 0
  1749. }
  1750. },
  1751. "required": [
  1752. "file",
  1753. "model"
  1754. ]
  1755. }
  1756. }
  1757. },
  1758. "required": true
  1759. },
  1760. "responses": {
  1761. "200": {
  1762. "description": "成功翻译",
  1763. "content": {
  1764. "application/json": {
  1765. "schema": {
  1766. "$ref": "#/components/schemas/AudioTranscriptionResponse"
  1767. }
  1768. }
  1769. },
  1770. "headers": {}
  1771. }
  1772. },
  1773. "security": [
  1774. {
  1775. "BearerAuth": []
  1776. }
  1777. ]
  1778. }
  1779. },
  1780. "/v1/audio/speech": {
  1781. "post": {
  1782. "summary": "文本转语音",
  1783. "deprecated": false,
  1784. "description": "将文本转换为音频",
  1785. "operationId": "createSpeech",
  1786. "tags": [
  1787. "OpenAI音频(Audio)",
  1788. "Audio"
  1789. ],
  1790. "parameters": [],
  1791. "requestBody": {
  1792. "content": {
  1793. "application/json": {
  1794. "schema": {
  1795. "$ref": "#/components/schemas/SpeechRequest"
  1796. }
  1797. }
  1798. },
  1799. "required": true
  1800. },
  1801. "responses": {
  1802. "200": {
  1803. "description": "成功生成音频",
  1804. "content": {
  1805. "audio/mpeg": {
  1806. "schema": {
  1807. "type": "string",
  1808. "format": "binary"
  1809. }
  1810. }
  1811. },
  1812. "headers": {}
  1813. }
  1814. },
  1815. "security": [
  1816. {
  1817. "BearerAuth": []
  1818. }
  1819. ]
  1820. }
  1821. },
  1822. "/v1/rerank": {
  1823. "post": {
  1824. "summary": "文档重排序",
  1825. "deprecated": false,
  1826. "description": "根据查询对文档列表进行相关性重排序",
  1827. "operationId": "createRerank",
  1828. "tags": [
  1829. "重排序(Rerank)",
  1830. "Rerank"
  1831. ],
  1832. "parameters": [],
  1833. "requestBody": {
  1834. "content": {
  1835. "application/json": {
  1836. "schema": {
  1837. "$ref": "#/components/schemas/RerankRequest"
  1838. }
  1839. }
  1840. },
  1841. "required": true
  1842. },
  1843. "responses": {
  1844. "200": {
  1845. "description": "成功重排序",
  1846. "content": {
  1847. "application/json": {
  1848. "schema": {
  1849. "$ref": "#/components/schemas/RerankResponse"
  1850. }
  1851. }
  1852. },
  1853. "headers": {}
  1854. }
  1855. },
  1856. "security": [
  1857. {
  1858. "BearerAuth": []
  1859. }
  1860. ]
  1861. }
  1862. },
  1863. "/v1/moderations": {
  1864. "post": {
  1865. "summary": "内容审核",
  1866. "deprecated": false,
  1867. "description": "检查文本内容是否违反使用政策",
  1868. "operationId": "createModeration",
  1869. "tags": [
  1870. "Moderations"
  1871. ],
  1872. "parameters": [],
  1873. "requestBody": {
  1874. "content": {
  1875. "application/json": {
  1876. "schema": {
  1877. "$ref": "#/components/schemas/ModerationRequest"
  1878. }
  1879. }
  1880. },
  1881. "required": true
  1882. },
  1883. "responses": {
  1884. "200": {
  1885. "description": "成功审核",
  1886. "content": {
  1887. "application/json": {
  1888. "schema": {
  1889. "$ref": "#/components/schemas/ModerationResponse"
  1890. }
  1891. }
  1892. },
  1893. "headers": {}
  1894. }
  1895. },
  1896. "security": [
  1897. {
  1898. "BearerAuth": []
  1899. }
  1900. ]
  1901. }
  1902. },
  1903. "/v1/realtime": {
  1904. "get": {
  1905. "summary": "实时 WebSocket 连接",
  1906. "deprecated": false,
  1907. "description": "建立 WebSocket 连接用于实时对话。\n\n**注意**: 这是一个 WebSocket 端点,需要使用 WebSocket 协议连接。\n\n连接 URL 示例: `wss://api.example.com/v1/realtime?model=gpt-4o-realtime`\n",
  1908. "operationId": "createRealtimeSession",
  1909. "tags": [
  1910. "Realtime"
  1911. ],
  1912. "parameters": [
  1913. {
  1914. "name": "model",
  1915. "in": "query",
  1916. "description": "要使用的模型",
  1917. "required": false,
  1918. "schema": {
  1919. "type": "string",
  1920. "example": "gpt-4o-realtime-preview"
  1921. }
  1922. }
  1923. ],
  1924. "responses": {
  1925. "101": {
  1926. "description": "WebSocket 协议切换",
  1927. "headers": {}
  1928. },
  1929. "400": {
  1930. "description": "请求错误",
  1931. "content": {
  1932. "application/json": {
  1933. "schema": {
  1934. "$ref": "#/components/schemas/ErrorResponse"
  1935. }
  1936. }
  1937. },
  1938. "headers": {}
  1939. }
  1940. },
  1941. "security": [
  1942. {
  1943. "BearerAuth": []
  1944. }
  1945. ]
  1946. }
  1947. },
  1948. "/v1/fine-tunes": {
  1949. "get": {
  1950. "summary": "列出微调任务 (未实现)",
  1951. "deprecated": false,
  1952. "description": "此接口尚未实现",
  1953. "operationId": "listFineTunes",
  1954. "tags": [
  1955. "未实现/Fine-tunes",
  1956. "Fine-tunes"
  1957. ],
  1958. "parameters": [],
  1959. "responses": {
  1960. "501": {
  1961. "description": "未实现",
  1962. "content": {
  1963. "application/json": {
  1964. "schema": {
  1965. "$ref": "#/components/schemas/ErrorResponse"
  1966. }
  1967. }
  1968. },
  1969. "headers": {}
  1970. }
  1971. },
  1972. "security": [
  1973. {
  1974. "BearerAuth": []
  1975. }
  1976. ]
  1977. },
  1978. "post": {
  1979. "summary": "创建微调任务 (未实现)",
  1980. "deprecated": false,
  1981. "description": "此接口尚未实现",
  1982. "operationId": "createFineTune",
  1983. "tags": [
  1984. "未实现/Fine-tunes",
  1985. "Fine-tunes"
  1986. ],
  1987. "parameters": [],
  1988. "requestBody": {
  1989. "content": {
  1990. "application/json": {
  1991. "schema": {
  1992. "type": "object",
  1993. "properties": {}
  1994. }
  1995. }
  1996. }
  1997. },
  1998. "responses": {
  1999. "501": {
  2000. "description": "未实现",
  2001. "content": {
  2002. "application/json": {
  2003. "schema": {
  2004. "$ref": "#/components/schemas/ErrorResponse"
  2005. }
  2006. }
  2007. },
  2008. "headers": {}
  2009. }
  2010. },
  2011. "security": [
  2012. {
  2013. "BearerAuth": []
  2014. }
  2015. ]
  2016. }
  2017. },
  2018. "/v1/fine-tunes/{fine_tune_id}": {
  2019. "get": {
  2020. "summary": "获取微调任务详情 (未实现)",
  2021. "deprecated": false,
  2022. "description": "此接口尚未实现",
  2023. "operationId": "retrieveFineTune",
  2024. "tags": [
  2025. "未实现/Fine-tunes",
  2026. "Fine-tunes"
  2027. ],
  2028. "parameters": [
  2029. {
  2030. "name": "fine_tune_id",
  2031. "in": "path",
  2032. "description": "",
  2033. "required": true,
  2034. "example": "",
  2035. "schema": {
  2036. "type": "string"
  2037. }
  2038. }
  2039. ],
  2040. "responses": {
  2041. "501": {
  2042. "description": "未实现",
  2043. "content": {
  2044. "application/json": {
  2045. "schema": {
  2046. "$ref": "#/components/schemas/ErrorResponse"
  2047. }
  2048. }
  2049. },
  2050. "headers": {}
  2051. }
  2052. },
  2053. "security": [
  2054. {
  2055. "BearerAuth": []
  2056. }
  2057. ]
  2058. }
  2059. },
  2060. "/v1/fine-tunes/{fine_tune_id}/cancel": {
  2061. "post": {
  2062. "summary": "取消微调任务 (未实现)",
  2063. "deprecated": false,
  2064. "description": "此接口尚未实现",
  2065. "operationId": "cancelFineTune",
  2066. "tags": [
  2067. "未实现/Fine-tunes",
  2068. "Fine-tunes"
  2069. ],
  2070. "parameters": [
  2071. {
  2072. "name": "fine_tune_id",
  2073. "in": "path",
  2074. "description": "",
  2075. "required": true,
  2076. "example": "",
  2077. "schema": {
  2078. "type": "string"
  2079. }
  2080. }
  2081. ],
  2082. "responses": {
  2083. "501": {
  2084. "description": "未实现",
  2085. "content": {
  2086. "application/json": {
  2087. "schema": {
  2088. "$ref": "#/components/schemas/ErrorResponse"
  2089. }
  2090. }
  2091. },
  2092. "headers": {}
  2093. }
  2094. },
  2095. "security": [
  2096. {
  2097. "BearerAuth": []
  2098. }
  2099. ]
  2100. }
  2101. },
  2102. "/v1/fine-tunes/{fine_tune_id}/events": {
  2103. "get": {
  2104. "summary": "获取微调任务事件 (未实现)",
  2105. "deprecated": false,
  2106. "description": "此接口尚未实现",
  2107. "operationId": "listFineTuneEvents",
  2108. "tags": [
  2109. "未实现/Fine-tunes",
  2110. "Fine-tunes"
  2111. ],
  2112. "parameters": [
  2113. {
  2114. "name": "fine_tune_id",
  2115. "in": "path",
  2116. "description": "",
  2117. "required": true,
  2118. "example": "",
  2119. "schema": {
  2120. "type": "string"
  2121. }
  2122. }
  2123. ],
  2124. "responses": {
  2125. "501": {
  2126. "description": "未实现",
  2127. "content": {
  2128. "application/json": {
  2129. "schema": {
  2130. "$ref": "#/components/schemas/ErrorResponse"
  2131. }
  2132. }
  2133. },
  2134. "headers": {}
  2135. }
  2136. },
  2137. "security": [
  2138. {
  2139. "BearerAuth": []
  2140. }
  2141. ]
  2142. }
  2143. },
  2144. "/v1/files": {
  2145. "get": {
  2146. "summary": "列出文件 (未实现)",
  2147. "deprecated": false,
  2148. "description": "此接口尚未实现",
  2149. "operationId": "listFiles",
  2150. "tags": [
  2151. "未实现/Files",
  2152. "Files"
  2153. ],
  2154. "parameters": [],
  2155. "responses": {
  2156. "501": {
  2157. "description": "未实现",
  2158. "content": {
  2159. "application/json": {
  2160. "schema": {
  2161. "$ref": "#/components/schemas/ErrorResponse"
  2162. }
  2163. }
  2164. },
  2165. "headers": {}
  2166. }
  2167. },
  2168. "security": [
  2169. {
  2170. "BearerAuth": []
  2171. }
  2172. ]
  2173. },
  2174. "post": {
  2175. "summary": "上传文件 (未实现)",
  2176. "deprecated": false,
  2177. "description": "此接口尚未实现",
  2178. "operationId": "createFile",
  2179. "tags": [
  2180. "未实现/Files",
  2181. "Files"
  2182. ],
  2183. "parameters": [],
  2184. "requestBody": {
  2185. "content": {
  2186. "multipart/form-data": {
  2187. "schema": {
  2188. "type": "object",
  2189. "properties": {
  2190. "file": {
  2191. "type": "string",
  2192. "format": "binary",
  2193. "example": ""
  2194. },
  2195. "purpose": {
  2196. "type": "string",
  2197. "example": ""
  2198. }
  2199. }
  2200. }
  2201. }
  2202. }
  2203. },
  2204. "responses": {
  2205. "501": {
  2206. "description": "未实现",
  2207. "content": {
  2208. "application/json": {
  2209. "schema": {
  2210. "$ref": "#/components/schemas/ErrorResponse"
  2211. }
  2212. }
  2213. },
  2214. "headers": {}
  2215. }
  2216. },
  2217. "security": [
  2218. {
  2219. "BearerAuth": []
  2220. }
  2221. ]
  2222. }
  2223. },
  2224. "/v1/files/{file_id}": {
  2225. "get": {
  2226. "summary": "获取文件信息 (未实现)",
  2227. "deprecated": false,
  2228. "description": "此接口尚未实现",
  2229. "operationId": "retrieveFile",
  2230. "tags": [
  2231. "未实现/Files",
  2232. "Files"
  2233. ],
  2234. "parameters": [
  2235. {
  2236. "name": "file_id",
  2237. "in": "path",
  2238. "description": "",
  2239. "required": true,
  2240. "example": "",
  2241. "schema": {
  2242. "type": "string"
  2243. }
  2244. }
  2245. ],
  2246. "responses": {
  2247. "501": {
  2248. "description": "未实现",
  2249. "content": {
  2250. "application/json": {
  2251. "schema": {
  2252. "$ref": "#/components/schemas/ErrorResponse"
  2253. }
  2254. }
  2255. },
  2256. "headers": {}
  2257. }
  2258. },
  2259. "security": [
  2260. {
  2261. "BearerAuth": []
  2262. }
  2263. ]
  2264. },
  2265. "delete": {
  2266. "summary": "删除文件 (未实现)",
  2267. "deprecated": false,
  2268. "description": "此接口尚未实现",
  2269. "operationId": "deleteFile",
  2270. "tags": [
  2271. "未实现/Files",
  2272. "Files"
  2273. ],
  2274. "parameters": [
  2275. {
  2276. "name": "file_id",
  2277. "in": "path",
  2278. "description": "",
  2279. "required": true,
  2280. "example": "",
  2281. "schema": {
  2282. "type": "string"
  2283. }
  2284. }
  2285. ],
  2286. "responses": {
  2287. "501": {
  2288. "description": "未实现",
  2289. "content": {
  2290. "application/json": {
  2291. "schema": {
  2292. "$ref": "#/components/schemas/ErrorResponse"
  2293. }
  2294. }
  2295. },
  2296. "headers": {}
  2297. }
  2298. },
  2299. "security": [
  2300. {
  2301. "BearerAuth": []
  2302. }
  2303. ]
  2304. }
  2305. },
  2306. "/v1/files/{file_id}/content": {
  2307. "get": {
  2308. "summary": "获取文件内容 (未实现)",
  2309. "deprecated": false,
  2310. "description": "此接口尚未实现",
  2311. "operationId": "downloadFile",
  2312. "tags": [
  2313. "未实现/Files",
  2314. "Files"
  2315. ],
  2316. "parameters": [
  2317. {
  2318. "name": "file_id",
  2319. "in": "path",
  2320. "description": "",
  2321. "required": true,
  2322. "example": "",
  2323. "schema": {
  2324. "type": "string"
  2325. }
  2326. }
  2327. ],
  2328. "responses": {
  2329. "501": {
  2330. "description": "未实现",
  2331. "content": {
  2332. "application/json": {
  2333. "schema": {
  2334. "$ref": "#/components/schemas/ErrorResponse"
  2335. }
  2336. }
  2337. },
  2338. "headers": {}
  2339. }
  2340. },
  2341. "security": [
  2342. {
  2343. "BearerAuth": []
  2344. }
  2345. ]
  2346. }
  2347. }
  2348. },
  2349. "components": {
  2350. "schemas": {
  2351. "ErrorResponse": {
  2352. "type": "object",
  2353. "properties": {
  2354. "error": {
  2355. "type": "object",
  2356. "properties": {
  2357. "message": {
  2358. "type": "string",
  2359. "description": "错误信息"
  2360. },
  2361. "type": {
  2362. "type": "string",
  2363. "description": "错误类型"
  2364. },
  2365. "param": {
  2366. "type": "string",
  2367. "description": "相关参数",
  2368. "nullable": true
  2369. },
  2370. "code": {
  2371. "type": "string",
  2372. "description": "错误代码",
  2373. "nullable": true
  2374. }
  2375. }
  2376. }
  2377. }
  2378. },
  2379. "Usage": {
  2380. "type": "object",
  2381. "properties": {
  2382. "prompt_tokens": {
  2383. "type": "integer",
  2384. "description": "提示词 Token 数"
  2385. },
  2386. "completion_tokens": {
  2387. "type": "integer",
  2388. "description": "补全 Token 数"
  2389. },
  2390. "total_tokens": {
  2391. "type": "integer",
  2392. "description": "总 Token 数"
  2393. },
  2394. "prompt_tokens_details": {
  2395. "type": "object",
  2396. "properties": {
  2397. "cached_tokens": {
  2398. "type": "integer"
  2399. },
  2400. "text_tokens": {
  2401. "type": "integer"
  2402. },
  2403. "audio_tokens": {
  2404. "type": "integer"
  2405. },
  2406. "image_tokens": {
  2407. "type": "integer"
  2408. }
  2409. }
  2410. },
  2411. "completion_tokens_details": {
  2412. "type": "object",
  2413. "properties": {
  2414. "text_tokens": {
  2415. "type": "integer"
  2416. },
  2417. "audio_tokens": {
  2418. "type": "integer"
  2419. },
  2420. "reasoning_tokens": {
  2421. "type": "integer"
  2422. }
  2423. }
  2424. }
  2425. }
  2426. },
  2427. "Model": {
  2428. "type": "object",
  2429. "properties": {
  2430. "id": {
  2431. "type": "string",
  2432. "description": "模型 ID",
  2433. "example": "gpt-4"
  2434. },
  2435. "object": {
  2436. "type": "string",
  2437. "description": "对象类型",
  2438. "example": "model"
  2439. },
  2440. "created": {
  2441. "type": "integer",
  2442. "description": "创建时间戳"
  2443. },
  2444. "owned_by": {
  2445. "type": "string",
  2446. "description": "模型所有者",
  2447. "example": "openai"
  2448. }
  2449. }
  2450. },
  2451. "ModelsResponse": {
  2452. "type": "object",
  2453. "properties": {
  2454. "object": {
  2455. "type": "string",
  2456. "example": "list"
  2457. },
  2458. "data": {
  2459. "type": "array",
  2460. "items": {
  2461. "$ref": "#/components/schemas/Model"
  2462. }
  2463. }
  2464. }
  2465. },
  2466. "GeminiModelsResponse": {
  2467. "type": "object",
  2468. "properties": {
  2469. "models": {
  2470. "type": "array",
  2471. "items": {
  2472. "type": "object",
  2473. "properties": {
  2474. "name": {
  2475. "type": "string",
  2476. "example": "models/gemini-pro"
  2477. },
  2478. "version": {
  2479. "type": "string"
  2480. },
  2481. "displayName": {
  2482. "type": "string"
  2483. },
  2484. "description": {
  2485. "type": "string"
  2486. },
  2487. "inputTokenLimit": {
  2488. "type": "integer"
  2489. },
  2490. "outputTokenLimit": {
  2491. "type": "integer"
  2492. },
  2493. "supportedGenerationMethods": {
  2494. "type": "array",
  2495. "items": {
  2496. "type": "string"
  2497. }
  2498. }
  2499. }
  2500. }
  2501. }
  2502. }
  2503. },
  2504. "Message": {
  2505. "type": "object",
  2506. "required": [
  2507. "role",
  2508. "content"
  2509. ],
  2510. "properties": {
  2511. "role": {
  2512. "type": "string",
  2513. "enum": [
  2514. "system",
  2515. "user",
  2516. "assistant",
  2517. "tool",
  2518. "developer"
  2519. ],
  2520. "description": "消息角色"
  2521. },
  2522. "content": {
  2523. "oneOf": [
  2524. {
  2525. "type": "string"
  2526. },
  2527. {
  2528. "type": "array",
  2529. "items": {
  2530. "$ref": "#/components/schemas/MessageContent"
  2531. }
  2532. }
  2533. ],
  2534. "description": "消息内容"
  2535. },
  2536. "name": {
  2537. "type": "string",
  2538. "description": "发送者名称"
  2539. },
  2540. "tool_calls": {
  2541. "type": "array",
  2542. "items": {
  2543. "$ref": "#/components/schemas/ToolCall"
  2544. }
  2545. },
  2546. "tool_call_id": {
  2547. "type": "string",
  2548. "description": "工具调用 ID(用于 tool 角色消息)"
  2549. },
  2550. "reasoning_content": {
  2551. "type": "string",
  2552. "description": "推理内容"
  2553. }
  2554. }
  2555. },
  2556. "MessageContent": {
  2557. "type": "object",
  2558. "properties": {
  2559. "type": {
  2560. "type": "string",
  2561. "enum": [
  2562. "text",
  2563. "image_url",
  2564. "input_audio",
  2565. "file",
  2566. "video_url"
  2567. ]
  2568. },
  2569. "text": {
  2570. "type": "string"
  2571. },
  2572. "image_url": {
  2573. "type": "object",
  2574. "properties": {
  2575. "url": {
  2576. "type": "string",
  2577. "description": "图片 URL 或 base64"
  2578. },
  2579. "detail": {
  2580. "type": "string",
  2581. "enum": [
  2582. "low",
  2583. "high",
  2584. "auto"
  2585. ]
  2586. }
  2587. }
  2588. },
  2589. "input_audio": {
  2590. "type": "object",
  2591. "properties": {
  2592. "data": {
  2593. "type": "string",
  2594. "description": "Base64 编码的音频数据"
  2595. },
  2596. "format": {
  2597. "type": "string",
  2598. "enum": [
  2599. "wav",
  2600. "mp3"
  2601. ]
  2602. }
  2603. }
  2604. },
  2605. "file": {
  2606. "type": "object",
  2607. "properties": {
  2608. "filename": {
  2609. "type": "string"
  2610. },
  2611. "file_data": {
  2612. "type": "string"
  2613. },
  2614. "file_id": {
  2615. "type": "string"
  2616. }
  2617. }
  2618. },
  2619. "video_url": {
  2620. "type": "object",
  2621. "properties": {
  2622. "url": {
  2623. "type": "string"
  2624. }
  2625. }
  2626. }
  2627. }
  2628. },
  2629. "ToolCall": {
  2630. "type": "object",
  2631. "properties": {
  2632. "id": {
  2633. "type": "string"
  2634. },
  2635. "type": {
  2636. "type": "string",
  2637. "example": "function"
  2638. },
  2639. "function": {
  2640. "type": "object",
  2641. "properties": {
  2642. "name": {
  2643. "type": "string"
  2644. },
  2645. "arguments": {
  2646. "type": "string"
  2647. }
  2648. }
  2649. }
  2650. }
  2651. },
  2652. "Tool": {
  2653. "type": "object",
  2654. "properties": {
  2655. "type": {
  2656. "type": "string",
  2657. "example": "function"
  2658. },
  2659. "function": {
  2660. "type": "object",
  2661. "properties": {
  2662. "name": {
  2663. "type": "string"
  2664. },
  2665. "description": {
  2666. "type": "string"
  2667. },
  2668. "parameters": {
  2669. "type": "object",
  2670. "description": "JSON Schema 格式的参数定义",
  2671. "properties": {}
  2672. }
  2673. }
  2674. }
  2675. }
  2676. },
  2677. "ResponseFormat": {
  2678. "type": "object",
  2679. "properties": {
  2680. "type": {
  2681. "type": "string",
  2682. "enum": [
  2683. "text",
  2684. "json_object",
  2685. "json_schema"
  2686. ]
  2687. },
  2688. "json_schema": {
  2689. "type": "object",
  2690. "description": "JSON Schema 定义",
  2691. "properties": {}
  2692. }
  2693. }
  2694. },
  2695. "ChatCompletionRequest": {
  2696. "type": "object",
  2697. "required": [
  2698. "model",
  2699. "messages"
  2700. ],
  2701. "properties": {
  2702. "model": {
  2703. "type": "string",
  2704. "description": "模型 ID",
  2705. "example": "gpt-4"
  2706. },
  2707. "messages": {
  2708. "type": "array",
  2709. "items": {
  2710. "$ref": "#/components/schemas/Message"
  2711. },
  2712. "description": "对话消息列表"
  2713. },
  2714. "temperature": {
  2715. "type": "number",
  2716. "minimum": 0,
  2717. "maximum": 2,
  2718. "default": 1,
  2719. "description": "采样温度"
  2720. },
  2721. "top_p": {
  2722. "type": "number",
  2723. "minimum": 0,
  2724. "maximum": 1,
  2725. "default": 1,
  2726. "description": "核采样参数"
  2727. },
  2728. "n": {
  2729. "type": "integer",
  2730. "minimum": 1,
  2731. "default": 1,
  2732. "description": "生成数量"
  2733. },
  2734. "stream": {
  2735. "type": "boolean",
  2736. "default": false,
  2737. "description": "是否流式响应"
  2738. },
  2739. "stream_options": {
  2740. "type": "object",
  2741. "properties": {
  2742. "include_usage": {
  2743. "type": "boolean"
  2744. }
  2745. }
  2746. },
  2747. "stop": {
  2748. "oneOf": [
  2749. {
  2750. "type": "string"
  2751. },
  2752. {
  2753. "type": "array",
  2754. "items": {
  2755. "type": "string"
  2756. }
  2757. }
  2758. ],
  2759. "description": "停止序列"
  2760. },
  2761. "max_tokens": {
  2762. "type": "integer",
  2763. "description": "最大生成 Token 数"
  2764. },
  2765. "max_completion_tokens": {
  2766. "type": "integer",
  2767. "description": "最大补全 Token 数"
  2768. },
  2769. "presence_penalty": {
  2770. "type": "number",
  2771. "minimum": -2,
  2772. "maximum": 2,
  2773. "default": 0
  2774. },
  2775. "frequency_penalty": {
  2776. "type": "number",
  2777. "minimum": -2,
  2778. "maximum": 2,
  2779. "default": 0
  2780. },
  2781. "logit_bias": {
  2782. "type": "object",
  2783. "additionalProperties": {
  2784. "type": "number"
  2785. },
  2786. "properties": {}
  2787. },
  2788. "user": {
  2789. "type": "string"
  2790. },
  2791. "tools": {
  2792. "type": "array",
  2793. "items": {
  2794. "$ref": "#/components/schemas/Tool"
  2795. }
  2796. },
  2797. "tool_choice": {
  2798. "oneOf": [
  2799. {
  2800. "type": "string",
  2801. "enum": [
  2802. "none",
  2803. "auto",
  2804. "required"
  2805. ]
  2806. },
  2807. {
  2808. "type": "object",
  2809. "properties": {
  2810. "type": {
  2811. "type": "string"
  2812. },
  2813. "function": {
  2814. "type": "object",
  2815. "properties": {
  2816. "name": {
  2817. "type": "string"
  2818. }
  2819. }
  2820. }
  2821. }
  2822. }
  2823. ]
  2824. },
  2825. "response_format": {
  2826. "$ref": "#/components/schemas/ResponseFormat"
  2827. },
  2828. "seed": {
  2829. "type": "integer"
  2830. },
  2831. "reasoning_effort": {
  2832. "type": "string",
  2833. "enum": [
  2834. "low",
  2835. "medium",
  2836. "high"
  2837. ],
  2838. "description": "推理强度 (用于支持推理的模型)"
  2839. },
  2840. "modalities": {
  2841. "type": "array",
  2842. "items": {
  2843. "type": "string",
  2844. "enum": [
  2845. "text",
  2846. "audio"
  2847. ]
  2848. }
  2849. },
  2850. "audio": {
  2851. "type": "object",
  2852. "properties": {
  2853. "voice": {
  2854. "type": "string"
  2855. },
  2856. "format": {
  2857. "type": "string"
  2858. }
  2859. }
  2860. }
  2861. }
  2862. },
  2863. "ChatCompletionResponse": {
  2864. "type": "object",
  2865. "properties": {
  2866. "id": {
  2867. "type": "string"
  2868. },
  2869. "object": {
  2870. "type": "string",
  2871. "example": "chat.completion"
  2872. },
  2873. "created": {
  2874. "type": "integer"
  2875. },
  2876. "model": {
  2877. "type": "string"
  2878. },
  2879. "choices": {
  2880. "type": "array",
  2881. "items": {
  2882. "type": "object",
  2883. "properties": {
  2884. "index": {
  2885. "type": "integer"
  2886. },
  2887. "message": {
  2888. "$ref": "#/components/schemas/Message"
  2889. },
  2890. "finish_reason": {
  2891. "type": "string",
  2892. "enum": [
  2893. "stop",
  2894. "length",
  2895. "tool_calls",
  2896. "content_filter"
  2897. ]
  2898. }
  2899. }
  2900. }
  2901. },
  2902. "usage": {
  2903. "$ref": "#/components/schemas/Usage"
  2904. },
  2905. "system_fingerprint": {
  2906. "type": "string"
  2907. }
  2908. }
  2909. },
  2910. "CompletionRequest": {
  2911. "type": "object",
  2912. "required": [
  2913. "model",
  2914. "prompt"
  2915. ],
  2916. "properties": {
  2917. "model": {
  2918. "type": "string"
  2919. },
  2920. "prompt": {
  2921. "oneOf": [
  2922. {
  2923. "type": "string"
  2924. },
  2925. {
  2926. "type": "array",
  2927. "items": {
  2928. "type": "string"
  2929. }
  2930. }
  2931. ]
  2932. },
  2933. "max_tokens": {
  2934. "type": "integer"
  2935. },
  2936. "temperature": {
  2937. "type": "number"
  2938. },
  2939. "top_p": {
  2940. "type": "number"
  2941. },
  2942. "n": {
  2943. "type": "integer"
  2944. },
  2945. "stream": {
  2946. "type": "boolean"
  2947. },
  2948. "stop": {
  2949. "oneOf": [
  2950. {
  2951. "type": "string"
  2952. },
  2953. {
  2954. "type": "array",
  2955. "items": {
  2956. "type": "string"
  2957. }
  2958. }
  2959. ]
  2960. },
  2961. "suffix": {
  2962. "type": "string"
  2963. },
  2964. "echo": {
  2965. "type": "boolean"
  2966. }
  2967. }
  2968. },
  2969. "CompletionResponse": {
  2970. "type": "object",
  2971. "properties": {
  2972. "id": {
  2973. "type": "string"
  2974. },
  2975. "object": {
  2976. "type": "string",
  2977. "example": "text_completion"
  2978. },
  2979. "created": {
  2980. "type": "integer"
  2981. },
  2982. "model": {
  2983. "type": "string"
  2984. },
  2985. "choices": {
  2986. "type": "array",
  2987. "items": {
  2988. "type": "object",
  2989. "properties": {
  2990. "text": {
  2991. "type": "string"
  2992. },
  2993. "index": {
  2994. "type": "integer"
  2995. },
  2996. "finish_reason": {
  2997. "type": "string"
  2998. }
  2999. }
  3000. }
  3001. },
  3002. "usage": {
  3003. "$ref": "#/components/schemas/Usage"
  3004. }
  3005. }
  3006. },
  3007. "ResponsesRequest": {
  3008. "type": "object",
  3009. "required": [
  3010. "model"
  3011. ],
  3012. "properties": {
  3013. "model": {
  3014. "type": "string"
  3015. },
  3016. "input": {
  3017. "description": "输入内容,可以是字符串或消息数组",
  3018. "oneOf": [
  3019. {
  3020. "type": "string"
  3021. },
  3022. {
  3023. "type": "array",
  3024. "items": {
  3025. "type": "object",
  3026. "properties": {}
  3027. }
  3028. }
  3029. ]
  3030. },
  3031. "instructions": {
  3032. "type": "string"
  3033. },
  3034. "max_output_tokens": {
  3035. "type": "integer"
  3036. },
  3037. "temperature": {
  3038. "type": "number"
  3039. },
  3040. "top_p": {
  3041. "type": "number"
  3042. },
  3043. "stream": {
  3044. "type": "boolean"
  3045. },
  3046. "tools": {
  3047. "type": "array",
  3048. "items": {
  3049. "type": "object",
  3050. "properties": {}
  3051. }
  3052. },
  3053. "tool_choice": {
  3054. "oneOf": [
  3055. {
  3056. "type": "string"
  3057. },
  3058. {
  3059. "type": "object",
  3060. "properties": {}
  3061. }
  3062. ]
  3063. },
  3064. "reasoning": {
  3065. "type": "object",
  3066. "properties": {
  3067. "effort": {
  3068. "type": "string",
  3069. "enum": [
  3070. "low",
  3071. "medium",
  3072. "high"
  3073. ]
  3074. },
  3075. "summary": {
  3076. "type": "string"
  3077. }
  3078. }
  3079. },
  3080. "previous_response_id": {
  3081. "type": "string"
  3082. },
  3083. "truncation": {
  3084. "type": "string",
  3085. "enum": [
  3086. "auto",
  3087. "disabled"
  3088. ]
  3089. }
  3090. }
  3091. },
  3092. "ResponsesResponse": {
  3093. "type": "object",
  3094. "properties": {
  3095. "id": {
  3096. "type": "string"
  3097. },
  3098. "object": {
  3099. "type": "string",
  3100. "example": "response"
  3101. },
  3102. "created_at": {
  3103. "type": "integer"
  3104. },
  3105. "status": {
  3106. "type": "string",
  3107. "enum": [
  3108. "completed",
  3109. "failed",
  3110. "in_progress",
  3111. "incomplete"
  3112. ]
  3113. },
  3114. "model": {
  3115. "type": "string"
  3116. },
  3117. "output": {
  3118. "type": "array",
  3119. "items": {
  3120. "type": "object",
  3121. "properties": {
  3122. "type": {
  3123. "type": "string"
  3124. },
  3125. "id": {
  3126. "type": "string"
  3127. },
  3128. "status": {
  3129. "type": "string"
  3130. },
  3131. "role": {
  3132. "type": "string"
  3133. },
  3134. "content": {
  3135. "type": "array",
  3136. "items": {
  3137. "type": "object",
  3138. "properties": {
  3139. "type": {
  3140. "type": "string"
  3141. },
  3142. "text": {
  3143. "type": "string"
  3144. }
  3145. }
  3146. }
  3147. }
  3148. }
  3149. }
  3150. },
  3151. "usage": {
  3152. "$ref": "#/components/schemas/Usage"
  3153. }
  3154. }
  3155. },
  3156. "ClaudeRequest": {
  3157. "type": "object",
  3158. "required": [
  3159. "model",
  3160. "messages",
  3161. "max_tokens"
  3162. ],
  3163. "properties": {
  3164. "model": {
  3165. "type": "string",
  3166. "example": "claude-3-opus-20240229"
  3167. },
  3168. "messages": {
  3169. "type": "array",
  3170. "items": {
  3171. "$ref": "#/components/schemas/ClaudeMessage"
  3172. }
  3173. },
  3174. "system": {
  3175. "oneOf": [
  3176. {
  3177. "type": "string"
  3178. },
  3179. {
  3180. "type": "array",
  3181. "items": {
  3182. "type": "object",
  3183. "properties": {}
  3184. }
  3185. }
  3186. ]
  3187. },
  3188. "max_tokens": {
  3189. "type": "integer",
  3190. "minimum": 1
  3191. },
  3192. "temperature": {
  3193. "type": "number",
  3194. "minimum": 0,
  3195. "maximum": 1
  3196. },
  3197. "top_p": {
  3198. "type": "number"
  3199. },
  3200. "top_k": {
  3201. "type": "integer"
  3202. },
  3203. "stream": {
  3204. "type": "boolean"
  3205. },
  3206. "stop_sequences": {
  3207. "type": "array",
  3208. "items": {
  3209. "type": "string"
  3210. }
  3211. },
  3212. "tools": {
  3213. "type": "array",
  3214. "items": {
  3215. "type": "object",
  3216. "properties": {
  3217. "name": {
  3218. "type": "string"
  3219. },
  3220. "description": {
  3221. "type": "string"
  3222. },
  3223. "input_schema": {
  3224. "type": "object",
  3225. "properties": {}
  3226. }
  3227. }
  3228. }
  3229. },
  3230. "tool_choice": {
  3231. "oneOf": [
  3232. {
  3233. "type": "object",
  3234. "properties": {
  3235. "type": {
  3236. "type": "string",
  3237. "enum": [
  3238. "auto",
  3239. "any",
  3240. "tool"
  3241. ]
  3242. },
  3243. "name": {
  3244. "type": "string"
  3245. }
  3246. }
  3247. }
  3248. ]
  3249. },
  3250. "thinking": {
  3251. "type": "object",
  3252. "properties": {
  3253. "type": {
  3254. "type": "string",
  3255. "enum": [
  3256. "enabled",
  3257. "disabled"
  3258. ]
  3259. },
  3260. "budget_tokens": {
  3261. "type": "integer"
  3262. }
  3263. }
  3264. },
  3265. "metadata": {
  3266. "type": "object",
  3267. "properties": {
  3268. "user_id": {
  3269. "type": "string"
  3270. }
  3271. }
  3272. }
  3273. }
  3274. },
  3275. "ClaudeMessage": {
  3276. "type": "object",
  3277. "required": [
  3278. "role",
  3279. "content"
  3280. ],
  3281. "properties": {
  3282. "role": {
  3283. "type": "string",
  3284. "enum": [
  3285. "user",
  3286. "assistant"
  3287. ]
  3288. },
  3289. "content": {
  3290. "oneOf": [
  3291. {
  3292. "type": "string"
  3293. },
  3294. {
  3295. "type": "array",
  3296. "items": {
  3297. "type": "object",
  3298. "properties": {
  3299. "type": {
  3300. "type": "string",
  3301. "enum": [
  3302. "text",
  3303. "image",
  3304. "tool_use",
  3305. "tool_result"
  3306. ]
  3307. },
  3308. "text": {
  3309. "type": "string"
  3310. },
  3311. "source": {
  3312. "type": "object",
  3313. "properties": {
  3314. "type": {
  3315. "type": "string",
  3316. "enum": [
  3317. "base64",
  3318. "url"
  3319. ]
  3320. },
  3321. "media_type": {
  3322. "type": "string"
  3323. },
  3324. "data": {
  3325. "type": "string"
  3326. },
  3327. "url": {
  3328. "type": "string"
  3329. }
  3330. }
  3331. },
  3332. "id": {
  3333. "type": "string"
  3334. },
  3335. "name": {
  3336. "type": "string"
  3337. },
  3338. "input": {
  3339. "type": "object",
  3340. "properties": {}
  3341. },
  3342. "tool_use_id": {
  3343. "type": "string"
  3344. },
  3345. "content": {
  3346. "type": "string"
  3347. }
  3348. }
  3349. }
  3350. }
  3351. ]
  3352. }
  3353. }
  3354. },
  3355. "ClaudeResponse": {
  3356. "type": "object",
  3357. "properties": {
  3358. "id": {
  3359. "type": "string"
  3360. },
  3361. "type": {
  3362. "type": "string",
  3363. "example": "message"
  3364. },
  3365. "role": {
  3366. "type": "string",
  3367. "example": "assistant"
  3368. },
  3369. "content": {
  3370. "type": "array",
  3371. "items": {
  3372. "type": "object",
  3373. "properties": {
  3374. "type": {
  3375. "type": "string"
  3376. },
  3377. "text": {
  3378. "type": "string"
  3379. }
  3380. }
  3381. }
  3382. },
  3383. "model": {
  3384. "type": "string"
  3385. },
  3386. "stop_reason": {
  3387. "type": "string",
  3388. "enum": [
  3389. "end_turn",
  3390. "max_tokens",
  3391. "stop_sequence",
  3392. "tool_use"
  3393. ]
  3394. },
  3395. "usage": {
  3396. "type": "object",
  3397. "properties": {
  3398. "input_tokens": {
  3399. "type": "integer"
  3400. },
  3401. "output_tokens": {
  3402. "type": "integer"
  3403. },
  3404. "cache_creation_input_tokens": {
  3405. "type": "integer"
  3406. },
  3407. "cache_read_input_tokens": {
  3408. "type": "integer"
  3409. }
  3410. }
  3411. }
  3412. }
  3413. },
  3414. "EmbeddingRequest": {
  3415. "type": "object",
  3416. "required": [
  3417. "model",
  3418. "input"
  3419. ],
  3420. "properties": {
  3421. "model": {
  3422. "type": "string",
  3423. "example": "text-embedding-ada-002"
  3424. },
  3425. "input": {
  3426. "oneOf": [
  3427. {
  3428. "type": "string"
  3429. },
  3430. {
  3431. "type": "array",
  3432. "items": {
  3433. "type": "string"
  3434. }
  3435. }
  3436. ],
  3437. "description": "要嵌入的文本"
  3438. },
  3439. "encoding_format": {
  3440. "type": "string",
  3441. "enum": [
  3442. "float",
  3443. "base64"
  3444. ],
  3445. "default": "float"
  3446. },
  3447. "dimensions": {
  3448. "type": "integer",
  3449. "description": "输出向量维度"
  3450. }
  3451. }
  3452. },
  3453. "EmbeddingResponse": {
  3454. "type": "object",
  3455. "properties": {
  3456. "object": {
  3457. "type": "string",
  3458. "example": "list"
  3459. },
  3460. "data": {
  3461. "type": "array",
  3462. "items": {
  3463. "type": "object",
  3464. "properties": {
  3465. "object": {
  3466. "type": "string",
  3467. "example": "embedding"
  3468. },
  3469. "index": {
  3470. "type": "integer"
  3471. },
  3472. "embedding": {
  3473. "type": "array",
  3474. "items": {
  3475. "type": "number"
  3476. }
  3477. }
  3478. }
  3479. }
  3480. },
  3481. "model": {
  3482. "type": "string"
  3483. },
  3484. "usage": {
  3485. "type": "object",
  3486. "properties": {
  3487. "prompt_tokens": {
  3488. "type": "integer"
  3489. },
  3490. "total_tokens": {
  3491. "type": "integer"
  3492. }
  3493. }
  3494. }
  3495. }
  3496. },
  3497. "ImageGenerationRequest": {
  3498. "type": "object",
  3499. "required": [
  3500. "prompt"
  3501. ],
  3502. "properties": {
  3503. "model": {
  3504. "type": "string",
  3505. "example": "dall-e-3"
  3506. },
  3507. "prompt": {
  3508. "type": "string",
  3509. "description": "图像描述"
  3510. },
  3511. "n": {
  3512. "type": "integer",
  3513. "minimum": 1,
  3514. "maximum": 10,
  3515. "default": 1
  3516. },
  3517. "size": {
  3518. "type": "string",
  3519. "enum": [
  3520. "256x256",
  3521. "512x512",
  3522. "1024x1024",
  3523. "1792x1024",
  3524. "1024x1792"
  3525. ],
  3526. "default": "1024x1024"
  3527. },
  3528. "quality": {
  3529. "type": "string",
  3530. "enum": [
  3531. "standard",
  3532. "hd"
  3533. ],
  3534. "default": "standard"
  3535. },
  3536. "style": {
  3537. "type": "string",
  3538. "enum": [
  3539. "vivid",
  3540. "natural"
  3541. ],
  3542. "default": "vivid"
  3543. },
  3544. "response_format": {
  3545. "type": "string",
  3546. "enum": [
  3547. "url",
  3548. "b64_json"
  3549. ],
  3550. "default": "url"
  3551. },
  3552. "user": {
  3553. "type": "string"
  3554. }
  3555. }
  3556. },
  3557. "ImageResponse": {
  3558. "type": "object",
  3559. "properties": {
  3560. "created": {
  3561. "type": "integer"
  3562. },
  3563. "data": {
  3564. "type": "array",
  3565. "items": {
  3566. "type": "object",
  3567. "properties": {
  3568. "url": {
  3569. "type": "string"
  3570. },
  3571. "b64_json": {
  3572. "type": "string"
  3573. },
  3574. "revised_prompt": {
  3575. "type": "string"
  3576. }
  3577. }
  3578. }
  3579. }
  3580. }
  3581. },
  3582. "AudioTranscriptionResponse": {
  3583. "type": "object",
  3584. "properties": {
  3585. "text": {
  3586. "type": "string"
  3587. }
  3588. }
  3589. },
  3590. "SpeechRequest": {
  3591. "type": "object",
  3592. "required": [
  3593. "model",
  3594. "input",
  3595. "voice"
  3596. ],
  3597. "properties": {
  3598. "model": {
  3599. "type": "string",
  3600. "example": "tts-1"
  3601. },
  3602. "input": {
  3603. "type": "string",
  3604. "description": "要转换的文本",
  3605. "maxLength": 4096
  3606. },
  3607. "voice": {
  3608. "type": "string",
  3609. "enum": [
  3610. "alloy",
  3611. "echo",
  3612. "fable",
  3613. "onyx",
  3614. "nova",
  3615. "shimmer"
  3616. ]
  3617. },
  3618. "response_format": {
  3619. "type": "string",
  3620. "enum": [
  3621. "mp3",
  3622. "opus",
  3623. "aac",
  3624. "flac",
  3625. "wav",
  3626. "pcm"
  3627. ],
  3628. "default": "mp3"
  3629. },
  3630. "speed": {
  3631. "type": "number",
  3632. "minimum": 0.25,
  3633. "maximum": 4,
  3634. "default": 1
  3635. }
  3636. }
  3637. },
  3638. "RerankRequest": {
  3639. "type": "object",
  3640. "required": [
  3641. "model",
  3642. "query",
  3643. "documents"
  3644. ],
  3645. "properties": {
  3646. "model": {
  3647. "type": "string",
  3648. "example": "rerank-english-v2.0"
  3649. },
  3650. "query": {
  3651. "type": "string",
  3652. "description": "查询文本"
  3653. },
  3654. "documents": {
  3655. "type": "array",
  3656. "items": {
  3657. "oneOf": [
  3658. {
  3659. "type": "string"
  3660. },
  3661. {
  3662. "type": "object",
  3663. "properties": {}
  3664. }
  3665. ]
  3666. },
  3667. "description": "要重排序的文档列表"
  3668. },
  3669. "top_n": {
  3670. "type": "integer",
  3671. "description": "返回前 N 个结果"
  3672. },
  3673. "return_documents": {
  3674. "type": "boolean",
  3675. "default": false
  3676. }
  3677. }
  3678. },
  3679. "RerankResponse": {
  3680. "type": "object",
  3681. "properties": {
  3682. "id": {
  3683. "type": "string"
  3684. },
  3685. "results": {
  3686. "type": "array",
  3687. "items": {
  3688. "type": "object",
  3689. "properties": {
  3690. "index": {
  3691. "type": "integer"
  3692. },
  3693. "relevance_score": {
  3694. "type": "number"
  3695. },
  3696. "document": {
  3697. "type": "object",
  3698. "properties": {}
  3699. }
  3700. }
  3701. }
  3702. },
  3703. "meta": {
  3704. "type": "object",
  3705. "properties": {}
  3706. }
  3707. }
  3708. },
  3709. "ModerationRequest": {
  3710. "type": "object",
  3711. "required": [
  3712. "input"
  3713. ],
  3714. "properties": {
  3715. "input": {
  3716. "oneOf": [
  3717. {
  3718. "type": "string"
  3719. },
  3720. {
  3721. "type": "array",
  3722. "items": {
  3723. "type": "string"
  3724. }
  3725. }
  3726. ]
  3727. },
  3728. "model": {
  3729. "type": "string",
  3730. "example": "text-moderation-latest"
  3731. }
  3732. }
  3733. },
  3734. "ModerationResponse": {
  3735. "type": "object",
  3736. "properties": {
  3737. "id": {
  3738. "type": "string"
  3739. },
  3740. "model": {
  3741. "type": "string"
  3742. },
  3743. "results": {
  3744. "type": "array",
  3745. "items": {
  3746. "type": "object",
  3747. "properties": {
  3748. "flagged": {
  3749. "type": "boolean"
  3750. },
  3751. "categories": {
  3752. "type": "object",
  3753. "properties": {}
  3754. },
  3755. "category_scores": {
  3756. "type": "object",
  3757. "properties": {}
  3758. }
  3759. }
  3760. }
  3761. }
  3762. }
  3763. },
  3764. "GeminiRequest": {
  3765. "type": "object",
  3766. "properties": {
  3767. "contents": {
  3768. "type": "array",
  3769. "items": {
  3770. "type": "object",
  3771. "properties": {
  3772. "role": {
  3773. "type": "string",
  3774. "enum": [
  3775. "user",
  3776. "model"
  3777. ]
  3778. },
  3779. "parts": {
  3780. "type": "array",
  3781. "items": {
  3782. "type": "object",
  3783. "properties": {
  3784. "text": {
  3785. "type": "string"
  3786. },
  3787. "inlineData": {
  3788. "type": "object",
  3789. "properties": {
  3790. "mimeType": {
  3791. "type": "string"
  3792. },
  3793. "data": {
  3794. "type": "string"
  3795. }
  3796. }
  3797. }
  3798. }
  3799. }
  3800. }
  3801. }
  3802. }
  3803. },
  3804. "generationConfig": {
  3805. "type": "object",
  3806. "properties": {
  3807. "temperature": {
  3808. "type": "number"
  3809. },
  3810. "topP": {
  3811. "type": "number"
  3812. },
  3813. "topK": {
  3814. "type": "integer"
  3815. },
  3816. "maxOutputTokens": {
  3817. "type": "integer"
  3818. },
  3819. "stopSequences": {
  3820. "type": "array",
  3821. "items": {
  3822. "type": "string"
  3823. }
  3824. }
  3825. }
  3826. },
  3827. "safetySettings": {
  3828. "type": "array",
  3829. "items": {
  3830. "type": "object",
  3831. "properties": {
  3832. "category": {
  3833. "type": "string"
  3834. },
  3835. "threshold": {
  3836. "type": "string"
  3837. }
  3838. }
  3839. }
  3840. },
  3841. "tools": {
  3842. "type": "array",
  3843. "items": {
  3844. "type": "object",
  3845. "properties": {}
  3846. }
  3847. },
  3848. "systemInstruction": {
  3849. "type": "object",
  3850. "properties": {
  3851. "parts": {
  3852. "type": "array",
  3853. "items": {
  3854. "type": "object",
  3855. "properties": {}
  3856. }
  3857. }
  3858. }
  3859. }
  3860. }
  3861. },
  3862. "GeminiResponse": {
  3863. "type": "object",
  3864. "properties": {
  3865. "candidates": {
  3866. "type": "array",
  3867. "items": {
  3868. "type": "object",
  3869. "properties": {
  3870. "content": {
  3871. "type": "object",
  3872. "properties": {
  3873. "role": {
  3874. "type": "string"
  3875. },
  3876. "parts": {
  3877. "type": "array",
  3878. "items": {
  3879. "type": "object",
  3880. "properties": {}
  3881. }
  3882. }
  3883. }
  3884. },
  3885. "finishReason": {
  3886. "type": "string"
  3887. },
  3888. "safetyRatings": {
  3889. "type": "array",
  3890. "items": {
  3891. "type": "object",
  3892. "properties": {}
  3893. }
  3894. }
  3895. }
  3896. }
  3897. },
  3898. "usageMetadata": {
  3899. "type": "object",
  3900. "properties": {
  3901. "promptTokenCount": {
  3902. "type": "integer"
  3903. },
  3904. "candidatesTokenCount": {
  3905. "type": "integer"
  3906. },
  3907. "totalTokenCount": {
  3908. "type": "integer"
  3909. }
  3910. }
  3911. }
  3912. }
  3913. },
  3914. "VideoRequest": {
  3915. "type": "object",
  3916. "description": "视频生成请求",
  3917. "properties": {
  3918. "model": {
  3919. "type": "string",
  3920. "description": "模型/风格 ID",
  3921. "example": "kling-v1"
  3922. },
  3923. "prompt": {
  3924. "type": "string",
  3925. "description": "文本描述提示词",
  3926. "example": "宇航员站起身走了"
  3927. },
  3928. "image": {
  3929. "type": "string",
  3930. "description": "图片输入 (URL 或 Base64)",
  3931. "example": "https://example.com/image.jpg"
  3932. },
  3933. "duration": {
  3934. "type": "number",
  3935. "description": "视频时长(秒)",
  3936. "example": 5
  3937. },
  3938. "width": {
  3939. "type": "integer",
  3940. "description": "视频宽度",
  3941. "example": 1280
  3942. },
  3943. "height": {
  3944. "type": "integer",
  3945. "description": "视频高度",
  3946. "example": 720
  3947. },
  3948. "fps": {
  3949. "type": "integer",
  3950. "description": "视频帧率",
  3951. "example": 30
  3952. },
  3953. "seed": {
  3954. "type": "integer",
  3955. "description": "随机种子",
  3956. "example": 20231234
  3957. },
  3958. "n": {
  3959. "type": "integer",
  3960. "description": "生成视频数量",
  3961. "example": 1
  3962. },
  3963. "response_format": {
  3964. "type": "string",
  3965. "description": "响应格式",
  3966. "example": "url"
  3967. },
  3968. "user": {
  3969. "type": "string",
  3970. "description": "用户标识",
  3971. "example": "user-1234"
  3972. },
  3973. "metadata": {
  3974. "type": "object",
  3975. "description": "扩展参数 (如 negative_prompt, style, quality_level 等)",
  3976. "additionalProperties": true,
  3977. "properties": {}
  3978. }
  3979. }
  3980. },
  3981. "VideoResponse": {
  3982. "type": "object",
  3983. "description": "视频生成任务提交响应",
  3984. "properties": {
  3985. "task_id": {
  3986. "type": "string",
  3987. "description": "任务 ID",
  3988. "example": "abcd1234efgh"
  3989. },
  3990. "status": {
  3991. "type": "string",
  3992. "description": "任务状态",
  3993. "example": "queued"
  3994. }
  3995. }
  3996. },
  3997. "VideoTaskResponse": {
  3998. "type": "object",
  3999. "description": "视频任务状态查询响应",
  4000. "properties": {
  4001. "task_id": {
  4002. "type": "string",
  4003. "description": "任务 ID",
  4004. "example": "abcd1234efgh"
  4005. },
  4006. "status": {
  4007. "type": "string",
  4008. "description": "任务状态",
  4009. "enum": [
  4010. "queued",
  4011. "in_progress",
  4012. "completed",
  4013. "failed"
  4014. ],
  4015. "example": "completed"
  4016. },
  4017. "url": {
  4018. "type": "string",
  4019. "description": "视频资源 URL(成功时)",
  4020. "example": "https://example.com/video.mp4"
  4021. },
  4022. "format": {
  4023. "type": "string",
  4024. "description": "视频格式",
  4025. "example": "mp4"
  4026. },
  4027. "metadata": {
  4028. "$ref": "#/components/schemas/VideoTaskMetadata"
  4029. },
  4030. "error": {
  4031. "$ref": "#/components/schemas/VideoTaskError"
  4032. }
  4033. }
  4034. },
  4035. "VideoTaskMetadata": {
  4036. "type": "object",
  4037. "description": "视频任务元数据",
  4038. "properties": {
  4039. "duration": {
  4040. "type": "number",
  4041. "description": "实际生成的视频时长",
  4042. "example": 5
  4043. },
  4044. "fps": {
  4045. "type": "integer",
  4046. "description": "实际帧率",
  4047. "example": 30
  4048. },
  4049. "width": {
  4050. "type": "integer",
  4051. "description": "实际宽度",
  4052. "example": 1280
  4053. },
  4054. "height": {
  4055. "type": "integer",
  4056. "description": "实际高度",
  4057. "example": 720
  4058. },
  4059. "seed": {
  4060. "type": "integer",
  4061. "description": "使用的随机种子",
  4062. "example": 20231234
  4063. }
  4064. }
  4065. },
  4066. "VideoTaskError": {
  4067. "type": "object",
  4068. "description": "视频任务错误信息",
  4069. "properties": {
  4070. "code": {
  4071. "type": "integer",
  4072. "description": "错误码"
  4073. },
  4074. "message": {
  4075. "type": "string",
  4076. "description": "错误信息"
  4077. }
  4078. }
  4079. },
  4080. "OpenAIVideoError": {
  4081. "type": "object",
  4082. "description": "OpenAI 视频错误信息",
  4083. "properties": {
  4084. "message": {
  4085. "type": "string",
  4086. "description": "错误信息"
  4087. },
  4088. "code": {
  4089. "type": "string",
  4090. "description": "错误码"
  4091. }
  4092. }
  4093. }
  4094. },
  4095. "responses": {},
  4096. "securitySchemes": {
  4097. "BearerAuth": {
  4098. "type": "http",
  4099. "scheme": "bearer",
  4100. "description": "使用 Bearer Token 认证。\n格式: `Authorization: Bearer sk-xxxxxx`\n"
  4101. }
  4102. }
  4103. },
  4104. "servers": [],
  4105. "security": [
  4106. {
  4107. "BearerAuth": []
  4108. }
  4109. ]
  4110. }