Smart AI Runner+ — Administrator Guide
This guide explains how to operate, secure, maintain, and recover the Smart AI Runner+ platform.
Useful Admin Git Bash Commands
1. Go to the Local Repo
cd "/c/Users/YOUR_USERNAME/Desktop/Local Repos/smart-ai-runner-plus"
2. See changed files
git status
3. Stage, commit, and push
git add .
git commit -m "Describe the update clearly"
git push
4. Verify important admin routes in the server file
grep -n '"/admin/customer"\|"/admin/create_key"\|"/admin/reissue_key"\|"/admin/deactivate_key"\|"/admin/reactivate_key"\|"/admin/customer-keys"\|"/admin/login"\|"/admin/usage"' cortex_server.py
5. Compile-check the server file before committing
python -m py_compile cortex_server.py
6. View the guide files
find ui -maxdepth 2 -type f | sort | grep -Ei "guide|help|docs|admin"
7. Test the live API with a real active key
curl -X POST "https://cortex-runner-private.onrender.com/ask" \
-H "Content-Type: application/json" \
-H "X-CORTEX-KEY: YOUR_ACTIVE_KEY_HERE" \
-d '{"prompt":"hello"}'
1. What This System Does
Smart AI Runner+ is a paid AI API platform with billing, key management, quota enforcement, rate limiting, onboarding, and admin controls.
- User purchases a subscription.
- Stripe confirms the purchase.
- Webhook activates a customer key.
- Customer retrieves or receives the key.
- Customer calls the API using the key.
2. Important System URLs
Main website:
https://cortex-runner-private.onrender.com
API endpoint:
https://cortex-runner-private.onrender.com/ask
Admin login page:
https://cortex-runner-private.onrender.com/admin/login
Admin customer key page:
https://cortex-runner-private.onrender.com/admin/customer-keys
Usage page:
https://cortex-runner-private.onrender.com/admin/usage
3. Customer Key Operations
The Admin Customer Keys page supports:
- Create / Update — create a new customer record or update an existing customer by email and plan
- Lookup — view the current record for a customer key
- Reissue Key — replace an exposed or old key with a new key
- Deactivate — disable a customer key
- Reactivate — re-enable a customer key
Recommended security action if a key is exposed
- Open the Admin Customer Keys page.
- Enter the exposed key.
- Click Reissue Key.
- If needed, use Create / Update with the customer email to confirm the correct plan.
4. Plan Limits
| Plan | Daily Limit | Max Tokens/Request |
| Starter | 50 requests | 1,500 |
| Pro | 100 requests | 1,500 |
| Enterprise | 500 requests | 1,500 |
5. Kill Switch
The system now includes a global kill switch through the Render environment variable:
GLOBAL_KILL_SWITCH
Behavior:
GLOBAL_KILL_SWITCH=false → normal API operation
GLOBAL_KILL_SWITCH=true → /ask returns HTTP 503 with a maintenance message
Use cases:
- emergency shutdown
- maintenance window
- unexpected cost protection
- abuse or misuse response
Important: change the variable in Render after code is already deployed.
6. Stripe Management
Stripe handles billing and subscriptions.
Important webhook events:
- checkout.session.completed
- invoice.paid
- invoice.payment_failed
- customer.subscription.deleted
Webhook endpoint:
/stripe/webhook
7. Environment Variables
Important Render environment variables include:
- STRIPE_STARTER_LINK
- STRIPE_PRO_LINK
- STRIPE_ENTERPRISE_LINK
- STARTER_MONTHLY_LIMIT
- PRO_MONTHLY_LIMIT
- ENTERPRISE_MONTHLY_LIMIT
- CORTEX_ADMIN_TOKEN
- GLOBAL_KILL_SWITCH
8. Updating the Application
All development is done in the Local Repo.
Local Repo path (replace the placeholders with your own values):
C:\Users\YOUR_NAME_HERE\Desktop\Local Repos\YOUR_AI_PROJECT_NAME
Deployment process:
- Modify files locally.
- Compile-check where needed.
- Commit changes using Git.
- Push to GitHub.
- Render auto-deploys the update.
Open Shell Helper
Run a shell or Git Bash session directly in the Local Repo so you can execute the commands above without copying paths every time.
Replace the placeholders with your own Windows username and project folder.
cd "/c/Users/YOUR_NAME_HERE/Desktop/Local Repos/YOUR_AI_PROJECT_NAME"
Then run your preferred shell command (e.g., git status, python cortex_server.py, etc.).
Download Git Bash
9. Best Practices
- Never share your admin token.
- Never manually edit the deployed repo folder.
- Use the Local Repo as the source for changes.
- Reissue exposed customer keys immediately.
- Use the kill switch if maintenance or abuse control is needed.
- Compile-check the server file before committing backend changes.