docs.go 318 KB

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