Every FORG capability is exposed via a clean REST API. Build custom dashboards, automate rule management, and integrate AI usage data directly into your workflows.
Authenticate with your license key as a Bearer token and start querying immediately — no SDK required.
curl https://forg.pro/api/v1/sessions \ -H "Authorization: Bearer lic_xxxxxxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json"
{
"sessions": [
{
"id": "sess_01j9xkp2mv",
"user_ref": "user_8f31…",
"workspace_type": "AI coding workspace",
"model_class": "Advanced Balanced",
"started_at": "2025-05-29T13:00:00Z",
"ended_at": "2025-05-29T14:22:01Z",
"tokens_in": 48210,
"tokens_out": 12048,
"cost_usd": 0.38,
"rule_actions": []
}
],
"total": 1,
"cursor": null
}All endpoints are relative to https://forg.pro
All API requests are authenticated using your FORG license key as a Bearer token. License keys follow the format lic_<20hex>.
Authorization: Bearer lic_xxxxxxxxxxxxxxxxxxxx
curl https://forg.pro/api/v1/usage \ -H "Authorization: Bearer lic_a1b2c3d4e5f6g7h8i9j0"
Never commit your license key to source control. Use environment variables: FORG_API_KEY.
Register an HTTPS endpoint and receive signed payloads the moment something important happens.
{
"event": "session.ended",
"id": "evt_01j9abc",
"ts": "2025-05-29T14:22:01Z",
"data": {
"session_id": "sess_xyz1234",
"user_id": "alice@co.com",
"workspace_type": "AI coding workspace",
"model_class": "Advanced Balanced",
"tokens_in": 48210,
"tokens_out": 12048,
"cost_usd": 0.38,
"duration_ms": 142300
}
}{
"event": "budget.exceeded",
"id": "evt_01j9def",
"ts": "2025-05-29T16:05:44Z",
"data": {
"budget_id": "bgt_monthly_alice",
"user_id": "alice@co.com",
"limit_usd": 50.00,
"used_usd": 50.14,
"period": "monthly"
}
}Type-safe clients for TypeScript and Python — built on top of the same REST API.
npm install @forg-pro/sdk
import { ForgClient } from "@forg-pro/sdk";
const forg = new ForgClient({
apiKey: process.env.FORG_API_KEY,
});
const sessions = await forg.sessions.list({
userId: "alice@co.com",
limit: 20,
});
console.log(sessions.data);pip install forg-sdk
import forg
client = forg.Client(
api_key=os.environ["FORG_API_KEY"]
)
sessions = client.sessions.list(
user_id="alice@co.com",
limit=20,
)
for s in sessions.data:
print(s.cost_usd)Limits apply per license key. Exceeding the limit returns 429 rate_limited with a Retry-After header.
All errors return a JSON body with { "error": "code", "message": "..." }
API access is included on all paid plans. Your license key is your API key — no extra setup required.