Interent is a pay-to-run AI toolchain marketplace: describe a task → get a suggested toolchain and expected outputs → review transparent pricing (incl. service fee) → pay once via Locus Checkout → Interent executes each step via Locus Wrapped APIs and returns the result.
Repo status: MVP / demo-friendly. Some providers and endpoints depend on what you have populated in the database.
- Plan a workflow from natural language (
/input)- Suggested flow (toolchain)
- Expected output selection (multi-select)
- Pricing breakdown: subtotal + 5% service fee + total (USDC precision)
- Choose provider alternatives for certain steps (e.g.
chatvia OpenAI or Gemini) when multiple options exist in thetaskstable. - Pay & run using Locus Checkout (single payment for the entire workflow).
- Test Pay mode for demos without paying (creates a mock “DONE” job result).
- Browse available providers/endpoints in
/provider(old/marketplaceredirects).
- Next.js (App Router) + TypeScript
- Supabase Postgres (jobs, tasks, pricing)
- Locus Checkout (
@withlocus/checkout-react) - Locus Wrapped APIs (server-side execution)
src/
app/
input/ # Describe task → plan toolchain → pay/testpay
jobs/[id]/ # Job viewer (input/toolchain + output)
provider/ # Provider catalog UI (reads from tasks table)
api/
plan/ # Toolchain planner (AI provider, OpenAI-compatible) + DB normalization
tasks/ # List supported tasks/tools from DB
workflows/create/ # Create workflow checkout session (Locus)
workflows/testpay/ # Create mock DONE job (no payment, no execution)
webhooks/locus/ # Payment webhook → execute workflow/step calls
admin/sync-tools/ # Populate tasks from Locus provider docs (server-side)
lib/
locus_wrapped.ts # Helper for calling Locus wrapped endpoints
- Node.js 18+ (recommended)
- A Supabase project
- Locus API credentials (internal/private depending on your org)
- Create a project in Supabase
- Open SQL Editor → run:
supabase-schema.sql - Copy credentials:
NEXT_PUBLIC_SUPABASE_URLNEXT_PUBLIC_SUPABASE_ANON_KEYSUPABASE_SERVICE_ROLE_KEY(server-only)
Reads use the anon key. Writes in server routes/webhooks use the service role key.
Set:
LOCUS_API_KEYLOCUS_API_BASE
Copy .env.example → .env.local and fill it in.
Important:
NEXT_PUBLIC_APP_URLmust be publicly reachable for webhooks.- Local dev:
http://localhost:3000(webhooks won’t reach local without a tunnel) - Deployed:
https://your-app.vercel.app
- Local dev:
npm install
npm run devOpen:
http://localhost:3000/input
POST /api/plan
- Uses an OpenAI-compatible AI provider (configurable via env)
- Normalizes steps against the
taskstable (canonical labels + pricing) - Returns pricing fields:
subtotalToolsUsdcserviceFeeUsdc(5% of subtotal)totalPriceUsdc
The planner (tool detection) calls an OpenAI-compatible POST /v1/chat/completions endpoint.
Set env vars:
AI_PROVIDER_BASE=https://ai.sumopod.com
AI_PROVIDER_API_KEY=...
AI_PROVIDER_MODEL=gpt-5-nanoPOST /api/workflows/create→ returns checkout session- User completes Locus checkout
- Locus webhook hits:
POST /api/webhooks/locus
- Webhook executes the workflow steps using Locus Wrapped APIs and stores results in
jobs.result_json
Use Test Pay on /input to create a mock job:
- No Locus payment
- No wrapped API calls
- Job immediately
DONEwith example output
The /provider page shows whatever is in public.tasks.
This repo interprets public.tasks.price_usdc as $ per 1M tokens (e.g. 0.10 means $0.10/M).
If you already created your Supabase tables, run the migration in:
supabase/migrations/20260428_000001_token_pricing_0_10_per_million.sql
in the Supabase SQL Editor.
To import the full Wrapped API catalog into tasks, call the admin sync endpoint:
- Set env:
ADMIN_SECRET(any random string)
- Call:
curl -X POST https://<your-domain>/api/admin/sync-tools \
-H "Content-Type: application/json" \
-H "x-admin-secret: <ADMIN_SECRET>" \
-d '{"priceUsdc": 0.10}'Or sync one provider:
curl -X POST https://<your-domain>/api/admin/sync-tools \
-H "Content-Type: application/json" \
-H "x-admin-secret: <ADMIN_SECRET>" \
-d '{"provider":"openai","priceUsdc":0.10}'- Import the repo into Vercel
- Set environment variables (same as
.env.local) - Deploy
Ensure
NEXT_PUBLIC_APP_URLpoints to the deployed HTTPS URL so the Locus webhook can reach your server.
The merchant SDK package may not be publicly available. This project creates checkout sessions via REST in:
src/app/api/jobs/create/route.ts
If your environment uses a different checkout creation endpoint, update that route.
See SECURITY.md (internal notes).