Rayana AI Portfolios API
The portfolios API from Rayana AI — 2 operation(s) for portfolios.
The portfolios API from Rayana AI — 2 operation(s) for portfolios.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/rayana-ai:rayana-ai-portfolios-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Rayana AI Portfolios API
description: 'Impersonal market-research data from the Rayana AI engine: rankings, signals, per-ticker scores, rotation, attention trends, and daily briefs. All content is computed once against broadcast model state and served identically to every caller.'
version: 1.1.0
tags:
- name: Portfolios
paths:
/v1/portfolios:
get:
tags:
- Portfolios
summary: Portfolios
description: 'The full shelf of model portfolios as merchandising cards, served to every
tier (it is the funnel). Draft books are never shown; ``?include_retired=true``
also returns archived books whose track record is frozen.
Each card carries ``openable`` (whether *this* caller''s tier can open the
book) and ``delayed`` (whether this caller would see it on a delay), so a
client can render the whole shelf with lock/delay badges.'
operationId: portfolios_v1_portfolios_get
parameters:
- name: include_retired
in: query
required: false
schema:
type: boolean
default: false
title: Include Retired
- name: X-API-Key
in: header
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: X-Api-Key
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/PortfolioShelf'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/v1/portfolios/{slug}:
get:
tags:
- Portfolios
summary: Portfolio
description: 'One book''s full detail: registry row, today''s holdings + overlay legs, a
recent-events window, the NAV series and windowed returns.
``events`` is the public projection of the diff log, not the log: the most
recent ``_PUBLIC_EVENT_LIMIT`` rows, trimmed to ``_PUBLIC_EVENT_KEYS`` with
each ``reason`` rewritten into the fixed public vocabulary. See the block
comment above — the stored reasons name the selection mechanism and quote
its cut-points, which is the same disclosure ``_public_construction`` exists
to prevent.
Gating: the caller''s tier must meet the book''s ``tier`` (403 otherwise, so a
free caller sees only the free book). The snapshot actually served is then
clamped by whichever is more restrictive of the caller''s ``access_level``
(draft/prime/published — see ``model_portfolio_snapshot_status``, standard
tier and up treated as prime — see ``effective_as_of``) and its
``publish_delay_min`` free-tier lever; ``asof`` is the snapshot actually
served under that clamp. ``delayed_to`` echoes that clamp date only for a
caller the free-tier lever actually applies to (``is_delayed``) — a paying
subscriber gets ``None`` even though the draft gate did clamp them, because
waiting for a snapshot to be confirmed is the schedule, not a delay.'
operationId: portfolio_v1_portfolios__slug__get
parameters:
- name: slug
in: path
required: true
schema:
type: string
title: Slug
- name: X-API-Key
in: header
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: X-Api-Key
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/PortfolioBook'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
components:
schemas:
ShelfCard:
properties:
slug:
type: string
title: Slug
display_name:
anyOf:
- type: string
- type: 'null'
title: Display Name
objective:
anyOf:
- type: string
- type: 'null'
title: Objective
risk_tier:
anyOf:
- type: string
- type: 'null'
title: Risk Tier
mechanism_blurb:
anyOf:
- type: string
- type: 'null'
title: Mechanism Blurb
asset_class:
anyOf:
- type: string
- type: 'null'
title: Asset Class
benchmark:
anyOf:
- type: string
- type: 'null'
title: Benchmark
tier:
anyOf:
- type: string
- type: 'null'
title: Tier
status:
anyOf:
- type: string
- type: 'null'
title: Status
inception_date:
anyOf:
- type: string
- type: 'null'
title: Inception Date
last_update:
anyOf:
- type: string
- type: 'null'
title: Last Update
n_holdings:
anyOf:
- type: integer
- type: 'null'
title: N Holdings
nav:
anyOf:
- type: number
- type: 'null'
title: Nav
cum_return_pct:
anyOf:
- type: number
- type: 'null'
title: Cum Return Pct
cagr_pct:
anyOf:
- type: number
- type: 'null'
title: Cagr Pct
drawdown_pct:
anyOf:
- type: number
- type: 'null'
title: Drawdown Pct
openable:
anyOf:
- type: boolean
- type: 'null'
title: Openable
delayed:
anyOf:
- type: boolean
- type: 'null'
title: Delayed
type: object
required:
- slug
title: ShelfCard
description: 'One merchandising card on the shelf.
``openable``/``delayed`` are computed per caller by the router, not stored.
``last_update``/``n_holdings`` arrive already collapsed to the pair this
caller''s access level entitles them to (``_public_card``) — the internal
``last_published_update``/``n_published_holdings`` pair is undeclared here
and so cannot ship even if that collapse were ever skipped.
Deliberately absent: ``source_lane`` and ``scoring_mode`` (internal lane
provenance — they name the engine that picks the book), the numeric ``id``,
and the gate configuration (``publish_delay_min``, ``draft_gate_enabled``,
``consumer_delay_min``), which is policy input rather than reader-facing
content — a reader sees its *effect*, as ``delayed``.'
NavPoint:
properties:
nav_date:
type: string
title: Nav Date
nav:
anyOf:
- type: number
- type: 'null'
title: Nav
daily_return_pct:
anyOf:
- type: number
- type: 'null'
title: Daily Return Pct
cum_return_pct:
anyOf:
- type: number
- type: 'null'
title: Cum Return Pct
drawdown_pct:
anyOf:
- type: number
- type: 'null'
title: Drawdown Pct
benchmark_ret_pct:
anyOf:
- type: number
- type: 'null'
title: Benchmark Ret Pct
n_holdings:
anyOf:
- type: integer
- type: 'null'
title: N Holdings
turnover_pct:
anyOf:
- type: number
- type: 'null'
title: Turnover Pct
distribution_pct:
anyOf:
- type: number
- type: 'null'
title: Distribution Pct
capital_nav:
anyOf:
- type: number
- type: 'null'
title: Capital Nav
cum_distribution_pct:
anyOf:
- type: number
- type: 'null'
title: Cum Distribution Pct
type: object
required:
- nav_date
title: NavPoint
description: 'One session on the track record. ``nav`` is TOTAL return indexed to 100
at inception and is never restated; ``capital_nav`` is the parallel curve a
holder sees if they take the distributions out (docs/distribution_layer.md).
``distribution_pct`` NULL means the book does not distribute at all — 0.0
means it does and nothing settled this session.'
BookEvent:
properties:
event_date:
anyOf:
- type: string
- type: 'null'
title: Event Date
action:
anyOf:
- type: string
- type: 'null'
title: Action
ticker:
anyOf:
- type: string
- type: 'null'
title: Ticker
name:
anyOf:
- type: string
- type: 'null'
title: Name
side:
anyOf:
- type: string
- type: 'null'
title: Side
delta_weight_pct:
anyOf:
- type: number
- type: 'null'
title: Delta Weight Pct
instrument_type:
anyOf:
- type: string
- type: 'null'
title: Instrument Type
reason:
anyOf:
- type: string
- type: 'null'
title: Reason
type: object
title: BookEvent
description: 'One row of the public event feed — the projection of the diff log, not
the log. ``reason`` has already been rewritten into the fixed public
vocabulary by ``_public_reason``; the stored text never reaches here, and
``source_metric`` (the number behind it) is undeclared on purpose.'
OverlayLeg:
properties:
ticker:
type: string
title: Ticker
name:
anyOf:
- type: string
- type: 'null'
title: Name
instrument_type:
type: string
title: Instrument Type
instrument:
$ref: '#/components/schemas/Contract'
default: {}
position_group:
anyOf:
- type: string
- type: 'null'
title: Position Group
notional_weight_pct:
anyOf:
- type: number
- type: 'null'
title: Notional Weight Pct
premium_yield_pct:
anyOf:
- type: number
- type: 'null'
title: Premium Yield Pct
assignment_prob:
anyOf:
- type: number
- type: 'null'
title: Assignment Prob
price:
anyOf:
- type: number
- type: 'null'
title: Price
type: object
required:
- ticker
- instrument_type
title: OverlayLeg
description: 'One written CSP / covered-call leg currently open against the core.
A leg carries the SAME ticker as the underlying it is written against and
is sized by NOTIONAL, not book weight — the two must never be summed, which
is why the read layer splits them out of ``holdings`` by ``instrument_type``.
``premium_yield_pct`` and ``assignment_prob`` are 0-1 FRACTIONS, unlike
every other ``_pct`` field in this API (strategy/premium_overlay.py''s
``annual_yield`` / ``abs(delta)``) — clients must format them accordingly.'
PortfolioBook:
properties:
slug:
type: string
title: Slug
factor_unwind:
anyOf:
- $ref: '#/components/schemas/FactorUnwind'
- type: 'null'
delayed_to:
anyOf:
- type: string
- type: 'null'
title: Delayed To
book:
$ref: '#/components/schemas/PortfolioRegistry'
asof:
anyOf:
- type: string
- type: 'null'
title: Asof
holdings:
items:
$ref: '#/components/schemas/Holding'
type: array
title: Holdings
default: []
overlay:
items:
$ref: '#/components/schemas/OverlayLeg'
type: array
title: Overlay
default: []
events:
items:
$ref: '#/components/schemas/BookEvent'
type: array
title: Events
default: []
nav:
items:
$ref: '#/components/schemas/NavPoint'
type: array
title: Nav
default: []
windows:
items:
$ref: '#/components/schemas/NavWindow'
type: array
title: Windows
default: []
metrics:
$ref: '#/components/schemas/PortfolioMetrics'
default:
n_holdings: 0
n_overlay: 0
type: object
required:
- slug
- book
title: PortfolioBook
Contract:
properties:
underlying:
anyOf:
- type: string
- type: 'null'
title: Underlying
expiry:
anyOf:
- type: string
- type: 'null'
title: Expiry
strike:
anyOf:
- type: number
- type: 'null'
title: Strike
right:
anyOf:
- type: string
- type: 'null'
title: Right
multiplier:
anyOf:
- type: number
- type: 'null'
title: Multiplier
premium:
anyOf:
- type: number
- type: 'null'
title: Premium
dte:
anyOf:
- type: number
- type: 'null'
title: Dte
contract:
anyOf:
- type: string
- type: 'null'
title: Contract
type: object
title: Contract
description: 'The option contract an overlay leg is written on: its identity
(expiry/strike/right, per ``_contract_id`` in strategy/model_portfolios.py)
plus what a reader needs to price it.
Deliberately absent: ``delta`` and ``implied_vol`` — the leg already
publishes ``assignment_prob``, which IS |delta| — and ``iv_rank`` / ``vrp``
/ ``timing_mult``, the overlay''s timing provenance, which is selection
mechanism (strategy/premium_overlay.py::contract_spec).'
Holding:
properties:
ticker:
type: string
title: Ticker
name:
anyOf:
- type: string
- type: 'null'
title: Name
sector:
anyOf:
- type: string
- type: 'null'
title: Sector
cluster:
anyOf:
- type: string
- type: 'null'
title: Cluster
rank:
anyOf:
- type: integer
- type: 'null'
title: Rank
weight_pct:
anyOf:
- type: number
- type: 'null'
title: Weight Pct
side:
anyOf:
- type: string
- type: 'null'
title: Side
price:
anyOf:
- type: number
- type: 'null'
title: Price
entry_date:
anyOf:
- type: string
- type: 'null'
title: Entry Date
select_metric:
anyOf:
- type: number
- type: 'null'
title: Select Metric
sel_metric_kind:
anyOf:
- type: string
- type: 'null'
title: Sel Metric Kind
instrument_type:
anyOf:
- type: string
- type: 'null'
title: Instrument Type
assigned:
type: boolean
title: Assigned
default: false
effective_basis:
anyOf:
- type: number
- type: 'null'
title: Effective Basis
type: object
required:
- ticker
title: Holding
description: 'One equity (or cash) position in today''s snapshot.
``weight_pct`` is the only position quantity that exists — no shares, no
dollars, by construction of the tables themselves (the FIREWALL note on the
model_portfolio_* DDL in data/db.py). ``side`` is ''long'' (NULL = long) or
''short'', and ``weight_pct`` stays POSITIVE either way.
Deliberately absent, all of which the ``list[dict]`` this replaced shipped:
``rationale`` — engine text that names the selection mechanism and quotes
its live cut-points ("invest composite 72 (BUY); tech 68 / fund 55",
"Donchian breakdown below the 200-SMA; 2N buy-stop $41.80"), i.e. exactly
the disclosure ``_public_events`` rewrites event reasons to prevent, one
table over; ``metrics`` — the per-name selection metrics JSON, whose
publishable aggregate is ``PortfolioMetrics`` below; ``stop_price`` and
``target_price`` — the exit rule''s live cut-points; and the row''s internal
identity (``id`` / ``portfolio_id`` / ``run_id`` / ``recorded_at``).
``assigned`` / ``effective_basis`` are the one allowlisted lift OUT of that
dropped ``metrics`` block (data/reads.py::_assigned_view), and they are not an
exception to the rule above: an assignment is an OUTCOME the event feed
already publishes in full, not a selection decision. Without them the single
row in the book that the picker did NOT choose arrives indistinguishable from
one it did — a new ticker with ``select_metric: null`` and no basis — which is
the whole of docs/subscriber_followability.md §5.'
PortfolioMetrics:
properties:
n_holdings:
type: integer
title: N Holdings
default: 0
n_overlay:
type: integer
title: N Overlay
default: 0
sleeve_state:
anyOf:
- type: string
- type: 'null'
title: Sleeve State
total_weight_pct:
anyOf:
- type: number
- type: 'null'
title: Total Weight Pct
weighted_select_metric:
anyOf:
- type: number
- type: 'null'
title: Weighted Select Metric
sel_metric_kind:
anyOf:
- type: string
- type: 'null'
title: Sel Metric Kind
overlay_annual_yield:
anyOf:
- type: number
- type: 'null'
title: Overlay Annual Yield
weighted_income_rate:
anyOf:
- type: number
- type: 'null'
title: Weighted Income Rate
weighted_sustainable_yield:
anyOf:
- type: number
- type: 'null'
title: Weighted Sustainable Yield
weighted_reinvest_required:
anyOf:
- type: number
- type: 'null'
title: Weighted Reinvest Required
income_coverage:
anyOf:
- type: number
- type: 'null'
title: Income Coverage
total_income_yield:
anyOf:
- type: number
- type: 'null'
title: Total Income Yield
distribution:
anyOf:
- $ref: '#/components/schemas/DistributionSummary'
- type: 'null'
type: object
title: PortfolioMetrics
description: 'Book-level aggregates over today''s snapshot (data/reads.py''s
``_book_metrics``). The income figures are weight-weighted over the book''s
TOTAL weight, so an unmeasured name drags the average down rather than being
assumed to yield like its peers.'
ValidationError:
properties:
loc:
items:
anyOf:
- type: string
- type: integer
type: array
title: Location
msg:
type: string
title: Message
type:
type: string
title: Error Type
input:
title: Input
ctx:
type: object
title: Context
type: object
required:
- loc
- msg
- type
title: ValidationError
NavWindow:
properties:
label:
type: string
title: Label
return_pct:
anyOf:
- type: number
- type: 'null'
title: Return Pct
from_date:
anyOf:
- type: string
- type: 'null'
title: From Date
covered:
type: boolean
title: Covered
default: false
capital_return_pct:
anyOf:
- type: number
- type: 'null'
title: Capital Return Pct
distribution_pct:
anyOf:
- type: number
- type: 'null'
title: Distribution Pct
type: object
required:
- label
title: NavWindow
description: 'MTD / 3M / 6M / 12M / ITD total return. ``covered`` False (with
``return_pct`` None) means the record does not yet reach back past that
window''s cutoff — render it as unavailable, never as the ITD number.'
DistributionSummary:
properties:
policy:
type: string
title: Policy
since:
anyOf:
- type: string
- type: 'null'
title: Since
covered_12m:
type: boolean
title: Covered 12M
default: false
distributions_to_date_pct:
anyOf:
- type: number
- type: 'null'
title: Distributions To Date Pct
trailing_12m_yield_pct:
anyOf:
- type: number
- type: 'null'
title: Trailing 12M Yield Pct
sustain_gap_pct:
anyOf:
- type: number
- type: 'null'
title: Sustain Gap Pct
return_of_capital_pct:
anyOf:
- type: number
- type: 'null'
title: Return Of Capital Pct
type: object
required:
- policy
title: DistributionSummary
description: 'The book''s distribution record (docs/distribution_layer.md §5). ``None``
on ``PortfolioMetrics.distribution`` means not a distributing book at all;
present with ``since`` and ``distributions_to_date_pct`` None means it IS
distributing but no session has crossed the seam yet — a real state, and it
renders differently. Nothing here is annualised. Any surface rendering a
distribution or yield figure must render ``sustain_gap_pct`` and
``return_of_capital_pct`` beside it (spec §11, D3).'
PortfolioRegistry:
properties:
slug:
type: string
title: Slug
display_name:
anyOf:
- type: string
- type: 'null'
title: Display Name
objective:
anyOf:
- type: string
- type: 'null'
title: Objective
risk_tier:
anyOf:
- type: string
- type: 'null'
title: Risk Tier
mechanism_blurb:
anyOf:
- type: string
- type: 'null'
title: Mechanism Blurb
asset_class:
anyOf:
- type: string
- type: 'null'
title: Asset Class
benchmark:
anyOf:
- type: string
- type: 'null'
title: Benchmark
tier:
anyOf:
- type: string
- type: 'null'
title: Tier
status:
anyOf:
- type: string
- type: 'null'
title: Status
inception_date:
anyOf:
- type: string
- type: 'null'
title: Inception Date
construction:
$ref: '#/components/schemas/PublicConstruction'
default: {}
type: object
required:
- slug
title: PortfolioRegistry
description: 'The book''s registry row as its detail page sees it: the same
merchandising identity as ``ShelfCard``, plus the parsed construction and
minus the per-caller flags (the detail endpoint''s own gate already answered
those).'
HTTPValidationError:
properties:
detail:
items:
$ref: '#/components/schemas/ValidationError'
type: array
title: Detail
type: object
title: HTTPValidationError
FactorUnwind:
properties:
flag:
type: string
title: Flag
date:
type: string
title: Date
index:
type: string
title: Index
held:
type: integer
title: Held
leg_size:
type: integer
title: Leg Size
type: object
required:
- flag
- date
- index
- held
- leg_size
title: FactorUnwind
description: 'Market-context banner: a recent crowded-winners unwind
(forensics/momentum_crash_monitor.py) that touched this book''s holdings.
Carries only a COUNT of overlapping names, never the monitor''s leg list.
Which names count as "recent leaders" is close to the momentum books'' own
selection lens, and the holdings themselves are already on the page.'
PublicConstruction:
properties:
holdings_min:
anyOf:
- type: integer
- type: 'null'
title: Holdings Min
holdings_max:
anyOf:
- type: integer
- type: 'null'
title: Holdings Max
turnover_tier:
anyOf:
- type: string
- type: 'null'
title: Turnover Tier
exit_rule:
anyOf:
- type: string
- type: 'null'
title: Exit Rule
distribution_policy:
anyOf:
- type: string
- type: 'null'
title: Distribution Policy
type: object
title: PublicConstruction
description: 'The book''s construction rules, trimmed to what is safe to publish — the
same set ``_PUBLIC_CONSTRUCTION_KEYS`` names in api/routers/portfolios.py,
which stays the enforcing copy (it runs before this model is built).'
PortfolioShelf:
properties:
count:
type: integer
title: Count
tier:
type: string
title: Tier
portfolios:
items:
$ref: '#/components/schemas/ShelfCard'
type: array
title: Portfolios
type: object
required:
- count
- tier
- portfolios
title: PortfolioShelf