クレジット API

エンドポイントのコストを調べ、クレジット残高をプログラムで確認できます。

ユースケース
予算計画

API呼び出し前にコストを計算し、クレジット支出を管理できます。

ダッシュボード統合

独自の管理パネルにリアルタイムの残高とコスト情報を表示できます。

スマート自動化

バッチジョブの前に残高を確認し、実行中のクレジット不足を回避できます。

99.9 % 稼働時間
レスポンス
20 req/s
0 クレジット / リクエスト

Look up endpoint cost


POST https://api.yeb.to/v1/credits/cost
パラメータ必須説明
api_key string はい Your API key
endpoint string 任意 Single endpoint key, e.g. youtube/channel/audit
endpoints array 任意 Array of up to 50 endpoint keys (use instead of endpoint)

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

レスポンス例

{
  "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}

レスポンスコード

コード説明
200 Successリクエスト処理成功。
400 Bad Request入力バリデーション失敗。
401 UnauthorizedAPIキーが不足または不正。
403 Forbiddenキーが無効または許可されていません。
429 Rate Limitリクエストが多すぎます。
500 Server Error予期しないエラー。

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
パラメータ必須説明
api_key string はい Your API key

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

レスポンス例

{
  "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}

レスポンスコード

コード説明
200 Successリクエスト処理成功。
400 Bad Request入力バリデーション失敗。
401 UnauthorizedAPIキーが不足または不正。
403 Forbiddenキーが無効または許可されていません。
429 Rate Limitリクエストが多すぎます。
500 Server Error予期しないエラー。

Check balance

credits/balance 0.0001 credits

Parameters

API Key
body · string · required

Code Samples


                
                
                
            

Response

Status:
Headers

                
Body

                

クレジット API — 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.

よくある質問

ほぼ無料です — 各呼び出しのコストは0.0001クレジット(実質無料)です。悪用を防ぎつつ、アクセスしやすい設定です。

はい — 最大50のエンドポイントキーを含む「endpoints」配列を送信し、1回のレスポンスですべてのコストを取得できます。

はい — コストはライブ設定から直接読み取られるため、常に最新の料金が取得できます。

はい。エラーが発生したリクエストを含め、すべてのリクエストがクレジットを消費します。クレジットは成功・失敗に関係なくリクエスト数に紐づいています。エラーが明らかに当社のプラットフォーム側の問題による場合は、影響を受けたクレジットを復元します(現金での返金はありません)。

[email protected]までご連絡ください。フィードバックを真摯に受け止めています。バグレポートや機能リクエストが意味のあるものであれば、APIを迅速に修正・改善し、お礼として50の無料クレジットを付与します。

APIやエンドポイントによって異なります。一部のエンドポイントは外部ソースのデータを使用しており、より厳しい制限がある場合があります。また、不正利用の防止とプラットフォームの安定性維持のために制限を設けています。各エンドポイントの具体的な制限についてはドキュメントをご確認ください。

クレジットシステムで運営しています。クレジットは前払いの返金不可の単位で、API呼び出しやツールに使用します。クレジットはFIFO(古いものから順に)消費され、購入日から12か月間有効です。ダッシュボードに各購入日とその有効期限が表示されます。

はい。購入したすべてのクレジット(端数残高を含む)は購入から12か月間有効です。未使用のクレジットは有効期間終了時に自動的に期限切れとなり、永久に削除されます。期限切れのクレジットは復元や現金その他の価値への変換はできません。経過措置:2025年9月22日以前に購入したクレジットは2025年9月22日購入として扱われ、2026年9月22日に期限切れとなります(購入時により早い期限が記載されていない限り)。

はい—有効期間内で繰り越されます。未使用のクレジットは利用可能な状態のまま月ごとに繰り越され、購入後12か月で期限切れになります。

クレジットは返金不可です。必要な分だけ購入してください—後からいつでもチャージできます。プラットフォーム側のエラーで課金に失敗した場合、調査後に影響を受けたクレジットを復元する場合があります。現金での返金はありません。

料金はドルではなくクレジットで設定されています。各エンドポイントには独自のコストがあります—上記の「クレジット / リクエスト」バッジをご覧ください。常に正確な支出額がわかります。
← APIに戻る