API Kredit

Cari tahu biaya endpoint dan periksa saldo kredit secara terprogram.

Kasus Penggunaan
Perencanaan anggaran

Hitung biaya sebelum melakukan panggilan API untuk mengelola pengeluaran kredit Anda.

Integrasi dasbor

Tampilkan saldo dan info biaya secara real-time di panel admin Anda sendiri.

Otomatisasi cerdas

Periksa saldo sebelum pekerjaan batch untuk menghindari kehabisan kredit di tengah proses.

99.9 % Waktu Aktif
Respons
20 req/s
0 Kredit / permintaan

Look up endpoint cost


POST https://api.yeb.to/v1/credits/cost
ParameterTipeWajibDeskripsi
api_key string ya Your API key
endpoint string opsional Single endpoint key, e.g. youtube/channel/audit
endpoints array opsional Array of up to 50 endpoint keys (use instead of endpoint)

Contoh

curl -X POST https://api.yeb.to/v1/credits/cost \
  -H "Content-Type: application/json" \
  -d '{
  "api_key": "YOUR_KEY",
  "endpoint": "youtube/channel/audit"
}'

Contoh Respons

{
  "endpoint": "youtube/channel/audit",
  "credits": 0.01,
  "credits_spent": 0.0001,
  "credits_left": 142.5,
  "response_code": 200,
  "response_time_ms": 12
}
{"error":"Provide \"endpoint\" (string) or \"endpoints\" (array).","code":422}

Kode Respons

KodeDeskripsi
200 SuccessPermintaan diproses OK.
400 Bad RequestValidasi input gagal.
401 UnauthorizedKunci API hilang / salah.
403 ForbiddenKunci tidak aktif atau tidak diizinkan.
429 Rate LimitTerlalu banyak permintaan.
500 Server ErrorKegagalan tak terduga.

Look up cost

credits/cost 0.0001 credits

Parameters

API Key
body · string · required
Endpoint
body · string
Endpoints
body · string

Code Samples


                
                
                
            

Response

Status:
Headers

                
Body

                

Check credit balance


POST https://api.yeb.to/v1/credits/balance
ParameterTipeWajibDeskripsi
api_key string ya Your API key

Contoh

curl -X POST https://api.yeb.to/v1/credits/balance \
  -H "Content-Type: application/json" \
  -d '{
  "api_key": "YOUR_KEY"
}'

Contoh Respons

{
  "credits": 142.5,
  "credits_spent": 0.0001,
  "credits_left": 142.5,
  "response_code": 200,
  "response_time_ms": 8
}
{"error":"Cannot resolve user from API key.","code":401}

Kode Respons

KodeDeskripsi
200 SuccessPermintaan diproses OK.
400 Bad RequestValidasi input gagal.
401 UnauthorizedKunci API hilang / salah.
403 ForbiddenKunci tidak aktif atau tidak diizinkan.
429 Rate LimitTerlalu banyak permintaan.
500 Server ErrorKegagalan tak terduga.

Check balance

credits/balance 0.0001 credits

Parameters

API Key
body · string · required

Code Samples


                
                
                
            

Response

Status:
Headers

                
Body

                

API Kredit — Practical Guide

Look up how many credits any API endpoint costs and check your balance — all programmatically. Ideal for budget control, dashboards, and pre-flight checks before batch jobs.

#What the Credits API does

The Credits API lets you look up endpoint costs and check your balance without making an actual API call. Use it to build cost-aware workflows, display pricing in your UI, or validate you have enough credits before launching a batch job.

Each Credits API call costs only 0.0001 credits — essentially free.

#Endpoints

# POST /v1/credits/cost

  • Best for: Looking up the credit cost of any endpoint before calling it.
  • Single lookup: Send "endpoint": "youtube/channel/audit" to get one cost.
  • Bulk lookup: Send "endpoints": ["screenshot/capture", "qr/code"] for up to 50 at once.

# POST /v1/credits/balance

  • Best for: Checking your current credit balance from code.
  • Returns: Your total available credits.

#Quick start

# Look up a single endpoint cost
curl -X POST "https://api.yeb.to/v1/credits/cost" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: <YOUR_API_KEY>" \
  -d '{"endpoint": "screenshot/capture"}'
# Bulk lookup (up to 50 endpoints)
curl -X POST "https://api.yeb.to/v1/credits/cost" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: <YOUR_API_KEY>" \
  -d '{"endpoints": ["youtube/channel/audit", "qr/code", "geoip/city"]}'
# Check your balance
curl -X POST "https://api.yeb.to/v1/credits/balance" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: <YOUR_API_KEY>"

#Parameters

Cost endpoint

Param Type Required Description
endpoint string One of the two Single endpoint key, e.g. youtube/channel/audit
endpoints array One of the two Array of up to 50 endpoint keys for bulk lookup

Balance endpoint

No extra parameters — just authenticate with your API key.

#Reading responses

Single cost lookup

