Credits & Rate Limits
GenSearch uses a credit-based system. Understanding costs and limits helps you optimize API usage.
Credit Costs
| Mode | Credits per Request | Typical Response Time |
|---|---|---|
fast | 10 | ~30 seconds |
auto | 10 | ~30-90 seconds |
thinkLonger | 25 | ~60-90 seconds |
deepResearch | 100 | ~12-15 minutes |
note
Document Search and other GraphQL queries do not consume credits.
Rate Limits
| Limit | Value | Scope |
|---|---|---|
| Credit limit | Per your commercial agreement | Per customer |
| Polling rate | Per your commercial agreement | Per customer (global) |
| Token expiration | 24 hours | Per 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:
- Client sends GenSearch request.
- API Gateway checks credit balance.
- If over your credit limit, the gateway returns HTTP 429 Too Many Requests.
- If within limit, the job is enqueued and the API returns a conversation ID.
- Client polls for results within your allocated polling rate.
- Worker processes job asynchronously.
- Result stored and returned on next poll.
Polling Best Practices
- Wait 10 seconds between polls for
deepResearch, 5 seconds forthinkLonger. - Wait 3 seconds for
fastand 4 seconds forauto. - Check the
progressfield (0.0to1.0) to estimate remaining time. - Check the
errorfield 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.