docs.go 331 KB

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