@@ -835,7 +835,7 @@ export async function createServer(config: ServerConfig): Promise<FastifyInstanc
835835 // No sensitive data. Just what the server sees for this key.
836836 // ===========================================================================
837837
838- server . get ( "/whoami" , async ( request ) => {
838+ server . get ( "/whoami" , { config : { rateLimit : { max : 30 , timeWindow : "1 minute" } } } , async ( request ) => {
839839 return {
840840 role : request . role ,
841841 vendor : request . vendor ,
@@ -1138,6 +1138,7 @@ export async function createServer(config: ServerConfig): Promise<FastifyInstanc
11381138 schema : {
11391139 body : memoryBodySchema ,
11401140 } ,
1141+ config : { rateLimit : { max : 30 , timeWindow : "1 minute" } } ,
11411142 } ,
11421143 async ( request , reply ) => {
11431144 const body = request . body as {
@@ -1185,6 +1186,7 @@ export async function createServer(config: ServerConfig): Promise<FastifyInstanc
11851186 schema : {
11861187 body : agentMemoryBodySchema ,
11871188 } ,
1189+ config : { rateLimit : { max : 30 , timeWindow : "1 minute" } } ,
11881190 } ,
11891191 async ( request , reply ) => {
11901192 const body = request . body as {
@@ -1232,7 +1234,7 @@ export async function createServer(config: ServerConfig): Promise<FastifyInstanc
12321234 // agent's own writes.
12331235 // ===========================================================================
12341236
1235- server . get ( "/agent/memories/latest" , async ( request , reply ) => {
1237+ server . get ( "/agent/memories/latest" , { config : { rateLimit : { max : 60 , timeWindow : "1 minute" } } } , async ( request , reply ) => {
12361238 const vendorFilter = request . vendor ;
12371239 const query = request . query as { tag ?: string ; origin ?: string } ;
12381240 const tag = query . tag ?. trim ( ) ;
@@ -1278,6 +1280,7 @@ export async function createServer(config: ServerConfig): Promise<FastifyInstanc
12781280 schema : {
12791281 params : memoryIdParamSchema ,
12801282 } ,
1283+ config : { rateLimit : { max : 60 , timeWindow : "1 minute" } } ,
12811284 } ,
12821285 async ( request , reply ) => {
12831286 const { id } = request . params as { id : string } ;
@@ -1328,6 +1331,7 @@ export async function createServer(config: ServerConfig): Promise<FastifyInstanc
13281331 } ,
13291332 } ,
13301333 } ,
1334+ config : { rateLimit : { max : 30 , timeWindow : "1 minute" } } ,
13311335 } ,
13321336 async ( request ) => {
13331337 const { tags, limit, offset } = request . body as {
@@ -1381,6 +1385,7 @@ export async function createServer(config: ServerConfig): Promise<FastifyInstanc
13811385 schema : {
13821386 body : browseBodySchema ,
13831387 } ,
1388+ config : { rateLimit : { max : 30 , timeWindow : "1 minute" } } ,
13841389 } ,
13851390 async ( request ) => {
13861391 const { filter, limit, offset } = request . body as {
@@ -1419,6 +1424,7 @@ export async function createServer(config: ServerConfig): Promise<FastifyInstanc
14191424 schema : {
14201425 params : memoryIdParamSchema ,
14211426 } ,
1427+ config : { rateLimit : { max : 60 , timeWindow : "1 minute" } } ,
14221428 } ,
14231429 async ( request , reply ) => {
14241430 const { id } = request . params as { id : string } ;
@@ -1442,6 +1448,7 @@ export async function createServer(config: ServerConfig): Promise<FastifyInstanc
14421448 schema : {
14431449 body : listFilterBodySchema ,
14441450 } ,
1451+ config : { rateLimit : { max : 30 , timeWindow : "1 minute" } } ,
14451452 } ,
14461453 async ( request ) => {
14471454 const body = request . body as {
@@ -1478,6 +1485,7 @@ export async function createServer(config: ServerConfig): Promise<FastifyInstanc
14781485 params : memoryIdParamSchema ,
14791486 body : updateMemoryBodySchema ,
14801487 } ,
1488+ config : { rateLimit : { max : 30 , timeWindow : "1 minute" } } ,
14811489 } ,
14821490 async ( request , reply ) => {
14831491 const { id } = request . params as { id : string } ;
@@ -1522,6 +1530,7 @@ export async function createServer(config: ServerConfig): Promise<FastifyInstanc
15221530 schema : {
15231531 params : memoryIdParamSchema ,
15241532 } ,
1533+ config : { rateLimit : { max : 30 , timeWindow : "1 minute" } } ,
15251534 } ,
15261535 async ( request , reply ) => {
15271536 const { id } = request . params as { id : string } ;
@@ -1544,6 +1553,7 @@ export async function createServer(config: ServerConfig): Promise<FastifyInstanc
15441553 schema : {
15451554 params : memoryIdParamSchema ,
15461555 } ,
1556+ config : { rateLimit : { max : 10 , timeWindow : "1 minute" } } ,
15471557 } ,
15481558 async ( request , reply ) => {
15491559 const { id } = request . params as { id : string } ;
@@ -1640,7 +1650,7 @@ export async function createServer(config: ServerConfig): Promise<FastifyInstanc
16401650 // populate the model selector.
16411651 // ===========================================================================
16421652
1643- server . get ( "/chat/models" , async ( ) => {
1653+ server . get ( "/chat/models" , { config : { rateLimit : { max : 30 , timeWindow : "1 minute" } } } , async ( ) => {
16441654 const available = AVAILABLE_MODELS . filter ( ( m ) => {
16451655 switch ( m . id ) {
16461656 case "gpt-4o" :
@@ -2304,7 +2314,7 @@ export async function createServer(config: ServerConfig): Promise<FastifyInstanc
23042314 "/webhooks/stripe" ,
23052315 {
23062316 config : {
2307- rateLimit : { max : 100 , timeWindow : "1 minute" } ,
2317+ rateLimit : { max : 30 , timeWindow : "1 minute" } ,
23082318 rawBody : true ,
23092319 } ,
23102320 } ,
0 commit comments