> ## Documentation Index
> Fetch the complete documentation index at: https://docs.shumi.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Stream updates as NDJSON

> Long-lived newline-delimited JSON. One object per line, emitted every `interval` seconds until the client disconnects. Opening a stream counts against quota; it is not payable per call, so an exhausted quota returns 429 rather than a payment challenge.



## OpenAPI

````yaml /api-reference/openapi.json get /api/cli/watch/{stream}
openapi: 3.1.0
info:
  title: Shumi API
  description: >-
    Typed crypto trade-intelligence endpoints. Every response is wrapped in a
    versioned envelope, so a client can tell a successful payload from an error
    without inspecting HTTP status alone.


    The same surface backs the `shumi` CLI and the `@shumi-ai/mcp` MCP server.
  version: 1.0.0
servers:
  - url: https://api.shumi.ai
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Ask
    description: Natural-language queries answered by the Shumi engine.
  - name: Coins
    description: Single-asset lookup, risk context, sentiment, and history.
  - name: Market
    description: Market-wide prices, breadth, and baselines.
  - name: Categories
    description: Category listings, membership, and sentiment.
  - name: Sentiment
    description: Crowd sentiment and narrative momentum.
  - name: Trade decisions
    description: Regime, funding, futures, pairs, and signal synthesis.
  - name: Tracking
    description: Watched holders, wallets, baskets, and transcripts.
  - name: RWA
    description: 'Real-world assets: equities, metals, and commodities.'
  - name: Streaming
    description: Long-lived NDJSON streams.
  - name: Account
    description: Entitlement and tier.
paths:
  /api/cli/watch/{stream}:
    get:
      tags:
        - Streaming
      summary: Stream updates as NDJSON
      description: >-
        Long-lived newline-delimited JSON. One object per line, emitted every
        `interval` seconds until the client disconnects. Opening a stream counts
        against quota; it is not payable per call, so an exhausted quota returns
        429 rather than a payment challenge.
      operationId: watch
      parameters:
        - name: stream
          in: path
          required: true
          schema:
            type: string
            enum:
              - funding
              - regime
              - sentiment
        - name: interval
          in: query
          schema:
            type: integer
            default: 30
            minimum: 10
            maximum: 300
          description: Seconds between emissions. Clamped.
        - name: max
          in: query
          schema:
            type: integer
          description: Stop after this many emissions. `0` streams indefinitely.
        - name: diff
          in: query
          schema:
            type: boolean
          description: Emit only when the payload changed.
      responses:
        '200':
          description: NDJSON stream.
          content:
            application/x-ndjson:
              schema:
                type: string
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/AuthRequired'
components:
  responses:
    BadRequest:
      description: Malformed request — usually a missing conditional parameter.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            schemaVersion: 1
            error:
              code: BAD_REQUEST
              message: action=movements requires ?contract=<token address>
    AuthRequired:
      description: No credential presented.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            schemaVersion: 1
            error:
              code: AUTH_REQUIRED
              message: 'Authentication required. Run: shumi login'
  schemas:
    Error:
      type: object
      required:
        - schemaVersion
        - error
      properties:
        schemaVersion:
          type: integer
          example: 1
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              enum:
                - BAD_REQUEST
                - AUTH_REQUIRED
                - AUTH_INVALID
                - RATE_LIMITED
                - UPSTREAM_4XX
                - UPSTREAM_5XX
                - NETWORK
                - INTERNAL
            message:
              type: string
            details:
              description: Present when the route can say something more specific.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        An API key (`shumi_sk_…`) or a session JWT. Create a key with `shumi
        login` and `shumi keys create`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.