Skip to content

Configuration

sanamhub edited this page Oct 7, 2026 · 1 revision

Configuration

TypeSafeSharp reads three environment variables, whichever gateway they point at.

Setting Environment variable Default
API key TYPESAFE_API_KEY none; the client throws without one
Base URL TYPESAFE_BASE_URL https://api.typesafe.ai
Model TYPESAFE_DEFAULT_MODEL jev-latest

Each setting resolves in order: the option value, then the environment variable, then the default. With new TypeSafeClient(new TypeSafeClientOptions()) everything comes from the environment.

Gateways

BaseUrl is an API root; the client appends /v1/systemone. Any gateway that speaks the same route works:

Gateway Base URL Model
TypeSafe (default) https://api.typesafe.ai jev-latest
OpenJEV https://api.openjev.sh openjev
rev serve (local) http://127.0.0.1:8421 any open checkpoint

OpenJEV

OpenJEV is an independent community gateway to the same Jev model, with the same request and response shape. The environment alone selects it:

export TYPESAFE_API_KEY=...          # your key from https://openjev.sh/dashboard
export TYPESAFE_BASE_URL=https://api.openjev.sh
export TYPESAFE_DEFAULT_MODEL=openjev

OpenJEV's own examples write the key as OPENJEV_API_KEY; that name is its convention, not this SDK's, so copy the value into TYPESAFE_API_KEY.

Local rev serve

rev serves the same route from a local, open checkpoint with no key and no network:

export TYPESAFE_API_KEY=local        # any placeholder; the local server ignores it
export TYPESAFE_BASE_URL=http://127.0.0.1:8421

Plain http is accepted only for loopback addresses.

ASP.NET Core

With AddTypeSafe(IConfiguration), the same values can come from configuration instead:

{
  "TypeSafe": {
    "ApiKey": "...",
    "BaseUrl": "https://api.openjev.sh",
    "DefaultModel": "openjev"
  }
}

Environment variables override it with the TypeSafe__ prefix, .NET's __-to-: mapping:

export TypeSafe__BaseUrl=https://api.openjev.sh
export TypeSafe__DefaultModel=openjev

Keep the key in the environment, user secrets or a vault, never in appsettings.json.

Clone this wiki locally