API Reference

curl https://expert-system.starmode.dev/api/v1/docs
1

Get an API key

Create a free account and generate your key.

Get API key
2

Install the skill

Claude Code

/plugin install github://starmode-base/expert-system-plugin

Any agent (Cursor, Copilot, Cline, Codex)

npx skills add starmode-base/expert-system-plugin

The plugin ships three focused skills that trigger automatically based on context. See the plugin repository for details.

Direct API access

All API requests require an API key. Generate one on the API Keys page, then include it in every request:

Authorization: Bearer esak_<your-key>

Example

curl -H "Authorization: Bearer esak_<your-key>" \
     https://expert-system.starmode.dev/api/v1/takeaways/recent

A missing or invalid key returns 401 Unauthorized. Revoked keys are rejected immediately.

Endpoints

GET/api/v1/takeaways/recent

Recent Takeaways

Returns the most recent takeaways ordered by publication date (newest first).

Query parameters

ParameterTypeRequiredDescription
limitnumberoptionalNumber of takeaways to return. Default: 10. Max: 100.

Response

{
  "items": [ TakeawayObject, ... ]
}

Takeaway object

FieldTypeDescription
idstringTakeaway unique identifier.
documentIdstringID of the source document.
titlestringShort headline summarising the takeaway.
summarystringBrief summary of the takeaway.
publicationDatestring (ISO 8601)Publication date of the source document.
documentobjectSource metadata: id, title, source, link, publicationDate.

Example request

curl -H "Authorization: Bearer esak_<your-key>" \
     "https://expert-system.starmode.dev/api/v1/takeaways/recent?limit=5"

Example response

{
  "items": [
    {
      "id": "tak_abc123",
      "documentId": "doc_xyz789",
      "title": "Fed signals pause through Q2",
      "summary": "The Federal Reserve indicated it will hold rates...",
      "publicationDate": "2026-03-01T00:00:00.000Z",
      "document": {
        "id": "doc_xyz789",
        "title": "Remarks on the Economic Outlook",
        "source": "Fed Speeches",
        "link": "https://www.federalreserve.gov/...",
        "publicationDate": "2026-03-01T00:00:00.000Z"
      }
    }
  ]
}
GET/api/v1/takeaways

Takeaways by ID

Fetch up to 50 takeaways by ID with full details, document metadata, and inline references.

Query parameters

ParameterTypeRequiredDescription
idsstringrequiredComma-separated list of takeaway IDs. Maximum 50 IDs per request.

Response

{
  "items": [ TakeawayObject, ... ]
}

Takeaway object

FieldTypeDescription
idstringUnique identifier.
titlestringShort headline summarising the takeaway.
summarystringBrief summary of the takeaway.
takeawaystringFull takeaway text — the actionable or notable finding.
urlstringLink to the takeaway on expert-system.
documentobjectSource document metadata: id, title, source, link, publicationDate.
takeawayReferencesarrayOrdered list of inline references. Each entry has referenceNumber (integer) and reference (string).

Example request

curl -H "Authorization: Bearer esak_<your-key>" \
     "https://expert-system.starmode.dev/api/v1/takeaways?ids=tak_abc123,tak_def456"

Example response

{
  "items": [
    {
      "id": "tak_abc123",
      "title": "Fed signals pause through Q2",
      "summary": "The Fed expects inflation to cool before changing rates.",
      "takeaway": "The Federal Reserve indicated it will hold rates...",
      "url": "https://expert-system.starmode.dev/takeaway/tak_abc123",
      "document": {
        "id": "doc_xyz789",
        "title": "Remarks on the Economic Outlook",
        "source": "Fed Speeches",
        "link": "https://www.federalreserve.gov/...",
        "publicationDate": "2026-03-01T00:00:00.000Z"
      },
      "takeawayReferences": [
        { "referenceNumber": 1, "reference": "Federal Reserve Press Release, Jan 2026" }
      ]
    }
  ]
}
GET/api/v1/takeaways/search

Takeaway Search

Semantic search across all takeaways using vector similarity, with optional time-weighted reranking.

Query parameters

ParameterTypeRequiredDescription
querystringrequiredNatural-language search query.
limitnumberoptionalNumber of results to return. Default: 10. Max: 100.
recentstringoptionalSet to "true" to apply time-weighted reranking that favours newer content.

Response

{
  "items": [ SearchResultObject, ... ]
}

Search result object

FieldTypeDescription
idstringTakeaway unique identifier.
documentIdstringID of the source document.
titlestringShort headline summarising the takeaway.
summarystringBrief summary of the takeaway.
publicationDatestringISO 8601 publication date of the source document.
documentobjectSource metadata: id, title, source, link, publicationDate.

Example request

curl -H "Authorization: Bearer esak_<your-key>" \
     "https://expert-system.starmode.dev/api/v1/takeaways/search?query=inflation+expectations&limit=5"

