跳转到主要内容
GET
/
api
/
v1
/
chat
/
credit
Get Remaining Credits
curl --request GET \
  --url https://api.fluxapi.ai/api/v1/chat/credit \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.fluxapi.ai/api/v1/chat/credit"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.fluxapi.ai/api/v1/chat/credit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.fluxapi.ai/api/v1/chat/credit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.fluxapi.ai/api/v1/chat/credit"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("Authorization", "Bearer <token>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.fluxapi.ai/api/v1/chat/credit")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.fluxapi.ai/api/v1/chat/credit")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "code": 200,
  "msg": "success",
  "data": 100
}
Retrieve the current balance of credits available in your account.

Usage Guide

  • Use this endpoint to check your current credit balance
  • Monitor usage to ensure sufficient credits for continued service
  • Plan credit replenishment based on your usage patterns

Developer Notes

  • Credit balance is required for all generation services
  • Service access will be restricted when credits are depleted
  • Credits are consumed based on the specific service and usage volume

授权

Authorization
string
header
必填

All APIs require authentication via Bearer Token.

Get API Key:

  1. Visit API Key Management Page to get your API Key

Usage: Add to request header: Authorization: Bearer YOUR_API_KEY

响应

Request successful

code
enum<integer>
必填

Response Status Code

CodeDescription
200Success - Request has been processed successfully
401Unauthorized - Authentication credentials are missing or invalid
402Insufficient Credits - Account does not have enough credits to perform the operation
404Not Found - The requested resource or endpoint does not exist
422Validation Error - The request parameters failed validation checks
429Rate Limited - Request limit has been exceeded for this resource
455Service Unavailable - System is currently undergoing maintenance
500Server Error - An unexpected error occurred while processing the request
505Feature Disabled - The requested feature is currently disabled
可用选项:
200,
401,
402,
404,
422,
429,
455,
500,
505
msg
string
必填

Error message when code != 200

示例:

"success"

data
integer
必填

Remaining credit quantity

示例:

100