Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Check feature access with nozle.can()
result = nozle.can("customer_123", "api_calls")
{ "allowed": True, "used": 1500, "limit": 10000, "remaining": 8500, "cost_per_use_cents": 2, "revenue_per_use_cents": 5, "margin_per_use_cents": 3, }
from fastapi import FastAPI, HTTPException from nozle import Nozle app = FastAPI() nozle = Nozle(api_key="sk_...", base_url="https://api.nozle.app", events_url="https://api.nozle.app") @app.post("/generate") async def generate(customer_id: str, prompt: str): check = nozle.can(customer_id, "api_calls") if not check["allowed"]: raise HTTPException(429, detail=f"Limit reached: {check['used']}/{check['limit']}") # ... proceed with generation