Example request — time-weighted

curl -H "Authorization: Bearer esak_<your-key>" \
     "https://expert-system.starmode.dev/api/v1/takeaways/search?query=inflation+expectations&recent=true"

Example response

{
  "items": [
    {
      "id": "tak_abc123",
      "documentId": "doc_xyz789",
      "title": "Inflation expectations remain anchored",
      "summary": "Long-term inflation expectations hold steady near 2%...",
      "publicationDate": "2026-03-01T00:00:00.000Z",
      "document": {
        "id": "doc_xyz789",
        "title": "Remarks on the Economic Outlook",
        "source": "Fed Speeches",
        "link": "https://www.federalreserve.gov/...",
        "publicationDate": "2026-03-01T00:00:00.000Z"
      }
    }
  ]
}
GET/api/v1/documents

Documents by ID

Fetch up to 50 source documents by ID, including full article text and metadata.

Query parameters

ParameterTypeRequiredDescription
idsstringrequiredComma-separated list of document IDs. Maximum 50 IDs per request.

Response

{
  "items": [ DocumentObject, ... ]
}

Document object

FieldTypeDescription
idstringUnique identifier.
sourcestringOrigin of the document, e.g. "a16z", "Fed Speeches", "MacroVoices".
titlestringDocument title.
descriptionstringShort description or abstract of the document.
publicationDatestring (ISO 8601)When the document was originally published.
linkstringURL to the original source.
articleTextstringFull plain-text body of the document.
isSubstantivebooleanWhether the document contains enough content to be worth processing.
createdAtstring (ISO 8601)When the document was ingested.
updatedAtstring (ISO 8601)When the document record was last updated.

Example request

curl -H "Authorization: Bearer esak_<your-key>" \
     "https://expert-system.starmode.dev/api/v1/documents?ids=doc_xyz789,doc_abc123"

Example response

{
  "items": [
    {
      "id": "doc_xyz789",
      "source": "Fed Speeches",
      "title": "Remarks on the Economic Outlook",
      "description": "Governor Powell discusses the path of inflation...",
      "publicationDate": "2026-03-01T00:00:00.000Z",
      "link": "https://www.federalreserve.gov/...",
      "articleText": "Thank you for the opportunity to speak...",
      "isSubstantive": true,
      "createdAt": "2026-03-01T08:15:00.000Z",
      "updatedAt": "2026-03-01T08:15:00.000Z"
    }
  ]
}
GET/api/v1/documents/{documentId}/content

Document Content

Read one source document in bounded character ranges for primary-source verification and deeper context.

Query parameters

ParameterTypeRequiredDescription
offsetintegeroptionalZero-based character offset. Default: 0.
limitintegeroptionalCharacters to return. Default: 12000. Max: 30000.

Response

{
  "item": {
    "id": "doc_xyz789",
    "title": "Remarks on the Economic Outlook",
    "source": "Fed Speeches",
    "link": "https://www.federalreserve.gov/...",
    "publicationDate": "2026-03-01T00:00:00.000Z",
    "content": {
      "text": "Thank you for the opportunity to speak...",
      "offset": 0,
      "nextOffset": 12000,
      "totalCharacters": 48320,
      "truncated": true
    }
  }
}

Deterministic company financials

The financials API normalizes publicly filed SEC EDGAR company-facts data into stable, versioned metric IDs. It does not use an LLM, infer missing values, or combine different SEC concepts into one series.

Company endpoints accept either a ticker symbol such as AAPL or a numeric SEC CIK such as CIK320193. Every response includes the normalized 10-digit CIK.

Canonical metrics — catalog version 1

Income statement

revenue, costOfRevenue, grossProfit, operatingIncome, netIncome, epsBasic, epsDiluted, researchAndDevelopment, sellingGeneralAdministrative, incomeTaxExpense

Balance sheet

cash, accountsReceivable, inventory, currentAssets, totalAssets, accountsPayable, currentLiabilities, totalLiabilities, shortTermDebt, longTermDebt, stockholdersEquity

Cash flow

operatingCashFlow, capitalExpenditures, investingCashFlow, financingCashFlow, dividendsPaid, shareRepurchases

Period semantics

instant — a balance-sheet value measured as of the observation date.

quarter — a standalone fiscal-quarter duration.

yearToDate — a filed multi-quarter cash-flow duration; the response includes its start date.

annual — a complete fiscal-year duration.

GET/api/v1/financials/metrics

Financial Metric Catalog

Returns the global versioned catalog of canonical financial metric IDs.

Response

{
  "catalogVersion": "1",
  "metrics": [
    {
      "id": "revenue",
      "label": "Revenue",
      "statement": "incomeStatement",
      "unitType": "monetary"
    }
  ]
}

Example request

