Skip to main content

Credits & Rate Limits

GenSearch uses a credit-based system. Understanding costs and limits helps you optimize API usage.

Credit Costs

ModeCredits per RequestTypical Response Time
fast10~30 seconds
auto10~30-90 seconds
thinkLonger25~60-90 seconds
deepResearch100~12-15 minutes
note

Document Search and other GraphQL queries do not consume credits.

Rate Limits

LimitValueScope
Credit limitPer your commercial agreementPer customer
Polling ratePer your commercial agreementPer customer (global)
Token expiration24 hoursPer token

Credit limits and polling rates are determined by your commercial agreement. Contact your account team at support@alpha-sense.com for details.

How Rate Limiting Works

When a client sends a GenSearch request, the following flow determines whether the request is accepted or throttled:

  1. Client sends GenSearch request.
  2. API Gateway checks credit balance.
  3. If over your credit limit, the gateway returns HTTP 429 Too Many Requests.
  4. If within limit, the job is enqueued and the API returns a conversation ID.
  5. Client polls for results within your allocated polling rate.
  6. Worker processes job asynchronously.
  7. Result stored and returned on next poll.

Polling Best Practices

  • Wait 10 seconds between polls for deepResearch, 5 seconds for thinkLonger.
  • Wait 3 seconds for fast and 4 seconds for auto.
  • Check the progress field (0.0 to 1.0) to estimate remaining time.
  • Check the error field on each poll.

Handling HTTP 429

import time

def poll_with_backoff(headers, query, variables, max_retries=3):
for attempt in range(max_retries):
response = requests.post(
"https://api.alpha-sense.com/gql",
headers=headers,
json={"query": query, "variables": variables}
)
if response.status_code == 429:
wait_time = 60 # Wait 60 seconds on rate limit
print(f"Rate limited. Waiting {wait_time}s...")
time.sleep(wait_time)
continue
return response.json()
raise Exception("Max retries exceeded")

Usage Tracking

Usage data is available via the Usage API. Contact your account team at support@alpha-sense.com for access and details on your current credit allocation.


Related Resources
  • GenSearch Modes -- learn about mode selection, credit costs, and when to use each mode.
  • Troubleshooting -- error handling guidance including HTTP 429 recovery and common failure patterns.