# Gloom Portfolio Exposure Analyzer

> Gloom Portfolio Exposure Analyzer is a paid API for AI agents from api.gloom.sh, paid per call via x402, $1.5/call, status unknown (last checked 2026-11-01).

Analyzes a portfolio's holdings against a stress scenario to produce exposure depth and per-holding status weights.

## Facts

- Endpoint: POST https://api.gloom.sh/v1/exposure/analyze?utm_source=zero.xyz
- Price: $1.5/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-01
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/gloom-portfolio-exposure-analyzer-58a5d7d2
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_ujLO7Ma4jDbZq7DXx72WE

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability gloom-portfolio-exposure-analyzer-58a5d7d2 -d '<json body>'
```

Example prompt: Can you run a scenario exposure analysis on my portfolio — I'm holding AAPL, TSLA, and MSFT — against scenario ID 'rate-shock-2024' and tell me the depth and weight of each position?

## When to prefer this

Use this endpoint when you need structured, scenario-based exposure analysis for a specific set of holdings and already have a scenario ID to apply. It is ideal for agents performing portfolio risk assessment, rebalancing decisions, or stress-testing workflows within the Gloom finance platform ecosystem, particularly when a quantitative depth score and per-holding status breakdown is needed rather than general market data or news.

## Known failure modes

- Unknown or unsupported scenarioId returns an empty or null scenario object
- Holdings with unrecognized ticker symbols return status 'unknown' with null name
- Empty holdings array may return a zero-depth result with no per-holding data
- Malformed request body (missing required fields) returns a 4xx error
- Payment failure or insufficient USDC balance blocks the call with a 402 response

## How this service works

Gloom is a free, open-source finance terminal for desktop and TUI with charts, news, filings, portfolios, alerts, and plugins.

## Output

Returns a JSON object containing the overall exposure depth score, a list of holdings each annotated with their symbol, weight, and status (e.g. 'unknown'), the scenario definition with associated shocks, and a count of the requested holdings.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "holdings": {
   "type": "array"
  },
  "scenarioId": {
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "data": {
   "depth": 2,
   "holdings": [
    {
     "name": null,
     "status": "unknown",
     "symbol": "AAPL",
     "weight": 1
    }
   ],
   "scenario": {
    "shocks": [
     {}
    ]
   },
   "requestedHoldings": 1
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/gloom-portfolio-exposure-analyzer-58a5d7d2/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.gloom.sh](https://www.zero.xyz/host/api.gloom.sh/llms.txt)
