Exergy World Model
Limits, errors, security & tooling
Rate limits and monthly allowances, error codes and retry strategy, sandbox isolation, and SDKs for Exergy World Model (EWM-1).
Rate limits, quotas & concurrency
Live self-serve API keys on exergy-lab.com allow 10 authenticated requests per minute and monthly evaluation allowances by plan (250/month on Plus, 1,000/month on Pro, no automatic overages). EWM-1 hosted preview defaults are listed below.
| Limit | Default | Scope / Override | When exceeded |
|---|---|---|---|
| Live API authenticated rate | 10 / min | Per account on exergy-lab.com | 429 rate_limited |
| Live API monthly evaluations | 250 (Plus) · 1,000 (Pro) | Per UTC month | 429 monthly_limit |
| EWM-1 preview requests / minute | 15 / min | EWM_RATE_LIMIT_PER_MIN | 429 Too Many Requests |
| EWM-1 preview requests / day | 250 / 24 h | EWM_RATE_LIMIT_PER_DAY | 429 Too Many Requests |
| Max concurrent requests | 8 solves | EWM_MAX_CONCURRENT | 429 Too Many Requests |
| Max prompt length | 60,000 characters | Hard limit | 400 Bad Request |
| Sandbox execution timeout | 25.0 s per attempt | Hard limit | Automatic self-repair pass |
Error codes & retry strategy
All API errors return a consistent JSON error object.
| Status | Type / code | Cause | What to do |
|---|---|---|---|
| 400 | invalid_request_error | Malformed JSON, empty prompt/messages, or prompt over 60,000 chars | Validate the body; do not retry unchanged |
| 401 | auth_or_rate_limit_error | Missing or invalid Authorization: Bearer / X-API-Key header | Check EXERGY_API_KEY |
| 413 | PAYLOAD_LIMIT | Payload exceeds size ceiling | Trim the request |
| 422 | INVALID_DECISION_REQUEST | Missing or invalid telemetry field on /v1/energy-decisions/evaluate | Inspect error.detail |
| 429 | auth_or_rate_limit_error | RPM, RPD, or concurrency limit exceeded | Exponential backoff with jitter (2 s, 4 s, 8 s, 16 s) |
| 502 | upstream_error | Transient upstream inference timeout | Exponential backoff |
{
"error": {
"message": "Rate limit exceeded (15 requests/minute). Please wait before retrying.",
"type": "auth_or_rate_limit_error",
"code": 429
}
}Sandbox security, isolation & data privacy
Static AST allowlist validation
Every generated script is parsed into a Python AST before execution. Permitted imports: ewm_thermo_lib and its domain modules, math, cmath, json, collections, itertools, functools, operator, statistics, decimal, fractions, typing, dataclasses, enum, re, copy, numbers, numpy, scipy, and CoolProp. Any reference to os, sys, subprocess, socket, http, urllib, shutil, pathlib, ctypes, multiprocessing, threading, open(), eval(), exec(), compile(), __import__(), globals(), locals(), getattr(), setattr(), or dunder introspection is blocked before execution.
Ephemeral directory & secret-stripped subprocess
Each execution runs in an isolated temporary directory that is deleted on completion, with all server secrets stripped from the subprocess environment.
Prompt sanitization
Incoming prompts are stripped of null bytes and control characters and capped at 60,000 characters.
SDKs, HTTP & OpenAPI tooling
- Interactive playground: open /docs on the server (https://api.exergylab.ai/docs or http://127.0.0.1:8765/docs) to try /v1/solve and /v1/chat/completions in the browser.
- OpenAPI 3.1.0: download /openapi.json to generate typed clients or import into Postman, Insomnia, or Bruno.
- OpenAI SDKs: compatible with the official openai clients for Python, TypeScript/Node.js, Go, and Java.
- Direct HTTP / curl: call /v1/solve or /v1/chat/completions from any language or shell script without installing an SDK.
# Solve an engineering prompt from the CLI (fast verified JSON mode)
curl -s https://api.exergylab.ai/v1/solve \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $EXERGY_API_KEY" \
-d '{
"prompt": "Find the specific enthalpy (kJ/kg) and flow exergy (kJ/kg) of steam at 40 bar and 420 C.",
"skip_composer": true
}'
# Check service health
curl -s https://api.exergylab.ai/v1/health