User
Get usage and quota
Get current month’s scoring usage, plan limits, and subscription status.
GET
/
api
/
usage
Get usage and quota
curl --request GET \
--url https://app.dacard.ai/api/usage \
--cookie __session=import requests
url = "https://app.dacard.ai/api/usage"
headers = {"cookie": "__session="}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {cookie: '__session='}};
fetch('https://app.dacard.ai/api/usage', 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://app.dacard.ai/api/usage",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_COOKIE => "__session=",
]);
$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://app.dacard.ai/api/usage"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("cookie", "__session=")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.dacard.ai/api/usage")
.header("cookie", "__session=")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.dacard.ai/api/usage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["cookie"] = '__session='
response = http.request(request)
puts response.read_body{
"credits": {
"used": 123,
"limit": 123,
"remaining": 123,
"breakdown": {
"score": 123,
"chat": 123,
"api": 123
}
},
"resetsAt": "2023-11-07T05:31:56Z",
"planId": "free",
"isUnlimited": true,
"creditCosts": {
"score": 123,
"chat": 123,
"api": 123
},
"subscription": {
"status": "active",
"currentPeriodEnd": "2023-11-07T05:31:56Z",
"cancelAtPeriodEnd": true
}
}{
"error": "Authentication required",
"code": "AUTH_REQUIRED"
}Authorizations
clerkAuthbearerAuth
Clerk session cookie. Authentication is handled by Clerk. Sign in at https://app.dacard.ai/sign-in to obtain a session.
Was this page helpful?
⌘I
Get usage and quota
curl --request GET \
--url https://app.dacard.ai/api/usage \
--cookie __session=import requests
url = "https://app.dacard.ai/api/usage"
headers = {"cookie": "__session="}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {cookie: '__session='}};
fetch('https://app.dacard.ai/api/usage', 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://app.dacard.ai/api/usage",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_COOKIE => "__session=",
]);
$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://app.dacard.ai/api/usage"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("cookie", "__session=")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.dacard.ai/api/usage")
.header("cookie", "__session=")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.dacard.ai/api/usage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["cookie"] = '__session='
response = http.request(request)
puts response.read_body{
"credits": {
"used": 123,
"limit": 123,
"remaining": 123,
"breakdown": {
"score": 123,
"chat": 123,
"api": 123
}
},
"resetsAt": "2023-11-07T05:31:56Z",
"planId": "free",
"isUnlimited": true,
"creditCosts": {
"score": 123,
"chat": 123,
"api": 123
},
"subscription": {
"status": "active",
"currentPeriodEnd": "2023-11-07T05:31:56Z",
"cancelAtPeriodEnd": true
}
}{
"error": "Authentication required",
"code": "AUTH_REQUIRED"
}