Balance और usage का इतिहास

GET /v1/balance — आपका बचा हुआ prepaid balance। GET /api/key/usage — balance के साथ आज/महीने का spend और प्रति key request counts। GET /v1/generations — paginated usage history। curl और Python में उदाहरण।

Self-service: अपना balance देखें, programmatically कीमतें लाएँ और अपनी key का usage history देखें।

Balance

GEThttps://getvibeapi.com/v1/balance

आपका शेष prepaid balance return करता है।

curl https://getvibeapi.com/v1/balance \
  -H "Authorization: Bearer $GETVIBE_API_KEY"
# → {"balance_rub": 1234.56, "currency": "RUB"}

प्रोग्रामेटिक मूल्य: /v1/pricing

GEThttps://getvibeapi.com/v1/pricing

आपके account के लिए canonical price source: models और variants, per-unit media prices। यह एक object लौटाता है जिसमें data (text models) और media (images और video) होते हैं। Prices live हैं और remote overrides को ध्यान में रखते हैं।

curl https://getvibeapi.com/v1/pricing \
  -H "Authorization: Bearer $GETVIBE_API_KEY"
हर variant record में एक addressAs field होता है — request में model field के लिए exact value (जैसे claude-opus-4.8:yellow)। cacheReadRub field केवल cache-enabled variants के लिए होता है और prompt-cache read price दिखाता है। Media records estimated: true के रूप में marked होते हैं — actual media charge वास्तविक generation volume पर निर्भर करता है और x-pv-cost-rub में वापस किया जाता है; streams के लिए, body field में x-pv-cost: 1 चाहिए।

Key सारांश

GEThttps://getvibeapi.com/api/key/usage

Balance के साथ-साथ आज का और इस महीने का spend और आज का request count return करता है। यह उसी key sk-pv-… से authorize करता है, Authorization: Bearer header या x-api-key के ज़रिए।

curl https://getvibeapi.com/api/key/usage \
  -H "Authorization: Bearer $GETVIBE_API_KEY"
# the same key is also accepted in the x-api-key header

उपयोग इतिहास

यदि रिस्पॉन्स स्ट्रीम होते समय आपका कनेक्शन टूट जाता है, तो आप केवल उन्हीं tokens के लिए भुगतान करते हैं जिन्हें provider ने वास्तव में processed के रूप में confirm किया है। यदि किसी output token से पहले stream समाप्त हो जाती है और provider input tokens confirm करता है, तो केवल उसी input का शुल्क लगता है; confirmed usage के बिना शुल्क शून्य होता है। खाली responses, provider errors, हमारी cost-limit cancellations, और असफल प्रयास जिन्हें सफल retry से बदल दिया गया, इनका शुल्क आपसे नहीं लिया जाता।
GEThttps://getvibeapi.com/v1/generations
ParameterTypeविवरण
pagenumberपृष्ठ संख्या। डिफ़ॉल्ट 1।
limitnumberPage size, अधिकतम 100. Defaults to 20.
dateFromstring (ISO)Filter: इस date से।
dateTostring (ISO)Filter: इस date तक।
request_idstringकेवल इस अनुरोध के रिकॉर्ड। मान प्रोजेक्ट के अनुरोध-आईडी हेडर (x-getvibe-request-id) से आता है।
curl "https://getvibeapi.com/v1/generations?page=1&limit=20" \
  -H "Authorization: Bearer $GETVIBE_API_KEY"
# optional filters: dateFrom, dateTo (ISO 8601), request_id
# request_id is the x-getvibe-request-id header value on getvibeapi.com
# curl "https://getvibeapi.com/v1/generations?request_id=$REQUEST_ID"

प्रतिक्रिया उदाहरण:

{
  "data": [
    {
      "id": "...",
      "request_id": "8d4b6b3a-4f7c-4a4e-9a61-2f0c1d3e5b7a",
      "model": "gpt-6.1-sol",
      "route": "yellow",
      "address_as": "gpt-6.1-sol:yellow",
      "type": "text",
      "prompt_tokens": 120,
      "completion_tokens": 340,
      "total_tokens": 460,
      "units": 0,
      "cost_rub": 0.42,
      "created_at": "2026-06-15T10:00:00.000Z"
    }
  ],
  "page": 1,
  "limit": 20,
  "total": 1
}
request_id फ़ील्ड वही आईडी है जो आपको मूल प्रतिक्रिया के x-getvibe-request-id हेडर में मिली थी। यह स्ट्रीमिंग प्रतिक्रियाओं में भी मौजूद होती है, इसलिए स्ट्रीम को उसके रिकॉर्ड से ठीक से मिलाया जा सकता है। मीडिया रिकॉर्ड में यह जनरेशन-सबमिट प्रतिक्रिया से jobId होती है।
cost_rub field वह राशि है जो हमने event के लिए debit की। route और address_as fields दिखाते हैं कि request को वास्तव में किस public route ने serve किया (देखें Routing → Flight breakdown)। केवल client के अपने usage fields ही लौटाए जाते हैं।

एक विशिष्ट record: /v1/generations/{id}

GEThttps://getvibeapi.com/v1/generations/{id}

इसके id द्वारा एक single usage-history record return करता है। Request owner-scoped है: आपको केवल अपने ही events मिलते हैं। id GET /v1/generations response से आता है (id field) या एक non-streaming /v1/chat/completions response के x-pv-generation-id header से।

curl https://getvibeapi.com/v1/generations/USAGE_EVENT_ID \
  -H "Authorization: Bearer $GETVIBE_API_KEY"
# USAGE_EVENT_ID comes from the /v1/generations response (the id field)
# or from the x-pv-generation-id header of a non-streaming response
# find the record by request id: GET /v1/generations?request_id=$REQUEST_ID

प्रतिक्रिया उदाहरण:

{
  "id": "cmpl_abc123",
  "request_id": "8d4b6b3a-4f7c-4a4e-9a61-2f0c1d3e5b7a",
  "model": "gpt-6.1-sol",
  "route": "yellow",
  "address_as": "gpt-6.1-sol:yellow",
  "type": "text",
  "prompt_tokens": 120,
  "completion_tokens": 340,
  "total_tokens": 460,
  "units": 0,
  "cost_rub": 0.42,
  "created_at": "2026-06-15T10:00:00.000Z"
}
ParameterTypeविवरण
idreq.string (path)Record identifier।
mediaTypestringType: TEXT, IMAGE, VIDEO, AUDIO, MUSIC, MODEL_3D।
streaming (stream: true) requests के लिए record id asynchronously बनाया जाता है — x-pv-generation-id header मौजूद नहीं होता। stream पूरा होने के तुरंत बाद record history में दिखाई देता है।
GetVibe API balance और usage — /v1/balance, /api/key/usage | GetVibe API