{
  "endpoint": "youtube/channel/audit",
  "credits": 0.01,
  "credits_spent": 0.0001,
  "credits_left": 142.5,
  "response_code": 200,
  "response_time_ms": 12
}

Bulk cost lookup

{
  "costs": {
    "screenshot/capture": 0.05,
    "qr/code": 0.009,
    "chatbot/message": 0.05
  },
  "credits_spent": 0.0001,
  "credits_left": 142.5,
  "response_code": 200,
  "response_time_ms": 8
}

Balance response

{
  "credits": 142.5,
  "credits_spent": 0.0001,
  "credits_left": 142.5,
  "response_code": 200,
  "response_time_ms": 8
}

#Endpoint key format

Endpoint keys follow the pattern module/action. Here are some examples:

KeyCreditsAPI
youtube/channel/audit0.01YouTube Channel
screenshot/capture0.05Screenshot
qr/code0.009QR Code Generator
geoip/city0.009GeoIP
chatbot/message0.05ChatBot
bot/detect/detect0.003Bot Detect
captions/transcribe1Captions
Use the /v1/credits/cost endpoint itself to discover costs for any key — if a key doesn't exist, it returns null.

#Practical recipes

  • Pre-flight check: Call /balance before a batch job. If credits < estimated cost, abort early and notify.
  • Pricing page: Fetch all costs with /cost and display them dynamically — always in sync with reality.
  • Usage dashboard: Combine /balance with your transaction history to show spend over time.

#Errors

HTTPWhenWhat to do
422 Neither endpoint nor endpoints provided Send at least one of the two parameters.
422 More than 50 endpoints in array Split into multiple requests.
401 Invalid or missing API key Check your API key in X-API-Key header or api_key param.

#API Changelog

2026-02-07
Initial release — /cost (single + bulk) and /balance endpoints.

Pertanyaan yang Sering Diajukan

Hampir gratis — setiap panggilan hanya menghabiskan 0,0001 kredit (pada dasarnya gratis). Ini mencegah penyalahgunaan sambil tetap mudah diakses.

Ya — kirim array "endpoints" dengan hingga 50 kunci endpoint dan dapatkan semua biaya dalam satu respons.

Ya — biaya dibaca langsung dari konfigurasi langsung, jadi Anda selalu mendapatkan harga terkini.

Ya. Setiap permintaan, bahkan yang menghasilkan error, mengonsumsi kredit. Kredit Anda terkait dengan jumlah permintaan, terlepas dari keberhasilan atau kegagalan. Jika error jelas disebabkan oleh masalah platform di pihak kami, kami akan memulihkan kredit yang terpengaruh (tanpa pengembalian uang tunai).

Hubungi kami di [email protected]. Kami menganggap umpan balik serius—jika laporan bug atau permintaan fitur Anda bermakna, kami dapat memperbaiki atau meningkatkan API dengan cepat dan memberikan Anda 50 kredit gratis sebagai terima kasih.

Tergantung pada API dan terkadang bahkan pada endpoint. Beberapa endpoint menggunakan data dari sumber eksternal, yang mungkin memiliki batas lebih ketat. Kami juga menerapkan batas untuk mencegah penyalahgunaan dan menjaga stabilitas platform kami. Periksa dokumentasi untuk batas spesifik setiap endpoint.

Kami beroperasi dengan sistem kredit. Kredit adalah unit prabayar yang tidak dapat dikembalikan yang Anda gunakan untuk panggilan API dan alat. Kredit dikonsumsi secara FIFO (yang terlama lebih dulu) dan berlaku selama 12 bulan sejak tanggal pembelian. Dashboard menampilkan setiap tanggal pembelian dan masa berlakunya.

Ya. Semua kredit yang dibeli (termasuk saldo pecahan) berlaku selama 12 bulan sejak pembelian. Kredit yang tidak digunakan kedaluwarsa secara otomatis dan dihapus secara permanen di akhir masa berlaku. Kredit yang kedaluwarsa tidak dapat dipulihkan atau dikonversi menjadi uang tunai atau nilai lainnya. Aturan transisi: kredit yang dibeli sebelum 22 Sep 2025 diperlakukan sebagai dibeli pada 22 Sep 2025 dan kedaluwarsa pada 22 Sep 2026 (kecuali kedaluwarsa lebih awal dinyatakan saat pembelian).

Ya—dalam masa berlakunya. Kredit yang tidak digunakan tetap tersedia dan dialihkan dari bulan ke bulan hingga kedaluwarsa 12 bulan setelah pembelian.

Kredit tidak dapat dikembalikan. Beli hanya yang Anda butuhkan—Anda selalu bisa mengisi ulang nanti. Jika error platform menyebabkan tagihan gagal, kami dapat memulihkan kredit yang terpengaruh setelah penyelidikan. Tidak ada pengembalian uang tunai.

Harga ditetapkan dalam kredit, bukan dolar. Setiap endpoint memiliki biayanya sendiri—lihat lencana "Kredit / permintaan" di atas. Anda akan selalu tahu persis berapa yang Anda keluarkan.
← Kembali ke API