Payment flow
Create a signed order through this Vercel app, open Khalti checkout, return to processing, poll serverless payment status, then reveal the API token after lookup success.
Docs
Operational notes for wiring Khalti and API token access inside this single Vercel project.
Create a signed order through this Vercel app, open Khalti checkout, return to processing, poll serverless payment status, then reveal the API token after lookup success.
Plaintext API tokens appear only on the success screen. Store the token immediately; model token usage is recorded against its 30,000-token allowance.
Clients call this app with ?token=API_TOKEN. This app validates the token, forwards the request to the hidden VM model, and returns the model response.
Each successful response records its model-token usage against the key's 30,000-token allowance. Production stores counters in Azure Table Storage; local development uses an in-memory store.
curl -X POST "http://localhost:3000/api/models/himalayan-0.5b-it/generate?token=API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"text":"Hello"}'Successful responses include X-Sajedar-Tokens-Used, X-Sajedar-Tokens-Remaining, and X-Sajedar-Key-Request-Count headers.
{
"orderId": "SJ-ORD-1101",
"state": "pending | success | failed",
"modelId": "himalayan-0.5b-it",
"amount": "Rs 800 / 30K tokens"
}Browse models