Workspace Quotas
Check resource quotas and remaining capacity for a workspace.
List Quotas
/v1/workspaces/{workspaceId}/quotasQuery Parameters
| Parameter | Type | Description |
|---|---|---|
usageTypeKey | string | Filter by usage type (e.g., images) |
page | integer | Page number |
size | integer | Items per page |
Example
Call this endpoint at the start of any workflow that will generate content or images
to verify your workspace has sufficient quota remaining. The availableAmount field
is the most useful for this check — it accounts for both the monthly limit and any
bonus or spillover credits.
Token and image usage via the REST API, the MCP server, or any other integration is deducted from the same workspace quotas as usage through the neuroflash app. There is no separate API allowance.
- cURL
- Python
- Node.js
- Go
curl "https://app.neuroflash.com/api/usage-service/v1/workspaces/{workspace_id}/quotas" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
import requests
quotas = requests.get(
f"https://app.neuroflash.com/api/usage-service/v1/workspaces/{workspace_id}/quotas",
headers={"Authorization": f"Bearer {token}"},
).json()
for quota in quotas["data"]:
print(f"{quota['usageTypeKey']}: {quota['availableAmount']} remaining "
f"(used {quota['usedAmount']} of {quota['limitAmount']})")
const quotas = await fetch(
`https://app.neuroflash.com/api/usage-service/v1/workspaces/${workspaceId}/quotas`,
{ headers: { Authorization: `Bearer ${token}` } }
).then((r) => r.json());
quotas.data.forEach((q) =>
console.log(`${q.usageTypeKey}: ${q.availableAmount} remaining (used ${q.usedAmount} of ${q.limitAmount})`)
);
quotaURL := fmt.Sprintf("https://app.neuroflash.com/api/usage-service/v1/workspaces/%s/quotas", workspaceID)
req, _ := http.NewRequest("GET", quotaURL, nil)
req.Header.Set("Authorization", "Bearer "+token)
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
var quotas struct {
Data []struct {
UsageTypeKey string `json:"usageTypeKey"`
AvailableAmount int `json:"availableAmount"`
UsedAmount int `json:"usedAmount"`
LimitAmount int `json:"limitAmount"`
} `json:"data"`
}
json.NewDecoder(resp.Body).Decode("as)
for _, q := range quotas.Data {
fmt.Printf("%s: %d remaining (used %d of %d)\n",
q.UsageTypeKey, q.AvailableAmount, q.UsedAmount, q.LimitAmount)
}
Response
{
"data": [
{
"id": "quota-uuid-123",
"workspaceId": "workspace-uuid",
"usageTypeKey": "images",
"bonusAmount": 0,
"spilloverAmount": 0,
"usedAmount": 12,
"usedAmountDaily": 3,
"dailyRefreshed": "2024-06-15",
"availableAmount": 88,
"limitAmount": 100,
"limitAmountDaily": 50,
"fairUseLimitReached": false
}
],
"page": {
"size": 20,
"totalElements": 1,
"totalPages": 1,
"currentPage": 1
}
}
Response Fields
| Field | Type | Description |
|---|---|---|
usageTypeKey | string | Usage type identifier (e.g. tokens, images) |
limitAmount | integer | Monthly limit for this usage type |
limitAmountDaily | integer | Daily limit. Resets at midnight UTC. |
usedAmount | integer | Total consumed in the current billing cycle |
usedAmountDaily | integer | Consumed since midnight UTC today |
availableAmount | integer | Remaining capacity in the current cycle |
bonusAmount | integer | Bonus credits added on top of the plan base |
spilloverAmount | integer | Unused credits carried over from the previous cycle |
fairUseLimitReached | boolean | Whether the fair use policy threshold has been reached |
dailyRefreshed | string | Date the daily counter last reset (ISO date) |
If usedAmountDaily reaches limitAmountDaily, requests will fail until midnight UTC
even if availableAmount is still positive. Check both fields when diagnosing
unexpected failures.
List Usage Types
/v1/usage-typesReturns all metered resource types available in the system. Use this to discover
valid usageTypeKey values for filtering quota responses.
Example
- cURL
- Python
- Node.js
- Go
curl "https://app.neuroflash.com/api/usage-service/v1/usage-types" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
types = requests.get(
"https://app.neuroflash.com/api/usage-service/v1/usage-types",
headers={"Authorization": f"Bearer {token}"},
).json()
for t in types["data"]:
print(f"{t['key']}: {t['displayName']}")
const types = await fetch(
"https://app.neuroflash.com/api/usage-service/v1/usage-types",
{ headers: { Authorization: `Bearer ${token}` } }
).then((r) => r.json());
types.data.forEach((t) => console.log(`${t.key}: ${t.displayName}`));
req, _ := http.NewRequest("GET",
"https://app.neuroflash.com/api/usage-service/v1/usage-types", nil)
req.Header.Set("Authorization", "Bearer "+token)
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
var types struct {
Data []struct {
Key string `json:"key"`
DisplayName string `json:"displayName"`
} `json:"data"`
}
json.NewDecoder(resp.Body).Decode(&types)
for _, t := range types.Data {
fmt.Printf("%s: %s\n", t.Key, t.DisplayName)
}
Response
{
"data": [
{
"id": "c01a5fac-89a9-49a6-9392-80c6bb3322a4",
"key": "images",
"displayName": "Images",
"fairUsePolicyLimit": null,
"permissionKeyDailyLimit": "maxImagesPerDay",
"permissionKeyMonthlyLimit": "maxImagesPerMonth"
},
{
"id": "2bfd44d4-700d-48b1-8c15-676f1cca0763",
"key": "tokens",
"displayName": "Tokens",
"fairUsePolicyLimit": null,
"permissionKeyDailyLimit": "maxAiOutputTokensPerDay",
"permissionKeyMonthlyLimit": "maxAiOutputTokensPerMonth"
}
],
"page": {
"size": 20,
"totalElements": 2,
"totalPages": 1,
"currentPage": 1
}
}