curl -H "Authorization: Bearer esak_<your-key>" \
     "https://expert-system.starmode.dev/api/v1/financials/metrics"
GET/api/v1/financials/{symbol}/metrics

Company Metric Availability

Returns only the canonical metrics available for one company and reporting period.

Path parameters

ParameterTypeRequiredDescription
symbolstringrequiredTicker symbol or SEC CIK.

Query parameters

ParameterTypeRequiredDescription
periodquarterly | annualoptionalReporting period to inspect. Default: quarterly.

Response

{
  "catalogVersion": "1",
  "symbol": "AAPL",
  "cik": "0000320193",
  "company": "Apple Inc.",
  "period": "quarterly",
  "metrics": [
    {
      "id": "revenue",
      "label": "Revenue",
      "statement": "incomeStatement",
      "unit": "USD"
    }
  ],
  "source": "SEC"
}

Example request

curl -H "Authorization: Bearer esak_<your-key>" \
     "https://expert-system.starmode.dev/api/v1/financials/AAPL/metrics?period=quarterly"
GET/api/v1/financials/{symbol}/{metric}

Company Financial Metric

Returns one compact, normalized SEC time series with optional filing provenance.

Path parameters

ParameterTypeRequiredDescription
symbolstringrequiredTicker symbol or SEC CIK.
metricstringrequiredCanonical metric ID from the v1 catalog.

Query parameters

ParameterTypeRequiredDescription
periodquarterly | annualoptionalReporting period. Default: quarterly.
limitnumberoptionalObservations to return. Default: 8. Minimum: 1. Maximum: 40.
includeprovenanceoptionalAdds filing date, form, accession number, original concept, and SEC source URL.

Response fields

FieldTypeDescription
catalogVersionstringVersion of the canonical metric catalog.
symbolstringUppercase ticker when the request used a known ticker.
cikstringNormalized 10-digit SEC CIK.
companystringSEC entity name.
metricstringCanonical metric ID.
unitstringSEC unit, such as USD or USD/shares.
dataarrayNewest-first observations with date, value, and periodType.
sourcestring | object"SEC" by default; SEC EDGAR provider and URL in provenance mode.

Example request

curl -H "Authorization: Bearer esak_<your-key>" \
     "https://expert-system.starmode.dev/api/v1/financials/AAPL/accountsPayable?period=quarterly&limit=4"

Compact response

{
  "catalogVersion": "1",
  "symbol": "AAPL",
  "cik": "0000320193",
  "company": "Apple Inc.",
  "metric": "accountsPayable",
  "period": "quarterly",
  "unit": "USD",
  "data": [
    {
      "date": "2026-06-27",
      "value": 64525000000,
      "periodType": "instant"
    }
  ],
  "source": "SEC"
}

Provenance observation

{
  "date": "2026-06-27",
  "value": 64525000000,
  "periodType": "instant",
  "filed": "2026-07-31",
  "form": "10-Q",
  "accession": "0000320193-26-000020",
  "concept": "AccountsPayableCurrent"
}
POST/api/v1/financials

Batch Company Financials

Retrieves several canonical metrics with one company-facts lookup and explicit per-metric availability errors.

Request body (JSON)

ParameterTypeRequiredDescription
symbolstringrequiredTicker symbol or SEC CIK.
metricsstring[]requiredBetween 1 and 27 unique canonical metric IDs.
periodquarterly | annualoptionalReporting period. Default: quarterly.
limitnumberoptionalObservations per metric. Default: 8. Minimum: 1. Maximum: 40.
includeprovenanceoptionalAdds filing provenance to returned observations.

Example request

curl -X POST -H "Authorization: Bearer esak_<your-key>" \
     -H "Content-Type: application/json" \
     -d '{"symbol":"JPM","metrics":["netIncome","inventory"],"period":"quarterly","limit":4}' \
     "https://expert-system.starmode.dev/api/v1/financials"

Partial-success response

{
  "catalogVersion": "1",
  "symbol": "JPM",
  "cik": "0000019617",
  "company": "JPMORGAN CHASE & CO",
  "period": "quarterly",
  "metrics": {
    "netIncome": {
      "unit": "USD",
      "data": [
        {
          "date": "2026-03-31",
          "value": 16494000000,
          "periodType": "quarter"
        }
      ]
    }
  },
  "errors": {
    "inventory": {
      "code": "METRIC_UNAVAILABLE",
      "message": "inventory is unavailable for JPM"
    }
  },
  "source": "SEC"
}

Valid but unavailable metrics appear in errors while available metrics are returned normally with status 200. An unknown metric ID rejects the whole request with METRIC_NOT_FOUND.

GET/api/v1/macro/series

Macro Series Catalog

List or search the supported FRED series before requesting observations.

Query parameters

ParameterTypeRequiredDescription
querystringoptionalOptional search across series IDs, descriptions, categories, and keywords.

