docs.go 320 KB

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