Quickstart

1. Create an API key

Go to Dashboard → Settings and generate a SpendGraph API key. Copy it once and store it securely.

2. Send traffic through the gateway

curl -X POST https://gw.spendgraph.dev/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-SG-Key: sg_live_..." \
  -H "X-SG-Provider: openai" \
  -d '{"model":"gpt-4o-mini","messages":[{"role":"user","content":"hello"}]}'

3. Check the dashboard

Open Overview, Explorer, Traces, Alerts, and Profitability to confirm traffic is flowing in and being attributed correctly.