Organizations
Retrieve organization subscriptions
Retrieve connection statuses and available ChatGPT and Claude usage. Provider usage errors are reported without failing the response.
GET
/
v1
/
organizations
/
{organizationId}
/
subscriptions
Retrieve organization subscriptions
curl --request GET \
--url https://api.tembo.io/v1/organizations/{organizationId}/subscriptions \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.tembo.io/v1/organizations/{organizationId}/subscriptions"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.tembo.io/v1/organizations/{organizationId}/subscriptions', 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.tembo.io/v1/organizations/{organizationId}/subscriptions",
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.tembo.io/v1/organizations/{organizationId}/subscriptions"
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.tembo.io/v1/organizations/{organizationId}/subscriptions")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tembo.io/v1/organizations/{organizationId}/subscriptions")
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{
"chatgpt": {
"connected": true,
"usage": {
"planType": "free",
"rateLimits": [
{
"limitId": "<string>",
"limitName": "<string>",
"planType": "free",
"primary": {
"usedPercent": 123,
"windowDurationMins": 123,
"resetsAt": 1
},
"secondary": {
"usedPercent": 123,
"windowDurationMins": 123,
"resetsAt": 1
},
"credits": {
"hasCredits": true,
"unlimited": true,
"balance": "<string>"
},
"individualLimit": {
"limit": "<string>",
"used": "<string>",
"remainingPercent": 123,
"resetsAt": 1
},
"spendControlReached": true,
"rateLimitReachedType": "rate_limit_reached"
}
],
"rateLimitResetCredits": {
"availableCount": 1,
"credits": [
{
"id": "<string>",
"resetType": "codexRateLimits",
"status": "available",
"grantedAt": 1,
"expiresAt": 1,
"title": "<string>",
"description": "<string>"
}
]
},
"tokenUsage": {
"summary": {
"lifetimeTokens": 1,
"peakDailyTokens": 1,
"longestRunningTurnSec": 1,
"currentStreakDays": 1,
"longestStreakDays": 1
},
"dailyUsageBuckets": [
{
"startDate": "2023-12-25",
"tokens": 1
}
]
},
"fetchedAt": "2023-11-07T05:31:56Z"
},
"usageError": {
"code": "reconnectRequired",
"message": "<string>",
"retryAfter": "<string>"
}
},
"claude": {
"connected": true,
"reconnectRequired": true,
"usage": {
"rateLimits": [
{
"key": "five_hour",
"label": "5-hour limit",
"detail": null,
"remainingPercent": 50,
"resetsAt": 1
}
]
},
"usageError": {
"code": "reconnectRequired",
"message": "<string>",
"retryAfter": "<string>"
}
},
"supergrok": {
"connected": true
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Was this page helpful?
⌘I
Retrieve organization subscriptions
curl --request GET \
--url https://api.tembo.io/v1/organizations/{organizationId}/subscriptions \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.tembo.io/v1/organizations/{organizationId}/subscriptions"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.tembo.io/v1/organizations/{organizationId}/subscriptions', 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.tembo.io/v1/organizations/{organizationId}/subscriptions",
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.tembo.io/v1/organizations/{organizationId}/subscriptions"
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.tembo.io/v1/organizations/{organizationId}/subscriptions")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tembo.io/v1/organizations/{organizationId}/subscriptions")
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{
"chatgpt": {
"connected": true,
"usage": {
"planType": "free",
"rateLimits": [
{
"limitId": "<string>",
"limitName": "<string>",
"planType": "free",
"primary": {
"usedPercent": 123,
"windowDurationMins": 123,
"resetsAt": 1
},
"secondary": {
"usedPercent": 123,
"windowDurationMins": 123,
"resetsAt": 1
},
"credits": {
"hasCredits": true,
"unlimited": true,
"balance": "<string>"
},
"individualLimit": {
"limit": "<string>",
"used": "<string>",
"remainingPercent": 123,
"resetsAt": 1
},
"spendControlReached": true,
"rateLimitReachedType": "rate_limit_reached"
}
],
"rateLimitResetCredits": {
"availableCount": 1,
"credits": [
{
"id": "<string>",
"resetType": "codexRateLimits",
"status": "available",
"grantedAt": 1,
"expiresAt": 1,
"title": "<string>",
"description": "<string>"
}
]
},
"tokenUsage": {
"summary": {
"lifetimeTokens": 1,
"peakDailyTokens": 1,
"longestRunningTurnSec": 1,
"currentStreakDays": 1,
"longestStreakDays": 1
},
"dailyUsageBuckets": [
{
"startDate": "2023-12-25",
"tokens": 1
}
]
},
"fetchedAt": "2023-11-07T05:31:56Z"
},
"usageError": {
"code": "reconnectRequired",
"message": "<string>",
"retryAfter": "<string>"
}
},
"claude": {
"connected": true,
"reconnectRequired": true,
"usage": {
"rateLimits": [
{
"key": "five_hour",
"label": "5-hour limit",
"detail": null,
"remainingPercent": 50,
"resetsAt": 1
}
]
},
"usageError": {
"code": "reconnectRequired",
"message": "<string>",
"retryAfter": "<string>"
}
},
"supergrok": {
"connected": true
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}