Errors
The errors the Guavy API returns, including authentication failures, spent token budgets and rate limits, what each one means, and how your client can tell them apart.
Authentication Errors
Authentication errors occur when you make a request without a valid Bearer token or API key in the Authorization header. When authentication fails, the API returns an HTTP 401 Unauthorized status code with the JSON body
{"success": false, "message": "unauthorized"}.
A 401 can also mean your key is fine and a token limit was reached. That response keeps the same status and a readable message, and adds fields your client can act on without parsing it:
error_code
(DAILY_TOKEN_LIMIT
or MONTHLY_TOKEN_LIMIT),
limit_type,
resets_at
and upgrade_url.
resets_at
is when the limit lifts, in UTC: the next midnight for the daily limit, and for the monthly budget the 1st of the month on a free account or the renewal of a monthly subscription once its payment clears. It is null when that time cannot be stated.
It also carries the x-tokens-*
balance headers, with x-tokens-cost
at 0 because nothing was charged.
{
"success": false,
"error_code": "DAILY_TOKEN_LIMIT",
"limit_type": "daily",
"resets_at": "2026-10-16T00:00:00Z",
"upgrade_url": "https://guavy.com/app/upgrade",
"message": "You've reached your daily token limit. It resets at 00:00 UTC. For a higher daily cap, choose a plan at https://guavy.com/app/upgrade"
}
HTTP Response Codes
The Guavy API uses standard HTTP response codes to indicate the success or failure of an API request. Here are some common response codes you may encounter:
-
400Bad Request: a malformed request. Most commonly astrategypath segment outside the supported set (aggressiveorconservative); the response names the offending value. -
401Unauthorized: a missing or invalid Bearer token in the Authorization header, or a token budget that is spent until the next reset. A budget refusal carries anerror_code, so the two can be told apart. -
402Payment Required: the market is not included in your plan. You should not see this today: every live market is reachable on the free Sandbox tier. -
404Not Found: the requested endpoint or resource does not exist, or the market you asked for is not one we serve yet. A market that is coming but not live says so, and lists the markets that are live. -
429Too Many Requests: the rate limit was exceeded. Retry after the interval in theRetry-Afterheader. -
503Service Unavailable: a data source we depend on is temporarily unavailable: the trade-simulator upstream, or the datastore behind the news, sentiment and trend endpoints. Your request was valid; retry after theRetry-Afterinterval. Tokens charged for a 503 are credited back, less a 1-token floor.
We don't bill you for our failures. When a request fails on our side, such as a 503 from a data source or a 404 for a resource that turns out not to exist after we've already charged, the tokens are credited back to your budget, less a 1-token floor that keeps a failing call from being infinitely free. A malformed request on your side (400) is charged normally.
Token Costs
Each API call consumes tokens from your monthly budget. Endpoints that return richer or deeper data cost more tokens. Historical endpoints scale with the amount of data requested.
You never have to guess how much is left: every metered response carries your balance in
x-tokens-* headers: x-tokens-cost (what this call cost),
x-tokens-limit / x-tokens-remaining (monthly), and
x-tokens-limit-today / x-tokens-remaining-today (daily). The
remaining values are net of any credit applied to the same request. A 401 refused at your
limit carries them too, with x-tokens-cost at 0 because nothing was charged.
| Endpoint | Token Cost |
|---|---|
| GET /api/v1/ping | 1 |
| GET /api/v1/instruments/list-symbols | 1 |
| GET /api/v1/instruments/search-instruments/:query | 2 |
| GET /api/v1/instruments/get-detail/:symbol | 5 |
| GET /api/v1/instruments/scorecard/:symbol | 10 |
| GET /api/v1/newsroom/get-market-summary | 3 |
| GET /api/v1/newsroom/get-article/:id | 3 |
| GET /api/v1/newsroom/get-recent-briefs/:symbol | 3 – 8 (scales with limit) |
| GET /api/v1/newsroom/search-briefs/:symbol | 3 – 8 (scales with limit) |
| GET /api/v1/newsroom/get-instrument-analysis/:symbol | 10 |
| GET /api/v1/trades/get-recent-buys | 3 |
| GET /api/v1/trades/get-recent-sells | 3 |
| GET /api/v1/trades/get-recommendations | 5 |
| GET /api/v1/trades/get-current-action/:symbol/:strategy | 5 |
| GET /api/v1/trades/get-trend-history/:symbol/:limit | 5 – 15 (scales with limit) |
| GET /api/v1/trades/get-backtest-history/:symbol/:strategy | 8 – 20 (scales with years) |
| GET /api/v1/trades/get-backtest-summary/:symbol/:strategy | 8 – 20 (scales with years) |
| GET /api/v1/sentiment/get-sentiment-history/:symbol | 3 – 12 (scales with limit) |
| GET /api/v1/technical-analysis/get-price-history/:symbol | 2 – 5 (5 for the full series, less with limit, from or to) |
| GET /api/v1/technical-analysis/get-indicators/:symbol | 8 |
Account Limits
Each plan includes a monthly token budget: 3,000 for Sandbox, 250,000 for Quant, and 1,000,000 for Pro. Each market has its own budget, and a daily cap as well (500 tokens a day on Sandbox). The monthly budget resets to the full amount on the 1st of the month for an account with no active monthly subscription, or on your subscription's renewal date once its payment clears. Unused base tokens don't carry over. You can top up at any time with a one-time token pack; pack tokens never expire and any unused pack balance rolls forward. If you exceed your budget, the API returns a 401 until the next reset or until you purchase more tokens.
Connection Limits
The Guavy API allows 300 requests per minute per API key, returning 429 above that. We recommend caching responses that don't change frequently to reduce token consumption and improve performance.