Developers

API and MCP

The planner’s functions are available over HTTP and as a local MCP server. Both call the same code as the web app, so a figure is computed in one place.

01

This deployment

Capabilities of this deployment
CapabilityStateDetail
Estimator, cost, offers, compareAvailableDeterministic. Runs without an account, a model key or a provider.
Ask Forxlite (AI assistant)AvailableModel credentials are configured on the server.
Accounts (wallet sign-in)AvailableSign in with a Solana wallet to keep plans in an account.
MCPLocal onlyThe MCP server runs locally from this repository. There is no hosted MCP endpoint.
TokenNot 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.

HTTP endpoints
Method and pathWhat it does
POST /api/estimateMemory estimate for an inference workload: weights, KV cache, overhead, total, assumptions.
GET /api/offersNormalized offers from connected providers with provider status. Query: minVramGiB, maxHourlyRate, tier, query, queuedOnly=1, providerId, limit.
POST /api/compareEstimate, then a fit label and a session cost for each offer, fitting offers first.
POST /api/costHourly rate × duration, from a rate you send or from a listed offer id.
GET /api/statusWhat this deployment can do.
POST /api/assistantAsk Forxlite. Answers 503 assistant_unavailable when no model credentials are configured.
Estimate memory
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 }
  }'
Compare offers for a workload
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
  }'
Session cost at your rate
curl -s https://www.forxlite.xyz/api/cost \
  -H "content-type: application/json" \
  -d '{ "hourlyRate": 0.75, "durationHours": 3, "measuredTokensPerSecond": 40 }'
List offers
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.

MCP tools
ToolDescription
estimate_memoryEstimates 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_offersLists 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_offersEstimates 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_costMultiplies 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.
Build and check
pnpm install
pnpm mcp:build      # writes dist/mcp/server.mjs, one file
pnpm mcp:check      # starts it and calls every tool over stdio

estimate_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 Code (command)
claude mcp add forxlite -- node /absolute/path/to/forxlite/dist/mcp/server.mjs
Claude Code or Cursor (.mcp.json or .cursor/mcp.json)
{
  "mcpServers": {
    "forxlite": {
      "command": "node",
      "args": ["/absolute/path/to/forxlite/dist/mcp/server.mjs"]
    }
  }
}
Codex (~/.codex/config.toml)
[mcp_servers.forxlite]
command = "node"
args = ["/absolute/path/to/forxlite/dist/mcp/server.mjs"]
Codex (command)
codex mcp add forxlite -- node /absolute/path/to/forxlite/dist/mcp/server.mjs

Client 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):

Server environment
# 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=300

With 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.