Retrieve Credit

The Retrieve credit endpoint allows you to check the total amount of credit available and how much has been used. This is useful for monitoring your API usage and ensuring you have sufficient credit for future tasks.

API Endpoint

To retrieve your credit information, send a GET request to the following URL:

GET https://api.genaifactory.ai/v1/credit

Headers

Ensure that your request includes the following header:

Name

Type

Required

Description

formacloud-api-key

string

Yes

API key required for authenticating your request.

Response Body

The response will provide details about your credit usage:

Name

Type

Required

Description

total_credit

number

Yes

The total amount of credit allocated for tasks.

used_credit

number

Yes

The amount of credit used by tasks.

Example Request

curl -G 'https://api.genaifactory.ai/v1/credit' \
-H 'formacloud-api-key: abc123'

Example Response

Success Response (Status Code 200)

{
    "total_credit": "1.00",
    "used_credit": "0.11"
}

Failure Response (Status Code 4XX)

{
    "error": "Invalid API key",
}

Last updated