Skip to main content

Overview

Retrieve your current credit balance and recent transaction history. This endpoint requires Cognito authentication (web app) - for API key users, check your balance in the web dashboard.
This endpoint is authenticated via Cognito (web app session). API key users should check their balance at trybijou.com/profile.

Request

Method: GET Path: /user/credits Auth: Cognito JWT (web app)

Response

balance
number
required
Current credit balance
recent_transactions
array
required
List of recent credit transactions (up to 10)

Transaction Object

transactionId
string
Unique transaction identifier
timestamp
number
Unix timestamp of the transaction
type
string
Transaction type: "credit" (added) or "debit" (used)
amount
number
Number of credits added or deducted
reason
string
Description of the transaction (e.g., "api_detect", "stripe_purchase")

Example Response

{
  "statusCode": 200,
  "body": {
    "data": {
      "balance": 847,
      "recent_transactions": [
        {
          "transactionId": "abc123",
          "timestamp": 1704067200,
          "userId": "user-123",
          "type": "debit",
          "amount": 1,
          "reason": "api_detect"
        },
        {
          "transactionId": "def456",
          "timestamp": 1704066000,
          "userId": "user-123",
          "type": "credit",
          "amount": 1000,
          "reason": "stripe_purchase",
          "provider": "stripe"
        }
      ]
    }
  }
}

Credit Costs

ActionCost
API detection (/api/detect)1 credit
Web detection (/detect)Free (5/day limit)
Presigned uploadFree

Purchasing Credits

Credits can be purchased at trybijou.com/profile.
PackagePriceCredits
Starter$101,000
Pro$202,000
Enterprise$505,000
1 credit = $0.01 = 1 API detection

Checking Balance in Code

While the /user/credits endpoint requires web authentication, the SDK will automatically receive a BijouInsufficientCreditsError when you run out of credits:
from bijou import BijouClient, BijouInsufficientCreditsError

client = BijouClient(api_key="bijou_your-key")

try:
    result = client.detect("image.jpg")
except BijouInsufficientCreditsError as e:
    print(f"Out of credits: {e.message}")
    print("Purchase more at https://trybijou.com/profile")
import { BijouClient, BijouInsufficientCreditsError } from '@bijou/sdk';

const client = new BijouClient({ apiKey: 'bijou_your-key' });

try {
  const result = await client.detect(imageBuffer);
} catch (error) {
  if (error instanceof BijouInsufficientCreditsError) {
    console.log(`Out of credits: ${error.message}`);
    console.log('Purchase more at https://trybijou.com/profile');
  }
}