{"components":{"schemas":{"Asset":{"properties":{"chart_dataset":{"description":"Default portal history: as_published or indicative; indicative prices are never execution prices.","type":"string"},"class":{"type":"string"},"client_symbols":{"items":{"type":"string"},"type":"array"},"currency":{"type":"string"},"enabled":{"type":"boolean"},"id":{"type":"string"},"name":{"type":"string"},"notes":{"type":"string"},"profile":{"type":"string"},"session":{"type":"string"},"symbol":{"type":"string"},"tick":{"description":"Exact decimal; empty on a status event without a price. Do not convert to binary float for order calculations.","pattern":"^(-?[0-9]+(\\.[0-9]+)?)?$","type":"string"}},"required":["id","symbol","class","tick"],"type":"object"},"Candle":{"properties":{"asset_id":{"type":"string"},"close":{"description":"Exact decimal; empty on a status event without a price. Do not convert to binary float for order calculations.","pattern":"^(-?[0-9]+(\\.[0-9]+)?)?$","type":"string"},"dataset":{"type":"string"},"final":{"type":"boolean"},"high":{"description":"Exact decimal; empty on a status event without a price. Do not convert to binary float for order calculations.","pattern":"^(-?[0-9]+(\\.[0-9]+)?)?$","type":"string"},"interval":{"type":"string"},"low":{"description":"Exact decimal; empty on a status event without a price. Do not convert to binary float for order calculations.","pattern":"^(-?[0-9]+(\\.[0-9]+)?)?$","type":"string"},"open":{"description":"Exact decimal; empty on a status event without a price. Do not convert to binary float for order calculations.","pattern":"^(-?[0-9]+(\\.[0-9]+)?)?$","type":"string"},"partial":{"type":"boolean"},"revision":{"type":"integer"},"side":{"type":"string"},"time":{"format":"date-time","type":"string"},"volume":{"type":["string","null"]},"watermark":{"type":"string"}},"required":["asset_id","dataset","time","open","high","low","close"],"type":"object"},"Quote":{"properties":{"ask":{"description":"Exact decimal; empty on a status event without a price. Do not convert to binary float for order calculations.","pattern":"^(-?[0-9]+(\\.[0-9]+)?)?$","type":"string"},"asset_id":{"type":"string"},"asset_sequence":{"type":"string"},"bid":{"description":"Exact decimal; empty on a status event without a price. Do not convert to binary float for order calculations.","pattern":"^(-?[0-9]+(\\.[0-9]+)?)?$","type":"string"},"data_state":{"enum":["HEALTHY","REDUNDANCY_REDUCED","SINGLE_SOURCE","UNCERTAIN","STALE","UNAVAILABLE","MANUAL"],"type":"string"},"demo":{"type":"boolean"},"effective_at":{"format":"date-time","type":"string"},"execution_ask":{"description":"Exact decimal; empty on a status event without a price. Do not convert to binary float for order calculations.","pattern":"^(-?[0-9]+(\\.[0-9]+)?)?$","type":"string"},"execution_bid":{"description":"Exact decimal; empty on a status event without a price. Do not convert to binary float for order calculations.","pattern":"^(-?[0-9]+(\\.[0-9]+)?)?$","type":"string"},"execution_eligible":{"type":"boolean"},"market_state":{"type":"string"},"methodology_version":{"type":"string"},"mid":{"description":"Exact decimal; empty on a status event without a price. Do not convert to binary float for order calculations.","pattern":"^(-?[0-9]+(\\.[0-9]+)?)?$","type":"string"},"quote_id":{"type":"string"},"reason_codes":{"items":{"type":"string"},"type":"array"},"recorded_at":{"format":"date-time","type":"string"},"replay":{"type":"boolean"},"sequence":{"type":"string"},"stream_id":{"type":"string"},"type":{"type":"string"},"valid_until":{"format":"date-time","type":"string"}},"required":["quote_id","asset_id","sequence","data_state","execution_eligible","demo"],"type":"object"}},"securitySchemes":{"APIKey":{"description":"A scoped API key created in your workspace. Paste the full key; do not include the Bearer prefix.","scheme":"bearer","type":"http"}}},"info":{"description":"Shared prices, candles and live streams. Create a key in [API keys](/keys), then send it as a Bearer token. Prices and sequence numbers are strings; check quote quality and expiry before use. Detailed quotes/replay are retained for 24 hours with hourly cleanup. Minute midpoint OHLC is retained long term. Consumers own order execution and evidence storage.","title":"API reference","version":"1.0.0"},"openapi":"3.1.0","paths":{"/v1/assets":{"get":{"description":"Required scope: `assets:read`.","operationId":"get_v1_assets","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"assets":{"items":{"$ref":"#/components/schemas/Asset"},"type":"array"}},"type":"object"}}},"description":"Successful read; inspect per-asset quality and coverage"},"401":{"description":"Invalid or expired credentials"},"403":{"description":"Scope or entitlement denied"},"410":{"description":"QUOTE_EXPIRED or CURSOR_EXPIRED: detail has expired; resynchronize from a current snapshot"},"429":{"description":"Rate budget exceeded"},"503":{"description":"Dependency unavailable"}},"summary":"List entitled instruments","tags":["Markets"]}},"/v1/assets/{id}":{"get":{"description":"Required scope: `assets:read`.","operationId":"get_v1_assets_id","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Asset"}}},"description":"Successful read; inspect per-asset quality and coverage"},"401":{"description":"Invalid or expired credentials"},"403":{"description":"Scope or entitlement denied"},"410":{"description":"QUOTE_EXPIRED or CURSOR_EXPIRED: detail has expired; resynchronize from a current snapshot"},"429":{"description":"Rate budget exceeded"},"503":{"description":"Dependency unavailable"}},"summary":"Describe one instrument","tags":["Markets"]}},"/v1/candles":{"get":{"description":"Required scope: `candles:read`. Without `from`, history expands with interval and limit (at least 24 hours, at most 31 days), aligned to the asset session's candle boundaries. Explicit ranges remain bounded to 31 days. A range that cuts a larger candle marks it partial and non-final. Coverage reports the actual queried range; missing history is never synthesized. Database failures return 503 HISTORY_UNAVAILABLE; invalid queries return 400.","operationId":"get_v1_candles","parameters":[{"description":"Asset ID","example":"crypto:BTCUSD","in":"query","name":"asset","required":true,"schema":{"type":"string"}},{"description":"as_published, indicative, corrected or provider:yahoo","in":"query","name":"dataset","schema":{"default":"as_published","description":"as_published, indicative (single-source, never execution), corrected, provider:yahoo, or a permitted reconstruction dataset","type":"string"}},{"description":"mid only; historical bid/ask series are not retained","in":"query","name":"side","schema":{"default":"mid","enum":["mid"],"type":"string"}},{"description":"1m, 5m, 15m, 1h, 4h, 1d or 1w","in":"query","name":"interval","schema":{"default":"1m","enum":["1m","5m","15m","1h","4h","1d","1w"],"type":"string"}},{"description":"Inclusive UTC RFC3339 boundary","in":"query","name":"from","schema":{"format":"date-time","type":"string"}},{"description":"Exclusive UTC RFC3339 boundary; maximum 31-day range","in":"query","name":"to","schema":{"format":"date-time","type":"string"}},{"description":"1-2000 output bars","in":"query","name":"limit","schema":{"default":500,"maximum":2000,"minimum":1,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"candles":{"items":{"$ref":"#/components/schemas/Candle"},"type":"array"},"coverage":{"type":"object"}},"type":"object"}}},"description":"Successful read; inspect per-asset quality and coverage"},"401":{"description":"Invalid or expired credentials"},"403":{"description":"Scope or entitlement denied"},"410":{"description":"QUOTE_EXPIRED or CURSOR_EXPIRED: detail has expired; resynchronize from a current snapshot"},"429":{"description":"Rate budget exceeded"},"503":{"description":"Dependency unavailable"}},"summary":"Read committed candles and revisions","tags":["History"]}},"/v1/events":{"get":{"description":"Required scope: `replay:read`.","operationId":"get_v1_events","parameters":[{"description":"Optional comma-separated entitled asset IDs","example":"crypto:BTCUSD,crypto:ETHUSD","in":"query","name":"assets","schema":{"type":"string"}},{"description":"Opaque cursor returned from this endpoint for the same scope","in":"query","name":"cursor","schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"cursor":{"type":"string"},"events":{"items":{"$ref":"#/components/schemas/Quote"},"type":"array"},"has_more":{"type":"boolean"}},"type":"object"}}},"description":"Successful read; inspect per-asset quality and coverage"},"401":{"description":"Invalid or expired credentials"},"403":{"description":"Scope or entitlement denied"},"410":{"description":"QUOTE_EXPIRED or CURSOR_EXPIRED: detail has expired; resynchronize from a current snapshot"},"429":{"description":"Rate budget exceeded"},"503":{"description":"Dependency unavailable"}},"summary":"Replay retained events (24-hour detail)","tags":["Streaming"]}},"/v1/market-status":{"get":{"description":"Required scope: `quotes:read`.","operationId":"get_v1_market-status","parameters":[{"description":"Comma-separated asset IDs","example":"crypto:BTCUSD,crypto:ETHUSD","in":"query","name":"assets","schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Successful read; inspect per-asset quality and coverage"},"401":{"description":"Invalid or expired credentials"},"403":{"description":"Scope or entitlement denied"},"410":{"description":"QUOTE_EXPIRED or CURSOR_EXPIRED: detail has expired; resynchronize from a current snapshot"},"429":{"description":"Rate budget exceeded"},"503":{"description":"Dependency unavailable"}},"summary":"Read quote and session eligibility","tags":["Markets"]}},"/v1/quotes":{"get":{"description":"Required scope: `quotes:read`.","operationId":"get_v1_quotes","parameters":[{"description":"Comma-separated immutable asset IDs","example":"crypto:BTCUSD,crypto:ETHUSD","in":"query","name":"assets","schema":{"type":"string"}},{"description":"Set true to require executable quotes","in":"query","name":"fresh","schema":{"default":false,"type":"boolean"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"quotes":{"items":{"$ref":"#/components/schemas/Quote"},"type":"array"},"sequence":{"type":"string"},"stream_id":{"type":"string"}},"type":"object"}}},"description":"Successful read; inspect per-asset quality and coverage"},"401":{"description":"Invalid or expired credentials"},"403":{"description":"Scope or entitlement denied"},"410":{"description":"QUOTE_EXPIRED or CURSOR_EXPIRED: detail has expired; resynchronize from a current snapshot"},"429":{"description":"Rate budget exceeded"},"503":{"description":"Dependency unavailable"}},"summary":"Read current shared quotes","tags":["Markets"]}},"/v1/quotes/{id}":{"get":{"description":"Required scope: `quotes:read`.","operationId":"get_v1_quotes_id","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Quote"}}},"description":"Successful read; inspect per-asset quality and coverage"},"401":{"description":"Invalid or expired credentials"},"403":{"description":"Scope or entitlement denied"},"410":{"description":"QUOTE_EXPIRED or CURSOR_EXPIRED: detail has expired; resynchronize from a current snapshot"},"429":{"description":"Rate budget exceeded"},"503":{"description":"Dependency unavailable"}},"summary":"Read a retained historical quote (24-hour detail)","tags":["Markets"]}},"/v1/sources":{"get":{"description":"Required scope: `quotes:read`. Quote and source evidence are read in one database snapshot. `decision`, `accepted` and `weight` describe that quote; `status` also reflects current freshness and controls. Prices are normalized before consensus. USDT/USD and USDC/USD default to fixed 1; EURC/EUR defaults to fixed 1. Same-group inputs share one vote. Fixed and dynamic conversion steps are recorded in normalization; stale, skewed or uncorroborated dynamic rates are excluded. Historical candles are never rewritten by changing an input.","operationId":"get_v1_sources","parameters":[{"description":"Canonical asset ID","example":"crypto:BTCUSD","in":"query","name":"asset","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"as_of":{"format":"date-time","type":"string"},"asset_id":{"type":"string"},"freshness_ms":{"type":"integer"},"quote":{"$ref":"#/components/schemas/Quote"},"quote_id":{"type":"string"},"server_time":{"format":"date-time","type":"string"},"sources":{"items":{"properties":{"accepted":{"type":"boolean"},"ask":{"description":"Exact decimal; empty on a status event without a price. Do not convert to binary float for order calculations.","pattern":"^(-?[0-9]+(\\.[0-9]+)?)?$","type":"string"},"bid":{"description":"Exact decimal; empty on a status event without a price. Do not convert to binary float for order calculations.","pattern":"^(-?[0-9]+(\\.[0-9]+)?)?$","type":"string"},"decision":{"type":"string"},"event_at":{"format":"date-time","type":"string"},"id":{"type":"string"},"name":{"type":"string"},"normalization":{"description":"Frozen raw prices, selected binding, conversion rules and exact dynamic rate quote IDs used in this decision.","type":"object"},"quote_currency":{"type":"string"},"raw_ask":{"description":"Exact decimal; empty on a status event without a price. Do not convert to binary float for order calculations.","pattern":"^(-?[0-9]+(\\.[0-9]+)?)?$","type":"string"},"raw_bid":{"description":"Exact decimal; empty on a status event without a price. Do not convert to binary float for order calculations.","pattern":"^(-?[0-9]+(\\.[0-9]+)?)?$","type":"string"},"status":{"type":"string"},"symbol":{"type":"string"},"weight":{"description":"Exact decimal; empty on a status event without a price. Do not convert to binary float for order calculations.","pattern":"^(-?[0-9]+(\\.[0-9]+)?)?$","type":"string"}},"type":"object"},"type":"array"}},"type":"object"}}},"description":"Successful read; inspect per-asset quality and coverage"},"401":{"description":"Invalid or expired credentials"},"403":{"description":"Scope or entitlement denied"},"410":{"description":"QUOTE_EXPIRED or CURSOR_EXPIRED: detail has expired; resynchronize from a current snapshot"},"429":{"description":"Rate budget exceeded"},"503":{"description":"Dependency unavailable"}},"summary":"Explain a published price","tags":["Markets"]}},"/v1/status":{"get":{"description":"Public service and aggregate feed status. Individual quotes report their own freshness.","operationId":"get_v1_status","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"assets":{"type":"integer"},"data_states":{"type":"object"},"execution_eligible":{"type":"integer"},"mode":{"type":"string"},"status":{"type":"string"}},"type":"object"}}},"description":"Successful read; inspect per-asset quality and coverage"},"401":{"description":"Invalid or expired credentials"},"403":{"description":"Scope or entitlement denied"},"410":{"description":"QUOTE_EXPIRED or CURSOR_EXPIRED: detail has expired; resynchronize from a current snapshot"},"429":{"description":"Rate budget exceeded"},"503":{"description":"Dependency unavailable"}},"security":[],"summary":"Service status","tags":["Service"]}},"/v1/stream-tickets":{"post":{"description":"Required scope: `stream:read`. Single use; expires after 30 seconds. See the WebSocket guide above for authentication and replay.","operationId":"createStreamTicket","requestBody":{"content":{"application/json":{"schema":{"properties":{"assets":{"items":{"type":"string"},"maxItems":250,"minItems":1,"type":"array"}},"required":["assets"],"type":"object"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"properties":{"expires_in":{"const":30,"type":"integer"},"ticket":{"type":"string"},"url":{"format":"uri","type":"string"}},"required":["ticket","expires_in","url"],"type":"object"}}},"description":"Single-use connection ticket"},"401":{"description":"Invalid credentials"},"403":{"description":"Scope or asset denied"},"429":{"description":"Rate budget exceeded"}},"summary":"Create a WebSocket ticket","tags":["Streaming"]}},"/v1/usage":{"get":{"description":"Required scope: `usage:read`.","operationId":"get_v1_usage","responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Successful read; inspect per-asset quality and coverage"},"401":{"description":"Invalid or expired credentials"},"403":{"description":"Scope or entitlement denied"},"410":{"description":"QUOTE_EXPIRED or CURSOR_EXPIRED: detail has expired; resynchronize from a current snapshot"},"429":{"description":"Rate budget exceeded"},"503":{"description":"Dependency unavailable"}},"summary":"Read account usage and limits","tags":["Service"]}}},"security":[{"APIKey":[]}],"servers":[{"url":"https://x.marketapi.cc"}],"tags":[{"name":"Markets"},{"name":"History"},{"name":"Streaming"},{"name":"Service"}]}
