Skip to main content

Cost Limits

Set daily spending limits to control your API usage costs.

Overview

Cost limits help you:

  • Prevent unexpected charges
  • Budget your API usage
  • Manage team spending
  • Avoid service interruptions

Understanding Cost Limits

Limit Hierarchy

Cost limits are applied at multiple levels:

Platform Default
└── Tenant/Organization Limit
└── User Limit (you can set this)

The effective limit is always the lowest of these values.

Example

Platform limit: $100/day
Tenant limit: $50/day
Your limit: $30/day
───────────────────────
Effective limit: $30/day

Viewing Your Limit

  1. Go to Profile in the sidebar
  2. Scroll to the Cost Limit section
  3. View your effective daily limit

The display shows:

  • Current Limit: Your effective daily spending cap
  • Source: Where the limit comes from (User, Tenant, or Platform)
  • Tenant Cap: Maximum limit allowed by your organization

Setting Your Limit

Set a Custom Limit

  1. Go to Profile
  2. Find the Cost Limit section
  3. Enter your desired daily limit (e.g., 25.00)
  4. Click Save

Constraints

  • Minimum: $0.01
  • Maximum: Your tenant's limit
  • You cannot exceed your organization's cap

Clear Your Limit

To remove your custom limit and use the tenant default:

  1. Click Clear next to your limit
  2. Your limit will revert to the tenant/platform default

Limit Source Badges

The interface shows where your limit comes from:

BadgeMeaning
UserYou set this limit
TenantOrganization-wide limit
PlatformSystem default

What Happens at the Limit

When you reach your daily limit:

  1. API requests are blocked until the next day
  2. Error response returned:
    {
    "error": "Daily cost limit exceeded",
    "limit": 30.00,
    "current": 30.15
    }
  3. Playground requests will fail with an error message

Limit Reset

Daily limits reset at midnight UTC.

Spending Alerts

The platform automatically sends email notifications as you approach your daily cost limit, giving you time to adjust your usage before requests are blocked.

Alert Thresholds

ThresholdTrigger
80%You receive an email when your daily spend reaches 80% of your effective limit
90%You receive a second email when your daily spend reaches 90% of your effective limit

What the Alert Email Includes

  • Your current spend amount for the day
  • Your daily cost limit
  • The reset time (midnight UTC) when the limit resets

Key Details

  • One alert per threshold per day — you will not receive duplicate emails for the same threshold
  • Alerts are informational only — your API access continues normally until you reach 100% of the limit
  • Thresholds reset daily — when the daily limit resets at midnight UTC, alert thresholds reset as well, so you will be notified again the next day if you approach your limit

Best Practices

For Development

Set a low limit during development:

  • Prevents accidental high usage from bugs
  • Encourages efficient prompt design
  • Protects against infinite loops

For Production

Set appropriate limits based on expected usage:

  • Review your usage patterns first
  • Add buffer for traffic spikes
  • Monitor approaching limits

For Teams

Organization admins can:

  • Set tenant-wide limits
  • Individual users can set lower personal limits
  • Track per-user spending in organization settings

Monitoring Costs

To track your spending:

  1. Go to Usage in the sidebar
  2. View daily/weekly/monthly costs
  3. See breakdown by model
  4. Monitor approaching limits

See Usage for detailed cost tracking.

API Reference

warning

Cost limit endpoints require JWT authentication (login with email/password). API keys cannot access these endpoints.

Manage cost limits programmatically.

Get Your Cost Limit

curl https://api.bulutistan.ai/api/v1/profile/cost-limit \
-H "Authorization: Bearer <your-jwt-token>"

Response:

{
"cost_per_day": 30.00,
"effective_limit": 30.00,
"source": "user",
"tenant_limit": 50.00
}
FieldDescription
cost_per_dayYour custom daily limit (null if using tenant/platform default)
effective_limitThe actual limit that applies (lowest of user, tenant, platform)
sourceWhere the effective limit comes from (user, tenant, or platform)
tenant_limitOrganization's limit (maximum you can set)

Set Your Cost Limit

curl -X PUT https://api.bulutistan.ai/api/v1/profile/cost-limit \
-H "Authorization: Bearer <your-jwt-token>" \
-H "Content-Type: application/json" \
-d '{
"cost_per_day": 25.00
}'

Response:

{
"cost_per_day": 25.00,
"effective_limit": 25.00,
"source": "user",
"tenant_limit": 50.00
}

Constraints:

  • Cannot exceed your tenant's limit
  • Minimum: $0.01
  • Maximum: Tenant's configured limit

Clear Your Cost Limit

Remove your custom limit and use the tenant default:

curl -X DELETE https://api.bulutistan.ai/api/v1/profile/cost-limit \
-H "Authorization: Bearer <your-jwt-token>"

Response: Same shape as GET /profile/cost-limitcost_per_day is now null, and source falls back to tenant (or platform).

{
"cost_per_day": null,
"effective_limit": 50.00,
"source": "tenant",
"tenant_limit": 50.00
}

Python Example

from openai import OpenAI
import requests

# Using requests for non-inference endpoints
jwt_token = "<your-jwt-token>"
base_url = "https://api.bulutistan.ai"

# Get current limit
response = requests.get(
f"{base_url}/api/v1/profile/cost-limit",
headers={"Authorization": f"Bearer {jwt_token}"}
)
limit_info = response.json()
print(f"Effective limit: ${limit_info['effective_limit']}")

# Set a new limit
response = requests.put(
f"{base_url}/api/v1/profile/cost-limit",
headers={
"Authorization": f"Bearer {jwt_token}",
"Content-Type": "application/json"
},
json={"cost_per_day": 20.00}
)
print(response.json())