API Reference

The Tengu API has two surfaces that share one key and one credit wallet:

SurfaceBase URLAuthWhat it is
FIRM data APIhttps://firm.tengu.coAuthorization: Bearer tengu_... (or X-API-Key)REST over 18 metered data products, per-call
Brain agent APIhttps://brain.tengu.co/v1Authorization: Bearer tengu_...OpenAI/Anthropic-compatible agent (Enterprise), per-token

Authentication#

Both surfaces accept the same tengu_ key three ways, in this precedence (first present wins):

  1. Authorization: Bearer tengu_...recommended (works with the OpenAI/Anthropic SDKs and most HTTP clients).
  2. X-API-Key: tengu_...
  3. ?api_key=tengu_... query parameter.

Every FIRM response is a JSON envelope: { "ok": true, "timestamp": "<ISO-8601>", ...data }. The data keys differ per endpoint (e.g. items for feeds, results for search, quote for a quote).

Discover every live endpoint (method, path, params) at any time — no key required:

Shell
curl https://firm.tengu.co/api/capabilities | jq '{manifest_version, tool_count, groups}'

Products, costs & per-plan access#

Which products your key can call depends on your plan. Calling a product outside your plan returns 402 plan_required and charges nothing — the body's unlocked_by[] names the plans that include it.

ProductCredits/callFreeStarter $99Pro $499Expert $999Enterprise
Market Data (quotes, OHLCV, crypto, index)1
Fundamentals (statements, ratios, screener)1
Public Filings (SEC/EDGAR index + extract)1
Congressional / Politician Trades2
News & Sentiment (equity news, analyst consensus)2
Macro, Rates, FX & Commodities2
Quant Signals (ML forecasts, intervals, voters)3
Funds & Institutional (13F + Form-4 insiders)4
Alt-Data (lobbying, contracts, patents, WSB)3
Options Flow & Dealer Positioning4
Execution & Research (TWAP/VWAP/TCA, skills)4
Risk Analytics (VaR, stress, hedging)5
Private Markets (10.6M companies, deals, funds)5
Tape & Intraday (minute bars, options/futures prints)3
Credit & Fixed-Income (TRACE bonds, CDS, ratings, loans)4
Transcripts & Events (earnings calls, Key Developments)3
LLM Research (web + Perplexity + Grok)6
Copilot (verdicts, sizing, thesis)10
Brain agent API~1/token

