Credits

Credits pay for live analyses. This page explains how your organization gets credits, what happens to a credit during an analysis, and how to check your balance.

What a credit is

One live analysis uses one credit. Every organization has one shared pool of credits, and every gfy_live_ key draws from it. Test keys never use credits.

How credits reach your organization

  • Grihafy adds credits to your organization. There is no self-service purchase yet; contact us.
  • Each addition is a separate grant and can have an expiry date. Credits that expire soonest are used first, so they are not wasted.

The life of a credit

When you submit a live analysis, one credit is held: set aside for that analysis but not yet used. When the analysis completes the credit is spent. If it does not complete, the credit is returned.

  1. Granted credits

    Added by Grihafy for your organization

    • become available
  2. available

    Credits you can spend now

    • submitting an analysis moves 1 credit to held
    • a grant with an expiry date expires if unused
  3. held

    Reserved while an analysis is running or waiting for review

    • completed: the credit is spent
    • failed, expired or deleted: the credit returns to available
  4. spent

    Used by a completed analysis

  5. expired

    Unused credits past their expiry date

What happensEffect on your credit
You submit a live analysisOne credit moves from available to held.
The analysis completesThe held credit is spent.
The analysis failsThe held credit is returned to available.
A review step is not answered for about 7 daysThe analysis expires and the credit is returned.
You delete the analysis before it finishesThe held credit is returned.
You delete a completed analysisNothing changes. The credit stays spent.
An analysis waits for a review stepThe credit stays held. Answering the review does not hold another credit.
The plan shows several flatsOne credit covers the whole plan. The other flats are created without a hold.
The upload is rejected (too large, wrong type or unreadable image)No credit is held and no analysis is created.
You submit with no credit available402 insufficient_credits. Nothing is created. Retry after more credits are added.

Check your balance

GET /v1/credits returns the live balance. Call it before a large batch of submissions.

curl https://api.grihafy.com/v1/credits \
  -H "Authorization: Bearer gfy_live_..."
FieldMeaning
availableCredits you can use right now. Held credits are already subtracted. Always null for a test key.
heldCredits reserved for analyses that are queued, processing or waiting for review.
expiringSoonGrants that expire within 30 days, each with the amount still unused and its expiry time.

Expiry

  • Expired credits stop counting toward available as soon as they expire.
  • A credit already held for a running analysis is still spent normally if its grant expires meanwhile.
  • If an analysis fails after the grant its credit came from has expired, the returned credit is not restored.

Usage history and alerts

The API reports the balance only. Members can see every grant and spend, and export them as CSV, at /org/your-org/settings/usage in the Grihafy web app. There is no low-balance notification yet, so check available and expiringSoon yourself.