Response

{
  "items": [
    {
      "id": "UNRATE",
      "description": "Civilian Unemployment Rate (%)",
      "category": "Labor Market",
      "nativeFrequency": "monthly",
      "nativeUnits": "Percent",
      "sourceUrl": "https://fred.stlouisfed.org/series/UNRATE"
    }
  ]
}
POST/api/v1/macro/observations

Macro Observations

Fetch independently configured observations for one to five supported FRED series.

Available data

Select series directly or search the macro series catalog first. Each series keeps its native timeline unless you explicitly request a lower frequency.

Growth / Real Economy: Real GDP, Industrial Production, Capacity Utilization, Real Personal Consumption, Real Business Fixed Investment.

Labor Market: Unemployment Rate, Labor Force Participation, Employment-Population Ratio, Nonfarm Payrolls, Initial Jobless Claims, Continuing Jobless Claims, Job Openings Rate, Quits Rate.

Inflation / Prices: CPI All Items, Core CPI, PCE Price Index, Core PCE, Trimmed Mean PCE, Median CPI.

Wages / Income: Average Hourly Earnings, Employment Cost Index, Real Disposable Personal Income.

Monetary Policy / Liquidity: Fed Funds Rate, Effective Fed Funds Rate, Interest on Reserve Balances, Fed Total Assets, Reserve Balances, Overnight Reverse Repo, M2 Money Supply.

Rates / Yield Curve: 2-Year Treasury, 10-Year Treasury, 10Y-2Y Spread, 10-Year Term Premium, 10-Year Breakeven Inflation.

Credit / Financial Stress: Baa Corporate Spread, High Yield OAS, Senior Loan Officer Survey, Financial Conditions Index, Bank Credit.

Housing: Housing Starts, Building Permits, Existing Home Sales, Case-Shiller Home Price Index, 30-Year Mortgage Rate.

Sentiment: Consumer Sentiment.

Request body (JSON)

{
  "series": [
    { "id": "UNRATE", "lastN": 12, "units": "lin" },
    {
      "id": "ICSA",
      "lastN": 12,
      "frequency": "m",
      "aggregationMethod": "avg"
    }
  ]
}

Send one to five unique series. Each accepts either lastN or a complete startDate/endDate range. Transformations are lin, chg, ch1, pch, pc1, pca, cch, and cca. Frequency aggregation supports avg, sum, and eop; upsampling is rejected.

lin returns levels; chg and ch1 return period and year-ago changes; pch and pc1 return period and year-ago percent changes; pca is compounded annualized percent change; and cch/cca are continuously compounded period and annualized changes.

Use one series for simple questions and batches for comparisons. Keep native frequency by default; request an explicit lower frequency and aggregation method only when comparable periods are required.

Response

{
  "asOf": "2026-08-02T00:00:00.000Z",
  "items": [
    {
      "seriesId": "UNRATE",
      "description": "Civilian Unemployment Rate (%)",
      "sourceUrl": "https://fred.stlouisfed.org/series/UNRATE",
      "nativeFrequency": "monthly",
      "returnedFrequency": "monthly",
      "nativeUnits": "Percent",
      "transformation": "lin",
      "observations": [{ "date": "2026-07-01", "value": 4.2 }]
    }
  ],
  "errors": []
}

Response fields

FieldTypeDescription
itemsarraySuccessful series with independent frequency, transformation, source, and observations.
errorsarrayPer-series provider errors; successful series remain available.

Example request

curl -X POST -H "Authorization: Bearer esak_<your-key>" \
     -H "Content-Type: application/json" \
     -d '{"series":[{"id":"UNRATE","lastN":12}]}' \
     "https://expert-system.starmode.dev/api/v1/macro/observations"

Error responses

Errors return a JSON body with an error field and the corresponding HTTP status code. Financial endpoints use a nested, machine-readable code and message.

FieldTypeDescription
400 Bad RequestMissing or invalid parameter (e.g. missing ids, invalid limit, malformed cursor or date).
401 UnauthorizedMissing, invalid, or revoked API key.
404 Not FoundCompany, metric, or company-specific metric data was not found.
429 Too Many RequestsMonthly API quota or upstream SEC rate limit was reached.
502 Bad GatewaySEC EDGAR was unavailable or returned an invalid payload.

Legacy endpoint error

{ "error": "Missing required parameter: ids" }

Financial endpoint error

{
  "error": {
    "code": "METRIC_UNAVAILABLE",
    "message": "inventory is unavailable for JPM"
  }
}

Financial error codes include UNAUTHORIZED, INVALID_REQUEST, COMPANY_NOT_FOUND, METRIC_NOT_FOUND, METRIC_UNAVAILABLE, SEC_UNAVAILABLE, RATE_LIMITED, and INTERNAL_ERROR.