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
}Common API
Get Remaining Credits
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
Authorizations
All APIs require authentication via Bearer Token.
Get API Key:
- Visit API Key Management Page to get your API Key
Usage: Add to request header: Authorization: Bearer YOUR_API_KEY
Response
Request successful
Response Status Code
| Code | Description |
|---|---|
| 200 | Success - Request has been processed successfully |
| 401 | Unauthorized - Authentication credentials are missing or invalid |
| 402 | Insufficient Credits - Account does not have enough credits to perform the operation |
| 404 | Not Found - The requested resource or endpoint does not exist |
| 422 | Validation Error - The request parameters failed validation checks |
| 429 | Rate Limited - Request limit has been exceeded for this resource |
| 455 | Service Unavailable - System is currently undergoing maintenance |
| 500 | Server Error - An unexpected error occurred while processing the request |
| 505 | Feature Disabled - The requested feature is currently disabled |
Available options:
200, 401, 402, 404, 422, 429, 455, 500, 505 Error message when code != 200
Example:
"success"
Remaining credit quantity
Example:
100