ZeroCredit AI Documentation

Get started in under five minutes.

1. Authenticate

Every request needs a bearer token from your dashboard.

Authorization: Bearer <YOUR_ZEROCREDIT_TOKEN>

2. Send a chat request

POST /api/chat
Content-Type: application/json

{
  "message": "Explain GST",
  "preferred_mode": "balanced"
}

3. Read the response

{
  "response": "...",
  "model": "Gemini 2.5 Flash",
  "provider": "google",
  "cache_hit": false,
  "cost_usd": 0.00021,
  "savings_usd": 0.0017,
  "latency_ms": 740
}

Routing modes

  • cheapest — always pick the lowest-cost model.
  • fastest — pick the lowest-latency model.
  • balanced — weighted score across cost, latency, quality.
  • premium — always pick the highest-quality model.
  • auto — same as balanced.