Maybe something like:
// app/api/gensx/[...path]/route.ts
import { createPassthroughHandlers } from '@gensx/nextjs';
// This will export GET/POST/etc handlers that look at the path and try to infer the operation.
export {
...createPassthroughHandlers({
apiKey: process.env.GENSX_API_KEY,
org: process.env.GENSX_ORG,
project: process.env.GENSX_PROJECT,
env: process.env.GENSX_ENV
});
};