Documentation / Quickstart

From first request to fixed billing run.

The shortest supported path: protect one provider request, attach a customer, verify pricing, and close a completed UTC month.

01 / Create

Save all three one-time secrets.

Recovery code

Reopens the private dashboard. The browser session lasts up to 12 hours and can be ended earlier.

Test and live write keys

Use test first. Each key sends events to a separate ledger. Full keys are shown once and stored only as hashes.

02 / Send

Protect and identify every request.

curl https://YOUR_TOLLGATE_HOST/p/YOUR_METER_ID/providers/openai/v1/chat/completions \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -H "X-Tollgate-Key: $TOLLGATE_WRITE_KEY" \
  -H "X-Tollgate-Idempotency-Key: req_01JSTABLE" \
  -H "X-Tollgate-Customer: customer-acme" \
  -H "Content-Type: application/json" \
  -d '{"model":"gpt-5.4-mini","messages":[{"role":"user","content":"Hello"}]}'

Keep the same idempotency key when retrying the same logical request. Use a new key for a new request. Tollgate rejects duplicate and conflicting retry IDs before another provider call.

03 / Prepare billing

Resolve the close blockers.

Customer

  1. Open Customers.
  2. Add a display name and billing email.
  3. Add the existing Stripe customer ID when using Stripe drafts.

Pricing

  1. Set a live default or customer override.
  2. Add a model rate card if provider cost is unavailable.
  3. Review unattributed and unpriced events.

04 / Close

Freeze, export, then review.

Fixed billing run

Only a completed UTC month can close. Later customer and pricing edits cannot rewrite the saved amount or source-call list.

Output

Download CSV or create Stripe draft invoices. Tollgate does not finalize, send, or collect those invoices.

Read the exact API contract