CreditsPreview cost

Preview cost

Preview how many credits a service call (or batch of calls) would cost, without deducting anything.

curl -X POST https://api.chuger.com/v1/credits/preview-cost \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"service_type": "content", "quantity": 50}'
{
  "service_type": "content",
  "service_name": "Content Extraction",
  "credit_cost_per_request": 2,
  "quantity": 50,
  "total_cost": 100,
  "current_balance": 18675,
  "remaining_after": 18575,
  "can_afford": true
}

Preview how many credits a service call (or a batch of calls) would cost, without consuming any credits. Useful before launching large bulk jobs or surfacing cost estimates in your UI.

POST https://api.chuger.com/v1/credits/preview-cost

No credits are deducted by this endpoint. Safe to call as often as you need.

All /v1/credits/* endpoints are free to call and not subject to per-minute rate limits.

Authentication

Bearer token in the Authorization header. See Authentication.

Request body

Content-Type: application/json

body
service_typestring
Required

One of scrape, content, serp, prompt.

body
quantityinteger

Number of calls being previewed. Integer between 1 and 100. Defaults to 1.

Example

Response fields

service_typestring
Required

Echo of the requested service.

service_namestring
Required

Display-friendly name of the service.

credit_cost_per_requestinteger
Required

Credits charged per successful call for this service on your plan.

quantityinteger
Required

Echo of the requested quantity.

total_costinteger
Required

credit_cost_per_request × quantity.

current_balanceinteger
Required

Your balance at the time of the preview.

remaining_afterinteger
Required

What your balance would be if you executed the previewed calls.

can_affordboolean
Required

true if your current balance covers total_cost.

Errors

StatusWhen
401Missing or invalid token
422service_type missing/invalid, or quantity out of range

See Errors for the full reference.