FORGE_API_KEY on the server. Install forgeintel-sdk (imported as forgeintel).
server.py
python -m pip install forgeintel-sdk==0.1.0b4.
Starlette executes the last added middleware first, so this places Forge outside the payment handler. Keep your existing uvicorn server:app entry point and ASGI lifespan enabled; Forge flushes at lifespan shutdown. For a plain ASGI application use app = forge.wrap(app) instead.
agent_context=False preserves existing paid clients. The published package otherwise rejects payment-bearing requests without agent type and search query. Enable it deliberately. Feedback is enabled independently.
Forge can enrich the existing /openapi.json response. FastAPI may not declare 402 responses generated by payment middleware; add those responses to paid route documentation or configure OpenAPIOptions(is_paid_operation=...) so eligible operations are identified. Keep any existing request validators and payment handlers. OpenAPI details.
Check forge.diagnostics()["enabled"] and ["config_errors"] during setup. Verify collector contact.