curl --request GET \
--url 'https://api.upsolve.ai/v2/api/projects/{projectId}/chat-usage?apiKey='import requests
url = "https://api.upsolve.ai/v2/api/projects/{projectId}/chat-usage?apiKey="
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.upsolve.ai/v2/api/projects/{projectId}/chat-usage?apiKey=', 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.upsolve.ai/v2/api/projects/{projectId}/chat-usage?apiKey=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.upsolve.ai/v2/api/projects/{projectId}/chat-usage?apiKey="
req, _ := http.NewRequest("GET", url, nil)
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.upsolve.ai/v2/api/projects/{projectId}/chat-usage?apiKey=")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.upsolve.ai/v2/api/projects/{projectId}/chat-usage?apiKey=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"users": [
{
"projectUserId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"externalId": "<string>",
"name": "<string>",
"projectOrganizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"environment": "<string>",
"workspaces": [
{
"workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"workspaceName": "<string>",
"sessions": 4503599627370495,
"questions": 4503599627370495
}
]
}
]
}
}{
"status": "error",
"error": {
"message": "<string>",
"code": "<string>",
"details": {}
}
}Get Project Chat Usage
Count what one of your embedded users did in chat, per workspace: the questions they asked and the conversations (sessions) they took part in. Find them by the id you gave Upsolve (externalId, as sent to embed-token); every match is returned, since one id can name a user in each organization and environment, and organizationExternalId or environment narrows it. Pass since for a period. A builder’s Playground tests and copies of other people’s conversations are not counted; what they asked to make or change a presentation is. Cost and credits are not reported: credits are charged to the organization as a whole and there is no per-user ledger.
curl --request GET \
--url 'https://api.upsolve.ai/v2/api/projects/{projectId}/chat-usage?apiKey='import requests
url = "https://api.upsolve.ai/v2/api/projects/{projectId}/chat-usage?apiKey="
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.upsolve.ai/v2/api/projects/{projectId}/chat-usage?apiKey=', 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.upsolve.ai/v2/api/projects/{projectId}/chat-usage?apiKey=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.upsolve.ai/v2/api/projects/{projectId}/chat-usage?apiKey="
req, _ := http.NewRequest("GET", url, nil)
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.upsolve.ai/v2/api/projects/{projectId}/chat-usage?apiKey=")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.upsolve.ai/v2/api/projects/{projectId}/chat-usage?apiKey=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"users": [
{
"projectUserId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"externalId": "<string>",
"name": "<string>",
"projectOrganizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"environment": "<string>",
"workspaces": [
{
"workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"workspaceName": "<string>",
"sessions": 4503599627370495,
"questions": 4503599627370495
}
]
}
]
}
}{
"status": "error",
"error": {
"message": "<string>",
"code": "<string>",
"details": {}
}
}Authorizations
Path Parameters
GET /v2/api/projects/:projectId/chat-usage Parameter
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$Query Parameters
Upsolve API key, generated under Account → Developer settings in the Upsolve Hub. Keys are user-scoped: pass organizationId alongside the key to select which org to act on.
1"up_embed_************"
Your Upsolve organization's UUID — the org that owns the API key and project. This is NOT a project organization: do not pass a value registered via /projects/register-organization, and do not pass an externalId (only projectOrganizationId accepts those). Omit it when using an org-bound API key — the org is read from the key and any value sent here is ignored. Required only for user-scoped API keys (created under Account → Developer settings) and for the Supabase JWT path, where the org is ambiguous and membership is verified against it.
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"123e4567-e89b-12d3-a456-426614174000"
Your own id for the person, as you send it in user.externalId to embed-token or register-user-token. Required: usage is read per person.
1 - 256Your own id for the organization the person belongs to (organization.externalId on embed-token). An external id is unique only within one project organization, so the same id can name one person in each organization that has them; pass this to read just one. Omit it to read every match.
1 - 256Only the project users of this environment, e.g. production or staging. Omit it to read them all.
ISO-8601 timestamp. Counts only activity at or after it: a conversation started earlier and continued after it counts as a session, with just its newer questions. Omit it to count all time.
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$Only this workspace. Omit it to read every workspace the person has chatted in.
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$Was this page helpful?