docs.go 335 KB

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