Developers
API and MCP
01
This deployment
| Capability | State | Detail |
|---|---|---|
| Estimator, cost, offers, compare | Available | Deterministic. Runs without an account, a model key or a provider. |
| Ask Forxlite (AI assistant) | Available | Model credentials are configured on the server. |
| Accounts (wallet sign-in) | Available | Sign in with a Solana wallet to keep plans in an account. |
| MCP | Local only | The MCP server runs locally from this repository. There is no hosted MCP endpoint. |
| Token | Not required | $FORXL is not required to use Forxlite. The address shown here is the one the project published. |
The same report is served as JSON at GET /api/status.
02
HTTP API
JSON in, JSON out. No key is needed for these routes. Errors use one shape: { "error": { "code", "message", "issues" } }, with status 422 for invalid input.
| Method and path | What it does |
|---|---|
| POST /api/estimate | Memory estimate for an inference workload: weights, KV cache, overhead, total, assumptions. |
| GET /api/offers | Normalized offers from connected providers with provider status. Query: minVramGiB, maxHourlyRate, tier, query, queuedOnly=1, providerId, limit. |
| POST /api/compare | Estimate, then a fit label and a session cost for each offer, fitting offers first. |
| POST /api/cost | Hourly rate × duration, from a rate you send or from a listed offer id. |
| GET /api/status | What this deployment can do. |
| POST /api/assistant | Ask Forxlite. Answers 503 assistant_unavailable when no model credentials are configured. |
curl -s https://www.forxlite.xyz/api/estimate \
-H "content-type: application/json" \
-d '{
"parameterCount": 8030000000,
"weightFormat": "gguf-q4_k_m",
"contextTokens": 8192,
"architecture": { "layers": 32, "kvHeads": 8, "headDim": 128 }
}'curl -s https://www.forxlite.xyz/api/compare \
-H "content-type: application/json" \
-d '{
"workload": {
"parameterCount": 32800000000,
"weightFormat": "gguf-q4_k_m",
"contextTokens": 8192,
"architecture": { "layers": 64, "kvHeads": 8, "headDim": 128 }
},
"durationHours": 3,
"budget": 10,
"limit": 5
}'curl -s https://www.forxlite.xyz/api/cost \
-H "content-type: application/json" \
-d '{ "hourlyRate": 0.75, "durationHours": 3, "measuredTokensPerSecond": 40 }'curl -s "https://www.forxlite.xyz/api/offers?minVramGiB=24&queuedOnly=1&limit=10"Field definitions and ranges are in src/lib/tools/schemas.ts. Units and formulas are in the methodology.
03
Local MCP server
The repository includes an MCP server that runs on your machine over stdio. It exposes four tools and plans only: it does not rent, reserve or run anything. There is no hosted MCP endpoint and no published package. You build it from this repository.
| Tool | Description |
|---|---|
| estimate_memory | Estimates the GPU memory an inference workload needs: weights, KV cache and runtime overhead, each as a low / typical / high range in bytes, with the assumptions used. Deterministic. Provide the architecture (layers, KV heads, head dimension) for a KV cache figure specific to the model; without it the KV cache is a coarse range and confidence is reduced. Training is not estimated. |
| list_gpu_offers | Lists GPU offers from the connected providers with listed price, memory per GPU, availability, source URLs and the time each was fetched. Also returns each provider’s status (live, cached, stale or unavailable). Prices and availability come from the provider and may be minutes old; never state them without their fetch time. |
| compare_gpu_offers | Estimates memory for a workload, then gives each connected offer a fit label and a session cost for the stated duration, sorted with fitting offers first and by listed price. Use it to build a shortlist. "Lowest listed price" applies only to the results returned. |
| calculate_session_cost | Multiplies an hourly rate by a session duration, applying a billing increment and minimum charge when known. The rate is either a figure the user entered or the listed rate of an offer id. Unknown charges are reported as unknown, never as zero. Does not predict how long a job takes. |
pnpm install
pnpm mcp:build # writes dist/mcp/server.mjs, one file
pnpm mcp:check # starts it and calls every tool over stdioestimate_memory and calculate_session_cost with a rate you supply work offline. The two offer tools read the provider’s public API from your machine and return each provider’s status with the data.
04
Client setup
Replace the path with the absolute path of dist/mcp/server.mjs in your checkout. pnpm mcp:build prints it. These follow each client’s own documentation at the time of writing; check it if a command changes.
claude mcp add forxlite -- node /absolute/path/to/forxlite/dist/mcp/server.mjs{
"mcpServers": {
"forxlite": {
"command": "node",
"args": ["/absolute/path/to/forxlite/dist/mcp/server.mjs"]
}
}
}[mcp_servers.forxlite]
command = "node"
args = ["/absolute/path/to/forxlite/dist/mcp/server.mjs"]codex mcp add forxlite -- node /absolute/path/to/forxlite/dist/mcp/server.mjsClient documentation: Claude Code, Cursor, Codex. Forxlite is not affiliated with these products.
05
Assistant configuration
Ask Forxlite needs model credentials on the server. They are never sent to the browser. Set one of these in the server environment (see .env.example):
# The Claude API directly
ANTHROPIC_API_KEY=...
# or, on Vercel, the AI Gateway with the deployment's own identity
FORXLITE_AI_GATEWAY=1
# optional
FORXLITE_AI_MODEL=claude-opus-5-5
FORXLITE_AI_DAILY_LIMIT=300With neither set, POST /api/assistant answers 503 and the planner shows “AI assistant unavailable”. No reply is simulated.
06
Account storage
Guest saving needs no configuration. To keep plans in accounts, give the server a PostgreSQL database with DATABASE_URL. The schema is created on first use. Without it, wallet sign-in is not offered and plans stay on the visitor’s device.
The local MCP server and guest plans do not use the database. On a serverless host, the provider cache and the assistant’s rate limits are held per instance.