Exergy World Model

Exergy World Model quickstart & API keys

Create an Exergy World Model API key in the Developer Portal, call POST /api/v1/world-model, connect Claude Code or Codex, or try EWM-1 SDK preview endpoints.

5 min read

Live Exergy World Model API (cURL & OpenAPI)

Sign in to your Exergy Lab account on a Plus ($19/month, 250 evaluations/month) or Pro ($99/month, 1,000 evaluations/month) plan, open the Developer Portal (/developers/portal), and create an API key (exg_ewm_...).

Export EXERGY_API_KEY in your shell, then call POST https://exergy-lab.com/api/v1/world-model directly or copy a pre-built prompt for Claude Code, Codex, Cursor, or Factory Droid from /exergy-world-model.

Evaluate a heat-recovery & steam-upgrade case (cURL) · bash
export EXERGY_API_KEY="exg_ewm_your_key_here"

curl -sS -X POST "https://exergy-lab.com/api/v1/world-model" \
  -H "Authorization: Bearer $EXERGY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "target_heat_duty_kw": 450,
    "source_inlet_temp_c": 55,
    "supply_temp_c": 135,
    "lockout_duration_hours": 2,
    "electricity_price_per_kwh": 0.085,
    "natural_gas_price_per_kwh": 0.042,
    "grid_carbon_kg_per_kwh": 0.22
  }'
Inspect discovery metadata & OpenAPI 3.1.0 spec (no auth required) · bash
curl -sS "https://exergy-lab.com/api/v1/world-model"
curl -sS "https://exergy-lab.com/api/v1/openapi.json"

Python (EWM-1 OpenAI SDK preview)

For private-beta EWM-1 hosted access (https://api.exergylab.ai/v1) or a local EWM-1 server (http://127.0.0.1:8765/v1), use the official OpenAI SDK.

Install · bash
pip install openai
Heat pump vs. boiler trade study · python
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.exergylab.ai/v1",  # Or "http://127.0.0.1:8765/v1" for local
    api_key=os.environ.get("EXERGY_API_KEY", "ewm-local"),
)

response = client.chat.completions.create(
    model="ewm-1",
    messages=[
        {
            "role": "user",
            "content": (
                "Compare an R1233zd(E) industrial heat pump (T_evap=45 C, T_cond=115 C, eta_is=0.78, eta_motor=0.95) "
                "against a natural gas boiler (eta_hhv=0.82) for a 5.0 MW_th process sink operating 8,000 hr/yr "
                "at $0.07/kWh electricity and $6.50/MMBtu natural gas."
            ),
        }
    ],
)

# 1. Full Markdown engineering report
print(response.choices[0].message.content)

# 2. Machine-readable verified metrics JSON
print("Structured Output:", response.model_extra["structured_output"])

# 3. Sandbox verification status
print("Sandbox Verified:", response.model_extra["ewm_verification"]["verified"])

TypeScript / Node.js (EWM-1 OpenAI SDK preview)

Install · bash
npm install openai
Steam properties · javascript
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.exergylab.ai/v1",
  apiKey: process.env.EXERGY_API_KEY ?? "ewm-local",
});

const response = await client.chat.completions.create({
  model: "ewm-1",
  messages: [
    {
      role: "user",
      content:
        "Calculate the saturation temperature (C), enthalpy of vaporization h_fg (kJ/kg), and vapor flow exergy (kJ/kg) of Water at 15 bar.",
    },
  ],
});

console.log(response.choices[0].message.content);

curl (EWM-1 native /v1/solve preview)

Native solver · bash
curl -s https://api.exergylab.ai/v1/solve \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $EXERGY_API_KEY" \
  -d '{
    "prompt": "Calculate the saturation temperature (C), enthalpy of vaporization h_fg (kJ/kg), and vapor flow exergy (kJ/kg) of Water at 15 bar.",
    "skip_composer": true,
    "include_code": true
  }'

Authentication & API keys

Manage self-serve API keys in the Developer Portal (/developers/portal). Send your key as a Bearer token.

  • Create, label, and revoke up to 3 active keys (90-day expiry) in /developers/portal on any Plus or Pro account.
  • Store your API key in EXERGY_API_KEY or a secret manager; never embed keys in client-side browser JavaScript or Git commits.
  • Plus includes 250 evaluations/month and Pro includes 1,000 evaluations/month with no automatic overages.
  • To request preview access to the broader https://api.exergylab.ai/v1 EWM-1 endpoints, reach out through /contact.
Bearer token (live /api/v1/world-model & OpenAI SDK) · text
Authorization: Bearer <EXERGY_API_KEY>
API key header (EWM-1 gateway preview) · text
X-API-Key: <EXERGY_API_KEY>