MarketIntell Brain API
Query the AI Brain with natural language
Query the AI Brain with natural language
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/marketintell-ai:marketintell-ai-brain-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: MarketIntell Brain API
version: 0.1.0
description: 'AI-powered market intelligence with tier-aware Mastra agents and a deterministic analytical pipeline across crypto, US equities, and India stocks. REST, MCP, OpenAI-compatible, async workflow, and batch transports share one evidence/provenance/recovery contract.
**Rate limits (per minute / per day):**
- Free: 60 / 25
- Builder: 120 / 50,000
- Pro: 300 / 2,000
- Enterprise: 1,000 / unlimited
MCP has a separate per-key bucket (default 30/min, env `MCP_RATE_LIMIT_MAX`). 429 responses include `Retry-After` and machine-readable recovery fields.
**Self-registration (agents):** `POST /v1/auth/challenge` returns a SHA-256 proof-of-work challenge; submit the solved nonce to `POST /v1/auth/signup`. Follow `/.well-known/oauth-protected-resource` to the authorization-server `agent_auth` block, or read `/auth.md`.'
contact:
name: MarketIntell
email: support@marketintell.ai
url: https://marketintell.ai/contact
license:
name: Proprietary
url: https://marketintell.ai/terms
termsOfService: https://marketintell.ai/terms
x-api-lifecycle:
stability: stable
versioning: Major versions are encoded in the URL path (currently /v1). Additive fields do not change the major version.
deprecation_notice_days: 90
deprecation_header: Deprecation (RFC 9745)
sunset_header: Sunset (RFC 8594)
migration_link_relation: successor-version
servers:
- url: https://api.marketintell.ai
description: Production
- url: http://localhost:3848
description: Local development
security:
- BearerAuth: []
- ApiKeyHeader: []
tags:
- name: Brain
description: Query the AI Brain with natural language
paths:
/v1/chat:
post:
operationId: postChat
summary: Query the Brain
tags:
- Brain
description: Send a natural language query to the Brain agent. Supports streaming via SSE when stream=true.
parameters:
- $ref: '#/components/parameters/IdempotencyKey'
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- message
properties:
message:
type: string
description: Natural language query
example: Should I long or short BTC?
session_id:
type: string
format: uuid
description: Session ID for multi-turn conversations
stream:
type: boolean
description: Enable SSE streaming
default: false
domain:
type: string
enum:
- crypto
- us_equities
- india_stocks
description: 'Force a specific domain. When omitted, the planner classifies the query (default: crypto).'
mode:
type: string
enum:
- auto
- deep
default: auto
description: '`''auto''` (default) lets the planner pick the T1/T2/T3 pipeline. `''deep''` forces the T3 supervisor (Pro+ only). The legacy value `''fast''` is no longer accepted by the API — use `''auto''` instead.'
portfolio_id:
type: string
description: Inject a specific portfolio's context. Must be owned by the calling key — cross-owner ids are silently ignored.
include_portfolio:
type: boolean
description: When true (and no portfolio_id supplied), auto-inject the calling key's most-recently-updated portfolio.
default: false
include_facts:
type: boolean
default: false
description: When true, include the neutral fact projection in fact_projection and reasoning_summary.evidence. Recommended for autonomous agent consumers.
response_format:
type: object
description: Output format. Defaults to text (prose markdown). Use json_schema for structured JSON output, or the trade_setup shorthand to receive the versioned canonical trade-setup schema (equivalent to json_schema with name='trade_setup' and no inline schema).
properties:
type:
type: string
enum:
- text
- json_schema
- trade_setup
default: text
json_schema:
type: object
properties:
name:
type: string
description: Built-in schema name (trade_setup, market_analysis, token_screen) or custom name. When set to a built-in name with no inline schema, the server injects the built-in.
schema:
type: object
description: Custom JSON schema (optional if using built-in name)
strict:
type: boolean
default: false
required:
- name
responses:
'200':
description: Brain response with classification and correlation metadata
headers:
Idempotency-Replayed:
$ref: '#/components/headers/IdempotencyReplayed'
content:
application/json:
schema:
type: object
properties:
success:
type: boolean
data:
type: object
properties:
contract_version:
type: string
enum:
- '1.0'
execution_id:
type: string
description: Stable request/execution correlation id
status:
type: string
enum:
- completed
session_id:
type: string
format: uuid
content:
type: string
disclaimer:
type: string
description: Financial-advice disclaimer. Always present. A separate field — never folded into `content` — so structured-output / json_schema replies stay clean. Clients should render it persistently alongside the answer.
specialists_used:
type: array
items:
type: string
latency_ms:
type: number
classification:
type: object
nullable: true
properties:
specialists:
type: array
items:
type: string
tokens:
type: array
items:
type: string
intent:
type: string
correlation:
type: object
nullable: true
properties:
alignment:
type: string
enum:
- BULLISH
- BEARISH
- NEUTRAL
- NO_EDGE
score:
type: number
minimum: -10
maximum: 10
confirming:
type: array
items:
type: string
contradicting:
type: array
items:
type: string
sizing_multiplier:
type: number
summary:
type: string
structured_output:
type: object
nullable: true
description: Parsed JSON output when response_format.type is json_schema. Null when type is text.
reasoning_summary:
type: object
description: Safe evidence and decision summary. It does not expose hidden chain-of-thought or model scratchpads.
additionalProperties: true
provenance:
type: object
additionalProperties: true
delivery:
type: object
additionalProperties: true
recovery:
type:
- object
- 'null'
additionalProperties: true
fact_projection:
type: object
description: Present when include_facts=true.
additionalProperties: true
degradation:
type: object
additionalProperties: true
example:
success: true
data:
session_id: 9f2c4b76-2d18-4c8f-a3a7-6c8a8f2d4ab1
content: 'BTC is in a continuation pattern on the 4H. Entry: $108,400. Stop: $106,800 (1.5%). Targets: $111,200 (1.7R), $113,500 (3R).'
disclaimer: Not financial advice. For informational purposes only — do your own research. Markets are risky and you can lose money.
specialists_used:
- technical
- derivatives
latency_ms: 4321
classification:
specialists:
- technical
- derivatives
tokens:
- BTC
intent: trade_setup
correlation:
alignment: BULLISH
score: 6.4
confirming:
- RSI > 50 on 4H
- Funding neutral
- Higher highs/higher lows
contradicting:
- VIX rising
sizing_multiplier: 1
summary: BULLISH(78%) | strong | 12 facts | verification 91%
structured_output: null
text/event-stream:
schema:
type: string
description: SSE stream with text_delta, done, error events
example: 'event: text_delta
data: {"delta":"BTC is in a "}
event: text_delta
data: {"delta":"continuation pattern."}
event: done
data: {"session_id":"...","specialists_used":["technical"],"latency_ms":4321,"disclaimer":"Not financial advice. For informational purposes only — do your own research. Markets are risky and you can lose money."}
'
'400':
description: Invalid request body
content:
application/json:
example:
success: false
error: 'message: Required'
'401':
description: Missing or invalid API key
content:
application/json:
example:
success: false
error: 'Authentication required. Provide an API key via Authorization: Bearer <key> or X-API-Key header.'
'429':
description: Rate limit or daily quota exceeded
content:
application/json:
example:
success: false
error: Rate limit exceeded
message: Maximum 30 requests per 60s. Try again in 12s
retry_after_ms: 12000
components:
headers:
IdempotencyReplayed:
description: Present and set to `true` only when this response was served from the idempotency cache instead of re-running the handler.
schema:
type: string
enum:
- 'true'
parameters:
IdempotencyKey:
name: Idempotency-Key
in: header
required: false
description: 'Opt-in idempotency token (max 255 chars). The FIRST request carrying a given key is processed normally and its 2xx response is cached for 24h, scoped to (api_key + method + path + request-body hash). A retry with the SAME key and body replays the cached response and adds `Idempotency-Replayed: true`. Reusing the same key with a DIFFERENT body returns 422 (`idempotency_key_reuse`). The cache is per-process and in-memory, so on a multi-replica deploy a retry that lands on a different task re-executes — callers must already tolerate at-least-once delivery.'
schema:
type: string
maxLength: 255
securitySchemes:
BearerAuth:
type: http
scheme: bearer
ApiKeyHeader:
type: apiKey
in: header
name: X-API-Key