swagger.json 334 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657
  1. {
  2. "swagger": "2.0",
  3. "info": {
  4. "title": "AI Proxy Swagger API",
  5. "contact": {},
  6. "version": "1.0"
  7. },
  8. "paths": {
  9. "/api/channel": {
  10. "post": {
  11. "security": [
  12. {
  13. "ApiKeyAuth": []
  14. }
  15. ],
  16. "description": "Adds a new channel to the system",
  17. "consumes": [
  18. "application/json"
  19. ],
  20. "produces": [
  21. "application/json"
  22. ],
  23. "tags": [
  24. "channel"
  25. ],
  26. "summary": "Add a single channel",
  27. "parameters": [
  28. {
  29. "description": "Channel information",
  30. "name": "channel",
  31. "in": "body",
  32. "required": true,
  33. "schema": {
  34. "$ref": "#/definitions/controller.AddChannelRequest"
  35. }
  36. }
  37. ],
  38. "responses": {
  39. "200": {
  40. "description": "OK",
  41. "schema": {
  42. "$ref": "#/definitions/middleware.APIResponse"
  43. }
  44. }
  45. }
  46. }
  47. },
  48. "/api/channel/{id}": {
  49. "get": {
  50. "security": [
  51. {
  52. "ApiKeyAuth": []
  53. }
  54. ],
  55. "description": "Returns detailed information about a specific channel",
  56. "produces": [
  57. "application/json"
  58. ],
  59. "tags": [
  60. "channel"
  61. ],
  62. "summary": "Get a channel by ID",
  63. "parameters": [
  64. {
  65. "type": "integer",
  66. "description": "Channel ID",
  67. "name": "id",
  68. "in": "path",
  69. "required": true
  70. }
  71. ],
  72. "responses": {
  73. "200": {
  74. "description": "OK",
  75. "schema": {
  76. "allOf": [
  77. {
  78. "$ref": "#/definitions/middleware.APIResponse"
  79. },
  80. {
  81. "type": "object",
  82. "properties": {
  83. "data": {
  84. "$ref": "#/definitions/model.Channel"
  85. }
  86. }
  87. }
  88. ]
  89. }
  90. }
  91. }
  92. },
  93. "put": {
  94. "security": [
  95. {
  96. "ApiKeyAuth": []
  97. }
  98. ],
  99. "description": "Updates an existing channel by its ID",
  100. "consumes": [
  101. "application/json"
  102. ],
  103. "produces": [
  104. "application/json"
  105. ],
  106. "tags": [
  107. "channel"
  108. ],
  109. "summary": "Update a channel",
  110. "parameters": [
  111. {
  112. "type": "integer",
  113. "description": "Channel ID",
  114. "name": "id",
  115. "in": "path",
  116. "required": true
  117. },
  118. {
  119. "description": "Updated channel information",
  120. "name": "channel",
  121. "in": "body",
  122. "required": true,
  123. "schema": {
  124. "$ref": "#/definitions/controller.AddChannelRequest"
  125. }
  126. }
  127. ],
  128. "responses": {
  129. "200": {
  130. "description": "OK",
  131. "schema": {
  132. "allOf": [
  133. {
  134. "$ref": "#/definitions/middleware.APIResponse"
  135. },
  136. {
  137. "type": "object",
  138. "properties": {
  139. "data": {
  140. "$ref": "#/definitions/model.Channel"
  141. }
  142. }
  143. }
  144. ]
  145. }
  146. }
  147. }
  148. },
  149. "delete": {
  150. "security": [
  151. {
  152. "ApiKeyAuth": []
  153. }
  154. ],
  155. "description": "Deletes a channel by its ID",
  156. "produces": [
  157. "application/json"
  158. ],
  159. "tags": [
  160. "channel"
  161. ],
  162. "summary": "Delete a channel",
  163. "parameters": [
  164. {
  165. "type": "integer",
  166. "description": "Channel ID",
  167. "name": "id",
  168. "in": "path",
  169. "required": true
  170. }
  171. ],
  172. "responses": {
  173. "200": {
  174. "description": "OK",
  175. "schema": {
  176. "$ref": "#/definitions/middleware.APIResponse"
  177. }
  178. }
  179. }
  180. }
  181. },
  182. "/api/channel/{id}/balance": {
  183. "get": {
  184. "security": [
  185. {
  186. "ApiKeyAuth": []
  187. }
  188. ],
  189. "description": "Updates the balance for a single channel",
  190. "produces": [
  191. "application/json"
  192. ],
  193. "tags": [
  194. "channel"
  195. ],
  196. "summary": "Update channel balance",
  197. "parameters": [
  198. {
  199. "type": "integer",
  200. "description": "Channel ID",
  201. "name": "id",
  202. "in": "path",
  203. "required": true
  204. }
  205. ],
  206. "responses": {
  207. "200": {
  208. "description": "OK",
  209. "schema": {
  210. "allOf": [
  211. {
  212. "$ref": "#/definitions/middleware.APIResponse"
  213. },
  214. {
  215. "type": "object",
  216. "properties": {
  217. "data": {
  218. "type": "number"
  219. }
  220. }
  221. }
  222. ]
  223. }
  224. }
  225. }
  226. }
  227. },
  228. "/api/channel/{id}/models": {
  229. "get": {
  230. "security": [
  231. {
  232. "ApiKeyAuth": []
  233. }
  234. ],
  235. "description": "Tests all models in the channel",
  236. "produces": [
  237. "application/json"
  238. ],
  239. "tags": [
  240. "channel"
  241. ],
  242. "summary": "Test channel models",
  243. "parameters": [
  244. {
  245. "type": "integer",
  246. "description": "Channel ID",
  247. "name": "id",
  248. "in": "path",
  249. "required": true
  250. },
  251. {
  252. "type": "boolean",
  253. "description": "Return success",
  254. "name": "return_success",
  255. "in": "query"
  256. },
  257. {
  258. "type": "boolean",
  259. "description": "Success body",
  260. "name": "success_body",
  261. "in": "query"
  262. },
  263. {
  264. "type": "boolean",
  265. "description": "Stream",
  266. "name": "stream",
  267. "in": "query"
  268. }
  269. ],
  270. "responses": {
  271. "200": {
  272. "description": "OK",
  273. "schema": {
  274. "allOf": [
  275. {
  276. "$ref": "#/definitions/middleware.APIResponse"
  277. },
  278. {
  279. "type": "object",
  280. "properties": {
  281. "data": {
  282. "type": "array",
  283. "items": {
  284. "$ref": "#/definitions/controller.TestResult"
  285. }
  286. }
  287. }
  288. }
  289. ]
  290. }
  291. }
  292. }
  293. }
  294. },
  295. "/api/channel/{id}/status": {
  296. "post": {
  297. "security": [
  298. {
  299. "ApiKeyAuth": []
  300. }
  301. ],
  302. "description": "Updates the status of a channel by its ID",
  303. "consumes": [
  304. "application/json"
  305. ],
  306. "produces": [
  307. "application/json"
  308. ],
  309. "tags": [
  310. "channel"
  311. ],
  312. "summary": "Update channel status",
  313. "parameters": [
  314. {
  315. "type": "integer",
  316. "description": "Channel ID",
  317. "name": "id",
  318. "in": "path",
  319. "required": true
  320. },
  321. {
  322. "description": "Status information",
  323. "name": "status",
  324. "in": "body",
  325. "required": true,
  326. "schema": {
  327. "$ref": "#/definitions/controller.UpdateChannelStatusRequest"
  328. }
  329. }
  330. ],
  331. "responses": {
  332. "200": {
  333. "description": "OK",
  334. "schema": {
  335. "$ref": "#/definitions/middleware.APIResponse"
  336. }
  337. }
  338. }
  339. }
  340. },
  341. "/api/channel/{id}/{model}": {
  342. "get": {
  343. "security": [
  344. {
  345. "ApiKeyAuth": []
  346. }
  347. ],
  348. "description": "Tests a single model in the channel",
  349. "produces": [
  350. "application/json"
  351. ],
  352. "tags": [
  353. "channel"
  354. ],
  355. "summary": "Test channel model",
  356. "parameters": [
  357. {
  358. "type": "integer",
  359. "description": "Channel ID",
  360. "name": "id",
  361. "in": "path",
  362. "required": true
  363. },
  364. {
  365. "type": "string",
  366. "description": "Model name",
  367. "name": "model",
  368. "in": "path",
  369. "required": true
  370. }
  371. ],
  372. "responses": {
  373. "200": {
  374. "description": "OK",
  375. "schema": {
  376. "allOf": [
  377. {
  378. "$ref": "#/definitions/middleware.APIResponse"
  379. },
  380. {
  381. "type": "object",
  382. "properties": {
  383. "data": {
  384. "$ref": "#/definitions/model.ChannelTest"
  385. }
  386. }
  387. }
  388. ]
  389. }
  390. }
  391. }
  392. }
  393. },
  394. "/api/channels": {
  395. "get": {
  396. "security": [
  397. {
  398. "ApiKeyAuth": []
  399. }
  400. ],
  401. "description": "Returns a paginated list of channels with optional filters",
  402. "produces": [
  403. "application/json"
  404. ],
  405. "tags": [
  406. "channels"
  407. ],
  408. "summary": "Get channels with pagination",
  409. "parameters": [
  410. {
  411. "type": "integer",
  412. "description": "Page number",
  413. "name": "page",
  414. "in": "query"
  415. },
  416. {
  417. "type": "integer",
  418. "description": "Items per page",
  419. "name": "per_page",
  420. "in": "query"
  421. },
  422. {
  423. "type": "integer",
  424. "description": "Filter by id",
  425. "name": "id",
  426. "in": "query"
  427. },
  428. {
  429. "type": "string",
  430. "description": "Filter by name",
  431. "name": "name",
  432. "in": "query"
  433. },
  434. {
  435. "type": "string",
  436. "description": "Filter by key",
  437. "name": "key",
  438. "in": "query"
  439. },
  440. {
  441. "type": "integer",
  442. "description": "Filter by channel type",
  443. "name": "channel_type",
  444. "in": "query"
  445. },
  446. {
  447. "type": "string",
  448. "description": "Filter by base URL",
  449. "name": "base_url",
  450. "in": "query"
  451. },
  452. {
  453. "type": "string",
  454. "description": "Order by field",
  455. "name": "order",
  456. "in": "query"
  457. }
  458. ],
  459. "responses": {
  460. "200": {
  461. "description": "OK",
  462. "schema": {
  463. "allOf": [
  464. {
  465. "$ref": "#/definitions/middleware.APIResponse"
  466. },
  467. {
  468. "type": "object",
  469. "properties": {
  470. "data": {
  471. "type": "object",
  472. "additionalProperties": {
  473. "allOf": [
  474. {},
  475. {
  476. "type": "object",
  477. "properties": {
  478. "channels": {
  479. "type": "array",
  480. "items": {
  481. "$ref": "#/definitions/model.Channel"
  482. }
  483. },
  484. "total": {
  485. "type": "integer"
  486. }
  487. }
  488. }
  489. ]
  490. }
  491. }
  492. }
  493. }
  494. ]
  495. }
  496. }
  497. }
  498. },
  499. "post": {
  500. "security": [
  501. {
  502. "ApiKeyAuth": []
  503. }
  504. ],
  505. "description": "Adds multiple channels in a batch operation",
  506. "consumes": [
  507. "application/json"
  508. ],
  509. "produces": [
  510. "application/json"
  511. ],
  512. "tags": [
  513. "channels"
  514. ],
  515. "summary": "Add multiple channels",
  516. "parameters": [
  517. {
  518. "description": "Channel information",
  519. "name": "channels",
  520. "in": "body",
  521. "required": true,
  522. "schema": {
  523. "type": "array",
  524. "items": {
  525. "$ref": "#/definitions/controller.AddChannelRequest"
  526. }
  527. }
  528. }
  529. ],
  530. "responses": {
  531. "200": {
  532. "description": "OK",
  533. "schema": {
  534. "$ref": "#/definitions/middleware.APIResponse"
  535. }
  536. }
  537. }
  538. }
  539. },
  540. "/api/channels/all": {
  541. "get": {
  542. "security": [
  543. {
  544. "ApiKeyAuth": []
  545. }
  546. ],
  547. "description": "Returns a list of all channels without pagination",
  548. "produces": [
  549. "application/json"
  550. ],
  551. "tags": [
  552. "channels"
  553. ],
  554. "summary": "Get all channels",
  555. "responses": {
  556. "200": {
  557. "description": "OK",
  558. "schema": {
  559. "allOf": [
  560. {
  561. "$ref": "#/definitions/middleware.APIResponse"
  562. },
  563. {
  564. "type": "object",
  565. "properties": {
  566. "data": {
  567. "type": "array",
  568. "items": {
  569. "$ref": "#/definitions/model.Channel"
  570. }
  571. }
  572. }
  573. }
  574. ]
  575. }
  576. }
  577. }
  578. }
  579. },
  580. "/api/channels/balance": {
  581. "get": {
  582. "security": [
  583. {
  584. "ApiKeyAuth": []
  585. }
  586. ],
  587. "description": "Updates the balance for all channels",
  588. "produces": [
  589. "application/json"
  590. ],
  591. "tags": [
  592. "channel"
  593. ],
  594. "summary": "Update all channels balance",
  595. "responses": {
  596. "200": {
  597. "description": "OK",
  598. "schema": {
  599. "$ref": "#/definitions/middleware.APIResponse"
  600. }
  601. }
  602. }
  603. }
  604. },
  605. "/api/channels/batch_delete": {
  606. "post": {
  607. "security": [
  608. {
  609. "ApiKeyAuth": []
  610. }
  611. ],
  612. "description": "Deletes multiple channels by their IDs",
  613. "consumes": [
  614. "application/json"
  615. ],
  616. "produces": [
  617. "application/json"
  618. ],
  619. "tags": [
  620. "channels"
  621. ],
  622. "summary": "Delete multiple channels",
  623. "parameters": [
  624. {
  625. "description": "Channel IDs",
  626. "name": "ids",
  627. "in": "body",
  628. "required": true,
  629. "schema": {
  630. "type": "array",
  631. "items": {
  632. "type": "integer"
  633. }
  634. }
  635. }
  636. ],
  637. "responses": {
  638. "200": {
  639. "description": "OK",
  640. "schema": {
  641. "$ref": "#/definitions/middleware.APIResponse"
  642. }
  643. }
  644. }
  645. }
  646. },
  647. "/api/channels/import/oneapi": {
  648. "post": {
  649. "security": [
  650. {
  651. "ApiKeyAuth": []
  652. }
  653. ],
  654. "description": "Imports channels from OneAPI",
  655. "produces": [
  656. "application/json"
  657. ],
  658. "tags": [
  659. "channels"
  660. ],
  661. "summary": "Import channel from OneAPI",
  662. "parameters": [
  663. {
  664. "description": "Import channel from OneAPI request",
  665. "name": "request",
  666. "in": "body",
  667. "required": true,
  668. "schema": {
  669. "$ref": "#/definitions/controller.ImportChannelFromOneAPIRequest"
  670. }
  671. }
  672. ],
  673. "responses": {
  674. "200": {
  675. "description": "OK",
  676. "schema": {
  677. "allOf": [
  678. {
  679. "$ref": "#/definitions/middleware.APIResponse"
  680. },
  681. {
  682. "type": "object",
  683. "properties": {
  684. "data": {
  685. "type": "array",
  686. "items": {}
  687. }
  688. }
  689. }
  690. ]
  691. }
  692. }
  693. }
  694. }
  695. },
  696. "/api/channels/search": {
  697. "get": {
  698. "security": [
  699. {
  700. "ApiKeyAuth": []
  701. }
  702. ],
  703. "description": "Search channels with keyword and optional filters",
  704. "produces": [
  705. "application/json"
  706. ],
  707. "tags": [
  708. "channels"
  709. ],
  710. "summary": "Search channels",
  711. "parameters": [
  712. {
  713. "type": "string",
  714. "description": "Search keyword",
  715. "name": "keyword",
  716. "in": "query",
  717. "required": true
  718. },
  719. {
  720. "type": "integer",
  721. "description": "Page number",
  722. "name": "page",
  723. "in": "query"
  724. },
  725. {
  726. "type": "integer",
  727. "description": "Items per page",
  728. "name": "per_page",
  729. "in": "query"
  730. },
  731. {
  732. "type": "integer",
  733. "description": "Filter by id",
  734. "name": "id",
  735. "in": "query"
  736. },
  737. {
  738. "type": "string",
  739. "description": "Filter by name",
  740. "name": "name",
  741. "in": "query"
  742. },
  743. {
  744. "type": "string",
  745. "description": "Filter by key",
  746. "name": "key",
  747. "in": "query"
  748. },
  749. {
  750. "type": "integer",
  751. "description": "Filter by channel type",
  752. "name": "channel_type",
  753. "in": "query"
  754. },
  755. {
  756. "type": "string",
  757. "description": "Filter by base URL",
  758. "name": "base_url",
  759. "in": "query"
  760. },
  761. {
  762. "type": "string",
  763. "description": "Order by field",
  764. "name": "order",
  765. "in": "query"
  766. }
  767. ],
  768. "responses": {
  769. "200": {
  770. "description": "OK",
  771. "schema": {
  772. "allOf": [
  773. {
  774. "$ref": "#/definitions/middleware.APIResponse"
  775. },
  776. {
  777. "type": "object",
  778. "properties": {
  779. "data": {
  780. "type": "object",
  781. "additionalProperties": {
  782. "allOf": [
  783. {},
  784. {
  785. "type": "object",
  786. "properties": {
  787. "channels": {
  788. "type": "array",
  789. "items": {
  790. "$ref": "#/definitions/model.Channel"
  791. }
  792. },
  793. "total": {
  794. "type": "integer"
  795. }
  796. }
  797. }
  798. ]
  799. }
  800. }
  801. }
  802. }
  803. ]
  804. }
  805. }
  806. }
  807. }
  808. },
  809. "/api/channels/test": {
  810. "get": {
  811. "security": [
  812. {
  813. "ApiKeyAuth": []
  814. }
  815. ],
  816. "description": "Tests all channels",
  817. "produces": [
  818. "application/json"
  819. ],
  820. "tags": [
  821. "channel"
  822. ],
  823. "summary": "Test all channels",
  824. "parameters": [
  825. {
  826. "type": "boolean",
  827. "description": "Test disabled",
  828. "name": "test_disabled",
  829. "in": "query"
  830. },
  831. {
  832. "type": "boolean",
  833. "description": "Return success",
  834. "name": "return_success",
  835. "in": "query"
  836. },
  837. {
  838. "type": "boolean",
  839. "description": "Success body",
  840. "name": "success_body",
  841. "in": "query"
  842. },
  843. {
  844. "type": "boolean",
  845. "description": "Stream",
  846. "name": "stream",
  847. "in": "query"
  848. }
  849. ],
  850. "responses": {
  851. "200": {
  852. "description": "OK",
  853. "schema": {
  854. "allOf": [
  855. {
  856. "$ref": "#/definitions/middleware.APIResponse"
  857. },
  858. {
  859. "type": "object",
  860. "properties": {
  861. "data": {
  862. "type": "array",
  863. "items": {
  864. "$ref": "#/definitions/controller.TestResult"
  865. }
  866. }
  867. }
  868. }
  869. ]
  870. }
  871. }
  872. }
  873. }
  874. },
  875. "/api/channels/type_metas": {
  876. "get": {
  877. "security": [
  878. {
  879. "ApiKeyAuth": []
  880. }
  881. ],
  882. "description": "Returns metadata for all channel types",
  883. "produces": [
  884. "application/json"
  885. ],
  886. "tags": [
  887. "channels"
  888. ],
  889. "summary": "Get channel type metadata",
  890. "responses": {
  891. "200": {
  892. "description": "OK",
  893. "schema": {
  894. "allOf": [
  895. {
  896. "$ref": "#/definitions/middleware.APIResponse"
  897. },
  898. {
  899. "type": "object",
  900. "properties": {
  901. "data": {
  902. "type": "object",
  903. "additionalProperties": {
  904. "$ref": "#/definitions/channeltype.AdaptorMeta"
  905. }
  906. }
  907. }
  908. }
  909. ]
  910. }
  911. }
  912. }
  913. }
  914. },
  915. "/api/dashboard": {
  916. "get": {
  917. "security": [
  918. {
  919. "ApiKeyAuth": []
  920. }
  921. ],
  922. "description": "Returns the general dashboard data including usage statistics and metrics",
  923. "produces": [
  924. "application/json"
  925. ],
  926. "tags": [
  927. "dashboard"
  928. ],
  929. "summary": "Get dashboard data",
  930. "parameters": [
  931. {
  932. "type": "string",
  933. "description": "Group or *",
  934. "name": "group",
  935. "in": "query"
  936. },
  937. {
  938. "type": "integer",
  939. "description": "Channel ID",
  940. "name": "channel",
  941. "in": "query"
  942. },
  943. {
  944. "type": "string",
  945. "description": "Type of time span (day, week, month, two_week)",
  946. "name": "type",
  947. "in": "query"
  948. },
  949. {
  950. "type": "string",
  951. "description": "Model name",
  952. "name": "model",
  953. "in": "query"
  954. },
  955. {
  956. "type": "integer",
  957. "description": "Start second timestamp",
  958. "name": "start_timestamp",
  959. "in": "query"
  960. },
  961. {
  962. "type": "integer",
  963. "description": "End second timestamp",
  964. "name": "end_timestamp",
  965. "in": "query"
  966. },
  967. {
  968. "type": "string",
  969. "description": "Timezone, default is Local",
  970. "name": "timezone",
  971. "in": "query"
  972. }
  973. ],
  974. "responses": {
  975. "200": {
  976. "description": "OK",
  977. "schema": {
  978. "allOf": [
  979. {
  980. "$ref": "#/definitions/middleware.APIResponse"
  981. },
  982. {
  983. "type": "object",
  984. "properties": {
  985. "data": {
  986. "$ref": "#/definitions/model.DashboardResponse"
  987. }
  988. }
  989. }
  990. ]
  991. }
  992. }
  993. }
  994. }
  995. },
  996. "/api/dashboard/{group}": {
  997. "get": {
  998. "security": [
  999. {
  1000. "ApiKeyAuth": []
  1001. }
  1002. ],
  1003. "description": "Returns dashboard data and metrics specific to the given group",
  1004. "produces": [
  1005. "application/json"
  1006. ],
  1007. "tags": [
  1008. "dashboard"
  1009. ],
  1010. "summary": "Get dashboard data for a specific group",
  1011. "parameters": [
  1012. {
  1013. "type": "string",
  1014. "description": "Group",
  1015. "name": "group",
  1016. "in": "path",
  1017. "required": true
  1018. },
  1019. {
  1020. "type": "string",
  1021. "description": "Type of time span (day, week, month, two_week)",
  1022. "name": "type",
  1023. "in": "query"
  1024. },
  1025. {
  1026. "type": "string",
  1027. "description": "Token name",
  1028. "name": "token_name",
  1029. "in": "query"
  1030. },
  1031. {
  1032. "type": "string",
  1033. "description": "Model or *",
  1034. "name": "model",
  1035. "in": "query"
  1036. },
  1037. {
  1038. "type": "integer",
  1039. "description": "Start second timestamp",
  1040. "name": "start_timestamp",
  1041. "in": "query"
  1042. },
  1043. {
  1044. "type": "integer",
  1045. "description": "End second timestamp",
  1046. "name": "end_timestamp",
  1047. "in": "query"
  1048. },
  1049. {
  1050. "type": "string",
  1051. "description": "Timezone, default is Local",
  1052. "name": "timezone",
  1053. "in": "query"
  1054. }
  1055. ],
  1056. "responses": {
  1057. "200": {
  1058. "description": "OK",
  1059. "schema": {
  1060. "allOf": [
  1061. {
  1062. "$ref": "#/definitions/middleware.APIResponse"
  1063. },
  1064. {
  1065. "type": "object",
  1066. "properties": {
  1067. "data": {
  1068. "$ref": "#/definitions/model.GroupDashboardResponse"
  1069. }
  1070. }
  1071. }
  1072. ]
  1073. }
  1074. }
  1075. }
  1076. }
  1077. },
  1078. "/api/dashboard/{group}/models": {
  1079. "get": {
  1080. "security": [
  1081. {
  1082. "ApiKeyAuth": []
  1083. }
  1084. ],
  1085. "description": "Returns model-specific metrics and usage data for the given group",
  1086. "produces": [
  1087. "application/json"
  1088. ],
  1089. "tags": [
  1090. "dashboard"
  1091. ],
  1092. "summary": "Get model usage data for a specific group",
  1093. "parameters": [
  1094. {
  1095. "type": "string",
  1096. "description": "Group",
  1097. "name": "group",
  1098. "in": "path",
  1099. "required": true
  1100. }
  1101. ],
  1102. "responses": {
  1103. "200": {
  1104. "description": "OK",
  1105. "schema": {
  1106. "allOf": [
  1107. {
  1108. "$ref": "#/definitions/middleware.APIResponse"
  1109. },
  1110. {
  1111. "type": "object",
  1112. "properties": {
  1113. "data": {
  1114. "type": "array",
  1115. "items": {
  1116. "$ref": "#/definitions/model.ModelConfig"
  1117. }
  1118. }
  1119. }
  1120. }
  1121. ]
  1122. }
  1123. }
  1124. }
  1125. }
  1126. },
  1127. "/api/group/{group}": {
  1128. "get": {
  1129. "security": [
  1130. {
  1131. "ApiKeyAuth": []
  1132. }
  1133. ],
  1134. "description": "Returns detailed information about a specific group",
  1135. "produces": [
  1136. "application/json"
  1137. ],
  1138. "tags": [
  1139. "group"
  1140. ],
  1141. "summary": "Get a group",
  1142. "parameters": [
  1143. {
  1144. "type": "string",
  1145. "description": "Group name",
  1146. "name": "group",
  1147. "in": "path",
  1148. "required": true
  1149. }
  1150. ],
  1151. "responses": {
  1152. "200": {
  1153. "description": "OK",
  1154. "schema": {
  1155. "allOf": [
  1156. {
  1157. "$ref": "#/definitions/middleware.APIResponse"
  1158. },
  1159. {
  1160. "type": "object",
  1161. "properties": {
  1162. "data": {
  1163. "$ref": "#/definitions/controller.GroupResponse"
  1164. }
  1165. }
  1166. }
  1167. ]
  1168. }
  1169. }
  1170. }
  1171. },
  1172. "put": {
  1173. "security": [
  1174. {
  1175. "ApiKeyAuth": []
  1176. }
  1177. ],
  1178. "description": "Updates an existing group with the given information",
  1179. "consumes": [
  1180. "application/json"
  1181. ],
  1182. "produces": [
  1183. "application/json"
  1184. ],
  1185. "tags": [
  1186. "group"
  1187. ],
  1188. "summary": "Update a group",
  1189. "parameters": [
  1190. {
  1191. "type": "string",
  1192. "description": "Group name",
  1193. "name": "group",
  1194. "in": "path",
  1195. "required": true
  1196. },
  1197. {
  1198. "description": "Updated group information",
  1199. "name": "data",
  1200. "in": "body",
  1201. "required": true,
  1202. "schema": {
  1203. "$ref": "#/definitions/controller.CreateGroupRequest"
  1204. }
  1205. }
  1206. ],
  1207. "responses": {
  1208. "200": {
  1209. "description": "OK",
  1210. "schema": {
  1211. "allOf": [
  1212. {
  1213. "$ref": "#/definitions/middleware.APIResponse"
  1214. },
  1215. {
  1216. "type": "object",
  1217. "properties": {
  1218. "data": {
  1219. "$ref": "#/definitions/model.Group"
  1220. }
  1221. }
  1222. }
  1223. ]
  1224. }
  1225. }
  1226. }
  1227. },
  1228. "post": {
  1229. "security": [
  1230. {
  1231. "ApiKeyAuth": []
  1232. }
  1233. ],
  1234. "description": "Creates a new group with the given information",
  1235. "consumes": [
  1236. "application/json"
  1237. ],
  1238. "produces": [
  1239. "application/json"
  1240. ],
  1241. "tags": [
  1242. "group"
  1243. ],
  1244. "summary": "Create a new group",
  1245. "parameters": [
  1246. {
  1247. "type": "string",
  1248. "description": "Group name",
  1249. "name": "group",
  1250. "in": "path",
  1251. "required": true
  1252. },
  1253. {
  1254. "description": "Group information",
  1255. "name": "data",
  1256. "in": "body",
  1257. "required": true,
  1258. "schema": {
  1259. "$ref": "#/definitions/controller.CreateGroupRequest"
  1260. }
  1261. }
  1262. ],
  1263. "responses": {
  1264. "200": {
  1265. "description": "OK",
  1266. "schema": {
  1267. "allOf": [
  1268. {
  1269. "$ref": "#/definitions/middleware.APIResponse"
  1270. },
  1271. {
  1272. "type": "object",
  1273. "properties": {
  1274. "data": {
  1275. "$ref": "#/definitions/model.Group"
  1276. }
  1277. }
  1278. }
  1279. ]
  1280. }
  1281. }
  1282. }
  1283. },
  1284. "delete": {
  1285. "security": [
  1286. {
  1287. "ApiKeyAuth": []
  1288. }
  1289. ],
  1290. "description": "Deletes a group by its name",
  1291. "produces": [
  1292. "application/json"
  1293. ],
  1294. "tags": [
  1295. "group"
  1296. ],
  1297. "summary": "Delete a group",
  1298. "parameters": [
  1299. {
  1300. "type": "string",
  1301. "description": "Group name",
  1302. "name": "group",
  1303. "in": "path",
  1304. "required": true
  1305. }
  1306. ],
  1307. "responses": {
  1308. "200": {
  1309. "description": "OK",
  1310. "schema": {
  1311. "$ref": "#/definitions/middleware.APIResponse"
  1312. }
  1313. }
  1314. }
  1315. }
  1316. },
  1317. "/api/group/{group}/model_config/{model}": {
  1318. "get": {
  1319. "security": [
  1320. {
  1321. "ApiKeyAuth": []
  1322. }
  1323. ],
  1324. "description": "Get group model config",
  1325. "produces": [
  1326. "application/json"
  1327. ],
  1328. "tags": [
  1329. "group"
  1330. ],
  1331. "summary": "Get group model config",
  1332. "parameters": [
  1333. {
  1334. "type": "string",
  1335. "description": "Group name",
  1336. "name": "group",
  1337. "in": "path",
  1338. "required": true
  1339. },
  1340. {
  1341. "type": "string",
  1342. "description": "Model name",
  1343. "name": "model",
  1344. "in": "path",
  1345. "required": true
  1346. }
  1347. ],
  1348. "responses": {
  1349. "200": {
  1350. "description": "OK",
  1351. "schema": {
  1352. "allOf": [
  1353. {
  1354. "$ref": "#/definitions/middleware.APIResponse"
  1355. },
  1356. {
  1357. "type": "object",
  1358. "properties": {
  1359. "data": {
  1360. "$ref": "#/definitions/model.GroupModelConfig"
  1361. }
  1362. }
  1363. }
  1364. ]
  1365. }
  1366. }
  1367. }
  1368. },
  1369. "put": {
  1370. "security": [
  1371. {
  1372. "ApiKeyAuth": []
  1373. }
  1374. ],
  1375. "description": "Update group model config",
  1376. "consumes": [
  1377. "application/json"
  1378. ],
  1379. "produces": [
  1380. "application/json"
  1381. ],
  1382. "tags": [
  1383. "group"
  1384. ],
  1385. "summary": "Update group model config",
  1386. "parameters": [
  1387. {
  1388. "type": "string",
  1389. "description": "Group name",
  1390. "name": "group",
  1391. "in": "path",
  1392. "required": true
  1393. },
  1394. {
  1395. "type": "string",
  1396. "description": "Model name",
  1397. "name": "model",
  1398. "in": "path",
  1399. "required": true
  1400. },
  1401. {
  1402. "description": "Group model config information",
  1403. "name": "data",
  1404. "in": "body",
  1405. "required": true,
  1406. "schema": {
  1407. "$ref": "#/definitions/controller.SaveGroupModelConfigRequest"
  1408. }
  1409. }
  1410. ],
  1411. "responses": {
  1412. "200": {
  1413. "description": "OK",
  1414. "schema": {
  1415. "$ref": "#/definitions/middleware.APIResponse"
  1416. }
  1417. }
  1418. }
  1419. },
  1420. "post": {
  1421. "security": [
  1422. {
  1423. "ApiKeyAuth": []
  1424. }
  1425. ],
  1426. "description": "Save group model config",
  1427. "consumes": [
  1428. "application/json"
  1429. ],
  1430. "produces": [
  1431. "application/json"
  1432. ],
  1433. "tags": [
  1434. "group"
  1435. ],
  1436. "summary": "Save group model config",
  1437. "parameters": [
  1438. {
  1439. "type": "string",
  1440. "description": "Group name",
  1441. "name": "group",
  1442. "in": "path",
  1443. "required": true
  1444. },
  1445. {
  1446. "description": "Group model config information",
  1447. "name": "data",
  1448. "in": "body",
  1449. "required": true,
  1450. "schema": {
  1451. "$ref": "#/definitions/controller.SaveGroupModelConfigRequest"
  1452. }
  1453. }
  1454. ],
  1455. "responses": {
  1456. "200": {
  1457. "description": "OK",
  1458. "schema": {
  1459. "$ref": "#/definitions/middleware.APIResponse"
  1460. }
  1461. }
  1462. }
  1463. },
  1464. "delete": {
  1465. "security": [
  1466. {
  1467. "ApiKeyAuth": []
  1468. }
  1469. ],
  1470. "description": "Delete group model config",
  1471. "produces": [
  1472. "application/json"
  1473. ],
  1474. "tags": [
  1475. "group"
  1476. ],
  1477. "summary": "Delete group model config",
  1478. "parameters": [
  1479. {
  1480. "type": "string",
  1481. "description": "Group name",
  1482. "name": "group",
  1483. "in": "path",
  1484. "required": true
  1485. },
  1486. {
  1487. "type": "string",
  1488. "description": "Model name",
  1489. "name": "model",
  1490. "in": "path",
  1491. "required": true
  1492. }
  1493. ],
  1494. "responses": {
  1495. "200": {
  1496. "description": "OK",
  1497. "schema": {
  1498. "$ref": "#/definitions/middleware.APIResponse"
  1499. }
  1500. }
  1501. }
  1502. }
  1503. },
  1504. "/api/group/{group}/model_configs/": {
  1505. "get": {
  1506. "security": [
  1507. {
  1508. "ApiKeyAuth": []
  1509. }
  1510. ],
  1511. "description": "Get group model configs",
  1512. "produces": [
  1513. "application/json"
  1514. ],
  1515. "tags": [
  1516. "group"
  1517. ],
  1518. "summary": "Get group model configs",
  1519. "parameters": [
  1520. {
  1521. "type": "string",
  1522. "description": "Group name",
  1523. "name": "group",
  1524. "in": "path",
  1525. "required": true
  1526. }
  1527. ],
  1528. "responses": {
  1529. "200": {
  1530. "description": "OK",
  1531. "schema": {
  1532. "allOf": [
  1533. {
  1534. "$ref": "#/definitions/middleware.APIResponse"
  1535. },
  1536. {
  1537. "type": "object",
  1538. "properties": {
  1539. "data": {
  1540. "type": "array",
  1541. "items": {
  1542. "$ref": "#/definitions/model.GroupModelConfig"
  1543. }
  1544. }
  1545. }
  1546. }
  1547. ]
  1548. }
  1549. }
  1550. }
  1551. },
  1552. "put": {
  1553. "security": [
  1554. {
  1555. "ApiKeyAuth": []
  1556. }
  1557. ],
  1558. "description": "Update group model configs",
  1559. "consumes": [
  1560. "application/json"
  1561. ],
  1562. "produces": [
  1563. "application/json"
  1564. ],
  1565. "tags": [
  1566. "group"
  1567. ],
  1568. "summary": "Update group model configs",
  1569. "parameters": [
  1570. {
  1571. "type": "string",
  1572. "description": "Group name",
  1573. "name": "group",
  1574. "in": "path",
  1575. "required": true
  1576. },
  1577. {
  1578. "description": "Group model config information",
  1579. "name": "data",
  1580. "in": "body",
  1581. "required": true,
  1582. "schema": {
  1583. "type": "array",
  1584. "items": {
  1585. "$ref": "#/definitions/controller.SaveGroupModelConfigRequest"
  1586. }
  1587. }
  1588. }
  1589. ],
  1590. "responses": {
  1591. "200": {
  1592. "description": "OK",
  1593. "schema": {
  1594. "$ref": "#/definitions/middleware.APIResponse"
  1595. }
  1596. }
  1597. }
  1598. },
  1599. "post": {
  1600. "security": [
  1601. {
  1602. "ApiKeyAuth": []
  1603. }
  1604. ],
  1605. "description": "Save group model configs",
  1606. "consumes": [
  1607. "application/json"
  1608. ],
  1609. "produces": [
  1610. "application/json"
  1611. ],
  1612. "tags": [
  1613. "group"
  1614. ],
  1615. "summary": "Save group model configs",
  1616. "parameters": [
  1617. {
  1618. "type": "string",
  1619. "description": "Group name",
  1620. "name": "group",
  1621. "in": "path",
  1622. "required": true
  1623. },
  1624. {
  1625. "description": "Group model config information",
  1626. "name": "data",
  1627. "in": "body",
  1628. "required": true,
  1629. "schema": {
  1630. "type": "array",
  1631. "items": {
  1632. "$ref": "#/definitions/controller.SaveGroupModelConfigRequest"
  1633. }
  1634. }
  1635. }
  1636. ],
  1637. "responses": {
  1638. "200": {
  1639. "description": "OK",
  1640. "schema": {
  1641. "$ref": "#/definitions/middleware.APIResponse"
  1642. }
  1643. }
  1644. }
  1645. },
  1646. "delete": {
  1647. "security": [
  1648. {
  1649. "ApiKeyAuth": []
  1650. }
  1651. ],
  1652. "description": "Delete group model configs",
  1653. "produces": [
  1654. "application/json"
  1655. ],
  1656. "tags": [
  1657. "group"
  1658. ],
  1659. "summary": "Delete group model configs",
  1660. "parameters": [
  1661. {
  1662. "type": "string",
  1663. "description": "Group name",
  1664. "name": "group",
  1665. "in": "path",
  1666. "required": true
  1667. },
  1668. {
  1669. "description": "Model names",
  1670. "name": "models",
  1671. "in": "body",
  1672. "required": true,
  1673. "schema": {
  1674. "type": "array",
  1675. "items": {
  1676. "type": "string"
  1677. }
  1678. }
  1679. }
  1680. ],
  1681. "responses": {
  1682. "200": {
  1683. "description": "OK",
  1684. "schema": {
  1685. "$ref": "#/definitions/middleware.APIResponse"
  1686. }
  1687. }
  1688. }
  1689. }
  1690. },
  1691. "/api/group/{group}/rpm_ratio": {
  1692. "post": {
  1693. "security": [
  1694. {
  1695. "ApiKeyAuth": []
  1696. }
  1697. ],
  1698. "description": "Updates the RPM (Requests Per Minute) ratio for a group",
  1699. "consumes": [
  1700. "application/json"
  1701. ],
  1702. "produces": [
  1703. "application/json"
  1704. ],
  1705. "tags": [
  1706. "group"
  1707. ],
  1708. "summary": "Update group RPM ratio",
  1709. "parameters": [
  1710. {
  1711. "type": "string",
  1712. "description": "Group name",
  1713. "name": "group",
  1714. "in": "path",
  1715. "required": true
  1716. },
  1717. {
  1718. "description": "RPM ratio information",
  1719. "name": "data",
  1720. "in": "body",
  1721. "required": true,
  1722. "schema": {
  1723. "$ref": "#/definitions/controller.UpdateGroupRPMRatioRequest"
  1724. }
  1725. }
  1726. ],
  1727. "responses": {
  1728. "200": {
  1729. "description": "OK",
  1730. "schema": {
  1731. "$ref": "#/definitions/middleware.APIResponse"
  1732. }
  1733. }
  1734. }
  1735. }
  1736. },
  1737. "/api/group/{group}/status": {
  1738. "post": {
  1739. "security": [
  1740. {
  1741. "ApiKeyAuth": []
  1742. }
  1743. ],
  1744. "description": "Updates the status of a group",
  1745. "consumes": [
  1746. "application/json"
  1747. ],
  1748. "produces": [
  1749. "application/json"
  1750. ],
  1751. "tags": [
  1752. "group"
  1753. ],
  1754. "summary": "Update group status",
  1755. "parameters": [
  1756. {
  1757. "type": "string",
  1758. "description": "Group name",
  1759. "name": "group",
  1760. "in": "path",
  1761. "required": true
  1762. },
  1763. {
  1764. "description": "Status information",
  1765. "name": "status",
  1766. "in": "body",
  1767. "required": true,
  1768. "schema": {
  1769. "$ref": "#/definitions/controller.UpdateGroupStatusRequest"
  1770. }
  1771. }
  1772. ],
  1773. "responses": {
  1774. "200": {
  1775. "description": "OK",
  1776. "schema": {
  1777. "$ref": "#/definitions/middleware.APIResponse"
  1778. }
  1779. }
  1780. }
  1781. }
  1782. },
  1783. "/api/group/{group}/tpm_ratio": {
  1784. "post": {
  1785. "security": [
  1786. {
  1787. "ApiKeyAuth": []
  1788. }
  1789. ],
  1790. "description": "Updates the TPM (Tokens Per Minute) ratio for a group",
  1791. "consumes": [
  1792. "application/json"
  1793. ],
  1794. "produces": [
  1795. "application/json"
  1796. ],
  1797. "tags": [
  1798. "group"
  1799. ],
  1800. "summary": "Update group TPM ratio",
  1801. "parameters": [
  1802. {
  1803. "type": "string",
  1804. "description": "Group name",
  1805. "name": "group",
  1806. "in": "path",
  1807. "required": true
  1808. },
  1809. {
  1810. "description": "TPM ratio information",
  1811. "name": "data",
  1812. "in": "body",
  1813. "required": true,
  1814. "schema": {
  1815. "$ref": "#/definitions/controller.UpdateGroupTPMRatioRequest"
  1816. }
  1817. }
  1818. ],
  1819. "responses": {
  1820. "200": {
  1821. "description": "OK",
  1822. "schema": {
  1823. "$ref": "#/definitions/middleware.APIResponse"
  1824. }
  1825. }
  1826. }
  1827. }
  1828. },
  1829. "/api/groups": {
  1830. "get": {
  1831. "security": [
  1832. {
  1833. "ApiKeyAuth": []
  1834. }
  1835. ],
  1836. "description": "Returns a list of all groups with pagination",
  1837. "produces": [
  1838. "application/json"
  1839. ],
  1840. "tags": [
  1841. "groups"
  1842. ],
  1843. "summary": "Get all groups",
  1844. "parameters": [
  1845. {
  1846. "type": "integer",
  1847. "description": "Page number",
  1848. "name": "page",
  1849. "in": "query"
  1850. },
  1851. {
  1852. "type": "integer",
  1853. "description": "Items per page",
  1854. "name": "per_page",
  1855. "in": "query"
  1856. }
  1857. ],
  1858. "responses": {
  1859. "200": {
  1860. "description": "OK",
  1861. "schema": {
  1862. "allOf": [
  1863. {
  1864. "$ref": "#/definitions/middleware.APIResponse"
  1865. },
  1866. {
  1867. "type": "object",
  1868. "properties": {
  1869. "data": {
  1870. "type": "object",
  1871. "additionalProperties": {
  1872. "allOf": [
  1873. {},
  1874. {
  1875. "type": "object",
  1876. "properties": {
  1877. "groups": {
  1878. "type": "array",
  1879. "items": {
  1880. "$ref": "#/definitions/controller.GroupResponse"
  1881. }
  1882. },
  1883. "total": {
  1884. "type": "integer"
  1885. }
  1886. }
  1887. }
  1888. ]
  1889. }
  1890. }
  1891. }
  1892. }
  1893. ]
  1894. }
  1895. }
  1896. }
  1897. }
  1898. },
  1899. "/api/groups/batch_delete": {
  1900. "post": {
  1901. "security": [
  1902. {
  1903. "ApiKeyAuth": []
  1904. }
  1905. ],
  1906. "description": "Deletes multiple groups by their IDs",
  1907. "consumes": [
  1908. "application/json"
  1909. ],
  1910. "produces": [
  1911. "application/json"
  1912. ],
  1913. "tags": [
  1914. "groups"
  1915. ],
  1916. "summary": "Delete multiple groups",
  1917. "parameters": [
  1918. {
  1919. "description": "Group IDs",
  1920. "name": "ids",
  1921. "in": "body",
  1922. "required": true,
  1923. "schema": {
  1924. "type": "array",
  1925. "items": {
  1926. "type": "string"
  1927. }
  1928. }
  1929. }
  1930. ],
  1931. "responses": {
  1932. "200": {
  1933. "description": "OK",
  1934. "schema": {
  1935. "$ref": "#/definitions/middleware.APIResponse"
  1936. }
  1937. }
  1938. }
  1939. }
  1940. },
  1941. "/api/groups/batch_status": {
  1942. "post": {
  1943. "security": [
  1944. {
  1945. "ApiKeyAuth": []
  1946. }
  1947. ],
  1948. "description": "Updates the status of multiple groups",
  1949. "consumes": [
  1950. "application/json"
  1951. ],
  1952. "produces": [
  1953. "application/json"
  1954. ],
  1955. "tags": [
  1956. "groups"
  1957. ],
  1958. "summary": "Update multiple groups status",
  1959. "parameters": [
  1960. {
  1961. "description": "Group IDs and status",
  1962. "name": "data",
  1963. "in": "body",
  1964. "required": true,
  1965. "schema": {
  1966. "$ref": "#/definitions/controller.UpdateGroupsStatusRequest"
  1967. }
  1968. }
  1969. ],
  1970. "responses": {
  1971. "200": {
  1972. "description": "OK",
  1973. "schema": {
  1974. "$ref": "#/definitions/middleware.APIResponse"
  1975. }
  1976. }
  1977. }
  1978. }
  1979. },
  1980. "/api/groups/ip_groups": {
  1981. "get": {
  1982. "security": [
  1983. {
  1984. "ApiKeyAuth": []
  1985. }
  1986. ],
  1987. "description": "Get IP group list",
  1988. "produces": [
  1989. "application/json"
  1990. ],
  1991. "tags": [
  1992. "groups"
  1993. ],
  1994. "summary": "Get IP group list",
  1995. "parameters": [
  1996. {
  1997. "type": "integer",
  1998. "description": "Threshold",
  1999. "name": "threshold",
  2000. "in": "query"
  2001. },
  2002. {
  2003. "type": "integer",
  2004. "description": "Start timestamp",
  2005. "name": "start_timestamp",
  2006. "in": "query"
  2007. },
  2008. {
  2009. "type": "integer",
  2010. "description": "End timestamp",
  2011. "name": "end_timestamp",
  2012. "in": "query"
  2013. }
  2014. ],
  2015. "responses": {
  2016. "200": {
  2017. "description": "OK",
  2018. "schema": {
  2019. "allOf": [
  2020. {
  2021. "$ref": "#/definitions/middleware.APIResponse"
  2022. },
  2023. {
  2024. "type": "object",
  2025. "properties": {
  2026. "data": {
  2027. "type": "object",
  2028. "additionalProperties": {
  2029. "type": "array",
  2030. "items": {
  2031. "type": "string"
  2032. }
  2033. }
  2034. }
  2035. }
  2036. }
  2037. ]
  2038. }
  2039. }
  2040. }
  2041. }
  2042. },
  2043. "/api/groups/search": {
  2044. "get": {
  2045. "security": [
  2046. {
  2047. "ApiKeyAuth": []
  2048. }
  2049. ],
  2050. "description": "Search groups with keyword and pagination",
  2051. "produces": [
  2052. "application/json"
  2053. ],
  2054. "tags": [
  2055. "groups"
  2056. ],
  2057. "summary": "Search groups",
  2058. "parameters": [
  2059. {
  2060. "type": "string",
  2061. "description": "Search keyword",
  2062. "name": "keyword",
  2063. "in": "query",
  2064. "required": true
  2065. },
  2066. {
  2067. "type": "integer",
  2068. "description": "Page number",
  2069. "name": "page",
  2070. "in": "query"
  2071. },
  2072. {
  2073. "type": "integer",
  2074. "description": "Items per page",
  2075. "name": "per_page",
  2076. "in": "query"
  2077. },
  2078. {
  2079. "type": "integer",
  2080. "description": "Status",
  2081. "name": "status",
  2082. "in": "query"
  2083. },
  2084. {
  2085. "type": "string",
  2086. "description": "Order",
  2087. "name": "order",
  2088. "in": "query"
  2089. }
  2090. ],
  2091. "responses": {
  2092. "200": {
  2093. "description": "OK",
  2094. "schema": {
  2095. "allOf": [
  2096. {
  2097. "$ref": "#/definitions/middleware.APIResponse"
  2098. },
  2099. {
  2100. "type": "object",
  2101. "properties": {
  2102. "data": {
  2103. "type": "object",
  2104. "additionalProperties": {
  2105. "allOf": [
  2106. {},
  2107. {
  2108. "type": "object",
  2109. "properties": {
  2110. "groups": {
  2111. "type": "array",
  2112. "items": {
  2113. "$ref": "#/definitions/controller.GroupResponse"
  2114. }
  2115. },
  2116. "total": {
  2117. "type": "integer"
  2118. }
  2119. }
  2120. }
  2121. ]
  2122. }
  2123. }
  2124. }
  2125. }
  2126. ]
  2127. }
  2128. }
  2129. }
  2130. }
  2131. },
  2132. "/api/log/{group}": {
  2133. "get": {
  2134. "security": [
  2135. {
  2136. "ApiKeyAuth": []
  2137. }
  2138. ],
  2139. "description": "Get logs for a specific group",
  2140. "produces": [
  2141. "application/json"
  2142. ],
  2143. "tags": [
  2144. "log"
  2145. ],
  2146. "summary": "Get group logs",
  2147. "parameters": [
  2148. {
  2149. "type": "string",
  2150. "description": "Group name",
  2151. "name": "group",
  2152. "in": "path",
  2153. "required": true
  2154. },
  2155. {
  2156. "type": "integer",
  2157. "description": "Page number",
  2158. "name": "page",
  2159. "in": "query"
  2160. },
  2161. {
  2162. "type": "integer",
  2163. "description": "Items per page",
  2164. "name": "per_page",
  2165. "in": "query"
  2166. },
  2167. {
  2168. "type": "integer",
  2169. "description": "Start timestamp (milliseconds)",
  2170. "name": "start_timestamp",
  2171. "in": "query"
  2172. },
  2173. {
  2174. "type": "integer",
  2175. "description": "End timestamp (milliseconds)",
  2176. "name": "end_timestamp",
  2177. "in": "query"
  2178. },
  2179. {
  2180. "type": "string",
  2181. "description": "Token name",
  2182. "name": "token_name",
  2183. "in": "query"
  2184. },
  2185. {
  2186. "type": "string",
  2187. "description": "Model name",
  2188. "name": "model_name",
  2189. "in": "query"
  2190. },
  2191. {
  2192. "type": "integer",
  2193. "description": "Channel ID",
  2194. "name": "channel",
  2195. "in": "query"
  2196. },
  2197. {
  2198. "type": "integer",
  2199. "description": "Token ID",
  2200. "name": "token_id",
  2201. "in": "query"
  2202. },
  2203. {
  2204. "type": "string",
  2205. "description": "Order",
  2206. "name": "order",
  2207. "in": "query"
  2208. },
  2209. {
  2210. "type": "string",
  2211. "description": "Request ID",
  2212. "name": "request_id",
  2213. "in": "query"
  2214. },
  2215. {
  2216. "type": "string",
  2217. "description": "Status code type",
  2218. "name": "code_type",
  2219. "in": "query"
  2220. },
  2221. {
  2222. "type": "integer",
  2223. "description": "Status code",
  2224. "name": "code",
  2225. "in": "query"
  2226. },
  2227. {
  2228. "type": "boolean",
  2229. "description": "With body",
  2230. "name": "with_body",
  2231. "in": "query"
  2232. },
  2233. {
  2234. "type": "string",
  2235. "description": "IP",
  2236. "name": "ip",
  2237. "in": "query"
  2238. },
  2239. {
  2240. "type": "string",
  2241. "description": "User",
  2242. "name": "user",
  2243. "in": "query"
  2244. }
  2245. ],
  2246. "responses": {
  2247. "200": {
  2248. "description": "OK",
  2249. "schema": {
  2250. "allOf": [
  2251. {
  2252. "$ref": "#/definitions/middleware.APIResponse"
  2253. },
  2254. {
  2255. "type": "object",
  2256. "properties": {
  2257. "data": {
  2258. "$ref": "#/definitions/model.GetGroupLogsResult"
  2259. }
  2260. }
  2261. }
  2262. ]
  2263. }
  2264. }
  2265. }
  2266. }
  2267. },
  2268. "/api/log/{group}/detail/{log_id}": {
  2269. "get": {
  2270. "security": [
  2271. {
  2272. "ApiKeyAuth": []
  2273. }
  2274. ],
  2275. "description": "Get detailed information about a specific log entry in a group",
  2276. "produces": [
  2277. "application/json"
  2278. ],
  2279. "tags": [
  2280. "log"
  2281. ],
  2282. "summary": "Get group log detail",
  2283. "parameters": [
  2284. {
  2285. "type": "string",
  2286. "description": "Group name",
  2287. "name": "group",
  2288. "in": "path",
  2289. "required": true
  2290. },
  2291. {
  2292. "type": "string",
  2293. "description": "Log ID",
  2294. "name": "log_id",
  2295. "in": "path",
  2296. "required": true
  2297. }
  2298. ],
  2299. "responses": {
  2300. "200": {
  2301. "description": "OK",
  2302. "schema": {
  2303. "allOf": [
  2304. {
  2305. "$ref": "#/definitions/middleware.APIResponse"
  2306. },
  2307. {
  2308. "type": "object",
  2309. "properties": {
  2310. "data": {
  2311. "$ref": "#/definitions/model.RequestDetail"
  2312. }
  2313. }
  2314. }
  2315. ]
  2316. }
  2317. }
  2318. }
  2319. }
  2320. },
  2321. "/api/log/{group}/search": {
  2322. "get": {
  2323. "security": [
  2324. {
  2325. "ApiKeyAuth": []
  2326. }
  2327. ],
  2328. "description": "Search logs for a specific group with filters",
  2329. "produces": [
  2330. "application/json"
  2331. ],
  2332. "tags": [
  2333. "log"
  2334. ],
  2335. "summary": "Search group logs",
  2336. "parameters": [
  2337. {
  2338. "type": "string",
  2339. "description": "Group name",
  2340. "name": "group",
  2341. "in": "path",
  2342. "required": true
  2343. },
  2344. {
  2345. "type": "string",
  2346. "description": "Keyword",
  2347. "name": "keyword",
  2348. "in": "query",
  2349. "required": true
  2350. },
  2351. {
  2352. "type": "integer",
  2353. "description": "Page number",
  2354. "name": "page",
  2355. "in": "query"
  2356. },
  2357. {
  2358. "type": "integer",
  2359. "description": "Items per page",
  2360. "name": "per_page",
  2361. "in": "query"
  2362. },
  2363. {
  2364. "type": "integer",
  2365. "description": "Start timestamp (milliseconds)",
  2366. "name": "start_timestamp",
  2367. "in": "query"
  2368. },
  2369. {
  2370. "type": "integer",
  2371. "description": "End timestamp (milliseconds)",
  2372. "name": "end_timestamp",
  2373. "in": "query"
  2374. },
  2375. {
  2376. "type": "string",
  2377. "description": "Filter by token name",
  2378. "name": "token_name",
  2379. "in": "query"
  2380. },
  2381. {
  2382. "type": "string",
  2383. "description": "Filter by model name",
  2384. "name": "model_name",
  2385. "in": "query"
  2386. },
  2387. {
  2388. "type": "integer",
  2389. "description": "Filter by channel",
  2390. "name": "channel",
  2391. "in": "query"
  2392. },
  2393. {
  2394. "type": "integer",
  2395. "description": "Filter by token id",
  2396. "name": "token_id",
  2397. "in": "query"
  2398. },
  2399. {
  2400. "type": "string",
  2401. "description": "Order",
  2402. "name": "order",
  2403. "in": "query"
  2404. },
  2405. {
  2406. "type": "string",
  2407. "description": "Request ID",
  2408. "name": "request_id",
  2409. "in": "query"
  2410. },
  2411. {
  2412. "type": "string",
  2413. "description": "Status code type",
  2414. "name": "code_type",
  2415. "in": "query"
  2416. },
  2417. {
  2418. "type": "integer",
  2419. "description": "Status code",
  2420. "name": "code",
  2421. "in": "query"
  2422. },
  2423. {
  2424. "type": "boolean",
  2425. "description": "With body",
  2426. "name": "with_body",
  2427. "in": "query"
  2428. },
  2429. {
  2430. "type": "string",
  2431. "description": "IP",
  2432. "name": "ip",
  2433. "in": "query"
  2434. },
  2435. {
  2436. "type": "string",
  2437. "description": "User",
  2438. "name": "user",
  2439. "in": "query"
  2440. }
  2441. ],
  2442. "responses": {
  2443. "200": {
  2444. "description": "OK",
  2445. "schema": {
  2446. "allOf": [
  2447. {
  2448. "$ref": "#/definitions/middleware.APIResponse"
  2449. },
  2450. {
  2451. "type": "object",
  2452. "properties": {
  2453. "data": {
  2454. "$ref": "#/definitions/model.GetGroupLogsResult"
  2455. }
  2456. }
  2457. }
  2458. ]
  2459. }
  2460. }
  2461. }
  2462. }
  2463. },
  2464. "/api/log/{group}/used/models": {
  2465. "get": {
  2466. "security": [
  2467. {
  2468. "ApiKeyAuth": []
  2469. }
  2470. ],
  2471. "description": "Get a list of models that have been used in a specific group's logs",
  2472. "produces": [
  2473. "application/json"
  2474. ],
  2475. "tags": [
  2476. "log"
  2477. ],
  2478. "summary": "Get group used models",
  2479. "parameters": [
  2480. {
  2481. "type": "string",
  2482. "description": "Group name",
  2483. "name": "group",
  2484. "in": "path",
  2485. "required": true
  2486. }
  2487. ],
  2488. "responses": {
  2489. "200": {
  2490. "description": "OK",
  2491. "schema": {
  2492. "allOf": [
  2493. {
  2494. "$ref": "#/definitions/middleware.APIResponse"
  2495. },
  2496. {
  2497. "type": "object",
  2498. "properties": {
  2499. "data": {
  2500. "type": "array",
  2501. "items": {
  2502. "type": "string"
  2503. }
  2504. }
  2505. }
  2506. }
  2507. ]
  2508. }
  2509. }
  2510. }
  2511. }
  2512. },
  2513. "/api/log/{group}/used/token_names": {
  2514. "get": {
  2515. "security": [
  2516. {
  2517. "ApiKeyAuth": []
  2518. }
  2519. ],
  2520. "description": "Get a list of token names that have been used in a specific group's logs",
  2521. "produces": [
  2522. "application/json"
  2523. ],
  2524. "tags": [
  2525. "log"
  2526. ],
  2527. "summary": "Get group used token names",
  2528. "parameters": [
  2529. {
  2530. "type": "string",
  2531. "description": "Group name",
  2532. "name": "group",
  2533. "in": "path",
  2534. "required": true
  2535. }
  2536. ],
  2537. "responses": {
  2538. "200": {
  2539. "description": "OK",
  2540. "schema": {
  2541. "allOf": [
  2542. {
  2543. "$ref": "#/definitions/middleware.APIResponse"
  2544. },
  2545. {
  2546. "type": "object",
  2547. "properties": {
  2548. "data": {
  2549. "type": "array",
  2550. "items": {
  2551. "type": "string"
  2552. }
  2553. }
  2554. }
  2555. }
  2556. ]
  2557. }
  2558. }
  2559. }
  2560. }
  2561. },
  2562. "/api/logs": {
  2563. "get": {
  2564. "security": [
  2565. {
  2566. "ApiKeyAuth": []
  2567. }
  2568. ],
  2569. "description": "Returns a paginated list of all logs with optional filters",
  2570. "produces": [
  2571. "application/json"
  2572. ],
  2573. "tags": [
  2574. "logs"
  2575. ],
  2576. "summary": "Get all logs",
  2577. "parameters": [
  2578. {
  2579. "type": "string",
  2580. "description": "Group or *",
  2581. "name": "group",
  2582. "in": "query"
  2583. },
  2584. {
  2585. "type": "integer",
  2586. "description": "Page number",
  2587. "name": "page",
  2588. "in": "query"
  2589. },
  2590. {
  2591. "type": "integer",
  2592. "description": "Items per page",
  2593. "name": "per_page",
  2594. "in": "query"
  2595. },
  2596. {
  2597. "type": "integer",
  2598. "description": "Start timestamp (milliseconds)",
  2599. "name": "start_timestamp",
  2600. "in": "query"
  2601. },
  2602. {
  2603. "type": "integer",
  2604. "description": "End timestamp (milliseconds)",
  2605. "name": "end_timestamp",
  2606. "in": "query"
  2607. },
  2608. {
  2609. "type": "string",
  2610. "description": "Token name",
  2611. "name": "token_name",
  2612. "in": "query"
  2613. },
  2614. {
  2615. "type": "string",
  2616. "description": "Model name",
  2617. "name": "model_name",
  2618. "in": "query"
  2619. },
  2620. {
  2621. "type": "integer",
  2622. "description": "Channel ID",
  2623. "name": "channel",
  2624. "in": "query"
  2625. },
  2626. {
  2627. "type": "integer",
  2628. "description": "Token ID",
  2629. "name": "token_id",
  2630. "in": "query"
  2631. },
  2632. {
  2633. "type": "string",
  2634. "description": "Order",
  2635. "name": "order",
  2636. "in": "query"
  2637. },
  2638. {
  2639. "type": "string",
  2640. "description": "Request ID",
  2641. "name": "request_id",
  2642. "in": "query"
  2643. },
  2644. {
  2645. "type": "string",
  2646. "description": "Status code type",
  2647. "name": "code_type",
  2648. "in": "query"
  2649. },
  2650. {
  2651. "type": "integer",
  2652. "description": "Status code",
  2653. "name": "code",
  2654. "in": "query"
  2655. },
  2656. {
  2657. "type": "boolean",
  2658. "description": "With body",
  2659. "name": "with_body",
  2660. "in": "query"
  2661. },
  2662. {
  2663. "type": "string",
  2664. "description": "IP",
  2665. "name": "ip",
  2666. "in": "query"
  2667. },
  2668. {
  2669. "type": "string",
  2670. "description": "User",
  2671. "name": "user",
  2672. "in": "query"
  2673. }
  2674. ],
  2675. "responses": {
  2676. "200": {
  2677. "description": "OK",
  2678. "schema": {
  2679. "allOf": [
  2680. {
  2681. "$ref": "#/definitions/middleware.APIResponse"
  2682. },
  2683. {
  2684. "type": "object",
  2685. "properties": {
  2686. "data": {
  2687. "$ref": "#/definitions/model.GetLogsResult"
  2688. }
  2689. }
  2690. }
  2691. ]
  2692. }
  2693. }
  2694. }
  2695. },
  2696. "delete": {
  2697. "security": [
  2698. {
  2699. "ApiKeyAuth": []
  2700. }
  2701. ],
  2702. "description": "Deletes logs older than the specified retention period",
  2703. "produces": [
  2704. "application/json"
  2705. ],
  2706. "tags": [
  2707. "logs"
  2708. ],
  2709. "summary": "Delete historical logs",
  2710. "parameters": [
  2711. {
  2712. "type": "integer",
  2713. "description": "Timestamp (milliseconds)",
  2714. "name": "timestamp",
  2715. "in": "query",
  2716. "required": true
  2717. }
  2718. ],
  2719. "responses": {
  2720. "200": {
  2721. "description": "OK",
  2722. "schema": {
  2723. "allOf": [
  2724. {
  2725. "$ref": "#/definitions/middleware.APIResponse"
  2726. },
  2727. {
  2728. "type": "object",
  2729. "properties": {
  2730. "data": {
  2731. "type": "integer"
  2732. }
  2733. }
  2734. }
  2735. ]
  2736. }
  2737. }
  2738. }
  2739. }
  2740. },
  2741. "/api/logs/consume_error": {
  2742. "get": {
  2743. "security": [
  2744. {
  2745. "ApiKeyAuth": []
  2746. }
  2747. ],
  2748. "description": "Search for logs with consumption errors",
  2749. "produces": [
  2750. "application/json"
  2751. ],
  2752. "tags": [
  2753. "logs"
  2754. ],
  2755. "summary": "Search consumption errors",
  2756. "parameters": [
  2757. {
  2758. "type": "integer",
  2759. "description": "Page number",
  2760. "name": "page",
  2761. "in": "query"
  2762. },
  2763. {
  2764. "type": "integer",
  2765. "description": "Items per page",
  2766. "name": "per_page",
  2767. "in": "query"
  2768. },
  2769. {
  2770. "type": "integer",
  2771. "description": "Start timestamp (milliseconds)",
  2772. "name": "start_timestamp",
  2773. "in": "query"
  2774. },
  2775. {
  2776. "type": "integer",
  2777. "description": "End timestamp (milliseconds)",
  2778. "name": "end_timestamp",
  2779. "in": "query"
  2780. },
  2781. {
  2782. "type": "string",
  2783. "description": "Keyword",
  2784. "name": "keyword",
  2785. "in": "query"
  2786. },
  2787. {
  2788. "type": "string",
  2789. "description": "Group",
  2790. "name": "group",
  2791. "in": "query"
  2792. },
  2793. {
  2794. "type": "string",
  2795. "description": "Token name",
  2796. "name": "token_name",
  2797. "in": "query"
  2798. },
  2799. {
  2800. "type": "string",
  2801. "description": "Model name",
  2802. "name": "model_name",
  2803. "in": "query"
  2804. },
  2805. {
  2806. "type": "string",
  2807. "description": "Content",
  2808. "name": "content",
  2809. "in": "query"
  2810. },
  2811. {
  2812. "type": "integer",
  2813. "description": "Token ID",
  2814. "name": "token_id",
  2815. "in": "query"
  2816. },
  2817. {
  2818. "type": "string",
  2819. "description": "Order",
  2820. "name": "order",
  2821. "in": "query"
  2822. },
  2823. {
  2824. "type": "string",
  2825. "description": "Request ID",
  2826. "name": "request_id",
  2827. "in": "query"
  2828. }
  2829. ],
  2830. "responses": {
  2831. "200": {
  2832. "description": "OK",
  2833. "schema": {
  2834. "allOf": [
  2835. {
  2836. "$ref": "#/definitions/middleware.APIResponse"
  2837. },
  2838. {
  2839. "type": "object",
  2840. "properties": {
  2841. "data": {
  2842. "type": "object",
  2843. "additionalProperties": {
  2844. "allOf": [
  2845. {},
  2846. {
  2847. "type": "object",
  2848. "properties": {
  2849. "logs": {
  2850. "type": "array",
  2851. "items": {
  2852. "$ref": "#/definitions/model.RequestDetail"
  2853. }
  2854. },
  2855. "total": {
  2856. "type": "integer"
  2857. }
  2858. }
  2859. }
  2860. ]
  2861. }
  2862. }
  2863. }
  2864. }
  2865. ]
  2866. }
  2867. }
  2868. }
  2869. }
  2870. },
  2871. "/api/logs/detail/{log_id}": {
  2872. "get": {
  2873. "security": [
  2874. {
  2875. "ApiKeyAuth": []
  2876. }
  2877. ],
  2878. "description": "Get detailed information about a specific log entry",
  2879. "produces": [
  2880. "application/json"
  2881. ],
  2882. "tags": [
  2883. "logs"
  2884. ],
  2885. "summary": "Get log detail",
  2886. "parameters": [
  2887. {
  2888. "type": "string",
  2889. "description": "Log ID",
  2890. "name": "log_id",
  2891. "in": "path",
  2892. "required": true
  2893. }
  2894. ],
  2895. "responses": {
  2896. "200": {
  2897. "description": "OK",
  2898. "schema": {
  2899. "allOf": [
  2900. {
  2901. "$ref": "#/definitions/middleware.APIResponse"
  2902. },
  2903. {
  2904. "type": "object",
  2905. "properties": {
  2906. "data": {
  2907. "$ref": "#/definitions/model.RequestDetail"
  2908. }
  2909. }
  2910. }
  2911. ]
  2912. }
  2913. }
  2914. }
  2915. }
  2916. },
  2917. "/api/logs/search": {
  2918. "get": {
  2919. "security": [
  2920. {
  2921. "ApiKeyAuth": []
  2922. }
  2923. ],
  2924. "description": "Search logs with various filters",
  2925. "produces": [
  2926. "application/json"
  2927. ],
  2928. "tags": [
  2929. "logs"
  2930. ],
  2931. "summary": "Search logs",
  2932. "parameters": [
  2933. {
  2934. "type": "string",
  2935. "description": "Group or *",
  2936. "name": "group",
  2937. "in": "query"
  2938. },
  2939. {
  2940. "type": "string",
  2941. "description": "Keyword",
  2942. "name": "keyword",
  2943. "in": "query",
  2944. "required": true
  2945. },
  2946. {
  2947. "type": "integer",
  2948. "description": "Page number",
  2949. "name": "page",
  2950. "in": "query"
  2951. },
  2952. {
  2953. "type": "integer",
  2954. "description": "Items per page",
  2955. "name": "per_page",
  2956. "in": "query"
  2957. },
  2958. {
  2959. "type": "integer",
  2960. "description": "Start timestamp (milliseconds)",
  2961. "name": "start_timestamp",
  2962. "in": "query"
  2963. },
  2964. {
  2965. "type": "integer",
  2966. "description": "End timestamp (milliseconds)",
  2967. "name": "end_timestamp",
  2968. "in": "query"
  2969. },
  2970. {
  2971. "type": "string",
  2972. "description": "Filter by token name",
  2973. "name": "token_name",
  2974. "in": "query"
  2975. },
  2976. {
  2977. "type": "string",
  2978. "description": "Filter by model name",
  2979. "name": "model_name",
  2980. "in": "query"
  2981. },
  2982. {
  2983. "type": "integer",
  2984. "description": "Filter by channel",
  2985. "name": "channel",
  2986. "in": "query"
  2987. },
  2988. {
  2989. "type": "integer",
  2990. "description": "Filter by token id",
  2991. "name": "token_id",
  2992. "in": "query"
  2993. },
  2994. {
  2995. "type": "string",
  2996. "description": "Order",
  2997. "name": "order",
  2998. "in": "query"
  2999. },
  3000. {
  3001. "type": "string",
  3002. "description": "Request ID",
  3003. "name": "request_id",
  3004. "in": "query"
  3005. },
  3006. {
  3007. "type": "string",
  3008. "description": "Status code type",
  3009. "name": "code_type",
  3010. "in": "query"
  3011. },
  3012. {
  3013. "type": "integer",
  3014. "description": "Status code",
  3015. "name": "code",
  3016. "in": "query"
  3017. },
  3018. {
  3019. "type": "boolean",
  3020. "description": "With body",
  3021. "name": "with_body",
  3022. "in": "query"
  3023. },
  3024. {
  3025. "type": "string",
  3026. "description": "IP",
  3027. "name": "ip",
  3028. "in": "query"
  3029. },
  3030. {
  3031. "type": "string",
  3032. "description": "User",
  3033. "name": "user",
  3034. "in": "query"
  3035. }
  3036. ],
  3037. "responses": {
  3038. "200": {
  3039. "description": "OK",
  3040. "schema": {
  3041. "allOf": [
  3042. {
  3043. "$ref": "#/definitions/middleware.APIResponse"
  3044. },
  3045. {
  3046. "type": "object",
  3047. "properties": {
  3048. "data": {
  3049. "$ref": "#/definitions/model.GetLogsResult"
  3050. }
  3051. }
  3052. }
  3053. ]
  3054. }
  3055. }
  3056. }
  3057. }
  3058. },
  3059. "/api/logs/used/models": {
  3060. "get": {
  3061. "security": [
  3062. {
  3063. "ApiKeyAuth": []
  3064. }
  3065. ],
  3066. "description": "Get a list of models that have been used in logs",
  3067. "produces": [
  3068. "application/json"
  3069. ],
  3070. "tags": [
  3071. "logs"
  3072. ],
  3073. "summary": "Get used models",
  3074. "parameters": [
  3075. {
  3076. "type": "string",
  3077. "description": "Group or *",
  3078. "name": "group",
  3079. "in": "query"
  3080. }
  3081. ],
  3082. "responses": {
  3083. "200": {
  3084. "description": "OK",
  3085. "schema": {
  3086. "allOf": [
  3087. {
  3088. "$ref": "#/definitions/middleware.APIResponse"
  3089. },
  3090. {
  3091. "type": "object",
  3092. "properties": {
  3093. "data": {
  3094. "type": "array",
  3095. "items": {
  3096. "type": "string"
  3097. }
  3098. }
  3099. }
  3100. }
  3101. ]
  3102. }
  3103. }
  3104. }
  3105. }
  3106. },
  3107. "/api/logs/used/token_names": {
  3108. "get": {
  3109. "security": [
  3110. {
  3111. "ApiKeyAuth": []
  3112. }
  3113. ],
  3114. "description": "Get a list of token names that have been used in logs",
  3115. "produces": [
  3116. "application/json"
  3117. ],
  3118. "tags": [
  3119. "logs"
  3120. ],
  3121. "summary": "Get used token names",
  3122. "parameters": [
  3123. {
  3124. "type": "string",
  3125. "description": "Group or *",
  3126. "name": "group",
  3127. "in": "query"
  3128. }
  3129. ],
  3130. "responses": {
  3131. "200": {
  3132. "description": "OK",
  3133. "schema": {
  3134. "allOf": [
  3135. {
  3136. "$ref": "#/definitions/middleware.APIResponse"
  3137. },
  3138. {
  3139. "type": "object",
  3140. "properties": {
  3141. "data": {
  3142. "type": "array",
  3143. "items": {
  3144. "type": "string"
  3145. }
  3146. }
  3147. }
  3148. }
  3149. ]
  3150. }
  3151. }
  3152. }
  3153. }
  3154. },
  3155. "/api/mcp/group/{group}": {
  3156. "get": {
  3157. "security": [
  3158. {
  3159. "ApiKeyAuth": []
  3160. }
  3161. ],
  3162. "description": "Get a list of Group MCPs with pagination and filtering",
  3163. "produces": [
  3164. "application/json"
  3165. ],
  3166. "tags": [
  3167. "mcp"
  3168. ],
  3169. "summary": "Get Group MCPs",
  3170. "parameters": [
  3171. {
  3172. "type": "string",
  3173. "description": "Group ID",
  3174. "name": "group",
  3175. "in": "path",
  3176. "required": true
  3177. },
  3178. {
  3179. "type": "integer",
  3180. "description": "Page number",
  3181. "name": "page",
  3182. "in": "query"
  3183. },
  3184. {
  3185. "type": "integer",
  3186. "description": "Items per page",
  3187. "name": "per_page",
  3188. "in": "query"
  3189. },
  3190. {
  3191. "type": "string",
  3192. "description": "MCP type",
  3193. "name": "type",
  3194. "in": "query"
  3195. },
  3196. {
  3197. "type": "string",
  3198. "description": "Search keyword",
  3199. "name": "keyword",
  3200. "in": "query"
  3201. }
  3202. ],
  3203. "responses": {
  3204. "200": {
  3205. "description": "OK",
  3206. "schema": {
  3207. "allOf": [
  3208. {
  3209. "$ref": "#/definitions/middleware.APIResponse"
  3210. },
  3211. {
  3212. "type": "object",
  3213. "properties": {
  3214. "data": {
  3215. "type": "array",
  3216. "items": {
  3217. "$ref": "#/definitions/model.GroupMCP"
  3218. }
  3219. }
  3220. }
  3221. }
  3222. ]
  3223. }
  3224. }
  3225. }
  3226. },
  3227. "post": {
  3228. "security": [
  3229. {
  3230. "ApiKeyAuth": []
  3231. }
  3232. ],
  3233. "description": "Create a new Group MCP",
  3234. "consumes": [
  3235. "application/json"
  3236. ],
  3237. "produces": [
  3238. "application/json"
  3239. ],
  3240. "tags": [
  3241. "mcp"
  3242. ],
  3243. "summary": "Create Group MCP",
  3244. "parameters": [
  3245. {
  3246. "type": "string",
  3247. "description": "Group ID",
  3248. "name": "group",
  3249. "in": "path",
  3250. "required": true
  3251. },
  3252. {
  3253. "description": "Group MCP object",
  3254. "name": "mcp",
  3255. "in": "body",
  3256. "required": true,
  3257. "schema": {
  3258. "$ref": "#/definitions/model.GroupMCP"
  3259. }
  3260. }
  3261. ],
  3262. "responses": {
  3263. "200": {
  3264. "description": "OK",
  3265. "schema": {
  3266. "allOf": [
  3267. {
  3268. "$ref": "#/definitions/middleware.APIResponse"
  3269. },
  3270. {
  3271. "type": "object",
  3272. "properties": {
  3273. "data": {
  3274. "$ref": "#/definitions/model.GroupMCP"
  3275. }
  3276. }
  3277. }
  3278. ]
  3279. }
  3280. }
  3281. }
  3282. }
  3283. },
  3284. "/api/mcp/group/{group}/{id}": {
  3285. "get": {
  3286. "security": [
  3287. {
  3288. "ApiKeyAuth": []
  3289. }
  3290. ],
  3291. "description": "Get a specific Group MCP by its ID and Group ID",
  3292. "produces": [
  3293. "application/json"
  3294. ],
  3295. "tags": [
  3296. "mcp"
  3297. ],
  3298. "summary": "Get Group MCP by ID",
  3299. "parameters": [
  3300. {
  3301. "type": "string",
  3302. "description": "MCP ID",
  3303. "name": "id",
  3304. "in": "path",
  3305. "required": true
  3306. },
  3307. {
  3308. "type": "string",
  3309. "description": "Group ID",
  3310. "name": "group",
  3311. "in": "path",
  3312. "required": true
  3313. }
  3314. ],
  3315. "responses": {
  3316. "200": {
  3317. "description": "OK",
  3318. "schema": {
  3319. "allOf": [
  3320. {
  3321. "$ref": "#/definitions/middleware.APIResponse"
  3322. },
  3323. {
  3324. "type": "object",
  3325. "properties": {
  3326. "data": {
  3327. "$ref": "#/definitions/model.GroupMCP"
  3328. }
  3329. }
  3330. }
  3331. ]
  3332. }
  3333. }
  3334. }
  3335. },
  3336. "put": {
  3337. "security": [
  3338. {
  3339. "ApiKeyAuth": []
  3340. }
  3341. ],
  3342. "description": "Update an existing Group MCP",
  3343. "consumes": [
  3344. "application/json"
  3345. ],
  3346. "produces": [
  3347. "application/json"
  3348. ],
  3349. "tags": [
  3350. "mcp"
  3351. ],
  3352. "summary": "Update Group MCP",
  3353. "parameters": [
  3354. {
  3355. "type": "string",
  3356. "description": "MCP ID",
  3357. "name": "id",
  3358. "in": "path",
  3359. "required": true
  3360. },
  3361. {
  3362. "type": "string",
  3363. "description": "Group ID",
  3364. "name": "group",
  3365. "in": "path",
  3366. "required": true
  3367. },
  3368. {
  3369. "description": "Group MCP object",
  3370. "name": "mcp",
  3371. "in": "body",
  3372. "required": true,
  3373. "schema": {
  3374. "$ref": "#/definitions/model.GroupMCP"
  3375. }
  3376. }
  3377. ],
  3378. "responses": {
  3379. "200": {
  3380. "description": "OK",
  3381. "schema": {
  3382. "allOf": [
  3383. {
  3384. "$ref": "#/definitions/middleware.APIResponse"
  3385. },
  3386. {
  3387. "type": "object",
  3388. "properties": {
  3389. "data": {
  3390. "$ref": "#/definitions/model.GroupMCP"
  3391. }
  3392. }
  3393. }
  3394. ]
  3395. }
  3396. }
  3397. }
  3398. },
  3399. "delete": {
  3400. "security": [
  3401. {
  3402. "ApiKeyAuth": []
  3403. }
  3404. ],
  3405. "description": "Delete a Group MCP by ID and Group ID",
  3406. "produces": [
  3407. "application/json"
  3408. ],
  3409. "tags": [
  3410. "mcp"
  3411. ],
  3412. "summary": "Delete Group MCP",
  3413. "parameters": [
  3414. {
  3415. "type": "string",
  3416. "description": "MCP ID",
  3417. "name": "id",
  3418. "in": "path",
  3419. "required": true
  3420. },
  3421. {
  3422. "type": "string",
  3423. "description": "Group ID",
  3424. "name": "group",
  3425. "in": "path",
  3426. "required": true
  3427. }
  3428. ],
  3429. "responses": {
  3430. "200": {
  3431. "description": "OK",
  3432. "schema": {
  3433. "$ref": "#/definitions/middleware.APIResponse"
  3434. }
  3435. }
  3436. }
  3437. }
  3438. },
  3439. "/api/mcp/public/": {
  3440. "get": {
  3441. "security": [
  3442. {
  3443. "ApiKeyAuth": []
  3444. }
  3445. ],
  3446. "description": "Get a list of MCPs with pagination and filtering",
  3447. "produces": [
  3448. "application/json"
  3449. ],
  3450. "tags": [
  3451. "mcp"
  3452. ],
  3453. "summary": "Get MCPs",
  3454. "parameters": [
  3455. {
  3456. "type": "integer",
  3457. "description": "Page number",
  3458. "name": "page",
  3459. "in": "query"
  3460. },
  3461. {
  3462. "type": "integer",
  3463. "description": "Items per page",
  3464. "name": "per_page",
  3465. "in": "query"
  3466. },
  3467. {
  3468. "type": "string",
  3469. "description": "MCP type",
  3470. "name": "type",
  3471. "in": "query"
  3472. },
  3473. {
  3474. "type": "string",
  3475. "description": "Search keyword",
  3476. "name": "keyword",
  3477. "in": "query"
  3478. }
  3479. ],
  3480. "responses": {
  3481. "200": {
  3482. "description": "OK",
  3483. "schema": {
  3484. "allOf": [
  3485. {
  3486. "$ref": "#/definitions/middleware.APIResponse"
  3487. },
  3488. {
  3489. "type": "object",
  3490. "properties": {
  3491. "data": {
  3492. "type": "array",
  3493. "items": {
  3494. "$ref": "#/definitions/model.PublicMCP"
  3495. }
  3496. }
  3497. }
  3498. }
  3499. ]
  3500. }
  3501. }
  3502. }
  3503. },
  3504. "post": {
  3505. "security": [
  3506. {
  3507. "ApiKeyAuth": []
  3508. }
  3509. ],
  3510. "description": "Create a new MCP",
  3511. "consumes": [
  3512. "application/json"
  3513. ],
  3514. "produces": [
  3515. "application/json"
  3516. ],
  3517. "tags": [
  3518. "mcp"
  3519. ],
  3520. "summary": "Create MCP",
  3521. "parameters": [
  3522. {
  3523. "description": "MCP object",
  3524. "name": "mcp",
  3525. "in": "body",
  3526. "required": true,
  3527. "schema": {
  3528. "$ref": "#/definitions/model.PublicMCP"
  3529. }
  3530. }
  3531. ],
  3532. "responses": {
  3533. "200": {
  3534. "description": "OK",
  3535. "schema": {
  3536. "$ref": "#/definitions/middleware.APIResponse"
  3537. }
  3538. }
  3539. }
  3540. }
  3541. },
  3542. "/api/mcp/public/{id}": {
  3543. "get": {
  3544. "security": [
  3545. {
  3546. "ApiKeyAuth": []
  3547. }
  3548. ],
  3549. "description": "Get a specific MCP by its ID",
  3550. "produces": [
  3551. "application/json"
  3552. ],
  3553. "tags": [
  3554. "mcp"
  3555. ],
  3556. "summary": "Get MCP by ID",
  3557. "parameters": [
  3558. {
  3559. "type": "string",
  3560. "description": "MCP ID",
  3561. "name": "id",
  3562. "in": "path",
  3563. "required": true
  3564. }
  3565. ],
  3566. "responses": {
  3567. "200": {
  3568. "description": "OK",
  3569. "schema": {
  3570. "allOf": [
  3571. {
  3572. "$ref": "#/definitions/middleware.APIResponse"
  3573. },
  3574. {
  3575. "type": "object",
  3576. "properties": {
  3577. "data": {
  3578. "$ref": "#/definitions/model.PublicMCP"
  3579. }
  3580. }
  3581. }
  3582. ]
  3583. }
  3584. }
  3585. }
  3586. },
  3587. "put": {
  3588. "security": [
  3589. {
  3590. "ApiKeyAuth": []
  3591. }
  3592. ],
  3593. "description": "Update an existing MCP",
  3594. "consumes": [
  3595. "application/json"
  3596. ],
  3597. "produces": [
  3598. "application/json"
  3599. ],
  3600. "tags": [
  3601. "mcp"
  3602. ],
  3603. "summary": "Update MCP",
  3604. "parameters": [
  3605. {
  3606. "type": "string",
  3607. "description": "MCP ID",
  3608. "name": "id",
  3609. "in": "path",
  3610. "required": true
  3611. },
  3612. {
  3613. "description": "MCP object",
  3614. "name": "mcp",
  3615. "in": "body",
  3616. "required": true,
  3617. "schema": {
  3618. "$ref": "#/definitions/model.PublicMCP"
  3619. }
  3620. }
  3621. ],
  3622. "responses": {
  3623. "200": {
  3624. "description": "OK",
  3625. "schema": {
  3626. "$ref": "#/definitions/middleware.APIResponse"
  3627. }
  3628. }
  3629. }
  3630. },
  3631. "delete": {
  3632. "security": [
  3633. {
  3634. "ApiKeyAuth": []
  3635. }
  3636. ],
  3637. "description": "Delete an MCP by ID",
  3638. "produces": [
  3639. "application/json"
  3640. ],
  3641. "tags": [
  3642. "mcp"
  3643. ],
  3644. "summary": "Delete MCP",
  3645. "parameters": [
  3646. {
  3647. "type": "string",
  3648. "description": "MCP ID",
  3649. "name": "id",
  3650. "in": "path",
  3651. "required": true
  3652. }
  3653. ],
  3654. "responses": {
  3655. "200": {
  3656. "description": "OK",
  3657. "schema": {
  3658. "$ref": "#/definitions/middleware.APIResponse"
  3659. }
  3660. }
  3661. }
  3662. }
  3663. },
  3664. "/api/mcp/public/{id}/group/{group}/params": {
  3665. "get": {
  3666. "security": [
  3667. {
  3668. "ApiKeyAuth": []
  3669. }
  3670. ],
  3671. "description": "Get reusing parameters for a specific group and MCP",
  3672. "produces": [
  3673. "application/json"
  3674. ],
  3675. "tags": [
  3676. "mcp"
  3677. ],
  3678. "summary": "Get group MCP reusing parameters",
  3679. "parameters": [
  3680. {
  3681. "type": "string",
  3682. "description": "MCP ID",
  3683. "name": "id",
  3684. "in": "path",
  3685. "required": true
  3686. },
  3687. {
  3688. "type": "string",
  3689. "description": "Group ID",
  3690. "name": "group",
  3691. "in": "path",
  3692. "required": true
  3693. }
  3694. ],
  3695. "responses": {
  3696. "200": {
  3697. "description": "OK",
  3698. "schema": {
  3699. "allOf": [
  3700. {
  3701. "$ref": "#/definitions/middleware.APIResponse"
  3702. },
  3703. {
  3704. "type": "object",
  3705. "properties": {
  3706. "data": {
  3707. "$ref": "#/definitions/model.PublicMCPReusingParam"
  3708. }
  3709. }
  3710. }
  3711. ]
  3712. }
  3713. }
  3714. }
  3715. },
  3716. "post": {
  3717. "security": [
  3718. {
  3719. "ApiKeyAuth": []
  3720. }
  3721. ],
  3722. "description": "Create or update reusing parameters for a specific group and MCP",
  3723. "consumes": [
  3724. "application/json"
  3725. ],
  3726. "produces": [
  3727. "application/json"
  3728. ],
  3729. "tags": [
  3730. "mcp"
  3731. ],
  3732. "summary": "Create or update group MCP reusing parameters",
  3733. "parameters": [
  3734. {
  3735. "type": "string",
  3736. "description": "MCP ID",
  3737. "name": "id",
  3738. "in": "path",
  3739. "required": true
  3740. },
  3741. {
  3742. "type": "string",
  3743. "description": "Group ID",
  3744. "name": "group",
  3745. "in": "path",
  3746. "required": true
  3747. },
  3748. {
  3749. "description": "Reusing parameters",
  3750. "name": "params",
  3751. "in": "body",
  3752. "required": true,
  3753. "schema": {
  3754. "$ref": "#/definitions/model.PublicMCPReusingParam"
  3755. }
  3756. }
  3757. ],
  3758. "responses": {
  3759. "200": {
  3760. "description": "OK",
  3761. "schema": {
  3762. "$ref": "#/definitions/middleware.APIResponse"
  3763. }
  3764. }
  3765. }
  3766. }
  3767. },
  3768. "/api/model_config": {
  3769. "post": {
  3770. "security": [
  3771. {
  3772. "ApiKeyAuth": []
  3773. }
  3774. ],
  3775. "description": "Saves a model config",
  3776. "produces": [
  3777. "application/json"
  3778. ],
  3779. "tags": [
  3780. "modelconfig"
  3781. ],
  3782. "summary": "Save model config",
  3783. "parameters": [
  3784. {
  3785. "description": "Model config",
  3786. "name": "config",
  3787. "in": "body",
  3788. "required": true,
  3789. "schema": {
  3790. "$ref": "#/definitions/controller.SaveModelConfigsRequest"
  3791. }
  3792. }
  3793. ],
  3794. "responses": {
  3795. "200": {
  3796. "description": "OK",
  3797. "schema": {
  3798. "$ref": "#/definitions/middleware.APIResponse"
  3799. }
  3800. }
  3801. }
  3802. }
  3803. },
  3804. "/api/model_config/{model}": {
  3805. "get": {
  3806. "security": [
  3807. {
  3808. "ApiKeyAuth": []
  3809. }
  3810. ],
  3811. "description": "Returns a model config",
  3812. "produces": [
  3813. "application/json"
  3814. ],
  3815. "tags": [
  3816. "modelconfig"
  3817. ],
  3818. "summary": "Get model config",
  3819. "parameters": [
  3820. {
  3821. "type": "string",
  3822. "description": "Model name",
  3823. "name": "model",
  3824. "in": "path",
  3825. "required": true
  3826. }
  3827. ],
  3828. "responses": {
  3829. "200": {
  3830. "description": "OK",
  3831. "schema": {
  3832. "allOf": [
  3833. {
  3834. "$ref": "#/definitions/middleware.APIResponse"
  3835. },
  3836. {
  3837. "type": "object",
  3838. "properties": {
  3839. "data": {
  3840. "$ref": "#/definitions/model.ModelConfig"
  3841. }
  3842. }
  3843. }
  3844. ]
  3845. }
  3846. }
  3847. }
  3848. },
  3849. "delete": {
  3850. "security": [
  3851. {
  3852. "ApiKeyAuth": []
  3853. }
  3854. ],
  3855. "description": "Deletes a model config",
  3856. "produces": [
  3857. "application/json"
  3858. ],
  3859. "tags": [
  3860. "modelconfig"
  3861. ],
  3862. "summary": "Delete model config",
  3863. "parameters": [
  3864. {
  3865. "type": "string",
  3866. "description": "Model name",
  3867. "name": "model",
  3868. "in": "path",
  3869. "required": true
  3870. }
  3871. ],
  3872. "responses": {
  3873. "200": {
  3874. "description": "OK",
  3875. "schema": {
  3876. "$ref": "#/definitions/middleware.APIResponse"
  3877. }
  3878. }
  3879. }
  3880. }
  3881. },
  3882. "/api/model_configs": {
  3883. "get": {
  3884. "security": [
  3885. {
  3886. "ApiKeyAuth": []
  3887. }
  3888. ],
  3889. "description": "Returns a list of model configs with pagination",
  3890. "produces": [
  3891. "application/json"
  3892. ],
  3893. "tags": [
  3894. "modelconfig"
  3895. ],
  3896. "summary": "Get model configs",
  3897. "parameters": [
  3898. {
  3899. "type": "string",
  3900. "description": "Model name",
  3901. "name": "model",
  3902. "in": "query"
  3903. }
  3904. ],
  3905. "responses": {
  3906. "200": {
  3907. "description": "OK",
  3908. "schema": {
  3909. "allOf": [
  3910. {
  3911. "$ref": "#/definitions/middleware.APIResponse"
  3912. },
  3913. {
  3914. "type": "object",
  3915. "properties": {
  3916. "data": {
  3917. "type": "object",
  3918. "additionalProperties": {
  3919. "allOf": [
  3920. {},
  3921. {
  3922. "type": "object",
  3923. "properties": {
  3924. "configs": {
  3925. "type": "array",
  3926. "items": {
  3927. "$ref": "#/definitions/model.ModelConfig"
  3928. }
  3929. },
  3930. "total": {
  3931. "type": "integer"
  3932. }
  3933. }
  3934. }
  3935. ]
  3936. }
  3937. }
  3938. }
  3939. }
  3940. ]
  3941. }
  3942. }
  3943. }
  3944. },
  3945. "post": {
  3946. "security": [
  3947. {
  3948. "ApiKeyAuth": []
  3949. }
  3950. ],
  3951. "description": "Saves a list of model configs",
  3952. "produces": [
  3953. "application/json"
  3954. ],
  3955. "tags": [
  3956. "modelconfig"
  3957. ],
  3958. "summary": "Save model configs",
  3959. "parameters": [
  3960. {
  3961. "description": "Model configs",
  3962. "name": "configs",
  3963. "in": "body",
  3964. "required": true,
  3965. "schema": {
  3966. "type": "array",
  3967. "items": {
  3968. "$ref": "#/definitions/controller.SaveModelConfigsRequest"
  3969. }
  3970. }
  3971. }
  3972. ],
  3973. "responses": {
  3974. "200": {
  3975. "description": "OK",
  3976. "schema": {
  3977. "$ref": "#/definitions/middleware.APIResponse"
  3978. }
  3979. }
  3980. }
  3981. }
  3982. },
  3983. "/api/model_configs/all": {
  3984. "get": {
  3985. "security": [
  3986. {
  3987. "ApiKeyAuth": []
  3988. }
  3989. ],
  3990. "description": "Returns a list of all model configs",
  3991. "produces": [
  3992. "application/json"
  3993. ],
  3994. "tags": [
  3995. "modelconfig"
  3996. ],
  3997. "summary": "Get all model configs",
  3998. "responses": {
  3999. "200": {
  4000. "description": "OK",
  4001. "schema": {
  4002. "allOf": [
  4003. {
  4004. "$ref": "#/definitions/middleware.APIResponse"
  4005. },
  4006. {
  4007. "type": "object",
  4008. "properties": {
  4009. "data": {
  4010. "type": "array",
  4011. "items": {
  4012. "$ref": "#/definitions/model.ModelConfig"
  4013. }
  4014. }
  4015. }
  4016. }
  4017. ]
  4018. }
  4019. }
  4020. }
  4021. }
  4022. },
  4023. "/api/model_configs/batch_delete": {
  4024. "post": {
  4025. "security": [
  4026. {
  4027. "ApiKeyAuth": []
  4028. }
  4029. ],
  4030. "description": "Deletes a list of model configs",
  4031. "produces": [
  4032. "application/json"
  4033. ],
  4034. "tags": [
  4035. "modelconfig"
  4036. ],
  4037. "summary": "Delete model configs",
  4038. "parameters": [
  4039. {
  4040. "description": "Model names",
  4041. "name": "models",
  4042. "in": "body",
  4043. "required": true,
  4044. "schema": {
  4045. "type": "array",
  4046. "items": {
  4047. "type": "string"
  4048. }
  4049. }
  4050. }
  4051. ],
  4052. "responses": {
  4053. "200": {
  4054. "description": "OK",
  4055. "schema": {
  4056. "$ref": "#/definitions/middleware.APIResponse"
  4057. }
  4058. }
  4059. }
  4060. }
  4061. },
  4062. "/api/model_configs/contains": {
  4063. "post": {
  4064. "security": [
  4065. {
  4066. "ApiKeyAuth": []
  4067. }
  4068. ],
  4069. "description": "Returns a list of model configs by models contains",
  4070. "produces": [
  4071. "application/json"
  4072. ],
  4073. "tags": [
  4074. "modelconfig"
  4075. ],
  4076. "summary": "Get model configs by models contains",
  4077. "parameters": [
  4078. {
  4079. "description": "Models",
  4080. "name": "models",
  4081. "in": "body",
  4082. "required": true,
  4083. "schema": {
  4084. "$ref": "#/definitions/controller.GetModelConfigsByModelsContainsRequest"
  4085. }
  4086. }
  4087. ],
  4088. "responses": {
  4089. "200": {
  4090. "description": "OK",
  4091. "schema": {
  4092. "allOf": [
  4093. {
  4094. "$ref": "#/definitions/middleware.APIResponse"
  4095. },
  4096. {
  4097. "type": "object",
  4098. "properties": {
  4099. "data": {
  4100. "type": "array",
  4101. "items": {
  4102. "$ref": "#/definitions/model.ModelConfig"
  4103. }
  4104. }
  4105. }
  4106. }
  4107. ]
  4108. }
  4109. }
  4110. }
  4111. }
  4112. },
  4113. "/api/model_configs/search": {
  4114. "get": {
  4115. "security": [
  4116. {
  4117. "ApiKeyAuth": []
  4118. }
  4119. ],
  4120. "description": "Returns a list of model configs by keyword",
  4121. "produces": [
  4122. "application/json"
  4123. ],
  4124. "tags": [
  4125. "modelconfig"
  4126. ],
  4127. "summary": "Search model configs",
  4128. "parameters": [
  4129. {
  4130. "type": "string",
  4131. "description": "Keyword",
  4132. "name": "keyword",
  4133. "in": "query"
  4134. },
  4135. {
  4136. "type": "string",
  4137. "description": "Model name",
  4138. "name": "model",
  4139. "in": "query"
  4140. },
  4141. {
  4142. "type": "string",
  4143. "description": "Owner",
  4144. "name": "owner",
  4145. "in": "query"
  4146. },
  4147. {
  4148. "type": "integer",
  4149. "description": "Page",
  4150. "name": "page",
  4151. "in": "query"
  4152. },
  4153. {
  4154. "type": "integer",
  4155. "description": "Per page",
  4156. "name": "per_page",
  4157. "in": "query"
  4158. }
  4159. ],
  4160. "responses": {
  4161. "200": {
  4162. "description": "OK",
  4163. "schema": {
  4164. "allOf": [
  4165. {
  4166. "$ref": "#/definitions/middleware.APIResponse"
  4167. },
  4168. {
  4169. "type": "object",
  4170. "properties": {
  4171. "data": {
  4172. "type": "object",
  4173. "additionalProperties": {
  4174. "allOf": [
  4175. {},
  4176. {
  4177. "type": "object",
  4178. "properties": {
  4179. "configs": {
  4180. "type": "array",
  4181. "items": {
  4182. "$ref": "#/definitions/model.ModelConfig"
  4183. }
  4184. },
  4185. "total": {
  4186. "type": "integer"
  4187. }
  4188. }
  4189. }
  4190. ]
  4191. }
  4192. }
  4193. }
  4194. }
  4195. ]
  4196. }
  4197. }
  4198. }
  4199. }
  4200. },
  4201. "/api/model_cost_rank": {
  4202. "get": {
  4203. "security": [
  4204. {
  4205. "ApiKeyAuth": []
  4206. }
  4207. ],
  4208. "description": "Returns ranking data for models based on cost",
  4209. "produces": [
  4210. "application/json"
  4211. ],
  4212. "tags": [
  4213. "dashboard"
  4214. ],
  4215. "summary": "Get model cost ranking data",
  4216. "parameters": [
  4217. {
  4218. "type": "string",
  4219. "description": "Group or *",
  4220. "name": "group",
  4221. "in": "query"
  4222. },
  4223. {
  4224. "type": "integer",
  4225. "description": "Channel ID",
  4226. "name": "channel",
  4227. "in": "query"
  4228. },
  4229. {
  4230. "type": "integer",
  4231. "description": "Start timestamp",
  4232. "name": "start_timestamp",
  4233. "in": "query"
  4234. },
  4235. {
  4236. "type": "integer",
  4237. "description": "End timestamp",
  4238. "name": "end_timestamp",
  4239. "in": "query"
  4240. }
  4241. ],
  4242. "responses": {
  4243. "200": {
  4244. "description": "OK",
  4245. "schema": {
  4246. "allOf": [
  4247. {
  4248. "$ref": "#/definitions/middleware.APIResponse"
  4249. },
  4250. {
  4251. "type": "object",
  4252. "properties": {
  4253. "data": {
  4254. "type": "array",
  4255. "items": {
  4256. "$ref": "#/definitions/model.ModelCostRank"
  4257. }
  4258. }
  4259. }
  4260. }
  4261. ]
  4262. }
  4263. }
  4264. }
  4265. }
  4266. },
  4267. "/api/model_cost_rank/{group}": {
  4268. "get": {
  4269. "security": [
  4270. {
  4271. "ApiKeyAuth": []
  4272. }
  4273. ],
  4274. "description": "Returns model cost ranking data specific to the given group",
  4275. "produces": [
  4276. "application/json"
  4277. ],
  4278. "tags": [
  4279. "dashboard"
  4280. ],
  4281. "summary": "Get model cost ranking data for a specific group",
  4282. "parameters": [
  4283. {
  4284. "type": "string",
  4285. "description": "Group",
  4286. "name": "group",
  4287. "in": "path",
  4288. "required": true
  4289. },
  4290. {
  4291. "type": "integer",
  4292. "description": "Start timestamp",
  4293. "name": "start_timestamp",
  4294. "in": "query"
  4295. },
  4296. {
  4297. "type": "integer",
  4298. "description": "End timestamp",
  4299. "name": "end_timestamp",
  4300. "in": "query"
  4301. }
  4302. ],
  4303. "responses": {
  4304. "200": {
  4305. "description": "OK",
  4306. "schema": {
  4307. "allOf": [
  4308. {
  4309. "$ref": "#/definitions/middleware.APIResponse"
  4310. },
  4311. {
  4312. "type": "object",
  4313. "properties": {
  4314. "data": {
  4315. "type": "array",
  4316. "items": {
  4317. "$ref": "#/definitions/model.ModelCostRank"
  4318. }
  4319. }
  4320. }
  4321. }
  4322. ]
  4323. }
  4324. }
  4325. }
  4326. }
  4327. },
  4328. "/api/models/builtin": {
  4329. "get": {
  4330. "security": [
  4331. {
  4332. "ApiKeyAuth": []
  4333. }
  4334. ],
  4335. "description": "Returns a list of builtin models",
  4336. "produces": [
  4337. "application/json"
  4338. ],
  4339. "tags": [
  4340. "model"
  4341. ],
  4342. "summary": "Get builtin models",
  4343. "responses": {
  4344. "200": {
  4345. "description": "OK",
  4346. "schema": {
  4347. "allOf": [
  4348. {
  4349. "$ref": "#/definitions/middleware.APIResponse"
  4350. },
  4351. {
  4352. "type": "object",
  4353. "properties": {
  4354. "data": {
  4355. "type": "array",
  4356. "items": {
  4357. "$ref": "#/definitions/controller.BuiltinModelConfig"
  4358. }
  4359. }
  4360. }
  4361. }
  4362. ]
  4363. }
  4364. }
  4365. }
  4366. }
  4367. },
  4368. "/api/models/builtin/channel": {
  4369. "get": {
  4370. "security": [
  4371. {
  4372. "ApiKeyAuth": []
  4373. }
  4374. ],
  4375. "description": "Returns a list of channel builtin models",
  4376. "produces": [
  4377. "application/json"
  4378. ],
  4379. "tags": [
  4380. "model"
  4381. ],
  4382. "summary": "Get channel builtin models",
  4383. "responses": {
  4384. "200": {
  4385. "description": "OK",
  4386. "schema": {
  4387. "allOf": [
  4388. {
  4389. "$ref": "#/definitions/middleware.APIResponse"
  4390. },
  4391. {
  4392. "type": "object",
  4393. "properties": {
  4394. "data": {
  4395. "type": "object",
  4396. "additionalProperties": {
  4397. "type": "array",
  4398. "items": {
  4399. "$ref": "#/definitions/controller.BuiltinModelConfig"
  4400. }
  4401. }
  4402. }
  4403. }
  4404. }
  4405. ]
  4406. }
  4407. }
  4408. }
  4409. }
  4410. },
  4411. "/api/models/builtin/channel/{type}": {
  4412. "get": {
  4413. "security": [
  4414. {
  4415. "ApiKeyAuth": []
  4416. }
  4417. ],
  4418. "description": "Returns a list of channel builtin models by type",
  4419. "produces": [
  4420. "application/json"
  4421. ],
  4422. "tags": [
  4423. "model"
  4424. ],
  4425. "summary": "Get channel builtin models by type",
  4426. "parameters": [
  4427. {
  4428. "enum": [
  4429. 1,
  4430. 3,
  4431. 12,
  4432. 13,
  4433. 14,
  4434. 15,
  4435. 16,
  4436. 17,
  4437. 18,
  4438. 19,
  4439. 20,
  4440. 23,
  4441. 24,
  4442. 25,
  4443. 26,
  4444. 27,
  4445. 28,
  4446. 29,
  4447. 30,
  4448. 31,
  4449. 32,
  4450. 33,
  4451. 34,
  4452. 35,
  4453. 36,
  4454. 37,
  4455. 40,
  4456. 41,
  4457. 42,
  4458. 43,
  4459. 44,
  4460. 45,
  4461. 46,
  4462. 47
  4463. ],
  4464. "type": "integer",
  4465. "description": "Channel type",
  4466. "name": "type",
  4467. "in": "path",
  4468. "required": true
  4469. }
  4470. ],
  4471. "responses": {
  4472. "200": {
  4473. "description": "OK",
  4474. "schema": {
  4475. "allOf": [
  4476. {
  4477. "$ref": "#/definitions/middleware.APIResponse"
  4478. },
  4479. {
  4480. "type": "object",
  4481. "properties": {
  4482. "data": {
  4483. "type": "array",
  4484. "items": {
  4485. "$ref": "#/definitions/controller.BuiltinModelConfig"
  4486. }
  4487. }
  4488. }
  4489. }
  4490. ]
  4491. }
  4492. }
  4493. }
  4494. }
  4495. },
  4496. "/api/models/channel": {
  4497. "get": {
  4498. "security": [
  4499. {
  4500. "ApiKeyAuth": []
  4501. }
  4502. ],
  4503. "description": "Returns a list of enabled models",
  4504. "produces": [
  4505. "application/json"
  4506. ],
  4507. "tags": [
  4508. "model"
  4509. ],
  4510. "summary": "Get enabled models and channels",
  4511. "responses": {
  4512. "200": {
  4513. "description": "OK",
  4514. "schema": {
  4515. "allOf": [
  4516. {
  4517. "$ref": "#/definitions/middleware.APIResponse"
  4518. },
  4519. {
  4520. "type": "object",
  4521. "properties": {
  4522. "data": {
  4523. "type": "object",
  4524. "additionalProperties": {
  4525. "type": "object",
  4526. "additionalProperties": {
  4527. "type": "array",
  4528. "items": {
  4529. "$ref": "#/definitions/controller.EnabledModelChannel"
  4530. }
  4531. }
  4532. }
  4533. }
  4534. }
  4535. }
  4536. ]
  4537. }
  4538. }
  4539. }
  4540. }
  4541. },
  4542. "/api/models/channel/{set}": {
  4543. "get": {
  4544. "security": [
  4545. {
  4546. "ApiKeyAuth": []
  4547. }
  4548. ],
  4549. "description": "Returns a list of enabled models and channels by set",
  4550. "produces": [
  4551. "application/json"
  4552. ],
  4553. "tags": [
  4554. "model"
  4555. ],
  4556. "summary": "Get enabled models and channels by set",
  4557. "parameters": [
  4558. {
  4559. "type": "string",
  4560. "description": "Models set",
  4561. "name": "set",
  4562. "in": "path",
  4563. "required": true
  4564. }
  4565. ],
  4566. "responses": {
  4567. "200": {
  4568. "description": "OK",
  4569. "schema": {
  4570. "allOf": [
  4571. {
  4572. "$ref": "#/definitions/middleware.APIResponse"
  4573. },
  4574. {
  4575. "type": "object",
  4576. "properties": {
  4577. "data": {
  4578. "type": "object",
  4579. "additionalProperties": {
  4580. "type": "array",
  4581. "items": {
  4582. "$ref": "#/definitions/controller.EnabledModelChannel"
  4583. }
  4584. }
  4585. }
  4586. }
  4587. }
  4588. ]
  4589. }
  4590. }
  4591. }
  4592. }
  4593. },
  4594. "/api/models/default": {
  4595. "get": {
  4596. "security": [
  4597. {
  4598. "ApiKeyAuth": []
  4599. }
  4600. ],
  4601. "description": "Returns a list of channel default models and mapping",
  4602. "produces": [
  4603. "application/json"
  4604. ],
  4605. "tags": [
  4606. "model"
  4607. ],
  4608. "summary": "Get channel default models and mapping",
  4609. "responses": {
  4610. "200": {
  4611. "description": "OK",
  4612. "schema": {
  4613. "allOf": [
  4614. {
  4615. "$ref": "#/definitions/middleware.APIResponse"
  4616. },
  4617. {
  4618. "type": "object",
  4619. "properties": {
  4620. "data": {
  4621. "type": "object",
  4622. "additionalProperties": {
  4623. "allOf": [
  4624. {},
  4625. {
  4626. "type": "object",
  4627. "properties": {
  4628. "mapping": {
  4629. "type": "object",
  4630. "additionalProperties": {
  4631. "type": "string"
  4632. }
  4633. },
  4634. "models": {
  4635. "type": "array",
  4636. "items": {
  4637. "type": "string"
  4638. }
  4639. }
  4640. }
  4641. }
  4642. ]
  4643. }
  4644. }
  4645. }
  4646. }
  4647. ]
  4648. }
  4649. }
  4650. }
  4651. }
  4652. },
  4653. "/api/models/default/{type}": {
  4654. "get": {
  4655. "security": [
  4656. {
  4657. "ApiKeyAuth": []
  4658. }
  4659. ],
  4660. "description": "Returns a list of channel default models and mapping by type",
  4661. "produces": [
  4662. "application/json"
  4663. ],
  4664. "tags": [
  4665. "model"
  4666. ],
  4667. "summary": "Get channel default models and mapping by type",
  4668. "parameters": [
  4669. {
  4670. "type": "string",
  4671. "description": "Channel type",
  4672. "name": "type",
  4673. "in": "path",
  4674. "required": true
  4675. }
  4676. ],
  4677. "responses": {
  4678. "200": {
  4679. "description": "OK",
  4680. "schema": {
  4681. "allOf": [
  4682. {
  4683. "$ref": "#/definitions/middleware.APIResponse"
  4684. },
  4685. {
  4686. "type": "object",
  4687. "properties": {
  4688. "data": {
  4689. "type": "object",
  4690. "additionalProperties": {
  4691. "allOf": [
  4692. {},
  4693. {
  4694. "type": "object",
  4695. "properties": {
  4696. "mapping": {
  4697. "type": "object",
  4698. "additionalProperties": {
  4699. "type": "string"
  4700. }
  4701. },
  4702. "models": {
  4703. "type": "array",
  4704. "items": {
  4705. "type": "string"
  4706. }
  4707. }
  4708. }
  4709. }
  4710. ]
  4711. }
  4712. }
  4713. }
  4714. }
  4715. ]
  4716. }
  4717. }
  4718. }
  4719. }
  4720. },
  4721. "/api/models/enabled": {
  4722. "get": {
  4723. "security": [
  4724. {
  4725. "ApiKeyAuth": []
  4726. }
  4727. ],
  4728. "description": "Returns a list of enabled models",
  4729. "produces": [
  4730. "application/json"
  4731. ],
  4732. "tags": [
  4733. "model"
  4734. ],
  4735. "summary": "Get enabled models",
  4736. "responses": {
  4737. "200": {
  4738. "description": "OK",
  4739. "schema": {
  4740. "allOf": [
  4741. {
  4742. "$ref": "#/definitions/middleware.APIResponse"
  4743. },
  4744. {
  4745. "type": "object",
  4746. "properties": {
  4747. "data": {
  4748. "type": "object",
  4749. "additionalProperties": {
  4750. "type": "array",
  4751. "items": {
  4752. "$ref": "#/definitions/model.ModelConfig"
  4753. }
  4754. }
  4755. }
  4756. }
  4757. }
  4758. ]
  4759. }
  4760. }
  4761. }
  4762. }
  4763. },
  4764. "/api/models/enabled/{set}": {
  4765. "get": {
  4766. "security": [
  4767. {
  4768. "ApiKeyAuth": []
  4769. }
  4770. ],
  4771. "description": "Returns a list of enabled models by set",
  4772. "produces": [
  4773. "application/json"
  4774. ],
  4775. "tags": [
  4776. "model"
  4777. ],
  4778. "summary": "Get enabled models by set",
  4779. "parameters": [
  4780. {
  4781. "type": "string",
  4782. "description": "Models set",
  4783. "name": "set",
  4784. "in": "path",
  4785. "required": true
  4786. }
  4787. ],
  4788. "responses": {
  4789. "200": {
  4790. "description": "OK",
  4791. "schema": {
  4792. "allOf": [
  4793. {
  4794. "$ref": "#/definitions/middleware.APIResponse"
  4795. },
  4796. {
  4797. "type": "object",
  4798. "properties": {
  4799. "data": {
  4800. "type": "array",
  4801. "items": {
  4802. "$ref": "#/definitions/model.ModelConfig"
  4803. }
  4804. }
  4805. }
  4806. }
  4807. ]
  4808. }
  4809. }
  4810. }
  4811. }
  4812. },
  4813. "/api/monitor": {
  4814. "get": {
  4815. "security": [
  4816. {
  4817. "ApiKeyAuth": []
  4818. }
  4819. ],
  4820. "description": "Returns a list of all channel model error rates",
  4821. "produces": [
  4822. "application/json"
  4823. ],
  4824. "tags": [
  4825. "monitor"
  4826. ],
  4827. "summary": "Get all channel model error rates",
  4828. "responses": {
  4829. "200": {
  4830. "description": "OK",
  4831. "schema": {
  4832. "allOf": [
  4833. {
  4834. "$ref": "#/definitions/middleware.APIResponse"
  4835. },
  4836. {
  4837. "type": "object",
  4838. "properties": {
  4839. "data": {
  4840. "type": "object",
  4841. "additionalProperties": {
  4842. "type": "object",
  4843. "additionalProperties": {
  4844. "type": "number"
  4845. }
  4846. }
  4847. }
  4848. }
  4849. }
  4850. ]
  4851. }
  4852. }
  4853. }
  4854. },
  4855. "delete": {
  4856. "security": [
  4857. {
  4858. "ApiKeyAuth": []
  4859. }
  4860. ],
  4861. "description": "Clears all model errors",
  4862. "produces": [
  4863. "application/json"
  4864. ],
  4865. "tags": [
  4866. "monitor"
  4867. ],
  4868. "summary": "Clear all model errors",
  4869. "responses": {
  4870. "200": {
  4871. "description": "OK",
  4872. "schema": {
  4873. "$ref": "#/definitions/middleware.APIResponse"
  4874. }
  4875. }
  4876. }
  4877. }
  4878. },
  4879. "/api/monitor/banned_channels": {
  4880. "get": {
  4881. "security": [
  4882. {
  4883. "ApiKeyAuth": []
  4884. }
  4885. ],
  4886. "description": "Returns a list of all banned model channels",
  4887. "produces": [
  4888. "application/json"
  4889. ],
  4890. "tags": [
  4891. "monitor"
  4892. ],
  4893. "summary": "Get all banned model channels",
  4894. "responses": {
  4895. "200": {
  4896. "description": "OK",
  4897. "schema": {
  4898. "allOf": [
  4899. {
  4900. "$ref": "#/definitions/middleware.APIResponse"
  4901. },
  4902. {
  4903. "type": "object",
  4904. "properties": {
  4905. "data": {
  4906. "type": "object",
  4907. "additionalProperties": {
  4908. "type": "array",
  4909. "items": {
  4910. "type": "integer"
  4911. }
  4912. }
  4913. }
  4914. }
  4915. }
  4916. ]
  4917. }
  4918. }
  4919. }
  4920. }
  4921. },
  4922. "/api/monitor/models": {
  4923. "get": {
  4924. "security": [
  4925. {
  4926. "ApiKeyAuth": []
  4927. }
  4928. ],
  4929. "description": "Returns a list of models error rate",
  4930. "produces": [
  4931. "application/json"
  4932. ],
  4933. "tags": [
  4934. "monitor"
  4935. ],
  4936. "summary": "Get models error rate",
  4937. "responses": {
  4938. "200": {
  4939. "description": "OK",
  4940. "schema": {
  4941. "allOf": [
  4942. {
  4943. "$ref": "#/definitions/middleware.APIResponse"
  4944. },
  4945. {
  4946. "type": "object",
  4947. "properties": {
  4948. "data": {
  4949. "type": "object",
  4950. "additionalProperties": {
  4951. "type": "number"
  4952. }
  4953. }
  4954. }
  4955. }
  4956. ]
  4957. }
  4958. }
  4959. }
  4960. }
  4961. },
  4962. "/api/monitor/{id}": {
  4963. "get": {
  4964. "security": [
  4965. {
  4966. "ApiKeyAuth": []
  4967. }
  4968. ],
  4969. "description": "Returns a list of channel model error rates",
  4970. "produces": [
  4971. "application/json"
  4972. ],
  4973. "tags": [
  4974. "monitor"
  4975. ],
  4976. "summary": "Get channel model error rates",
  4977. "parameters": [
  4978. {
  4979. "type": "integer",
  4980. "description": "Channel ID",
  4981. "name": "id",
  4982. "in": "path",
  4983. "required": true
  4984. }
  4985. ],
  4986. "responses": {
  4987. "200": {
  4988. "description": "OK",
  4989. "schema": {
  4990. "allOf": [
  4991. {
  4992. "$ref": "#/definitions/middleware.APIResponse"
  4993. },
  4994. {
  4995. "type": "object",
  4996. "properties": {
  4997. "data": {
  4998. "type": "array",
  4999. "items": {
  5000. "type": "object",
  5001. "additionalProperties": {
  5002. "type": "number"
  5003. }
  5004. }
  5005. }
  5006. }
  5007. }
  5008. ]
  5009. }
  5010. }
  5011. }
  5012. },
  5013. "delete": {
  5014. "security": [
  5015. {
  5016. "ApiKeyAuth": []
  5017. }
  5018. ],
  5019. "description": "Clears all model errors for a specific channel",
  5020. "produces": [
  5021. "application/json"
  5022. ],
  5023. "tags": [
  5024. "monitor"
  5025. ],
  5026. "summary": "Clear channel all model errors",
  5027. "parameters": [
  5028. {
  5029. "type": "integer",
  5030. "description": "Channel ID",
  5031. "name": "id",
  5032. "in": "path",
  5033. "required": true
  5034. }
  5035. ],
  5036. "responses": {
  5037. "200": {
  5038. "description": "OK",
  5039. "schema": {
  5040. "$ref": "#/definitions/middleware.APIResponse"
  5041. }
  5042. }
  5043. }
  5044. }
  5045. },
  5046. "/api/monitor/{id}/{model}": {
  5047. "delete": {
  5048. "security": [
  5049. {
  5050. "ApiKeyAuth": []
  5051. }
  5052. ],
  5053. "description": "Clears model errors for a specific channel and model",
  5054. "produces": [
  5055. "application/json"
  5056. ],
  5057. "tags": [
  5058. "monitor"
  5059. ],
  5060. "summary": "Clear channel model errors",
  5061. "parameters": [
  5062. {
  5063. "type": "integer",
  5064. "description": "Channel ID",
  5065. "name": "id",
  5066. "in": "path",
  5067. "required": true
  5068. },
  5069. {
  5070. "type": "string",
  5071. "description": "Model name",
  5072. "name": "model",
  5073. "in": "path",
  5074. "required": true
  5075. }
  5076. ],
  5077. "responses": {
  5078. "200": {
  5079. "description": "OK",
  5080. "schema": {
  5081. "$ref": "#/definitions/middleware.APIResponse"
  5082. }
  5083. }
  5084. }
  5085. }
  5086. },
  5087. "/api/options": {
  5088. "get": {
  5089. "security": [
  5090. {
  5091. "ApiKeyAuth": []
  5092. }
  5093. ],
  5094. "description": "Returns a list of options",
  5095. "produces": [
  5096. "application/json"
  5097. ],
  5098. "tags": [
  5099. "option"
  5100. ],
  5101. "summary": "Get options",
  5102. "responses": {
  5103. "200": {
  5104. "description": "OK",
  5105. "schema": {
  5106. "allOf": [
  5107. {
  5108. "$ref": "#/definitions/middleware.APIResponse"
  5109. },
  5110. {
  5111. "type": "object",
  5112. "properties": {
  5113. "data": {
  5114. "type": "object",
  5115. "additionalProperties": {
  5116. "type": "string"
  5117. }
  5118. }
  5119. }
  5120. }
  5121. ]
  5122. }
  5123. }
  5124. }
  5125. },
  5126. "post": {
  5127. "security": [
  5128. {
  5129. "ApiKeyAuth": []
  5130. }
  5131. ],
  5132. "description": "Updates multiple options",
  5133. "produces": [
  5134. "application/json"
  5135. ],
  5136. "tags": [
  5137. "option"
  5138. ],
  5139. "summary": "Update options",
  5140. "parameters": [
  5141. {
  5142. "description": "Options",
  5143. "name": "options",
  5144. "in": "body",
  5145. "required": true,
  5146. "schema": {
  5147. "type": "object",
  5148. "additionalProperties": {
  5149. "type": "string"
  5150. }
  5151. }
  5152. }
  5153. ],
  5154. "responses": {
  5155. "200": {
  5156. "description": "OK",
  5157. "schema": {
  5158. "$ref": "#/definitions/middleware.APIResponse"
  5159. }
  5160. }
  5161. }
  5162. }
  5163. },
  5164. "/api/options/": {
  5165. "put": {
  5166. "security": [
  5167. {
  5168. "ApiKeyAuth": []
  5169. }
  5170. ],
  5171. "description": "Updates a single option",
  5172. "produces": [
  5173. "application/json"
  5174. ],
  5175. "tags": [
  5176. "option"
  5177. ],
  5178. "summary": "Update option",
  5179. "parameters": [
  5180. {
  5181. "description": "Option value",
  5182. "name": "value",
  5183. "in": "body",
  5184. "required": true,
  5185. "schema": {
  5186. "$ref": "#/definitions/model.Option"
  5187. }
  5188. }
  5189. ],
  5190. "responses": {
  5191. "200": {
  5192. "description": "OK",
  5193. "schema": {
  5194. "$ref": "#/definitions/middleware.APIResponse"
  5195. }
  5196. }
  5197. }
  5198. },
  5199. "post": {
  5200. "security": [
  5201. {
  5202. "ApiKeyAuth": []
  5203. }
  5204. ],
  5205. "description": "Updates a single option",
  5206. "produces": [
  5207. "application/json"
  5208. ],
  5209. "tags": [
  5210. "option"
  5211. ],
  5212. "summary": "Update option",
  5213. "parameters": [
  5214. {
  5215. "description": "Option value",
  5216. "name": "value",
  5217. "in": "body",
  5218. "required": true,
  5219. "schema": {
  5220. "$ref": "#/definitions/model.Option"
  5221. }
  5222. }
  5223. ],
  5224. "responses": {
  5225. "200": {
  5226. "description": "OK",
  5227. "schema": {
  5228. "$ref": "#/definitions/middleware.APIResponse"
  5229. }
  5230. }
  5231. }
  5232. }
  5233. },
  5234. "/api/options/{key}": {
  5235. "get": {
  5236. "security": [
  5237. {
  5238. "ApiKeyAuth": []
  5239. }
  5240. ],
  5241. "description": "Returns a single option",
  5242. "produces": [
  5243. "application/json"
  5244. ],
  5245. "tags": [
  5246. "option"
  5247. ],
  5248. "summary": "Get option",
  5249. "parameters": [
  5250. {
  5251. "type": "string",
  5252. "description": "Option key",
  5253. "name": "key",
  5254. "in": "path",
  5255. "required": true
  5256. }
  5257. ],
  5258. "responses": {
  5259. "200": {
  5260. "description": "OK",
  5261. "schema": {
  5262. "allOf": [
  5263. {
  5264. "$ref": "#/definitions/middleware.APIResponse"
  5265. },
  5266. {
  5267. "type": "object",
  5268. "properties": {
  5269. "data": {
  5270. "$ref": "#/definitions/model.Option"
  5271. }
  5272. }
  5273. }
  5274. ]
  5275. }
  5276. }
  5277. }
  5278. },
  5279. "put": {
  5280. "security": [
  5281. {
  5282. "ApiKeyAuth": []
  5283. }
  5284. ],
  5285. "description": "Updates a single option by key",
  5286. "produces": [
  5287. "application/json"
  5288. ],
  5289. "tags": [
  5290. "option"
  5291. ],
  5292. "summary": "Update option by key",
  5293. "parameters": [
  5294. {
  5295. "type": "string",
  5296. "description": "Option key",
  5297. "name": "key",
  5298. "in": "path",
  5299. "required": true
  5300. },
  5301. {
  5302. "description": "Option value",
  5303. "name": "value",
  5304. "in": "body",
  5305. "required": true,
  5306. "schema": {
  5307. "type": "string"
  5308. }
  5309. }
  5310. ],
  5311. "responses": {
  5312. "200": {
  5313. "description": "OK",
  5314. "schema": {
  5315. "$ref": "#/definitions/middleware.APIResponse"
  5316. }
  5317. }
  5318. }
  5319. }
  5320. },
  5321. "/api/status": {
  5322. "get": {
  5323. "description": "Returns the status of the server",
  5324. "produces": [
  5325. "application/json"
  5326. ],
  5327. "tags": [
  5328. "misc"
  5329. ],
  5330. "summary": "Get status",
  5331. "responses": {
  5332. "200": {
  5333. "description": "OK",
  5334. "schema": {
  5335. "allOf": [
  5336. {
  5337. "$ref": "#/definitions/middleware.APIResponse"
  5338. },
  5339. {
  5340. "type": "object",
  5341. "properties": {
  5342. "data": {
  5343. "$ref": "#/definitions/controller.StatusData"
  5344. }
  5345. }
  5346. }
  5347. ]
  5348. }
  5349. }
  5350. }
  5351. }
  5352. },
  5353. "/api/token/{group}": {
  5354. "post": {
  5355. "security": [
  5356. {
  5357. "ApiKeyAuth": []
  5358. }
  5359. ],
  5360. "description": "Adds a new token to a specific group",
  5361. "consumes": [
  5362. "application/json"
  5363. ],
  5364. "produces": [
  5365. "application/json"
  5366. ],
  5367. "tags": [
  5368. "token"
  5369. ],
  5370. "summary": "Add group token",
  5371. "parameters": [
  5372. {
  5373. "type": "string",
  5374. "description": "Group name",
  5375. "name": "group",
  5376. "in": "path",
  5377. "required": true
  5378. },
  5379. {
  5380. "type": "boolean",
  5381. "description": "Auto create group",
  5382. "name": "auto_create_group",
  5383. "in": "query"
  5384. },
  5385. {
  5386. "type": "boolean",
  5387. "description": "Ignore exist",
  5388. "name": "ignore_exist",
  5389. "in": "query"
  5390. },
  5391. {
  5392. "description": "Token information",
  5393. "name": "token",
  5394. "in": "body",
  5395. "required": true,
  5396. "schema": {
  5397. "$ref": "#/definitions/controller.AddTokenRequest"
  5398. }
  5399. }
  5400. ],
  5401. "responses": {
  5402. "200": {
  5403. "description": "OK",
  5404. "schema": {
  5405. "allOf": [
  5406. {
  5407. "$ref": "#/definitions/middleware.APIResponse"
  5408. },
  5409. {
  5410. "type": "object",
  5411. "properties": {
  5412. "data": {
  5413. "$ref": "#/definitions/controller.TokenResponse"
  5414. }
  5415. }
  5416. }
  5417. ]
  5418. }
  5419. }
  5420. }
  5421. }
  5422. },
  5423. "/api/token/{group}/batch_delete": {
  5424. "post": {
  5425. "security": [
  5426. {
  5427. "ApiKeyAuth": []
  5428. }
  5429. ],
  5430. "description": "Deletes multiple tokens from a specific group",
  5431. "produces": [
  5432. "application/json"
  5433. ],
  5434. "tags": [
  5435. "token"
  5436. ],
  5437. "summary": "Delete group tokens",
  5438. "parameters": [
  5439. {
  5440. "type": "string",
  5441. "description": "Group name",
  5442. "name": "group",
  5443. "in": "path",
  5444. "required": true
  5445. },
  5446. {
  5447. "description": "Token IDs",
  5448. "name": "ids",
  5449. "in": "body",
  5450. "required": true,
  5451. "schema": {
  5452. "type": "array",
  5453. "items": {
  5454. "type": "integer"
  5455. }
  5456. }
  5457. }
  5458. ],
  5459. "responses": {
  5460. "200": {
  5461. "description": "OK",
  5462. "schema": {
  5463. "$ref": "#/definitions/middleware.APIResponse"
  5464. }
  5465. }
  5466. }
  5467. }
  5468. },
  5469. "/api/token/{group}/search": {
  5470. "get": {
  5471. "security": [
  5472. {
  5473. "ApiKeyAuth": []
  5474. }
  5475. ],
  5476. "description": "Returns a paginated list of tokens for a specific group based on search criteria",
  5477. "produces": [
  5478. "application/json"
  5479. ],
  5480. "tags": [
  5481. "token"
  5482. ],
  5483. "summary": "Search tokens for a specific group",
  5484. "parameters": [
  5485. {
  5486. "type": "string",
  5487. "description": "Group name",
  5488. "name": "group",
  5489. "in": "path",
  5490. "required": true
  5491. },
  5492. {
  5493. "type": "string",
  5494. "description": "Keyword",
  5495. "name": "keyword",
  5496. "in": "query"
  5497. },
  5498. {
  5499. "type": "integer",
  5500. "description": "Page number",
  5501. "name": "page",
  5502. "in": "query"
  5503. },
  5504. {
  5505. "type": "integer",
  5506. "description": "Items per page",
  5507. "name": "per_page",
  5508. "in": "query"
  5509. },
  5510. {
  5511. "type": "string",
  5512. "description": "Order",
  5513. "name": "order",
  5514. "in": "query"
  5515. },
  5516. {
  5517. "type": "string",
  5518. "description": "Name",
  5519. "name": "name",
  5520. "in": "query"
  5521. },
  5522. {
  5523. "type": "string",
  5524. "description": "Key",
  5525. "name": "key",
  5526. "in": "query"
  5527. },
  5528. {
  5529. "type": "integer",
  5530. "description": "Status",
  5531. "name": "status",
  5532. "in": "query"
  5533. }
  5534. ],
  5535. "responses": {
  5536. "200": {
  5537. "description": "OK",
  5538. "schema": {
  5539. "allOf": [
  5540. {
  5541. "$ref": "#/definitions/middleware.APIResponse"
  5542. },
  5543. {
  5544. "type": "object",
  5545. "properties": {
  5546. "data": {
  5547. "type": "object",
  5548. "additionalProperties": {
  5549. "allOf": [
  5550. {},
  5551. {
  5552. "type": "object",
  5553. "properties": {
  5554. "tokens": {
  5555. "type": "array",
  5556. "items": {
  5557. "$ref": "#/definitions/controller.TokenResponse"
  5558. }
  5559. },
  5560. "total": {
  5561. "type": "integer"
  5562. }
  5563. }
  5564. }
  5565. ]
  5566. }
  5567. }
  5568. }
  5569. }
  5570. ]
  5571. }
  5572. }
  5573. }
  5574. }
  5575. },
  5576. "/api/token/{group}/{id}": {
  5577. "get": {
  5578. "security": [
  5579. {
  5580. "ApiKeyAuth": []
  5581. }
  5582. ],
  5583. "description": "Returns detailed information about a specific token for a specific group",
  5584. "produces": [
  5585. "application/json"
  5586. ],
  5587. "tags": [
  5588. "token"
  5589. ],
  5590. "summary": "Get token by ID for a specific group",
  5591. "parameters": [
  5592. {
  5593. "type": "string",
  5594. "description": "Group name",
  5595. "name": "group",
  5596. "in": "path",
  5597. "required": true
  5598. },
  5599. {
  5600. "type": "integer",
  5601. "description": "Token ID",
  5602. "name": "id",
  5603. "in": "path",
  5604. "required": true
  5605. }
  5606. ],
  5607. "responses": {
  5608. "200": {
  5609. "description": "OK",
  5610. "schema": {
  5611. "allOf": [
  5612. {
  5613. "$ref": "#/definitions/middleware.APIResponse"
  5614. },
  5615. {
  5616. "type": "object",
  5617. "properties": {
  5618. "data": {
  5619. "$ref": "#/definitions/controller.TokenResponse"
  5620. }
  5621. }
  5622. }
  5623. ]
  5624. }
  5625. }
  5626. }
  5627. },
  5628. "put": {
  5629. "security": [
  5630. {
  5631. "ApiKeyAuth": []
  5632. }
  5633. ],
  5634. "description": "Updates an existing token in a specific group",
  5635. "consumes": [
  5636. "application/json"
  5637. ],
  5638. "produces": [
  5639. "application/json"
  5640. ],
  5641. "tags": [
  5642. "token"
  5643. ],
  5644. "summary": "Update group token",
  5645. "parameters": [
  5646. {
  5647. "type": "string",
  5648. "description": "Group name",
  5649. "name": "group",
  5650. "in": "path",
  5651. "required": true
  5652. },
  5653. {
  5654. "type": "integer",
  5655. "description": "Token ID",
  5656. "name": "id",
  5657. "in": "path",
  5658. "required": true
  5659. },
  5660. {
  5661. "description": "Updated token information",
  5662. "name": "token",
  5663. "in": "body",
  5664. "required": true,
  5665. "schema": {
  5666. "$ref": "#/definitions/controller.AddTokenRequest"
  5667. }
  5668. }
  5669. ],
  5670. "responses": {
  5671. "200": {
  5672. "description": "OK",
  5673. "schema": {
  5674. "allOf": [
  5675. {
  5676. "$ref": "#/definitions/middleware.APIResponse"
  5677. },
  5678. {
  5679. "type": "object",
  5680. "properties": {
  5681. "data": {
  5682. "$ref": "#/definitions/controller.TokenResponse"
  5683. }
  5684. }
  5685. }
  5686. ]
  5687. }
  5688. }
  5689. }
  5690. },
  5691. "delete": {
  5692. "security": [
  5693. {
  5694. "ApiKeyAuth": []
  5695. }
  5696. ],
  5697. "description": "Deletes a specific token from a group",
  5698. "produces": [
  5699. "application/json"
  5700. ],
  5701. "tags": [
  5702. "token"
  5703. ],
  5704. "summary": "Delete group token",
  5705. "parameters": [
  5706. {
  5707. "type": "string",
  5708. "description": "Group name",
  5709. "name": "group",
  5710. "in": "path",
  5711. "required": true
  5712. },
  5713. {
  5714. "type": "integer",
  5715. "description": "Token ID",
  5716. "name": "id",
  5717. "in": "path",
  5718. "required": true
  5719. }
  5720. ],
  5721. "responses": {
  5722. "200": {
  5723. "description": "OK",
  5724. "schema": {
  5725. "$ref": "#/definitions/middleware.APIResponse"
  5726. }
  5727. }
  5728. }
  5729. }
  5730. },
  5731. "/api/token/{group}/{id}/name": {
  5732. "post": {
  5733. "security": [
  5734. {
  5735. "ApiKeyAuth": []
  5736. }
  5737. ],
  5738. "description": "Updates the name of a token in a specific group",
  5739. "consumes": [
  5740. "application/json"
  5741. ],
  5742. "produces": [
  5743. "application/json"
  5744. ],
  5745. "tags": [
  5746. "token"
  5747. ],
  5748. "summary": "Update group token name",
  5749. "parameters": [
  5750. {
  5751. "type": "string",
  5752. "description": "Group name",
  5753. "name": "group",
  5754. "in": "path",
  5755. "required": true
  5756. },
  5757. {
  5758. "type": "integer",
  5759. "description": "Token ID",
  5760. "name": "id",
  5761. "in": "path",
  5762. "required": true
  5763. },
  5764. {
  5765. "description": "Name information",
  5766. "name": "name",
  5767. "in": "body",
  5768. "required": true,
  5769. "schema": {
  5770. "$ref": "#/definitions/controller.UpdateTokenNameRequest"
  5771. }
  5772. }
  5773. ],
  5774. "responses": {
  5775. "200": {
  5776. "description": "OK",
  5777. "schema": {
  5778. "$ref": "#/definitions/middleware.APIResponse"
  5779. }
  5780. }
  5781. }
  5782. }
  5783. },
  5784. "/api/token/{group}/{id}/status": {
  5785. "post": {
  5786. "security": [
  5787. {
  5788. "ApiKeyAuth": []
  5789. }
  5790. ],
  5791. "description": "Updates the status of a token in a specific group",
  5792. "consumes": [
  5793. "application/json"
  5794. ],
  5795. "produces": [
  5796. "application/json"
  5797. ],
  5798. "tags": [
  5799. "token"
  5800. ],
  5801. "summary": "Update group token status",
  5802. "parameters": [
  5803. {
  5804. "type": "string",
  5805. "description": "Group name",
  5806. "name": "group",
  5807. "in": "path",
  5808. "required": true
  5809. },
  5810. {
  5811. "type": "integer",
  5812. "description": "Token ID",
  5813. "name": "id",
  5814. "in": "path",
  5815. "required": true
  5816. },
  5817. {
  5818. "description": "Status information",
  5819. "name": "status",
  5820. "in": "body",
  5821. "required": true,
  5822. "schema": {
  5823. "$ref": "#/definitions/controller.UpdateTokenStatusRequest"
  5824. }
  5825. }
  5826. ],
  5827. "responses": {
  5828. "200": {
  5829. "description": "OK",
  5830. "schema": {
  5831. "$ref": "#/definitions/middleware.APIResponse"
  5832. }
  5833. }
  5834. }
  5835. }
  5836. },
  5837. "/api/tokens": {
  5838. "get": {
  5839. "security": [
  5840. {
  5841. "ApiKeyAuth": []
  5842. }
  5843. ],
  5844. "description": "Returns a paginated list of all tokens",
  5845. "produces": [
  5846. "application/json"
  5847. ],
  5848. "tags": [
  5849. "tokens"
  5850. ],
  5851. "summary": "Get all tokens",
  5852. "parameters": [
  5853. {
  5854. "type": "integer",
  5855. "description": "Page number",
  5856. "name": "page",
  5857. "in": "query"
  5858. },
  5859. {
  5860. "type": "integer",
  5861. "description": "Items per page",
  5862. "name": "per_page",
  5863. "in": "query"
  5864. },
  5865. {
  5866. "type": "string",
  5867. "description": "Group name",
  5868. "name": "group",
  5869. "in": "query"
  5870. },
  5871. {
  5872. "type": "string",
  5873. "description": "Order",
  5874. "name": "order",
  5875. "in": "query"
  5876. },
  5877. {
  5878. "type": "integer",
  5879. "description": "Status",
  5880. "name": "status",
  5881. "in": "query"
  5882. }
  5883. ],
  5884. "responses": {
  5885. "200": {
  5886. "description": "OK",
  5887. "schema": {
  5888. "allOf": [
  5889. {
  5890. "$ref": "#/definitions/middleware.APIResponse"
  5891. },
  5892. {
  5893. "type": "object",
  5894. "properties": {
  5895. "data": {
  5896. "type": "object",
  5897. "additionalProperties": {
  5898. "allOf": [
  5899. {},
  5900. {
  5901. "type": "object",
  5902. "properties": {
  5903. "tokens": {
  5904. "type": "array",
  5905. "items": {
  5906. "$ref": "#/definitions/controller.TokenResponse"
  5907. }
  5908. },
  5909. "total": {
  5910. "type": "integer"
  5911. }
  5912. }
  5913. }
  5914. ]
  5915. }
  5916. }
  5917. }
  5918. }
  5919. ]
  5920. }
  5921. }
  5922. }
  5923. }
  5924. },
  5925. "/api/tokens/batch_delete": {
  5926. "post": {
  5927. "security": [
  5928. {
  5929. "ApiKeyAuth": []
  5930. }
  5931. ],
  5932. "description": "Deletes multiple tokens by their IDs",
  5933. "consumes": [
  5934. "application/json"
  5935. ],
  5936. "produces": [
  5937. "application/json"
  5938. ],
  5939. "tags": [
  5940. "tokens"
  5941. ],
  5942. "summary": "Delete multiple tokens",
  5943. "parameters": [
  5944. {
  5945. "description": "Token IDs",
  5946. "name": "ids",
  5947. "in": "body",
  5948. "required": true,
  5949. "schema": {
  5950. "type": "array",
  5951. "items": {
  5952. "type": "integer"
  5953. }
  5954. }
  5955. }
  5956. ],
  5957. "responses": {
  5958. "200": {
  5959. "description": "OK",
  5960. "schema": {
  5961. "$ref": "#/definitions/middleware.APIResponse"
  5962. }
  5963. }
  5964. }
  5965. }
  5966. },
  5967. "/api/tokens/search": {
  5968. "get": {
  5969. "security": [
  5970. {
  5971. "ApiKeyAuth": []
  5972. }
  5973. ],
  5974. "description": "Returns a paginated list of tokens based on search criteria",
  5975. "produces": [
  5976. "application/json"
  5977. ],
  5978. "tags": [
  5979. "tokens"
  5980. ],
  5981. "summary": "Search tokens",
  5982. "parameters": [
  5983. {
  5984. "type": "string",
  5985. "description": "Keyword",
  5986. "name": "keyword",
  5987. "in": "query"
  5988. },
  5989. {
  5990. "type": "integer",
  5991. "description": "Page number",
  5992. "name": "page",
  5993. "in": "query"
  5994. },
  5995. {
  5996. "type": "integer",
  5997. "description": "Items per page",
  5998. "name": "per_page",
  5999. "in": "query"
  6000. },
  6001. {
  6002. "type": "string",
  6003. "description": "Order",
  6004. "name": "order",
  6005. "in": "query"
  6006. },
  6007. {
  6008. "type": "string",
  6009. "description": "Name",
  6010. "name": "name",
  6011. "in": "query"
  6012. },
  6013. {
  6014. "type": "string",
  6015. "description": "Key",
  6016. "name": "key",
  6017. "in": "query"
  6018. },
  6019. {
  6020. "type": "integer",
  6021. "description": "Status",
  6022. "name": "status",
  6023. "in": "query"
  6024. },
  6025. {
  6026. "type": "string",
  6027. "description": "Group",
  6028. "name": "group",
  6029. "in": "query"
  6030. }
  6031. ],
  6032. "responses": {
  6033. "200": {
  6034. "description": "OK",
  6035. "schema": {
  6036. "allOf": [
  6037. {
  6038. "$ref": "#/definitions/middleware.APIResponse"
  6039. },
  6040. {
  6041. "type": "object",
  6042. "properties": {
  6043. "data": {
  6044. "type": "object",
  6045. "additionalProperties": {
  6046. "allOf": [
  6047. {},
  6048. {
  6049. "type": "object",
  6050. "properties": {
  6051. "tokens": {
  6052. "type": "array",
  6053. "items": {
  6054. "$ref": "#/definitions/controller.TokenResponse"
  6055. }
  6056. },
  6057. "total": {
  6058. "type": "integer"
  6059. }
  6060. }
  6061. }
  6062. ]
  6063. }
  6064. }
  6065. }
  6066. }
  6067. ]
  6068. }
  6069. }
  6070. }
  6071. }
  6072. },
  6073. "/api/tokens/{group}": {
  6074. "get": {
  6075. "security": [
  6076. {
  6077. "ApiKeyAuth": []
  6078. }
  6079. ],
  6080. "description": "Returns a paginated list of all tokens for a specific group",
  6081. "produces": [
  6082. "application/json"
  6083. ],
  6084. "tags": [
  6085. "tokens"
  6086. ],
  6087. "summary": "Get all tokens for a specific group",
  6088. "parameters": [
  6089. {
  6090. "type": "string",
  6091. "description": "Group name",
  6092. "name": "group",
  6093. "in": "path",
  6094. "required": true
  6095. },
  6096. {
  6097. "type": "integer",
  6098. "description": "Page number",
  6099. "name": "page",
  6100. "in": "query"
  6101. },
  6102. {
  6103. "type": "integer",
  6104. "description": "Items per page",
  6105. "name": "per_page",
  6106. "in": "query"
  6107. },
  6108. {
  6109. "type": "string",
  6110. "description": "Order",
  6111. "name": "order",
  6112. "in": "query"
  6113. },
  6114. {
  6115. "type": "integer",
  6116. "description": "Status",
  6117. "name": "status",
  6118. "in": "query"
  6119. }
  6120. ],
  6121. "responses": {
  6122. "200": {
  6123. "description": "OK",
  6124. "schema": {
  6125. "allOf": [
  6126. {
  6127. "$ref": "#/definitions/middleware.APIResponse"
  6128. },
  6129. {
  6130. "type": "object",
  6131. "properties": {
  6132. "data": {
  6133. "type": "object",
  6134. "additionalProperties": {
  6135. "allOf": [
  6136. {},
  6137. {
  6138. "type": "object",
  6139. "properties": {
  6140. "tokens": {
  6141. "type": "array",
  6142. "items": {
  6143. "$ref": "#/definitions/controller.TokenResponse"
  6144. }
  6145. },
  6146. "total": {
  6147. "type": "integer"
  6148. }
  6149. }
  6150. }
  6151. ]
  6152. }
  6153. }
  6154. }
  6155. }
  6156. ]
  6157. }
  6158. }
  6159. }
  6160. }
  6161. },
  6162. "/api/tokens/{id}": {
  6163. "get": {
  6164. "security": [
  6165. {
  6166. "ApiKeyAuth": []
  6167. }
  6168. ],
  6169. "description": "Returns detailed information about a specific token",
  6170. "produces": [
  6171. "application/json"
  6172. ],
  6173. "tags": [
  6174. "tokens"
  6175. ],
  6176. "summary": "Get token by ID",
  6177. "parameters": [
  6178. {
  6179. "type": "integer",
  6180. "description": "Token ID",
  6181. "name": "id",
  6182. "in": "path",
  6183. "required": true
  6184. }
  6185. ],
  6186. "responses": {
  6187. "200": {
  6188. "description": "OK",
  6189. "schema": {
  6190. "allOf": [
  6191. {
  6192. "$ref": "#/definitions/middleware.APIResponse"
  6193. },
  6194. {
  6195. "type": "object",
  6196. "properties": {
  6197. "data": {
  6198. "$ref": "#/definitions/controller.TokenResponse"
  6199. }
  6200. }
  6201. }
  6202. ]
  6203. }
  6204. }
  6205. }
  6206. },
  6207. "put": {
  6208. "security": [
  6209. {
  6210. "ApiKeyAuth": []
  6211. }
  6212. ],
  6213. "description": "Updates an existing token's information",
  6214. "consumes": [
  6215. "application/json"
  6216. ],
  6217. "produces": [
  6218. "application/json"
  6219. ],
  6220. "tags": [
  6221. "tokens"
  6222. ],
  6223. "summary": "Update token",
  6224. "parameters": [
  6225. {
  6226. "type": "integer",
  6227. "description": "Token ID",
  6228. "name": "id",
  6229. "in": "path",
  6230. "required": true
  6231. },
  6232. {
  6233. "description": "Updated token information",
  6234. "name": "token",
  6235. "in": "body",
  6236. "required": true,
  6237. "schema": {
  6238. "$ref": "#/definitions/controller.AddTokenRequest"
  6239. }
  6240. }
  6241. ],
  6242. "responses": {
  6243. "200": {
  6244. "description": "OK",
  6245. "schema": {
  6246. "allOf": [
  6247. {
  6248. "$ref": "#/definitions/middleware.APIResponse"
  6249. },
  6250. {
  6251. "type": "object",
  6252. "properties": {
  6253. "data": {
  6254. "$ref": "#/definitions/controller.TokenResponse"
  6255. }
  6256. }
  6257. }
  6258. ]
  6259. }
  6260. }
  6261. }
  6262. },
  6263. "delete": {
  6264. "security": [
  6265. {
  6266. "ApiKeyAuth": []
  6267. }
  6268. ],
  6269. "description": "Deletes a specific token by ID",
  6270. "produces": [
  6271. "application/json"
  6272. ],
  6273. "tags": [
  6274. "tokens"
  6275. ],
  6276. "summary": "Delete token",
  6277. "parameters": [
  6278. {
  6279. "type": "integer",
  6280. "description": "Token ID",
  6281. "name": "id",
  6282. "in": "path",
  6283. "required": true
  6284. }
  6285. ],
  6286. "responses": {
  6287. "200": {
  6288. "description": "OK",
  6289. "schema": {
  6290. "$ref": "#/definitions/middleware.APIResponse"
  6291. }
  6292. }
  6293. }
  6294. }
  6295. },
  6296. "/api/tokens/{id}/name": {
  6297. "post": {
  6298. "security": [
  6299. {
  6300. "ApiKeyAuth": []
  6301. }
  6302. ],
  6303. "description": "Updates the name of a specific token",
  6304. "consumes": [
  6305. "application/json"
  6306. ],
  6307. "produces": [
  6308. "application/json"
  6309. ],
  6310. "tags": [
  6311. "tokens"
  6312. ],
  6313. "summary": "Update token name",
  6314. "parameters": [
  6315. {
  6316. "type": "integer",
  6317. "description": "Token ID",
  6318. "name": "id",
  6319. "in": "path",
  6320. "required": true
  6321. },
  6322. {
  6323. "description": "Name information",
  6324. "name": "name",
  6325. "in": "body",
  6326. "required": true,
  6327. "schema": {
  6328. "$ref": "#/definitions/controller.UpdateTokenNameRequest"
  6329. }
  6330. }
  6331. ],
  6332. "responses": {
  6333. "200": {
  6334. "description": "OK",
  6335. "schema": {
  6336. "$ref": "#/definitions/middleware.APIResponse"
  6337. }
  6338. }
  6339. }
  6340. }
  6341. },
  6342. "/api/tokens/{id}/status": {
  6343. "post": {
  6344. "security": [
  6345. {
  6346. "ApiKeyAuth": []
  6347. }
  6348. ],
  6349. "description": "Updates the status of a specific token",
  6350. "consumes": [
  6351. "application/json"
  6352. ],
  6353. "produces": [
  6354. "application/json"
  6355. ],
  6356. "tags": [
  6357. "tokens"
  6358. ],
  6359. "summary": "Update token status",
  6360. "parameters": [
  6361. {
  6362. "type": "integer",
  6363. "description": "Token ID",
  6364. "name": "id",
  6365. "in": "path",
  6366. "required": true
  6367. },
  6368. {
  6369. "description": "Status information",
  6370. "name": "status",
  6371. "in": "body",
  6372. "required": true,
  6373. "schema": {
  6374. "$ref": "#/definitions/controller.UpdateTokenStatusRequest"
  6375. }
  6376. }
  6377. ],
  6378. "responses": {
  6379. "200": {
  6380. "description": "OK",
  6381. "schema": {
  6382. "$ref": "#/definitions/middleware.APIResponse"
  6383. }
  6384. }
  6385. }
  6386. }
  6387. },
  6388. "/mcp/group/message": {
  6389. "post": {
  6390. "summary": "MCP SSE Proxy",
  6391. "responses": {}
  6392. }
  6393. },
  6394. "/mcp/group/{id}/sse": {
  6395. "get": {
  6396. "summary": "Group MCP SSE Server",
  6397. "responses": {}
  6398. }
  6399. },
  6400. "/mcp/group/{id}/streamable": {
  6401. "get": {
  6402. "summary": "Group MCP Streamable Server",
  6403. "responses": {}
  6404. },
  6405. "post": {
  6406. "summary": "Group MCP Streamable Server",
  6407. "responses": {}
  6408. },
  6409. "delete": {
  6410. "summary": "Group MCP Streamable Server",
  6411. "responses": {}
  6412. }
  6413. },
  6414. "/mcp/public/message": {
  6415. "post": {
  6416. "summary": "Public MCP SSE Server",
  6417. "responses": {}
  6418. }
  6419. },
  6420. "/mcp/public/{id}/sse": {
  6421. "get": {
  6422. "summary": "Public MCP SSE Server",
  6423. "responses": {}
  6424. }
  6425. },
  6426. "/mcp/public/{id}/streamable": {
  6427. "get": {
  6428. "summary": "Public MCP Streamable Server",
  6429. "responses": {}
  6430. },
  6431. "post": {
  6432. "summary": "Public MCP Streamable Server",
  6433. "responses": {}
  6434. },
  6435. "delete": {
  6436. "summary": "Public MCP Streamable Server",
  6437. "responses": {}
  6438. }
  6439. },
  6440. "/v1/audio/speech": {
  6441. "post": {
  6442. "security": [
  6443. {
  6444. "ApiKeyAuth": []
  6445. }
  6446. ],
  6447. "description": "AudioSpeech",
  6448. "produces": [
  6449. "application/json"
  6450. ],
  6451. "tags": [
  6452. "relay"
  6453. ],
  6454. "summary": "AudioSpeech",
  6455. "parameters": [
  6456. {
  6457. "description": "Request",
  6458. "name": "request",
  6459. "in": "body",
  6460. "required": true,
  6461. "schema": {
  6462. "$ref": "#/definitions/model.TextToSpeechRequest"
  6463. }
  6464. },
  6465. {
  6466. "type": "string",
  6467. "description": "Optional Aiproxy-Channel header",
  6468. "name": "Aiproxy-Channel",
  6469. "in": "header"
  6470. }
  6471. ],
  6472. "responses": {
  6473. "200": {
  6474. "description": "audio binary",
  6475. "schema": {
  6476. "type": "file"
  6477. },
  6478. "headers": {
  6479. "X-RateLimit-Limit-Requests": {
  6480. "type": "integer",
  6481. "description": "X-RateLimit-Limit-Requests"
  6482. },
  6483. "X-RateLimit-Limit-Tokens": {
  6484. "type": "integer",
  6485. "description": "X-RateLimit-Limit-Tokens"
  6486. },
  6487. "X-RateLimit-Remaining-Requests": {
  6488. "type": "integer",
  6489. "description": "X-RateLimit-Remaining-Requests"
  6490. },
  6491. "X-RateLimit-Remaining-Tokens": {
  6492. "type": "integer",
  6493. "description": "X-RateLimit-Remaining-Tokens"
  6494. },
  6495. "X-RateLimit-Reset-Requests": {
  6496. "type": "string",
  6497. "description": "X-RateLimit-Reset-Requests"
  6498. },
  6499. "X-RateLimit-Reset-Tokens": {
  6500. "type": "string",
  6501. "description": "X-RateLimit-Reset-Tokens"
  6502. }
  6503. }
  6504. }
  6505. }
  6506. }
  6507. },
  6508. "/v1/audio/transcription": {
  6509. "post": {
  6510. "security": [
  6511. {
  6512. "ApiKeyAuth": []
  6513. }
  6514. ],
  6515. "description": "AudioTranscription",
  6516. "produces": [
  6517. "application/json"
  6518. ],
  6519. "tags": [
  6520. "relay"
  6521. ],
  6522. "summary": "AudioTranscription",
  6523. "parameters": [
  6524. {
  6525. "type": "string",
  6526. "description": "Model",
  6527. "name": "model",
  6528. "in": "formData",
  6529. "required": true
  6530. },
  6531. {
  6532. "type": "file",
  6533. "description": "File",
  6534. "name": "file",
  6535. "in": "formData",
  6536. "required": true
  6537. },
  6538. {
  6539. "type": "string",
  6540. "description": "Optional Aiproxy-Channel header",
  6541. "name": "Aiproxy-Channel",
  6542. "in": "header"
  6543. }
  6544. ],
  6545. "responses": {
  6546. "200": {
  6547. "description": "OK",
  6548. "schema": {
  6549. "$ref": "#/definitions/model.SttJSONResponse"
  6550. },
  6551. "headers": {
  6552. "X-RateLimit-Limit-Requests": {
  6553. "type": "integer",
  6554. "description": "X-RateLimit-Limit-Requests"
  6555. },
  6556. "X-RateLimit-Limit-Tokens": {
  6557. "type": "integer",
  6558. "description": "X-RateLimit-Limit-Tokens"
  6559. },
  6560. "X-RateLimit-Remaining-Requests": {
  6561. "type": "integer",
  6562. "description": "X-RateLimit-Remaining-Requests"
  6563. },
  6564. "X-RateLimit-Remaining-Tokens": {
  6565. "type": "integer",
  6566. "description": "X-RateLimit-Remaining-Tokens"
  6567. },
  6568. "X-RateLimit-Reset-Requests": {
  6569. "type": "string",
  6570. "description": "X-RateLimit-Reset-Requests"
  6571. },
  6572. "X-RateLimit-Reset-Tokens": {
  6573. "type": "string",
  6574. "description": "X-RateLimit-Reset-Tokens"
  6575. }
  6576. }
  6577. }
  6578. }
  6579. }
  6580. },
  6581. "/v1/audio/translation": {
  6582. "post": {
  6583. "security": [
  6584. {
  6585. "ApiKeyAuth": []
  6586. }
  6587. ],
  6588. "description": "AudioTranslation",
  6589. "produces": [
  6590. "application/json"
  6591. ],
  6592. "tags": [
  6593. "relay"
  6594. ],
  6595. "summary": "AudioTranslation",
  6596. "parameters": [
  6597. {
  6598. "type": "string",
  6599. "description": "Model",
  6600. "name": "model",
  6601. "in": "formData",
  6602. "required": true
  6603. },
  6604. {
  6605. "type": "file",
  6606. "description": "File",
  6607. "name": "file",
  6608. "in": "formData",
  6609. "required": true
  6610. },
  6611. {
  6612. "type": "string",
  6613. "description": "Optional Aiproxy-Channel header",
  6614. "name": "Aiproxy-Channel",
  6615. "in": "header"
  6616. }
  6617. ],
  6618. "responses": {
  6619. "200": {
  6620. "description": "OK",
  6621. "schema": {
  6622. "$ref": "#/definitions/model.SttJSONResponse"
  6623. },
  6624. "headers": {
  6625. "X-RateLimit-Limit-Requests": {
  6626. "type": "integer",
  6627. "description": "X-RateLimit-Limit-Requests"
  6628. },
  6629. "X-RateLimit-Limit-Tokens": {
  6630. "type": "integer",
  6631. "description": "X-RateLimit-Limit-Tokens"
  6632. },
  6633. "X-RateLimit-Remaining-Requests": {
  6634. "type": "integer",
  6635. "description": "X-RateLimit-Remaining-Requests"
  6636. },
  6637. "X-RateLimit-Remaining-Tokens": {
  6638. "type": "integer",
  6639. "description": "X-RateLimit-Remaining-Tokens"
  6640. },
  6641. "X-RateLimit-Reset-Requests": {
  6642. "type": "string",
  6643. "description": "X-RateLimit-Reset-Requests"
  6644. },
  6645. "X-RateLimit-Reset-Tokens": {
  6646. "type": "string",
  6647. "description": "X-RateLimit-Reset-Tokens"
  6648. }
  6649. }
  6650. }
  6651. }
  6652. }
  6653. },
  6654. "/v1/chat/completions": {
  6655. "post": {
  6656. "security": [
  6657. {
  6658. "ApiKeyAuth": []
  6659. }
  6660. ],
  6661. "description": "ChatCompletions",
  6662. "produces": [
  6663. "application/json"
  6664. ],
  6665. "tags": [
  6666. "relay"
  6667. ],
  6668. "summary": "ChatCompletions",
  6669. "parameters": [
  6670. {
  6671. "description": "Request",
  6672. "name": "request",
  6673. "in": "body",
  6674. "required": true,
  6675. "schema": {
  6676. "$ref": "#/definitions/model.GeneralOpenAIRequest"
  6677. }
  6678. },
  6679. {
  6680. "type": "string",
  6681. "description": "Optional Aiproxy-Channel header",
  6682. "name": "Aiproxy-Channel",
  6683. "in": "header"
  6684. }
  6685. ],
  6686. "responses": {
  6687. "200": {
  6688. "description": "OK",
  6689. "schema": {
  6690. "$ref": "#/definitions/model.TextResponse"
  6691. },
  6692. "headers": {
  6693. "X-RateLimit-Limit-Requests": {
  6694. "type": "integer",
  6695. "description": "X-RateLimit-Limit-Requests"
  6696. },
  6697. "X-RateLimit-Limit-Tokens": {
  6698. "type": "integer",
  6699. "description": "X-RateLimit-Limit-Tokens"
  6700. },
  6701. "X-RateLimit-Remaining-Requests": {
  6702. "type": "integer",
  6703. "description": "X-RateLimit-Remaining-Requests"
  6704. },
  6705. "X-RateLimit-Remaining-Tokens": {
  6706. "type": "integer",
  6707. "description": "X-RateLimit-Remaining-Tokens"
  6708. },
  6709. "X-RateLimit-Reset-Requests": {
  6710. "type": "string",
  6711. "description": "X-RateLimit-Reset-Requests"
  6712. },
  6713. "X-RateLimit-Reset-Tokens": {
  6714. "type": "string",
  6715. "description": "X-RateLimit-Reset-Tokens"
  6716. }
  6717. }
  6718. }
  6719. }
  6720. }
  6721. },
  6722. "/v1/completions": {
  6723. "post": {
  6724. "security": [
  6725. {
  6726. "ApiKeyAuth": []
  6727. }
  6728. ],
  6729. "description": "Completions",
  6730. "produces": [
  6731. "application/json"
  6732. ],
  6733. "tags": [
  6734. "relay"
  6735. ],
  6736. "summary": "Completions",
  6737. "parameters": [
  6738. {
  6739. "description": "Request",
  6740. "name": "request",
  6741. "in": "body",
  6742. "required": true,
  6743. "schema": {
  6744. "$ref": "#/definitions/model.GeneralOpenAIRequest"
  6745. }
  6746. },
  6747. {
  6748. "type": "string",
  6749. "description": "Optional Aiproxy-Channel header",
  6750. "name": "Aiproxy-Channel",
  6751. "in": "header"
  6752. }
  6753. ],
  6754. "responses": {
  6755. "200": {
  6756. "description": "OK",
  6757. "schema": {
  6758. "$ref": "#/definitions/model.TextResponse"
  6759. },
  6760. "headers": {
  6761. "X-RateLimit-Limit-Requests": {
  6762. "type": "integer",
  6763. "description": "X-RateLimit-Limit-Requests"
  6764. },
  6765. "X-RateLimit-Limit-Tokens": {
  6766. "type": "integer",
  6767. "description": "X-RateLimit-Limit-Tokens"
  6768. },
  6769. "X-RateLimit-Remaining-Requests": {
  6770. "type": "integer",
  6771. "description": "X-RateLimit-Remaining-Requests"
  6772. },
  6773. "X-RateLimit-Remaining-Tokens": {
  6774. "type": "integer",
  6775. "description": "X-RateLimit-Remaining-Tokens"
  6776. },
  6777. "X-RateLimit-Reset-Requests": {
  6778. "type": "string",
  6779. "description": "X-RateLimit-Reset-Requests"
  6780. },
  6781. "X-RateLimit-Reset-Tokens": {
  6782. "type": "string",
  6783. "description": "X-RateLimit-Reset-Tokens"
  6784. }
  6785. }
  6786. }
  6787. }
  6788. }
  6789. },
  6790. "/v1/dashboard/billing/subscription": {
  6791. "get": {
  6792. "security": [
  6793. {
  6794. "ApiKeyAuth": []
  6795. }
  6796. ],
  6797. "description": "Get subscription",
  6798. "produces": [
  6799. "application/json"
  6800. ],
  6801. "tags": [
  6802. "relay"
  6803. ],
  6804. "summary": "Get subscription",
  6805. "responses": {
  6806. "200": {
  6807. "description": "OK",
  6808. "schema": {
  6809. "$ref": "#/definitions/openai.SubscriptionResponse"
  6810. }
  6811. }
  6812. }
  6813. }
  6814. },
  6815. "/v1/dashboard/billing/usage": {
  6816. "get": {
  6817. "security": [
  6818. {
  6819. "ApiKeyAuth": []
  6820. }
  6821. ],
  6822. "description": "Get usage",
  6823. "produces": [
  6824. "application/json"
  6825. ],
  6826. "tags": [
  6827. "relay"
  6828. ],
  6829. "summary": "Get usage",
  6830. "responses": {
  6831. "200": {
  6832. "description": "OK",
  6833. "schema": {
  6834. "$ref": "#/definitions/openai.UsageResponse"
  6835. }
  6836. }
  6837. }
  6838. }
  6839. },
  6840. "/v1/embeddings": {
  6841. "post": {
  6842. "security": [
  6843. {
  6844. "ApiKeyAuth": []
  6845. }
  6846. ],
  6847. "description": "Embeddings",
  6848. "produces": [
  6849. "application/json"
  6850. ],
  6851. "tags": [
  6852. "relay"
  6853. ],
  6854. "summary": "Embeddings",
  6855. "parameters": [
  6856. {
  6857. "description": "Request",
  6858. "name": "request",
  6859. "in": "body",
  6860. "required": true,
  6861. "schema": {
  6862. "$ref": "#/definitions/model.EmbeddingRequest"
  6863. }
  6864. },
  6865. {
  6866. "type": "string",
  6867. "description": "Optional Aiproxy-Channel header",
  6868. "name": "Aiproxy-Channel",
  6869. "in": "header"
  6870. }
  6871. ],
  6872. "responses": {
  6873. "200": {
  6874. "description": "OK",
  6875. "schema": {
  6876. "$ref": "#/definitions/model.EmbeddingResponse"
  6877. },
  6878. "headers": {
  6879. "X-RateLimit-Limit-Requests": {
  6880. "type": "integer",
  6881. "description": "X-RateLimit-Limit-Requests"
  6882. },
  6883. "X-RateLimit-Limit-Tokens": {
  6884. "type": "integer",
  6885. "description": "X-RateLimit-Limit-Tokens"
  6886. },
  6887. "X-RateLimit-Remaining-Requests": {
  6888. "type": "integer",
  6889. "description": "X-RateLimit-Remaining-Requests"
  6890. },
  6891. "X-RateLimit-Remaining-Tokens": {
  6892. "type": "integer",
  6893. "description": "X-RateLimit-Remaining-Tokens"
  6894. },
  6895. "X-RateLimit-Reset-Requests": {
  6896. "type": "string",
  6897. "description": "X-RateLimit-Reset-Requests"
  6898. },
  6899. "X-RateLimit-Reset-Tokens": {
  6900. "type": "string",
  6901. "description": "X-RateLimit-Reset-Tokens"
  6902. }
  6903. }
  6904. }
  6905. }
  6906. }
  6907. },
  6908. "/v1/images/edits": {
  6909. "post": {
  6910. "security": [
  6911. {
  6912. "ApiKeyAuth": []
  6913. }
  6914. ],
  6915. "description": "ImagesEdits",
  6916. "produces": [
  6917. "application/json"
  6918. ],
  6919. "tags": [
  6920. "relay"
  6921. ],
  6922. "summary": "ImagesEdits",
  6923. "parameters": [
  6924. {
  6925. "type": "string",
  6926. "description": "Prompt",
  6927. "name": "prompt",
  6928. "in": "formData",
  6929. "required": true
  6930. },
  6931. {
  6932. "type": "string",
  6933. "description": "Model",
  6934. "name": "model",
  6935. "in": "formData",
  6936. "required": true
  6937. },
  6938. {
  6939. "type": "file",
  6940. "description": "Images",
  6941. "name": "image",
  6942. "in": "formData",
  6943. "required": true
  6944. },
  6945. {
  6946. "type": "string",
  6947. "description": "Optional Aiproxy-Channel header",
  6948. "name": "Aiproxy-Channel",
  6949. "in": "header"
  6950. }
  6951. ],
  6952. "responses": {
  6953. "200": {
  6954. "description": "OK",
  6955. "schema": {
  6956. "$ref": "#/definitions/model.SttJSONResponse"
  6957. },
  6958. "headers": {
  6959. "X-RateLimit-Limit-Requests": {
  6960. "type": "integer",
  6961. "description": "X-RateLimit-Limit-Requests"
  6962. },
  6963. "X-RateLimit-Limit-Tokens": {
  6964. "type": "integer",
  6965. "description": "X-RateLimit-Limit-Tokens"
  6966. },
  6967. "X-RateLimit-Remaining-Requests": {
  6968. "type": "integer",
  6969. "description": "X-RateLimit-Remaining-Requests"
  6970. },
  6971. "X-RateLimit-Remaining-Tokens": {
  6972. "type": "integer",
  6973. "description": "X-RateLimit-Remaining-Tokens"
  6974. },
  6975. "X-RateLimit-Reset-Requests": {
  6976. "type": "string",
  6977. "description": "X-RateLimit-Reset-Requests"
  6978. },
  6979. "X-RateLimit-Reset-Tokens": {
  6980. "type": "string",
  6981. "description": "X-RateLimit-Reset-Tokens"
  6982. }
  6983. }
  6984. }
  6985. }
  6986. }
  6987. },
  6988. "/v1/images/generations": {
  6989. "post": {
  6990. "security": [
  6991. {
  6992. "ApiKeyAuth": []
  6993. }
  6994. ],
  6995. "description": "ImagesGenerations",
  6996. "produces": [
  6997. "application/json"
  6998. ],
  6999. "tags": [
  7000. "relay"
  7001. ],
  7002. "summary": "ImagesGenerations",
  7003. "parameters": [
  7004. {
  7005. "description": "Request",
  7006. "name": "request",
  7007. "in": "body",
  7008. "required": true,
  7009. "schema": {
  7010. "$ref": "#/definitions/model.ImageRequest"
  7011. }
  7012. },
  7013. {
  7014. "type": "string",
  7015. "description": "Optional Aiproxy-Channel header",
  7016. "name": "Aiproxy-Channel",
  7017. "in": "header"
  7018. }
  7019. ],
  7020. "responses": {
  7021. "200": {
  7022. "description": "OK",
  7023. "schema": {
  7024. "$ref": "#/definitions/model.ImageResponse"
  7025. },
  7026. "headers": {
  7027. "X-RateLimit-Limit-Requests": {
  7028. "type": "integer",
  7029. "description": "X-RateLimit-Limit-Requests"
  7030. },
  7031. "X-RateLimit-Limit-Tokens": {
  7032. "type": "integer",
  7033. "description": "X-RateLimit-Limit-Tokens"
  7034. },
  7035. "X-RateLimit-Remaining-Requests": {
  7036. "type": "integer",
  7037. "description": "X-RateLimit-Remaining-Requests"
  7038. },
  7039. "X-RateLimit-Remaining-Tokens": {
  7040. "type": "integer",
  7041. "description": "X-RateLimit-Remaining-Tokens"
  7042. },
  7043. "X-RateLimit-Reset-Requests": {
  7044. "type": "string",
  7045. "description": "X-RateLimit-Reset-Requests"
  7046. },
  7047. "X-RateLimit-Reset-Tokens": {
  7048. "type": "string",
  7049. "description": "X-RateLimit-Reset-Tokens"
  7050. }
  7051. }
  7052. }
  7053. }
  7054. }
  7055. },
  7056. "/v1/message": {
  7057. "post": {
  7058. "security": [
  7059. {
  7060. "ApiKeyAuth": []
  7061. }
  7062. ],
  7063. "description": "Anthropic",
  7064. "produces": [
  7065. "application/json"
  7066. ],
  7067. "tags": [
  7068. "relay"
  7069. ],
  7070. "summary": "Anthropic",
  7071. "parameters": [
  7072. {
  7073. "description": "Request",
  7074. "name": "request",
  7075. "in": "body",
  7076. "required": true,
  7077. "schema": {
  7078. "$ref": "#/definitions/model.AnthropicMessageRequest"
  7079. }
  7080. },
  7081. {
  7082. "type": "string",
  7083. "description": "Optional Aiproxy-Channel header",
  7084. "name": "Aiproxy-Channel",
  7085. "in": "header"
  7086. }
  7087. ],
  7088. "responses": {
  7089. "200": {
  7090. "description": "OK",
  7091. "schema": {
  7092. "$ref": "#/definitions/model.TextResponse"
  7093. },
  7094. "headers": {
  7095. "X-RateLimit-Limit-Requests": {
  7096. "type": "integer",
  7097. "description": "X-RateLimit-Limit-Requests"
  7098. },
  7099. "X-RateLimit-Limit-Tokens": {
  7100. "type": "integer",
  7101. "description": "X-RateLimit-Limit-Tokens"
  7102. },
  7103. "X-RateLimit-Remaining-Requests": {
  7104. "type": "integer",
  7105. "description": "X-RateLimit-Remaining-Requests"
  7106. },
  7107. "X-RateLimit-Remaining-Tokens": {
  7108. "type": "integer",
  7109. "description": "X-RateLimit-Remaining-Tokens"
  7110. },
  7111. "X-RateLimit-Reset-Requests": {
  7112. "type": "string",
  7113. "description": "X-RateLimit-Reset-Requests"
  7114. },
  7115. "X-RateLimit-Reset-Tokens": {
  7116. "type": "string",
  7117. "description": "X-RateLimit-Reset-Tokens"
  7118. }
  7119. }
  7120. }
  7121. }
  7122. }
  7123. },
  7124. "/v1/models": {
  7125. "get": {
  7126. "security": [
  7127. {
  7128. "ApiKeyAuth": []
  7129. }
  7130. ],
  7131. "description": "List all models",
  7132. "produces": [
  7133. "application/json"
  7134. ],
  7135. "tags": [
  7136. "relay"
  7137. ],
  7138. "summary": "List models",
  7139. "responses": {
  7140. "200": {
  7141. "description": "OK",
  7142. "schema": {
  7143. "type": "object",
  7144. "properties": {
  7145. "data": {
  7146. "type": "array",
  7147. "items": {
  7148. "$ref": "#/definitions/controller.OpenAIModels"
  7149. }
  7150. },
  7151. "object": {
  7152. "type": "string"
  7153. }
  7154. }
  7155. }
  7156. }
  7157. }
  7158. }
  7159. },
  7160. "/v1/models/{model}": {
  7161. "get": {
  7162. "security": [
  7163. {
  7164. "ApiKeyAuth": []
  7165. }
  7166. ],
  7167. "description": "Retrieve a model",
  7168. "produces": [
  7169. "application/json"
  7170. ],
  7171. "tags": [
  7172. "relay"
  7173. ],
  7174. "summary": "Retrieve model",
  7175. "responses": {
  7176. "200": {
  7177. "description": "OK",
  7178. "schema": {
  7179. "$ref": "#/definitions/controller.OpenAIModels"
  7180. }
  7181. }
  7182. }
  7183. }
  7184. },
  7185. "/v1/parse-pdf": {
  7186. "post": {
  7187. "security": [
  7188. {
  7189. "ApiKeyAuth": []
  7190. }
  7191. ],
  7192. "description": "ParsePdf",
  7193. "produces": [
  7194. "application/json"
  7195. ],
  7196. "tags": [
  7197. "relay"
  7198. ],
  7199. "summary": "ParsePdf",
  7200. "parameters": [
  7201. {
  7202. "type": "string",
  7203. "description": "Model",
  7204. "name": "model",
  7205. "in": "formData",
  7206. "required": true
  7207. },
  7208. {
  7209. "type": "file",
  7210. "description": "File",
  7211. "name": "file",
  7212. "in": "formData",
  7213. "required": true
  7214. },
  7215. {
  7216. "type": "string",
  7217. "description": "Optional Aiproxy-Channel header",
  7218. "name": "Aiproxy-Channel",
  7219. "in": "header"
  7220. }
  7221. ],
  7222. "responses": {
  7223. "200": {
  7224. "description": "OK",
  7225. "schema": {
  7226. "$ref": "#/definitions/model.ParsePdfResponse"
  7227. },
  7228. "headers": {
  7229. "X-RateLimit-Limit-Requests": {
  7230. "type": "integer",
  7231. "description": "X-RateLimit-Limit-Requests"
  7232. },
  7233. "X-RateLimit-Limit-Tokens": {
  7234. "type": "integer",
  7235. "description": "X-RateLimit-Limit-Tokens"
  7236. },
  7237. "X-RateLimit-Remaining-Requests": {
  7238. "type": "integer",
  7239. "description": "X-RateLimit-Remaining-Requests"
  7240. },
  7241. "X-RateLimit-Remaining-Tokens": {
  7242. "type": "integer",
  7243. "description": "X-RateLimit-Remaining-Tokens"
  7244. },
  7245. "X-RateLimit-Reset-Requests": {
  7246. "type": "string",
  7247. "description": "X-RateLimit-Reset-Requests"
  7248. },
  7249. "X-RateLimit-Reset-Tokens": {
  7250. "type": "string",
  7251. "description": "X-RateLimit-Reset-Tokens"
  7252. }
  7253. }
  7254. }
  7255. }
  7256. }
  7257. },
  7258. "/v1/rerank": {
  7259. "post": {
  7260. "security": [
  7261. {
  7262. "ApiKeyAuth": []
  7263. }
  7264. ],
  7265. "description": "Rerank",
  7266. "produces": [
  7267. "application/json"
  7268. ],
  7269. "tags": [
  7270. "relay"
  7271. ],
  7272. "summary": "Rerank",
  7273. "parameters": [
  7274. {
  7275. "description": "Request",
  7276. "name": "request",
  7277. "in": "body",
  7278. "required": true,
  7279. "schema": {
  7280. "$ref": "#/definitions/model.RerankRequest"
  7281. }
  7282. },
  7283. {
  7284. "type": "string",
  7285. "description": "Optional Aiproxy-Channel header",
  7286. "name": "Aiproxy-Channel",
  7287. "in": "header"
  7288. }
  7289. ],
  7290. "responses": {
  7291. "200": {
  7292. "description": "OK",
  7293. "schema": {
  7294. "$ref": "#/definitions/model.RerankResponse"
  7295. },
  7296. "headers": {
  7297. "X-RateLimit-Limit-Requests": {
  7298. "type": "integer",
  7299. "description": "X-RateLimit-Limit-Requests"
  7300. },
  7301. "X-RateLimit-Limit-Tokens": {
  7302. "type": "integer",
  7303. "description": "X-RateLimit-Limit-Tokens"
  7304. },
  7305. "X-RateLimit-Remaining-Requests": {
  7306. "type": "integer",
  7307. "description": "X-RateLimit-Remaining-Requests"
  7308. },
  7309. "X-RateLimit-Remaining-Tokens": {
  7310. "type": "integer",
  7311. "description": "X-RateLimit-Remaining-Tokens"
  7312. },
  7313. "X-RateLimit-Reset-Requests": {
  7314. "type": "string",
  7315. "description": "X-RateLimit-Reset-Requests"
  7316. },
  7317. "X-RateLimit-Reset-Tokens": {
  7318. "type": "string",
  7319. "description": "X-RateLimit-Reset-Tokens"
  7320. }
  7321. }
  7322. }
  7323. }
  7324. }
  7325. }
  7326. },
  7327. "definitions": {
  7328. "channeltype.AdaptorMeta": {
  7329. "type": "object",
  7330. "properties": {
  7331. "defaultBaseUrl": {
  7332. "type": "string"
  7333. },
  7334. "keyHelp": {
  7335. "type": "string"
  7336. },
  7337. "name": {
  7338. "type": "string"
  7339. }
  7340. }
  7341. },
  7342. "controller.AddChannelRequest": {
  7343. "type": "object",
  7344. "properties": {
  7345. "base_url": {
  7346. "type": "string"
  7347. },
  7348. "config": {
  7349. "$ref": "#/definitions/model.ChannelConfig"
  7350. },
  7351. "key": {
  7352. "type": "string"
  7353. },
  7354. "model_mapping": {
  7355. "type": "object",
  7356. "additionalProperties": {
  7357. "type": "string"
  7358. }
  7359. },
  7360. "models": {
  7361. "type": "array",
  7362. "items": {
  7363. "type": "string"
  7364. }
  7365. },
  7366. "name": {
  7367. "type": "string"
  7368. },
  7369. "priority": {
  7370. "type": "integer"
  7371. },
  7372. "sets": {
  7373. "type": "array",
  7374. "items": {
  7375. "type": "string"
  7376. }
  7377. },
  7378. "status": {
  7379. "type": "integer"
  7380. },
  7381. "type": {
  7382. "$ref": "#/definitions/model.ChannelType"
  7383. }
  7384. }
  7385. },
  7386. "controller.AddTokenRequest": {
  7387. "type": "object",
  7388. "properties": {
  7389. "expiredAt": {
  7390. "type": "integer"
  7391. },
  7392. "models": {
  7393. "type": "array",
  7394. "items": {
  7395. "type": "string"
  7396. }
  7397. },
  7398. "name": {
  7399. "type": "string"
  7400. },
  7401. "quota": {
  7402. "type": "number"
  7403. },
  7404. "subnets": {
  7405. "type": "array",
  7406. "items": {
  7407. "type": "string"
  7408. }
  7409. }
  7410. }
  7411. },
  7412. "controller.BuiltinModelConfig": {
  7413. "type": "object",
  7414. "properties": {
  7415. "config": {
  7416. "type": "object",
  7417. "additionalProperties": {}
  7418. },
  7419. "created_at": {
  7420. "type": "string"
  7421. },
  7422. "exclude_from_tests": {
  7423. "type": "boolean"
  7424. },
  7425. "image_prices": {
  7426. "description": "map[size]price_per_image",
  7427. "type": "object",
  7428. "additionalProperties": {
  7429. "type": "number"
  7430. }
  7431. },
  7432. "image_quality_prices": {
  7433. "description": "map[size]map[quality]price_per_image",
  7434. "type": "object",
  7435. "additionalProperties": {
  7436. "type": "object",
  7437. "additionalProperties": {
  7438. "type": "number"
  7439. }
  7440. }
  7441. },
  7442. "model": {
  7443. "type": "string"
  7444. },
  7445. "owner": {
  7446. "$ref": "#/definitions/model.ModelOwner"
  7447. },
  7448. "price": {
  7449. "$ref": "#/definitions/model.Price"
  7450. },
  7451. "retry_times": {
  7452. "type": "integer"
  7453. },
  7454. "rpm": {
  7455. "type": "integer"
  7456. },
  7457. "tpm": {
  7458. "type": "integer"
  7459. },
  7460. "type": {
  7461. "$ref": "#/definitions/mode.Mode"
  7462. },
  7463. "updated_at": {
  7464. "type": "string"
  7465. }
  7466. }
  7467. },
  7468. "controller.CreateGroupRequest": {
  7469. "type": "object",
  7470. "properties": {
  7471. "available_sets": {
  7472. "type": "array",
  7473. "items": {
  7474. "type": "string"
  7475. }
  7476. },
  7477. "balance_alert_enabled": {
  7478. "type": "boolean"
  7479. },
  7480. "balance_alert_threshold": {
  7481. "type": "number"
  7482. },
  7483. "rpm_ratio": {
  7484. "type": "number"
  7485. },
  7486. "tpm_ratio": {
  7487. "type": "number"
  7488. }
  7489. }
  7490. },
  7491. "controller.EnabledModelChannel": {
  7492. "type": "object",
  7493. "properties": {
  7494. "id": {
  7495. "type": "integer"
  7496. },
  7497. "name": {
  7498. "type": "string"
  7499. },
  7500. "type": {
  7501. "$ref": "#/definitions/model.ChannelType"
  7502. }
  7503. }
  7504. },
  7505. "controller.GetModelConfigsByModelsContainsRequest": {
  7506. "type": "object",
  7507. "properties": {
  7508. "models": {
  7509. "type": "array",
  7510. "items": {
  7511. "type": "string"
  7512. }
  7513. }
  7514. }
  7515. },
  7516. "controller.GroupResponse": {
  7517. "type": "object",
  7518. "properties": {
  7519. "accessed_at": {
  7520. "type": "string"
  7521. },
  7522. "available_sets": {
  7523. "type": "array",
  7524. "items": {
  7525. "type": "string"
  7526. }
  7527. },
  7528. "balance_alert_enabled": {
  7529. "type": "boolean"
  7530. },
  7531. "balance_alert_threshold": {
  7532. "type": "number"
  7533. },
  7534. "created_at": {
  7535. "type": "string"
  7536. },
  7537. "id": {
  7538. "type": "string"
  7539. },
  7540. "request_count": {
  7541. "type": "integer"
  7542. },
  7543. "rpm_ratio": {
  7544. "type": "number"
  7545. },
  7546. "status": {
  7547. "type": "integer"
  7548. },
  7549. "tpm_ratio": {
  7550. "type": "number"
  7551. },
  7552. "used_amount": {
  7553. "type": "number"
  7554. }
  7555. }
  7556. },
  7557. "controller.ImportChannelFromOneAPIRequest": {
  7558. "type": "object",
  7559. "properties": {
  7560. "dsn": {
  7561. "type": "string"
  7562. }
  7563. }
  7564. },
  7565. "controller.OpenAIModelPermission": {
  7566. "type": "object",
  7567. "properties": {
  7568. "allow_create_engine": {
  7569. "type": "boolean"
  7570. },
  7571. "allow_fine_tuning": {
  7572. "type": "boolean"
  7573. },
  7574. "allow_logprobs": {
  7575. "type": "boolean"
  7576. },
  7577. "allow_sampling": {
  7578. "type": "boolean"
  7579. },
  7580. "allow_search_indices": {
  7581. "type": "boolean"
  7582. },
  7583. "allow_view": {
  7584. "type": "boolean"
  7585. },
  7586. "created": {
  7587. "type": "integer"
  7588. },
  7589. "group": {
  7590. "type": "string"
  7591. },
  7592. "id": {
  7593. "type": "string"
  7594. },
  7595. "is_blocking": {
  7596. "type": "boolean"
  7597. },
  7598. "object": {
  7599. "type": "string"
  7600. },
  7601. "organization": {
  7602. "type": "string"
  7603. }
  7604. }
  7605. },
  7606. "controller.OpenAIModels": {
  7607. "type": "object",
  7608. "properties": {
  7609. "created": {
  7610. "type": "integer"
  7611. },
  7612. "id": {
  7613. "type": "string"
  7614. },
  7615. "object": {
  7616. "type": "string"
  7617. },
  7618. "owned_by": {
  7619. "type": "string"
  7620. },
  7621. "parent": {
  7622. "type": "string"
  7623. },
  7624. "permission": {
  7625. "type": "array",
  7626. "items": {
  7627. "$ref": "#/definitions/controller.OpenAIModelPermission"
  7628. }
  7629. },
  7630. "root": {
  7631. "type": "string"
  7632. }
  7633. }
  7634. },
  7635. "controller.SaveGroupModelConfigRequest": {
  7636. "type": "object",
  7637. "properties": {
  7638. "image_prices": {
  7639. "type": "object",
  7640. "additionalProperties": {
  7641. "type": "number"
  7642. }
  7643. },
  7644. "model": {
  7645. "type": "string"
  7646. },
  7647. "override_limit": {
  7648. "type": "boolean"
  7649. },
  7650. "override_price": {
  7651. "type": "boolean"
  7652. },
  7653. "price": {
  7654. "$ref": "#/definitions/model.Price"
  7655. },
  7656. "rpm": {
  7657. "type": "integer"
  7658. },
  7659. "tpm": {
  7660. "type": "integer"
  7661. }
  7662. }
  7663. },
  7664. "controller.SaveModelConfigsRequest": {
  7665. "type": "object",
  7666. "properties": {
  7667. "config": {
  7668. "type": "object",
  7669. "additionalProperties": {}
  7670. },
  7671. "created_at": {
  7672. "type": "string"
  7673. },
  7674. "exclude_from_tests": {
  7675. "type": "boolean"
  7676. },
  7677. "image_prices": {
  7678. "description": "map[size]price_per_image",
  7679. "type": "object",
  7680. "additionalProperties": {
  7681. "type": "number"
  7682. }
  7683. },
  7684. "image_quality_prices": {
  7685. "description": "map[size]map[quality]price_per_image",
  7686. "type": "object",
  7687. "additionalProperties": {
  7688. "type": "object",
  7689. "additionalProperties": {
  7690. "type": "number"
  7691. }
  7692. }
  7693. },
  7694. "model": {
  7695. "type": "string"
  7696. },
  7697. "owner": {
  7698. "$ref": "#/definitions/model.ModelOwner"
  7699. },
  7700. "price": {
  7701. "$ref": "#/definitions/model.Price"
  7702. },
  7703. "retry_times": {
  7704. "type": "integer"
  7705. },
  7706. "rpm": {
  7707. "type": "integer"
  7708. },
  7709. "tpm": {
  7710. "type": "integer"
  7711. },
  7712. "type": {
  7713. "$ref": "#/definitions/mode.Mode"
  7714. },
  7715. "updated_at": {
  7716. "type": "string"
  7717. }
  7718. }
  7719. },
  7720. "controller.StatusData": {
  7721. "type": "object",
  7722. "properties": {
  7723. "startTime": {
  7724. "type": "integer"
  7725. }
  7726. }
  7727. },
  7728. "controller.TestResult": {
  7729. "type": "object",
  7730. "properties": {
  7731. "data": {
  7732. "$ref": "#/definitions/model.ChannelTest"
  7733. },
  7734. "message": {
  7735. "type": "string"
  7736. },
  7737. "success": {
  7738. "type": "boolean"
  7739. }
  7740. }
  7741. },
  7742. "controller.TokenResponse": {
  7743. "type": "object",
  7744. "properties": {
  7745. "accessed_at": {
  7746. "type": "string"
  7747. },
  7748. "created_at": {
  7749. "type": "string"
  7750. },
  7751. "expired_at": {
  7752. "type": "string"
  7753. },
  7754. "group": {
  7755. "type": "string"
  7756. },
  7757. "id": {
  7758. "type": "integer"
  7759. },
  7760. "key": {
  7761. "type": "string"
  7762. },
  7763. "models": {
  7764. "type": "array",
  7765. "items": {
  7766. "type": "string"
  7767. }
  7768. },
  7769. "name": {
  7770. "type": "string"
  7771. },
  7772. "quota": {
  7773. "type": "number"
  7774. },
  7775. "request_count": {
  7776. "type": "integer"
  7777. },
  7778. "status": {
  7779. "type": "integer"
  7780. },
  7781. "subnets": {
  7782. "type": "array",
  7783. "items": {
  7784. "type": "string"
  7785. }
  7786. },
  7787. "used_amount": {
  7788. "type": "number"
  7789. }
  7790. }
  7791. },
  7792. "controller.UpdateChannelStatusRequest": {
  7793. "type": "object",
  7794. "properties": {
  7795. "status": {
  7796. "type": "integer"
  7797. }
  7798. }
  7799. },
  7800. "controller.UpdateGroupRPMRatioRequest": {
  7801. "type": "object",
  7802. "properties": {
  7803. "rpm_ratio": {
  7804. "type": "number"
  7805. }
  7806. }
  7807. },
  7808. "controller.UpdateGroupStatusRequest": {
  7809. "type": "object",
  7810. "properties": {
  7811. "status": {
  7812. "type": "integer"
  7813. }
  7814. }
  7815. },
  7816. "controller.UpdateGroupTPMRatioRequest": {
  7817. "type": "object",
  7818. "properties": {
  7819. "tpm_ratio": {
  7820. "type": "number"
  7821. }
  7822. }
  7823. },
  7824. "controller.UpdateGroupsStatusRequest": {
  7825. "type": "object",
  7826. "properties": {
  7827. "groups": {
  7828. "type": "array",
  7829. "items": {
  7830. "type": "string"
  7831. }
  7832. },
  7833. "status": {
  7834. "type": "integer"
  7835. }
  7836. }
  7837. },
  7838. "controller.UpdateTokenNameRequest": {
  7839. "type": "object",
  7840. "properties": {
  7841. "name": {
  7842. "type": "string"
  7843. }
  7844. }
  7845. },
  7846. "controller.UpdateTokenStatusRequest": {
  7847. "type": "object",
  7848. "properties": {
  7849. "status": {
  7850. "type": "integer"
  7851. }
  7852. }
  7853. },
  7854. "github_com_labring_aiproxy_core_model.Usage": {
  7855. "type": "object",
  7856. "properties": {
  7857. "cache_creation_tokens": {
  7858. "type": "integer"
  7859. },
  7860. "cached_tokens": {
  7861. "type": "integer"
  7862. },
  7863. "image_input_tokens": {
  7864. "type": "integer"
  7865. },
  7866. "input_tokens": {
  7867. "type": "integer"
  7868. },
  7869. "output_tokens": {
  7870. "type": "integer"
  7871. },
  7872. "reasoning_tokens": {
  7873. "type": "integer"
  7874. },
  7875. "total_tokens": {
  7876. "type": "integer"
  7877. },
  7878. "web_search_count": {
  7879. "type": "integer"
  7880. }
  7881. }
  7882. },
  7883. "github_com_labring_aiproxy_core_relay_model.Usage": {
  7884. "type": "object",
  7885. "properties": {
  7886. "completion_tokens": {
  7887. "type": "integer"
  7888. },
  7889. "completion_tokens_details": {
  7890. "$ref": "#/definitions/model.CompletionTokensDetails"
  7891. },
  7892. "prompt_tokens": {
  7893. "type": "integer"
  7894. },
  7895. "prompt_tokens_details": {
  7896. "$ref": "#/definitions/model.PromptTokensDetails"
  7897. },
  7898. "total_tokens": {
  7899. "type": "integer"
  7900. },
  7901. "web_search_count": {
  7902. "type": "integer"
  7903. }
  7904. }
  7905. },
  7906. "middleware.APIResponse": {
  7907. "type": "object",
  7908. "properties": {
  7909. "data": {},
  7910. "message": {
  7911. "type": "string"
  7912. },
  7913. "success": {
  7914. "type": "boolean"
  7915. }
  7916. }
  7917. },
  7918. "mode.Mode": {
  7919. "type": "integer",
  7920. "enum": [
  7921. 0,
  7922. 1,
  7923. 2,
  7924. 3,
  7925. 4,
  7926. 5,
  7927. 6,
  7928. 7,
  7929. 8,
  7930. 9,
  7931. 10,
  7932. 11,
  7933. 12
  7934. ],
  7935. "x-enum-varnames": [
  7936. "Unknown",
  7937. "ChatCompletions",
  7938. "Completions",
  7939. "Embeddings",
  7940. "Moderations",
  7941. "ImagesGenerations",
  7942. "ImagesEdits",
  7943. "AudioSpeech",
  7944. "AudioTranscription",
  7945. "AudioTranslation",
  7946. "Rerank",
  7947. "ParsePdf",
  7948. "Anthropic"
  7949. ]
  7950. },
  7951. "model.AnthropicMessageRequest": {
  7952. "type": "object",
  7953. "properties": {
  7954. "messages": {
  7955. "type": "array",
  7956. "items": {
  7957. "$ref": "#/definitions/model.Message"
  7958. }
  7959. },
  7960. "model": {
  7961. "type": "string"
  7962. }
  7963. }
  7964. },
  7965. "model.Audio": {
  7966. "type": "object",
  7967. "properties": {
  7968. "format": {
  7969. "type": "string"
  7970. },
  7971. "voice": {
  7972. "type": "string"
  7973. }
  7974. }
  7975. },
  7976. "model.Channel": {
  7977. "type": "object",
  7978. "properties": {
  7979. "balance": {
  7980. "type": "number"
  7981. },
  7982. "balance_threshold": {
  7983. "type": "number"
  7984. },
  7985. "balance_updated_at": {
  7986. "type": "string"
  7987. },
  7988. "base_url": {
  7989. "type": "string"
  7990. },
  7991. "channel_tests": {
  7992. "type": "array",
  7993. "items": {
  7994. "$ref": "#/definitions/model.ChannelTest"
  7995. }
  7996. },
  7997. "config": {
  7998. "$ref": "#/definitions/model.ChannelConfig"
  7999. },
  8000. "created_at": {
  8001. "type": "string"
  8002. },
  8003. "enabled_auto_balance_check": {
  8004. "type": "boolean"
  8005. },
  8006. "id": {
  8007. "type": "integer"
  8008. },
  8009. "key": {
  8010. "type": "string"
  8011. },
  8012. "last_test_error_at": {
  8013. "type": "string"
  8014. },
  8015. "model_mapping": {
  8016. "type": "object",
  8017. "additionalProperties": {
  8018. "type": "string"
  8019. }
  8020. },
  8021. "models": {
  8022. "type": "array",
  8023. "items": {
  8024. "type": "string"
  8025. }
  8026. },
  8027. "name": {
  8028. "type": "string"
  8029. },
  8030. "priority": {
  8031. "type": "integer"
  8032. },
  8033. "request_count": {
  8034. "type": "integer"
  8035. },
  8036. "sets": {
  8037. "type": "array",
  8038. "items": {
  8039. "type": "string"
  8040. }
  8041. },
  8042. "status": {
  8043. "type": "integer"
  8044. },
  8045. "type": {
  8046. "$ref": "#/definitions/model.ChannelType"
  8047. },
  8048. "used_amount": {
  8049. "type": "number"
  8050. }
  8051. }
  8052. },
  8053. "model.ChannelConfig": {
  8054. "type": "object",
  8055. "properties": {
  8056. "split_think": {
  8057. "type": "boolean"
  8058. }
  8059. }
  8060. },
  8061. "model.ChannelTest": {
  8062. "type": "object",
  8063. "properties": {
  8064. "actual_model": {
  8065. "type": "string"
  8066. },
  8067. "channel_id": {
  8068. "type": "integer"
  8069. },
  8070. "channel_name": {
  8071. "type": "string"
  8072. },
  8073. "channel_type": {
  8074. "$ref": "#/definitions/model.ChannelType"
  8075. },
  8076. "code": {
  8077. "type": "integer"
  8078. },
  8079. "mode": {
  8080. "$ref": "#/definitions/mode.Mode"
  8081. },
  8082. "model": {
  8083. "type": "string"
  8084. },
  8085. "response": {
  8086. "type": "string"
  8087. },
  8088. "success": {
  8089. "type": "boolean"
  8090. },
  8091. "test_at": {
  8092. "type": "string"
  8093. },
  8094. "took": {
  8095. "type": "number"
  8096. }
  8097. }
  8098. },
  8099. "model.ChannelType": {
  8100. "type": "integer",
  8101. "enum": [
  8102. 1,
  8103. 3,
  8104. 12,
  8105. 13,
  8106. 14,
  8107. 15,
  8108. 16,
  8109. 17,
  8110. 18,
  8111. 19,
  8112. 20,
  8113. 23,
  8114. 24,
  8115. 25,
  8116. 26,
  8117. 27,
  8118. 28,
  8119. 29,
  8120. 30,
  8121. 31,
  8122. 32,
  8123. 33,
  8124. 34,
  8125. 35,
  8126. 36,
  8127. 37,
  8128. 40,
  8129. 41,
  8130. 42,
  8131. 43,
  8132. 44,
  8133. 45,
  8134. 46,
  8135. 47
  8136. ],
  8137. "x-enum-varnames": [
  8138. "ChannelTypeOpenAI",
  8139. "ChannelTypeAzure",
  8140. "ChannelTypeGoogleGeminiOpenAI",
  8141. "ChannelTypeBaiduV2",
  8142. "ChannelTypeAnthropic",
  8143. "ChannelTypeBaidu",
  8144. "ChannelTypeZhipu",
  8145. "ChannelTypeAli",
  8146. "ChannelTypeXunfei",
  8147. "ChannelTypeAI360",
  8148. "ChannelTypeOpenRouter",
  8149. "ChannelTypeTencent",
  8150. "ChannelTypeGoogleGemini",
  8151. "ChannelTypeMoonshot",
  8152. "ChannelTypeBaichuan",
  8153. "ChannelTypeMinimax",
  8154. "ChannelTypeMistral",
  8155. "ChannelTypeGroq",
  8156. "ChannelTypeOllama",
  8157. "ChannelTypeLingyiwanwu",
  8158. "ChannelTypeStepfun",
  8159. "ChannelTypeAWS",
  8160. "ChannelTypeCoze",
  8161. "ChannelTypeCohere",
  8162. "ChannelTypeDeepseek",
  8163. "ChannelTypeCloudflare",
  8164. "ChannelTypeDoubao",
  8165. "ChannelTypeNovita",
  8166. "ChannelTypeVertexAI",
  8167. "ChannelTypeSiliconflow",
  8168. "ChannelTypeDoubaoAudio",
  8169. "ChannelTypeXAI",
  8170. "ChannelTypeDoc2x",
  8171. "ChannelTypeJina"
  8172. ]
  8173. },
  8174. "model.ChartData": {
  8175. "type": "object",
  8176. "properties": {
  8177. "cache_creation_tokens": {
  8178. "type": "integer"
  8179. },
  8180. "cached_tokens": {
  8181. "type": "integer"
  8182. },
  8183. "exception_count": {
  8184. "type": "integer"
  8185. },
  8186. "input_tokens": {
  8187. "type": "integer"
  8188. },
  8189. "output_tokens": {
  8190. "type": "integer"
  8191. },
  8192. "request_count": {
  8193. "type": "integer"
  8194. },
  8195. "timestamp": {
  8196. "type": "integer"
  8197. },
  8198. "total_tokens": {
  8199. "type": "integer"
  8200. },
  8201. "used_amount": {
  8202. "type": "number"
  8203. },
  8204. "web_search_count": {
  8205. "type": "integer"
  8206. }
  8207. }
  8208. },
  8209. "model.CompletionTokensDetails": {
  8210. "type": "object",
  8211. "properties": {
  8212. "accepted_prediction_tokens": {
  8213. "type": "integer"
  8214. },
  8215. "audio_tokens": {
  8216. "type": "integer"
  8217. },
  8218. "reasoning_tokens": {
  8219. "type": "integer"
  8220. },
  8221. "rejected_prediction_tokens": {
  8222. "type": "integer"
  8223. }
  8224. }
  8225. },
  8226. "model.DashboardResponse": {
  8227. "type": "object",
  8228. "properties": {
  8229. "cache_creation_tokens": {
  8230. "type": "integer"
  8231. },
  8232. "cached_tokens": {
  8233. "type": "integer"
  8234. },
  8235. "channels": {
  8236. "type": "array",
  8237. "items": {
  8238. "type": "integer"
  8239. }
  8240. },
  8241. "chart_data": {
  8242. "type": "array",
  8243. "items": {
  8244. "$ref": "#/definitions/model.ChartData"
  8245. }
  8246. },
  8247. "exception_count": {
  8248. "type": "integer"
  8249. },
  8250. "input_tokens": {
  8251. "type": "integer"
  8252. },
  8253. "output_tokens": {
  8254. "type": "integer"
  8255. },
  8256. "rpm": {
  8257. "type": "integer"
  8258. },
  8259. "total_count": {
  8260. "type": "integer"
  8261. },
  8262. "total_tokens": {
  8263. "type": "integer"
  8264. },
  8265. "tpm": {
  8266. "type": "integer"
  8267. },
  8268. "used_amount": {
  8269. "type": "number"
  8270. },
  8271. "web_search_count": {
  8272. "type": "integer"
  8273. }
  8274. }
  8275. },
  8276. "model.Document": {
  8277. "type": "object",
  8278. "properties": {
  8279. "text": {
  8280. "type": "string"
  8281. }
  8282. }
  8283. },
  8284. "model.EmbeddingRequest": {
  8285. "type": "object",
  8286. "properties": {
  8287. "dimensions": {
  8288. "type": "integer"
  8289. },
  8290. "encoding_format": {
  8291. "type": "string"
  8292. },
  8293. "input": {
  8294. "type": "string"
  8295. },
  8296. "model": {
  8297. "type": "string"
  8298. }
  8299. }
  8300. },
  8301. "model.EmbeddingResponse": {
  8302. "type": "object",
  8303. "properties": {
  8304. "data": {
  8305. "type": "array",
  8306. "items": {
  8307. "$ref": "#/definitions/model.EmbeddingResponseItem"
  8308. }
  8309. },
  8310. "model": {
  8311. "type": "string"
  8312. },
  8313. "object": {
  8314. "type": "string"
  8315. },
  8316. "usage": {
  8317. "$ref": "#/definitions/github_com_labring_aiproxy_core_relay_model.Usage"
  8318. }
  8319. }
  8320. },
  8321. "model.EmbeddingResponseItem": {
  8322. "type": "object",
  8323. "properties": {
  8324. "embedding": {
  8325. "type": "array",
  8326. "items": {
  8327. "type": "number"
  8328. }
  8329. },
  8330. "index": {
  8331. "type": "integer"
  8332. },
  8333. "object": {
  8334. "type": "string"
  8335. }
  8336. }
  8337. },
  8338. "model.FinishReason": {
  8339. "type": "string",
  8340. "enum": [
  8341. "stop",
  8342. "length",
  8343. "content_filter",
  8344. "tool_calls",
  8345. "function_call"
  8346. ],
  8347. "x-enum-varnames": [
  8348. "FinishReasonStop",
  8349. "FinishReasonLength",
  8350. "FinishReasonContentFilter",
  8351. "FinishReasonToolCalls",
  8352. "FinishReasonFunctionCall"
  8353. ]
  8354. },
  8355. "model.Function": {
  8356. "type": "object",
  8357. "properties": {
  8358. "arguments": {
  8359. "type": "string"
  8360. },
  8361. "description": {
  8362. "type": "string"
  8363. },
  8364. "name": {
  8365. "type": "string"
  8366. },
  8367. "parameters": {}
  8368. }
  8369. },
  8370. "model.GeneralOpenAIRequest": {
  8371. "type": "object",
  8372. "properties": {
  8373. "audio": {
  8374. "$ref": "#/definitions/model.Audio"
  8375. },
  8376. "dimensions": {
  8377. "type": "integer"
  8378. },
  8379. "encoding_format": {
  8380. "type": "string"
  8381. },
  8382. "frequency_penalty": {
  8383. "type": "number"
  8384. },
  8385. "function_call": {},
  8386. "functions": {},
  8387. "input": {},
  8388. "instruction": {
  8389. "type": "string"
  8390. },
  8391. "logit_bias": {},
  8392. "logprobs": {
  8393. "type": "boolean"
  8394. },
  8395. "max_completion_tokens": {
  8396. "type": "integer"
  8397. },
  8398. "max_tokens": {
  8399. "type": "integer"
  8400. },
  8401. "messages": {
  8402. "type": "array",
  8403. "items": {
  8404. "$ref": "#/definitions/model.Message"
  8405. }
  8406. },
  8407. "metadata": {},
  8408. "modalities": {
  8409. "type": "array",
  8410. "items": {
  8411. "type": "string"
  8412. }
  8413. },
  8414. "model": {
  8415. "type": "string"
  8416. },
  8417. "n": {
  8418. "type": "integer"
  8419. },
  8420. "num_ctx": {
  8421. "type": "integer"
  8422. },
  8423. "parallel_tool_calls": {
  8424. "type": "boolean"
  8425. },
  8426. "prediction": {},
  8427. "presence_penalty": {
  8428. "type": "number"
  8429. },
  8430. "prompt": {},
  8431. "quality": {
  8432. "type": "string"
  8433. },
  8434. "response_format": {
  8435. "$ref": "#/definitions/model.ResponseFormat"
  8436. },
  8437. "seed": {
  8438. "type": "number"
  8439. },
  8440. "service_tier": {
  8441. "type": "string"
  8442. },
  8443. "size": {
  8444. "type": "string"
  8445. },
  8446. "stop": {},
  8447. "store": {
  8448. "type": "boolean"
  8449. },
  8450. "stream": {
  8451. "type": "boolean"
  8452. },
  8453. "stream_options": {
  8454. "$ref": "#/definitions/model.StreamOptions"
  8455. },
  8456. "style": {
  8457. "type": "string"
  8458. },
  8459. "temperature": {
  8460. "type": "number"
  8461. },
  8462. "tool_choice": {},
  8463. "tools": {
  8464. "type": "array",
  8465. "items": {
  8466. "$ref": "#/definitions/model.Tool"
  8467. }
  8468. },
  8469. "top_k": {
  8470. "type": "integer"
  8471. },
  8472. "top_logprobs": {
  8473. "type": "integer"
  8474. },
  8475. "top_p": {
  8476. "type": "number"
  8477. },
  8478. "user": {
  8479. "type": "string"
  8480. }
  8481. }
  8482. },
  8483. "model.GetGroupLogsResult": {
  8484. "type": "object",
  8485. "properties": {
  8486. "channels": {
  8487. "type": "array",
  8488. "items": {
  8489. "type": "integer"
  8490. }
  8491. },
  8492. "logs": {
  8493. "type": "array",
  8494. "items": {
  8495. "$ref": "#/definitions/model.Log"
  8496. }
  8497. },
  8498. "models": {
  8499. "type": "array",
  8500. "items": {
  8501. "type": "string"
  8502. }
  8503. },
  8504. "token_names": {
  8505. "type": "array",
  8506. "items": {
  8507. "type": "string"
  8508. }
  8509. },
  8510. "total": {
  8511. "type": "integer"
  8512. }
  8513. }
  8514. },
  8515. "model.GetLogsResult": {
  8516. "type": "object",
  8517. "properties": {
  8518. "channels": {
  8519. "type": "array",
  8520. "items": {
  8521. "type": "integer"
  8522. }
  8523. },
  8524. "logs": {
  8525. "type": "array",
  8526. "items": {
  8527. "$ref": "#/definitions/model.Log"
  8528. }
  8529. },
  8530. "total": {
  8531. "type": "integer"
  8532. }
  8533. }
  8534. },
  8535. "model.Group": {
  8536. "type": "object",
  8537. "properties": {
  8538. "available_sets": {
  8539. "type": "array",
  8540. "items": {
  8541. "type": "string"
  8542. }
  8543. },
  8544. "balance_alert_enabled": {
  8545. "type": "boolean"
  8546. },
  8547. "balance_alert_threshold": {
  8548. "type": "number"
  8549. },
  8550. "created_at": {
  8551. "type": "string"
  8552. },
  8553. "id": {
  8554. "type": "string"
  8555. },
  8556. "request_count": {
  8557. "type": "integer"
  8558. },
  8559. "rpm_ratio": {
  8560. "type": "number"
  8561. },
  8562. "status": {
  8563. "type": "integer"
  8564. },
  8565. "tpm_ratio": {
  8566. "type": "number"
  8567. },
  8568. "used_amount": {
  8569. "type": "number"
  8570. }
  8571. }
  8572. },
  8573. "model.GroupDashboardResponse": {
  8574. "type": "object",
  8575. "properties": {
  8576. "cache_creation_tokens": {
  8577. "type": "integer"
  8578. },
  8579. "cached_tokens": {
  8580. "type": "integer"
  8581. },
  8582. "channels": {
  8583. "type": "array",
  8584. "items": {
  8585. "type": "integer"
  8586. }
  8587. },
  8588. "chart_data": {
  8589. "type": "array",
  8590. "items": {
  8591. "$ref": "#/definitions/model.ChartData"
  8592. }
  8593. },
  8594. "exception_count": {
  8595. "type": "integer"
  8596. },
  8597. "input_tokens": {
  8598. "type": "integer"
  8599. },
  8600. "models": {
  8601. "type": "array",
  8602. "items": {
  8603. "type": "string"
  8604. }
  8605. },
  8606. "output_tokens": {
  8607. "type": "integer"
  8608. },
  8609. "rpm": {
  8610. "type": "integer"
  8611. },
  8612. "token_names": {
  8613. "type": "array",
  8614. "items": {
  8615. "type": "string"
  8616. }
  8617. },
  8618. "total_count": {
  8619. "type": "integer"
  8620. },
  8621. "total_tokens": {
  8622. "type": "integer"
  8623. },
  8624. "tpm": {
  8625. "type": "integer"
  8626. },
  8627. "used_amount": {
  8628. "type": "number"
  8629. },
  8630. "web_search_count": {
  8631. "type": "integer"
  8632. }
  8633. }
  8634. },
  8635. "model.GroupMCP": {
  8636. "type": "object",
  8637. "properties": {
  8638. "created_at": {
  8639. "type": "string"
  8640. },
  8641. "group_id": {
  8642. "type": "string"
  8643. },
  8644. "id": {
  8645. "type": "string"
  8646. },
  8647. "name": {
  8648. "type": "string"
  8649. },
  8650. "openapi_config": {
  8651. "$ref": "#/definitions/model.MCPOpenAPIConfig"
  8652. },
  8653. "proxy_config": {
  8654. "$ref": "#/definitions/model.GroupMCPProxyConfig"
  8655. },
  8656. "type": {
  8657. "$ref": "#/definitions/model.GroupMCPType"
  8658. },
  8659. "update_at": {
  8660. "type": "string"
  8661. }
  8662. }
  8663. },
  8664. "model.GroupMCPProxyConfig": {
  8665. "type": "object",
  8666. "properties": {
  8667. "headers": {
  8668. "type": "object",
  8669. "additionalProperties": {
  8670. "type": "string"
  8671. }
  8672. },
  8673. "querys": {
  8674. "type": "object",
  8675. "additionalProperties": {
  8676. "type": "string"
  8677. }
  8678. },
  8679. "url": {
  8680. "type": "string"
  8681. }
  8682. }
  8683. },
  8684. "model.GroupMCPType": {
  8685. "type": "string",
  8686. "enum": [
  8687. "mcp_proxy_sse",
  8688. "mcp_proxy_streamable",
  8689. "mcp_openapi"
  8690. ],
  8691. "x-enum-varnames": [
  8692. "GroupMCPTypeProxySSE",
  8693. "GroupMCPTypeProxyStreamable",
  8694. "GroupMCPTypeOpenAPI"
  8695. ]
  8696. },
  8697. "model.GroupModelConfig": {
  8698. "type": "object",
  8699. "properties": {
  8700. "group_id": {
  8701. "type": "string"
  8702. },
  8703. "image_prices": {
  8704. "type": "object",
  8705. "additionalProperties": {
  8706. "type": "number"
  8707. }
  8708. },
  8709. "model": {
  8710. "type": "string"
  8711. },
  8712. "override_limit": {
  8713. "type": "boolean"
  8714. },
  8715. "override_price": {
  8716. "type": "boolean"
  8717. },
  8718. "override_retry_times": {
  8719. "type": "boolean"
  8720. },
  8721. "price": {
  8722. "$ref": "#/definitions/model.Price"
  8723. },
  8724. "retry_times": {
  8725. "type": "integer"
  8726. },
  8727. "rpm": {
  8728. "type": "integer"
  8729. },
  8730. "tpm": {
  8731. "type": "integer"
  8732. }
  8733. }
  8734. },
  8735. "model.ImageData": {
  8736. "type": "object",
  8737. "properties": {
  8738. "b64_json": {
  8739. "type": "string"
  8740. },
  8741. "revised_prompt": {
  8742. "type": "string"
  8743. },
  8744. "url": {
  8745. "type": "string"
  8746. }
  8747. }
  8748. },
  8749. "model.ImageInputTokensDetails": {
  8750. "type": "object",
  8751. "properties": {
  8752. "image_tokens": {
  8753. "description": "The number of image tokens in the input prompt.",
  8754. "type": "integer"
  8755. },
  8756. "text_tokens": {
  8757. "description": "The number of text tokens in the input prompt.",
  8758. "type": "integer"
  8759. }
  8760. }
  8761. },
  8762. "model.ImageRequest": {
  8763. "type": "object",
  8764. "properties": {
  8765. "background": {
  8766. "type": "string"
  8767. },
  8768. "model": {
  8769. "type": "string"
  8770. },
  8771. "moderation": {
  8772. "type": "string"
  8773. },
  8774. "n": {
  8775. "type": "integer"
  8776. },
  8777. "output_compression": {
  8778. "type": "integer"
  8779. },
  8780. "output_format": {
  8781. "description": "png, jpeg, webp",
  8782. "type": "string"
  8783. },
  8784. "prompt": {
  8785. "type": "string"
  8786. },
  8787. "quality": {
  8788. "description": "auto, high, medium, low, hd, standard",
  8789. "type": "string"
  8790. },
  8791. "response_format": {
  8792. "description": "url, b64_json",
  8793. "type": "string"
  8794. },
  8795. "size": {
  8796. "description": "1024x1024, 1536x1024, 1024x1536, auto, 256x256, 512x512, 1792x1024, 1024x1792",
  8797. "type": "string"
  8798. },
  8799. "style": {
  8800. "description": "vivid, natural",
  8801. "type": "string"
  8802. },
  8803. "user": {
  8804. "type": "string"
  8805. }
  8806. }
  8807. },
  8808. "model.ImageResponse": {
  8809. "type": "object",
  8810. "properties": {
  8811. "created": {
  8812. "type": "integer"
  8813. },
  8814. "data": {
  8815. "type": "array",
  8816. "items": {
  8817. "$ref": "#/definitions/model.ImageData"
  8818. }
  8819. },
  8820. "usage": {
  8821. "description": "For gpt-image-1 only, the token usage information for the image generation.",
  8822. "allOf": [
  8823. {
  8824. "$ref": "#/definitions/model.ImageUsage"
  8825. }
  8826. ]
  8827. }
  8828. }
  8829. },
  8830. "model.ImageUsage": {
  8831. "type": "object",
  8832. "properties": {
  8833. "input_tokens": {
  8834. "description": "The number of tokens (images and text) in the input prompt.",
  8835. "type": "integer"
  8836. },
  8837. "input_tokens_details": {
  8838. "description": "The input tokens detailed information for the image generation.",
  8839. "allOf": [
  8840. {
  8841. "$ref": "#/definitions/model.ImageInputTokensDetails"
  8842. }
  8843. ]
  8844. },
  8845. "output_tokens": {
  8846. "description": "The number of image tokens in the output image.",
  8847. "type": "integer"
  8848. },
  8849. "total_tokens": {
  8850. "description": "The total number of tokens (images and text) used for the image generation.",
  8851. "type": "integer"
  8852. }
  8853. }
  8854. },
  8855. "model.JSONSchema": {
  8856. "type": "object",
  8857. "properties": {
  8858. "description": {
  8859. "type": "string"
  8860. },
  8861. "name": {
  8862. "type": "string"
  8863. },
  8864. "schema": {
  8865. "type": "object",
  8866. "additionalProperties": true
  8867. },
  8868. "strict": {
  8869. "type": "boolean"
  8870. }
  8871. }
  8872. },
  8873. "model.Log": {
  8874. "type": "object",
  8875. "properties": {
  8876. "channel": {
  8877. "type": "integer"
  8878. },
  8879. "code": {
  8880. "type": "integer"
  8881. },
  8882. "content": {
  8883. "type": "string"
  8884. },
  8885. "created_at": {
  8886. "type": "string"
  8887. },
  8888. "endpoint": {
  8889. "type": "string"
  8890. },
  8891. "group": {
  8892. "type": "string"
  8893. },
  8894. "id": {
  8895. "type": "integer"
  8896. },
  8897. "ip": {
  8898. "type": "string"
  8899. },
  8900. "metadata": {
  8901. "type": "object",
  8902. "additionalProperties": {
  8903. "type": "string"
  8904. }
  8905. },
  8906. "mode": {
  8907. "type": "integer"
  8908. },
  8909. "model": {
  8910. "type": "string"
  8911. },
  8912. "price": {
  8913. "$ref": "#/definitions/model.Price"
  8914. },
  8915. "request_at": {
  8916. "type": "string"
  8917. },
  8918. "request_detail": {
  8919. "$ref": "#/definitions/model.RequestDetail"
  8920. },
  8921. "request_id": {
  8922. "type": "string"
  8923. },
  8924. "retry_at": {
  8925. "type": "string"
  8926. },
  8927. "retry_times": {
  8928. "type": "integer"
  8929. },
  8930. "token_id": {
  8931. "type": "integer"
  8932. },
  8933. "token_name": {
  8934. "type": "string"
  8935. },
  8936. "ttfb_milliseconds": {
  8937. "type": "integer"
  8938. },
  8939. "usage": {
  8940. "$ref": "#/definitions/github_com_labring_aiproxy_core_model.Usage"
  8941. },
  8942. "used_amount": {
  8943. "type": "number"
  8944. },
  8945. "user": {
  8946. "description": "https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids",
  8947. "type": "string"
  8948. }
  8949. }
  8950. },
  8951. "model.MCPOpenAPIConfig": {
  8952. "type": "object",
  8953. "properties": {
  8954. "authorization": {
  8955. "type": "string"
  8956. },
  8957. "openapi_content": {
  8958. "type": "string"
  8959. },
  8960. "openapi_spec": {
  8961. "type": "string"
  8962. },
  8963. "server_addr": {
  8964. "type": "string"
  8965. },
  8966. "v2": {
  8967. "type": "boolean"
  8968. }
  8969. }
  8970. },
  8971. "model.MCPPrice": {
  8972. "type": "object",
  8973. "properties": {
  8974. "default_tools_call_price": {
  8975. "type": "number"
  8976. },
  8977. "tools_call_prices": {
  8978. "type": "object",
  8979. "additionalProperties": {
  8980. "type": "number"
  8981. }
  8982. }
  8983. }
  8984. },
  8985. "model.Message": {
  8986. "type": "object",
  8987. "properties": {
  8988. "content": {},
  8989. "name": {
  8990. "type": "string"
  8991. },
  8992. "reasoning_content": {
  8993. "type": "string"
  8994. },
  8995. "role": {
  8996. "type": "string"
  8997. },
  8998. "tool_call_id": {
  8999. "type": "string"
  9000. },
  9001. "tool_calls": {
  9002. "type": "array",
  9003. "items": {
  9004. "$ref": "#/definitions/model.Tool"
  9005. }
  9006. }
  9007. }
  9008. },
  9009. "model.ModelConfig": {
  9010. "type": "object",
  9011. "properties": {
  9012. "config": {
  9013. "type": "object",
  9014. "additionalProperties": {}
  9015. },
  9016. "created_at": {
  9017. "type": "string"
  9018. },
  9019. "exclude_from_tests": {
  9020. "type": "boolean"
  9021. },
  9022. "image_prices": {
  9023. "description": "map[size]price_per_image",
  9024. "type": "object",
  9025. "additionalProperties": {
  9026. "type": "number"
  9027. }
  9028. },
  9029. "image_quality_prices": {
  9030. "description": "map[size]map[quality]price_per_image",
  9031. "type": "object",
  9032. "additionalProperties": {
  9033. "type": "object",
  9034. "additionalProperties": {
  9035. "type": "number"
  9036. }
  9037. }
  9038. },
  9039. "model": {
  9040. "type": "string"
  9041. },
  9042. "owner": {
  9043. "$ref": "#/definitions/model.ModelOwner"
  9044. },
  9045. "price": {
  9046. "$ref": "#/definitions/model.Price"
  9047. },
  9048. "retry_times": {
  9049. "type": "integer"
  9050. },
  9051. "rpm": {
  9052. "type": "integer"
  9053. },
  9054. "tpm": {
  9055. "type": "integer"
  9056. },
  9057. "type": {
  9058. "$ref": "#/definitions/mode.Mode"
  9059. },
  9060. "updated_at": {
  9061. "type": "string"
  9062. }
  9063. }
  9064. },
  9065. "model.ModelCostRank": {
  9066. "type": "object",
  9067. "properties": {
  9068. "cache_creation_tokens": {
  9069. "type": "integer"
  9070. },
  9071. "cached_tokens": {
  9072. "type": "integer"
  9073. },
  9074. "input_tokens": {
  9075. "type": "integer"
  9076. },
  9077. "model": {
  9078. "type": "string"
  9079. },
  9080. "output_tokens": {
  9081. "type": "integer"
  9082. },
  9083. "request_count": {
  9084. "type": "integer"
  9085. },
  9086. "total_tokens": {
  9087. "type": "integer"
  9088. },
  9089. "used_amount": {
  9090. "type": "number"
  9091. },
  9092. "web_search_count": {
  9093. "type": "integer"
  9094. }
  9095. }
  9096. },
  9097. "model.ModelOwner": {
  9098. "type": "string",
  9099. "enum": [
  9100. "openai",
  9101. "alibaba",
  9102. "tencent",
  9103. "xunfei",
  9104. "deepseek",
  9105. "moonshot",
  9106. "minimax",
  9107. "baidu",
  9108. "google",
  9109. "baai",
  9110. "funaudiollm",
  9111. "doubao",
  9112. "fishaudio",
  9113. "chatglm",
  9114. "stabilityai",
  9115. "netease",
  9116. "ai360",
  9117. "anthropic",
  9118. "meta",
  9119. "baichuan",
  9120. "mistral",
  9121. "openchat",
  9122. "microsoft",
  9123. "defog",
  9124. "nexusflow",
  9125. "cohere",
  9126. "huggingface",
  9127. "lingyiwanwu",
  9128. "stepfun",
  9129. "xai",
  9130. "doc2x",
  9131. "jina"
  9132. ],
  9133. "x-enum-varnames": [
  9134. "ModelOwnerOpenAI",
  9135. "ModelOwnerAlibaba",
  9136. "ModelOwnerTencent",
  9137. "ModelOwnerXunfei",
  9138. "ModelOwnerDeepSeek",
  9139. "ModelOwnerMoonshot",
  9140. "ModelOwnerMiniMax",
  9141. "ModelOwnerBaidu",
  9142. "ModelOwnerGoogle",
  9143. "ModelOwnerBAAI",
  9144. "ModelOwnerFunAudioLLM",
  9145. "ModelOwnerDoubao",
  9146. "ModelOwnerFishAudio",
  9147. "ModelOwnerChatGLM",
  9148. "ModelOwnerStabilityAI",
  9149. "ModelOwnerNetease",
  9150. "ModelOwnerAI360",
  9151. "ModelOwnerAnthropic",
  9152. "ModelOwnerMeta",
  9153. "ModelOwnerBaichuan",
  9154. "ModelOwnerMistral",
  9155. "ModelOwnerOpenChat",
  9156. "ModelOwnerMicrosoft",
  9157. "ModelOwnerDefog",
  9158. "ModelOwnerNexusFlow",
  9159. "ModelOwnerCohere",
  9160. "ModelOwnerHuggingFace",
  9161. "ModelOwnerLingyiWanwu",
  9162. "ModelOwnerStepFun",
  9163. "ModelOwnerXAI",
  9164. "ModelOwnerDoc2x",
  9165. "ModelOwnerJina"
  9166. ]
  9167. },
  9168. "model.Option": {
  9169. "type": "object",
  9170. "properties": {
  9171. "key": {
  9172. "type": "string"
  9173. },
  9174. "value": {
  9175. "type": "string"
  9176. }
  9177. }
  9178. },
  9179. "model.ParamType": {
  9180. "type": "string",
  9181. "enum": [
  9182. "header",
  9183. "query"
  9184. ],
  9185. "x-enum-varnames": [
  9186. "ParamTypeHeader",
  9187. "ParamTypeQuery"
  9188. ]
  9189. },
  9190. "model.ParsePdfResponse": {
  9191. "type": "object",
  9192. "properties": {
  9193. "markdown": {
  9194. "type": "string"
  9195. },
  9196. "pages": {
  9197. "type": "integer"
  9198. }
  9199. }
  9200. },
  9201. "model.Price": {
  9202. "type": "object",
  9203. "properties": {
  9204. "cache_creation_price": {
  9205. "type": "number"
  9206. },
  9207. "cache_creation_price_unit": {
  9208. "type": "integer"
  9209. },
  9210. "cached_price": {
  9211. "type": "number"
  9212. },
  9213. "cached_price_unit": {
  9214. "type": "integer"
  9215. },
  9216. "image_input_price": {
  9217. "type": "number"
  9218. },
  9219. "image_input_price_unit": {
  9220. "type": "integer"
  9221. },
  9222. "input_price": {
  9223. "type": "number"
  9224. },
  9225. "input_price_unit": {
  9226. "type": "integer"
  9227. },
  9228. "output_price": {
  9229. "type": "number"
  9230. },
  9231. "output_price_unit": {
  9232. "type": "integer"
  9233. },
  9234. "per_request_price": {
  9235. "type": "number"
  9236. },
  9237. "thinking_mode_output_price": {
  9238. "description": "when ThinkingModeOutputPrice and ReasoningTokens are not 0, OutputPrice and OutputPriceUnit will be overwritten",
  9239. "type": "number"
  9240. },
  9241. "thinking_mode_output_price_unit": {
  9242. "type": "integer"
  9243. },
  9244. "web_search_price": {
  9245. "type": "number"
  9246. },
  9247. "web_search_price_unit": {
  9248. "type": "integer"
  9249. }
  9250. }
  9251. },
  9252. "model.PromptTokensDetails": {
  9253. "type": "object",
  9254. "properties": {
  9255. "audio_tokens": {
  9256. "type": "integer"
  9257. },
  9258. "cache_creation_tokens": {
  9259. "type": "integer"
  9260. },
  9261. "cached_tokens": {
  9262. "type": "integer"
  9263. }
  9264. }
  9265. },
  9266. "model.PublicMCP": {
  9267. "type": "object",
  9268. "properties": {
  9269. "author": {
  9270. "type": "string"
  9271. },
  9272. "created_at": {
  9273. "type": "string"
  9274. },
  9275. "id": {
  9276. "type": "string"
  9277. },
  9278. "logo_url": {
  9279. "type": "string"
  9280. },
  9281. "name": {
  9282. "type": "string"
  9283. },
  9284. "openapi_config": {
  9285. "$ref": "#/definitions/model.MCPOpenAPIConfig"
  9286. },
  9287. "price": {
  9288. "$ref": "#/definitions/model.MCPPrice"
  9289. },
  9290. "proxy_config": {
  9291. "$ref": "#/definitions/model.PublicMCPProxyConfig"
  9292. },
  9293. "readme": {
  9294. "type": "string"
  9295. },
  9296. "readme_url": {
  9297. "type": "string"
  9298. },
  9299. "repo_url": {
  9300. "type": "string"
  9301. },
  9302. "tags": {
  9303. "type": "array",
  9304. "items": {
  9305. "type": "string"
  9306. }
  9307. },
  9308. "type": {
  9309. "$ref": "#/definitions/model.PublicMCPType"
  9310. },
  9311. "update_at": {
  9312. "type": "string"
  9313. }
  9314. }
  9315. },
  9316. "model.PublicMCPProxyConfig": {
  9317. "type": "object",
  9318. "properties": {
  9319. "headers": {
  9320. "type": "object",
  9321. "additionalProperties": {
  9322. "type": "string"
  9323. }
  9324. },
  9325. "querys": {
  9326. "type": "object",
  9327. "additionalProperties": {
  9328. "type": "string"
  9329. }
  9330. },
  9331. "reusing_params": {
  9332. "type": "object",
  9333. "additionalProperties": {
  9334. "$ref": "#/definitions/model.ReusingParam"
  9335. }
  9336. },
  9337. "url": {
  9338. "type": "string"
  9339. }
  9340. }
  9341. },
  9342. "model.PublicMCPReusingParam": {
  9343. "type": "object",
  9344. "properties": {
  9345. "created_at": {
  9346. "type": "string"
  9347. },
  9348. "group_id": {
  9349. "type": "string"
  9350. },
  9351. "mcp_id": {
  9352. "type": "string"
  9353. },
  9354. "reusing_params": {
  9355. "type": "object",
  9356. "additionalProperties": {
  9357. "type": "string"
  9358. }
  9359. },
  9360. "update_at": {
  9361. "type": "string"
  9362. }
  9363. }
  9364. },
  9365. "model.PublicMCPType": {
  9366. "type": "string",
  9367. "enum": [
  9368. "mcp_proxy_sse",
  9369. "mcp_proxy_streamable",
  9370. "mcp_git_repo",
  9371. "mcp_openapi"
  9372. ],
  9373. "x-enum-comments": {
  9374. "PublicMCPTypeGitRepo": "read only"
  9375. },
  9376. "x-enum-varnames": [
  9377. "PublicMCPTypeProxySSE",
  9378. "PublicMCPTypeProxyStreamable",
  9379. "PublicMCPTypeGitRepo",
  9380. "PublicMCPTypeOpenAPI"
  9381. ]
  9382. },
  9383. "model.RequestDetail": {
  9384. "type": "object",
  9385. "properties": {
  9386. "id": {
  9387. "type": "integer"
  9388. },
  9389. "log_id": {
  9390. "type": "integer"
  9391. },
  9392. "request_body": {
  9393. "type": "string"
  9394. },
  9395. "request_body_truncated": {
  9396. "type": "boolean"
  9397. },
  9398. "response_body": {
  9399. "type": "string"
  9400. },
  9401. "response_body_truncated": {
  9402. "type": "boolean"
  9403. }
  9404. }
  9405. },
  9406. "model.RerankMeta": {
  9407. "type": "object",
  9408. "properties": {
  9409. "model": {
  9410. "type": "string"
  9411. },
  9412. "tokens": {
  9413. "$ref": "#/definitions/model.RerankMetaTokens"
  9414. }
  9415. }
  9416. },
  9417. "model.RerankMetaTokens": {
  9418. "type": "object",
  9419. "properties": {
  9420. "input_tokens": {
  9421. "type": "integer"
  9422. },
  9423. "output_tokens": {
  9424. "type": "integer"
  9425. }
  9426. }
  9427. },
  9428. "model.RerankRequest": {
  9429. "type": "object",
  9430. "properties": {
  9431. "documents": {
  9432. "type": "array",
  9433. "items": {
  9434. "type": "string"
  9435. }
  9436. },
  9437. "max_chunks_per_doc": {
  9438. "type": "integer"
  9439. },
  9440. "model": {
  9441. "type": "string"
  9442. },
  9443. "overlap_tokens": {
  9444. "type": "integer"
  9445. },
  9446. "query": {
  9447. "type": "string"
  9448. },
  9449. "return_documents": {
  9450. "type": "boolean"
  9451. },
  9452. "top_n": {
  9453. "type": "integer"
  9454. }
  9455. }
  9456. },
  9457. "model.RerankResponse": {
  9458. "type": "object",
  9459. "properties": {
  9460. "id": {
  9461. "type": "string"
  9462. },
  9463. "meta": {
  9464. "$ref": "#/definitions/model.RerankMeta"
  9465. },
  9466. "results": {
  9467. "type": "array",
  9468. "items": {
  9469. "$ref": "#/definitions/model.RerankResult"
  9470. }
  9471. }
  9472. }
  9473. },
  9474. "model.RerankResult": {
  9475. "type": "object",
  9476. "properties": {
  9477. "document": {
  9478. "$ref": "#/definitions/model.Document"
  9479. },
  9480. "index": {
  9481. "type": "integer"
  9482. },
  9483. "relevance_score": {
  9484. "type": "number"
  9485. }
  9486. }
  9487. },
  9488. "model.ResponseFormat": {
  9489. "type": "object",
  9490. "properties": {
  9491. "json_schema": {
  9492. "$ref": "#/definitions/model.JSONSchema"
  9493. },
  9494. "type": {
  9495. "type": "string"
  9496. }
  9497. }
  9498. },
  9499. "model.ReusingParam": {
  9500. "type": "object",
  9501. "properties": {
  9502. "description": {
  9503. "type": "string"
  9504. },
  9505. "name": {
  9506. "type": "string"
  9507. },
  9508. "required": {
  9509. "type": "boolean"
  9510. },
  9511. "type": {
  9512. "$ref": "#/definitions/model.ParamType"
  9513. }
  9514. }
  9515. },
  9516. "model.StreamOptions": {
  9517. "type": "object",
  9518. "properties": {
  9519. "include_usage": {
  9520. "type": "boolean"
  9521. }
  9522. }
  9523. },
  9524. "model.SttJSONResponse": {
  9525. "type": "object",
  9526. "properties": {
  9527. "text": {
  9528. "type": "string"
  9529. }
  9530. }
  9531. },
  9532. "model.TextResponse": {
  9533. "type": "object",
  9534. "properties": {
  9535. "choices": {
  9536. "type": "array",
  9537. "items": {
  9538. "$ref": "#/definitions/model.TextResponseChoice"
  9539. }
  9540. },
  9541. "created": {
  9542. "type": "integer"
  9543. },
  9544. "id": {
  9545. "type": "string"
  9546. },
  9547. "model": {
  9548. "type": "string"
  9549. },
  9550. "object": {
  9551. "type": "string"
  9552. },
  9553. "usage": {
  9554. "$ref": "#/definitions/github_com_labring_aiproxy_core_relay_model.Usage"
  9555. }
  9556. }
  9557. },
  9558. "model.TextResponseChoice": {
  9559. "type": "object",
  9560. "properties": {
  9561. "finish_reason": {
  9562. "$ref": "#/definitions/model.FinishReason"
  9563. },
  9564. "index": {
  9565. "type": "integer"
  9566. },
  9567. "message": {
  9568. "$ref": "#/definitions/model.Message"
  9569. },
  9570. "text": {
  9571. "type": "string"
  9572. }
  9573. }
  9574. },
  9575. "model.TextToSpeechRequest": {
  9576. "type": "object",
  9577. "required": [
  9578. "input",
  9579. "model",
  9580. "voice"
  9581. ],
  9582. "properties": {
  9583. "input": {
  9584. "type": "string"
  9585. },
  9586. "model": {
  9587. "type": "string"
  9588. },
  9589. "response_format": {
  9590. "type": "string"
  9591. },
  9592. "speed": {
  9593. "type": "number"
  9594. },
  9595. "voice": {
  9596. "type": "string"
  9597. }
  9598. }
  9599. },
  9600. "model.Tool": {
  9601. "type": "object",
  9602. "properties": {
  9603. "function": {
  9604. "$ref": "#/definitions/model.Function"
  9605. },
  9606. "id": {
  9607. "type": "string"
  9608. },
  9609. "type": {
  9610. "type": "string"
  9611. }
  9612. }
  9613. },
  9614. "openai.SubscriptionResponse": {
  9615. "type": "object",
  9616. "properties": {
  9617. "access_until": {
  9618. "type": "integer"
  9619. },
  9620. "hard_limit_usd": {
  9621. "type": "number"
  9622. },
  9623. "has_payment_method": {
  9624. "type": "boolean"
  9625. },
  9626. "object": {
  9627. "type": "string"
  9628. },
  9629. "soft_limit_usd": {
  9630. "type": "number"
  9631. },
  9632. "system_hard_limit_usd": {
  9633. "type": "number"
  9634. }
  9635. }
  9636. },
  9637. "openai.UsageResponse": {
  9638. "type": "object",
  9639. "properties": {
  9640. "object": {
  9641. "type": "string"
  9642. },
  9643. "total_usage": {
  9644. "description": "DailyCosts []OpenAIUsageDailyCost `json:\"daily_costs\"`",
  9645. "type": "number"
  9646. }
  9647. }
  9648. }
  9649. },
  9650. "securityDefinitions": {
  9651. "ApiKeyAuth": {
  9652. "type": "apiKey",
  9653. "name": "Authorization",
  9654. "in": "header"
  9655. }
  9656. }
  9657. }