0-credit routes (any plan): /api/v3/private_markets/search — charges nothing, but like every /api/* data route it still requires a valid key. No-auth routes (no key needed): /api/capabilities, /api/health, /api/status, /api/v3/monitoring/*, /api/ml/health.

À-la-carte add-ons — buy on top of any paid plan (each is its own subscription that unlocks one product + tops your wallet): Private Markets $299/mo, Options Flow $79/mo, Copilot $199/mo. So a Starter or Pro customer can add Copilot without going Enterprise.

Included credits/month: Free 1,000 · Starter 250,000 · Pro 2,000,000 · Expert 5,000,000 · Enterprise 20,000,000. Rate limits: Free 30 · Starter 120 · Pro 600 · Expert 1,200 · Enterprise 6,000 req/min. See Pricing & credits.

Pagination#

Many list endpoints accept ?limit (results per call) and ?offset (skip N). Defaults and maxima vary by endpoint — the authoritative params are in GET /api/capabilities. Example:

Shell
1curl -H "Authorization: Bearer $TENGU_API_KEY" \2  "https://firm.tengu.co/api/v3/fundamentals/sec_filings?ticker=AAPL&limit=10&offset=0"

FIRM data endpoints#

Paths are relative to https://firm.tengu.co. {ticker} is a symbol like AAPL. This lists the most-used routes per product; the complete set is in GET /api/capabilities (filter by tool_count/groups).

Market Data — Free+ · 1 credit#

MethodPathDescription
GET/api/market/quote/{ticker}Live quote (canonical)
GET/api/crypto/{ticker}Live crypto quote
GET/api/data/universeTradable universe + reference data

Fundamentals — Free+ · 1 credit#

MethodPathDescription
GET/api/v3/fundamentals/company_full/{ticker}Full financials in one call
GET/api/v3/fundamentals/income_statements?ticker={ticker}Income statement
GET/api/v3/fundamentals/balance_sheets?ticker={ticker}Balance sheet
GET/api/v3/fundamentals/cash_flow_statements?ticker={ticker}Cash flow
GET/api/v3/fundamentals/metrics?ticker={ticker}Key metrics & ratios

Public Filings (SEC / EDGAR) — Free+ · 1 credit#

MethodPathDescription
GET/api/v3/fundamentals/sec_filings?ticker={ticker}Filing index → {ticker, form_type, items}
GET/api/v3/sec/filing/{ticker}/{filing_type}Filing detail/extract

Insider / Form-4 data is in the Funds & Institutional product (4 credits), not Public Filings — see below.

Congressional / Politician Trades — Starter+ · 2 credits#

MethodPathDescription
GET/api/v3/intel/congressCongressional trades → {items, count}
GET/api/v3/intel/politiciansPolitician trades
GET/api/v3/intel/corporate_donors/{ticker}Corporate donors

News & Sentiment — Starter+ · 2 credits#

MethodPathDescription
GET/api/v3/news/summary/{ticker}Equity news summary
GET/api/v3/intel/analyst_consensus/{ticker}Analyst consensus
GET/api/v3/intel/news_headlinesHeadlines / why-moving / movers

Macro, Rates, FX & Commodities — Starter+ · 2 credits#

MethodPathDescription
GET/api/v3/macro/treasury_curveTreasury curve, rates & regime
GET/api/v3/intel/yield_curveTreasury curve
GET/api/v3/intel/commoditiesCommodities
GET/api/v3/news_forex/latestFX news

Quant Signals — Starter+ · 3 credits#

MethodPathDescription
GET/api/v3/intel/ml_prediction/{ticker}ML forecast + conformal interval
GET/api/v3/intel/ml_drivers/{ticker}SHAP drivers
GET/api/v3/intel/voter_attribution/{ticker}19-voter decomposition
GET/api/v3/decision/trade_setupsRanked trade setups

Funds & Institutional (13F + Form-4) — Starter+ · 4 credits#

MethodPathDescription
GET/api/v3/intel/sec13f?ticker={ticker}Institutional holdings → {items, count, source}
GET/api/v3/intel/top_shareholders/{ticker}Top shareholders
GET/api/v3/fundamentals/institutional_ownership?ticker={ticker}Institutional ownership
GET/api/v3/intel/insiders?ticker={ticker}Insider (Form-4) activity
GET/api/insider/clustersCross-insider buy clusters

Alt-Data — Pro+ · 3 credits#

MethodPathDescription
GET/api/v3/intel/lobbying/{ticker}Lobbying activity
GET/api/v3/intel/gov_contracts/{ticker}Government contracts
GET/api/v3/intel/patents/{ticker}Patents
GET/api/v3/intel/exec_compensation/{ticker}Executive compensation
GET/api/v3/intel/wsb/{ticker}WallStreetBets mentions

Options Flow & Dealer Positioning — Pro+ · 4 credits#

MethodPathDescription
GET/api/v3/intel/options_flowUnusual options flow
GET/api/v3/intel/gex/{ticker}Gamma exposure
GET/api/v3/intel/max_pain/{ticker}Max pain
GET/api/v3/intel/darkpool/{ticker}Dark-pool prints

Execution & Research — Pro+ · 4 credits#

MethodPathDescription
GET/api/v3/execution/twap_plan/{ticker}TWAP/VWAP execution plan
GET/api/v3/skills/ta_master/{ticker}TA & trade-plan skills

Risk Analytics — Pro+ · 5 credits#

MethodPathDescription
GET/api/v2/risk/var?ticker={ticker}Value at Risk
GET/api/v2/risk/stressStress / crash scenarios
GET/api/v3/institutional/hedgingHedging analytics

Private Markets — Pro+ · 5 credits (search is free)#

MethodPathDescriptionCredits
GET/api/v3/private_markets/search?q={query}Discovery (companies/investors/funds) → {results}0
GET/api/v3/private_markets/company/{company_id}Full PitchBook-style profile5
GET/api/v3/private_markets/company/{company_id}/dossierEverything on a company in one call5
GET/api/v3/private_markets/company/{company_id}/dealsFunding rounds / M&A history5
GET/api/v3/private_markets/companiesScreen by sector/geo5

Tape & Intraday History — Pro+ · 3 credits#

FIRM's own self-collected tick tape — minute bars, per-print options/futures trades, and a historical options chain with greeks/IV/OI. Full catalogue in Tape & Intraday History.

MethodPathDescription
GET/api/v3/tape/bars/{ticker}Intraday minute bars (FIRM's own capture)
GET/api/v3/tape/options_chain/{ticker}Historical options chain w/ greeks, IV, OI
GET/api/v3/tape/options/{ticker}Raw options trade prints for one day
GET/api/v3/tape/futures/{root}CME futures trade prints
GET/api/v3/tape/futures_curve/{root}Futures term structure

Credit & Fixed-Income — Pro+ · 4 credits#

Institutional corporate-credit stack from licensed WRDS / S&P Capital IQ archives (served at the latest available lag). Full catalogue in Credit & Fixed-Income.

MethodPathDescription
GET/api/v3/credit/{ticker}One-call credit snapshot (call this first)
GET/api/v3/credit/bonds/{ticker}FINRA TRACE corporate-bond trade prints
GET/api/v3/credit/cds/{ticker}/historyMarkit single-name CDS spread history
GET/api/v3/credit/ratings/{ticker}S&P credit rating-action history
GET/api/v3/credit/loans/{ticker}DealScan syndicated bank-loan book

Transcripts & Corporate Events — Pro+ · 3 credits#

Full-text S&P Capital IQ earnings-call transcripts + the Key Developments corporate-event ledger back to 1990. Full catalogue in Transcripts & Corporate Events.

MethodPathDescription
GET/api/v3/transcripts/{ticker}List a company's earnings calls / investor events
GET/api/v3/transcripts/{ticker}/{event_id}Full transcript as ordered speaker turns
GET/api/v3/transcripts/searchSearch transcripts (headlines or full text)

LLM Research — Pro+ · 6 credits#

MethodPathDescription
POST/api/v3/research/web_searchGrounded web search
POST/api/v3/research/perplexityPerplexity synthesis
GET/api/v3/research/x_sentimentGrok/X sentiment

Copilot — Enterprise (or $199 add-on) · 10 credits#

MethodPathDescription
GET/api/v3/copilot/ticker_full/{ticker}One-call verdict + sizing
POST/api/v1/copilot/portfolioPortfolio review
GET/api/v1/copilot/score/{ticker}Quant score (v1 alias)

Brain agent endpoints — Enterprise#

Base URL https://brain.tengu.co/v1. Auth Authorization: Bearer tengu_....

MethodPathShape
POST/v1/chat/completionsOpenAI Chat Completions (model: "brain")
POST/v1/messagesAnthropic Messages

Both support streaming (stream: true). Brain is stateless per request — send the full messages[] history to continue a conversation. Metered per token against the shared wallet (one metered event per turn, no matter how many FIRM tools it invoked internally). Brain requires the Enterprise plan (it has autonomous access to the full product suite); on lower plans it returns 402 plan_required.

Error responses#

Every error body is {"detail": {"error_code": "...", "error_message": "...", ...}}. None deduct credits.

Statuserror_codeExtra fieldsMeaning
401unauthorizedKey missing/invalid/disabled.
402plan_requiredtool_group, current_plan, unlocked_by[], upgrade_urlProduct not in your plan.
402usage_exceededWallet empty / overage cap reached.
403account_suspendedBilling lapsed.
404not_foundUnknown route or symbol.
429rate_limitedheader Retry-After: 60Plan rate limit exceeded.
502unkey_unreachableheader Retry-After: 5Transient key-service blip — retry.

Example 402 plan_required body:

JSON
1{2  "detail": {3    "error_code": "plan_required",4    "error_message": "your plan 'starter' does not include 'private_markets' — upgrade to Pro to access it. Manage your plan at https://app.tengu.co",5    "tool_group": "private_markets",6    "current_plan": "starter",7    "unlocked_by": ["pro", "enterprise"],8    "upgrade_url": "https://app.tengu.co"9  }10}

Retry policy: retry only 429 (wait Retry-After≈60s) and 502 (wait Retry-After≈5s), with exponential backoff capped at ~120s. Never retry 401/402/403/404 — they need a new key, an upgrade, or a corrected path. See the drop-in client in the Quickstart.