docs.go 358 KB

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