We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 919230f commit 512f9ddCopy full SHA for 512f9dd
apps/portal/src/app/x402/server/page.mdx
@@ -110,7 +110,7 @@ if (verifyResult.status !== 200) {
110
}
111
112
// Do the expensive work that requires payment
113
-const { tokensUsed } = await callExpensiveAIModel();
+const { answer, tokensUsed } = await callExpensiveAIModel();
114
115
// Now settle the payment based on actual usage
116
const pricePerTokenUsed = 0.00001; // ex: $0.00001 per AI model token used
@@ -119,7 +119,7 @@ const settleResult = await settlePayment({
119
price: tokensUsed * pricePerTokenUsed, // adjust final price based on usage
120
});
121
122
-return Response.json(result);
+return Response.json(answer);
123
```
124
125
## Price and Token Configuration
0 commit comments