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

# Analysis

> Returns analysis for a given ticker

"Fresh" analysis will be computed for the ticker 100% of the time. The analysis is computed based off of 15-minute delayed financial data until further notice.

"Cached" analysis will check the cache for the ticker and return the cached analysis if it exists. If the cached analysis does not exist, it will compute the analysis and then cache it.
If the ticker is not in the cache, it will compute the analysis and then cache it, you will be charged with the cached rate.

Expect fresh and cache-miss analyses to take 20-30 seconds to complete. Cache-hit analyses will take 3-5 seconds to complete.


## OpenAPI

````yaml GET /v1/enterprise/tickers/{ticker}/analysis
openapi: 3.1.0
info:
  title: Byte AI API
  description: AI-driven financial intelligence
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.byteai.me
security:
  - bearerAuth: []
paths:
  /v1/enterprise/tickers/{ticker}/analysis:
    get:
      description: Returns analysis for a given ticker
      parameters:
        - name: ticker
          in: path
          description: The ticker to get analysis for
          required: true
          schema:
            type: string
            example: MSFT
        - name: model
          in: query
          description: The model to use for analysis
          schema:
            type: string
            enum:
              - o4-mini-cached
              - o4-mini-fresh
              - gpt-5-cached
              - gpt-5-fresh
              - gpt-5-nano-cached
              - gpt-5-nano-fresh
            example: gpt-4.1-mini-fresh
      responses:
        '200':
          description: Analysis response
          content:
            application/json:
              schema:
                type: object
                required:
                  - analysis
                properties:
                  analysis:
                    $ref: '#/components/schemas/Analysis'
              example:
                analysis:
                  ticker: MSFT
                  id: e5c6cde2-5137-4dfe-96a1-50e5f37e9968
                  justification: >-
                    The stock is underbought because the RSI is below 30 and the
                    MACD is above the signal line.
                  rsi_analysis: 'RSI at 47.2133 (-5.6% vs baseline): Leaning Underbought.'
                  macd_analysis: >-
                    The MACD is the same as the Signal Line (difference < 0.1),
                    leaning slightly bullish.
                  bb_analysis: >-
                    The stock price is almost the same as the upper Bollinger
                    Band (difference < 0.5). Note: The Bollinger bandwidth is
                    only 0.86, which is quite narrow.
                  created_at: '2025-05-23T19:22:59.437Z'
                  model: gpt-4.1-mini
                  news_analysis:
                    summary: >-
                      The overall sentiment for Microsoft (MSFT) is moderately
                      positive with no significant negative headlines. Most
                      articles reflect neutral to somewhat-bullish views,
                      particularly highlighting Microsoft's competitive position
                      in the evolving software industry and anticipation of
                      strong earnings. There is no clear indication of economic
                      downturn impacting MSFT specifically. Broader market
                      themes include cautious investor sentiment around AI
                      stocks with some volatility noted but Microsoft is not
                      directly implicated in negative trends. Geopolitical and
                      regulatory news, like the NRC overhaul and tariff
                      discussions, appear unrelated to Microsoft’s core business
                      impacts at this time.
                    relevance: >-
                      The somewhat-bullish sentiment around Microsoft's industry
                      competitiveness and upcoming earnings suggests potential
                      positive market sentiment for MSFT shares. The absence of
                      major negative news or direct economic headwinds specific
                      to Microsoft implies stability and possible growth
                      prospects, making MSFT an attractive consideration in a
                      cautiously optimistic tech sector environment.
        '400':
          description: Bad request - Invalid or missing parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                invalidTickerFormat:
                  summary: Invalid ticker format (non-alphabetic or wrong length)
                  value:
                    type: invalid_request
                    message: >-
                      Ticker must be 2-4 alphabetic characters (e.g., AAPL,
                      MSFT)
                missingTicker:
                  summary: Missing ticker parameter
                  value:
                    type: invalid_request
                    message: Ticker and model query parameters are required
                missingModel:
                  summary: Missing model parameter
                  value:
                    type: invalid_request
                    message: Model query parameter is required
                invalidModel:
                  summary: Invalid model parameter
                  value:
                    type: invalid_request
                    message: >-
                      Model must be one of: o4-mini-cached, o4-mini-fresh,
                      gpt-5-cached, gpt-5-fresh, gpt-5-nano-cached,
                      gpt-5-nano-fresh
        '401':
          description: Unauthorized - Invalid or missing authentication
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                missingAuthorizationHeader:
                  summary: Missing authorization header
                  value:
                    type: missing_authorization_header
                    message: No authorization header provided
                missingAuthorizationKey:
                  summary: Missing authorization key
                  value:
                    type: missing_authorization_key
                    message: No authorization key provided in header
                invalidApiKey:
                  summary: Invalid API key
                  value:
                    type: invalid_api_key
                    message: Invalid API key
                corruptedApiKey:
                  summary: Corrupted API key
                  value:
                    type: corrupted_api_key
                    message: API key found but corrupted
                userNotFound:
                  summary: User not found for API key
                  value:
                    type: user_not_found
                    message: User not found for the provided API key
                unauthorized:
                  summary: Unexpected authorization error
                  value:
                    type: unauthorized
                    message: Unauthorized
        '403':
          description: Forbidden - Access denied due to subscription issues
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                notSubscribed:
                  summary: Organization not subscribed to the model
                  value:
                    type: forbidden
                    message: 'Organization is not subscribed to model: gpt-5-cached'
                insufficientCredits:
                  summary: Insufficient credits to run the model
                  value:
                    type: insufficient_credits
                    message: >-
                      Insufficient credits to run this model. Please add funds
                      to your account.
        '429':
          description: Too Many Requests - Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                rateLimitExceeded:
                  summary: Rate limit exceeded
                  value:
                    type: rate_limit_exceeded
                    message: Rate limit exceeded
        '500':
          description: Internal server error - Unexpected server-side issues
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                stripeCustomerNotFound:
                  summary: Stripe customer not found
                  value:
                    type: not_found
                    message: 'No such customer: ''cus_SNCOeNkTgiIuCy'''
                organizationNotFound:
                  summary: Organization or Stripe customer ID not found
                  value:
                    type: not_found
                    message: Organization or Stripe customer ID not found
                noActiveSubscription:
                  summary: No active subscription found
                  value:
                    type: not_found
                    message: No active subscription found for the customer
                priceNotFound:
                  summary: Price not found for subscription item
                  value:
                    type: not_found
                    message: Price not found for subscription item sub_12345
                analysisNotGenerated:
                  summary: Failed to generate analysis
                  value:
                    type: analysis_failed
                    message: Failed to generate analysis for ticker MSFT
                unexpectedError:
                  summary: Unexpected server error
                  value:
                    type: server_error
                    message: An unexpected error occurred
components:
  schemas:
    Analysis:
      required:
        - ticker
        - id
        - justification
        - rsi_analysis
        - macd_analysis
        - bb_analysis
        - created_at
        - model
        - news_analysis
      type: object
      properties:
        ticker:
          description: The ticker to get analysis for
          type: string
          example: MSFT
        justification:
          description: The justification for the analysis
          type: string
          example: >-
            The stock is underbought because the RSI is below 30 and the MACD is
            above the signal line.
        id:
          description: The analysis id
          type: string
          example: e5c6cde2-5137-4dfe-96a1-50e5f37e9968
        rsi_analysis:
          description: The RSI analysis
          type: string
          example: 'RSI at 47.2133 (-5.6% vs baseline): Leaning Underbought.'
        macd_analysis:
          description: The MACD analysis
          type: string
          example: >-
            The MACD is the same as the Signal Line (difference < 0.1), leaning
            slightly bullish.
        bb_analysis:
          description: The Bollinger Bands analysis
          type: string
          example: >-
            The stock price is almost the same as the upper Bollinger Band
            (difference < 0.5). Note: The Bollinger bandwidth is only 0.86,
            which is quite narrow.
        created_at:
          description: The creation date of the analysis
          type: string
          example: '2025-05-23T19:22:59.437Z'
        model:
          description: The model used to generate the analysis
          type: string
          example: gpt-4.1-mini-fresh
        news_analysis:
          description: The news analysis containing a summary and relevance assessment
          type: object
          required:
            - summary
            - relevance
          properties:
            summary:
              description: A summary of the news relevant to the ticker
              type: string
              example: >-
                The overall sentiment for Microsoft (MSFT) is moderately
                positive with no significant negative headlines. Most articles
                reflect neutral to somewhat-bullish views, particularly
                highlighting Microsoft's competitive position in the evolving
                software industry and anticipation of strong earnings. There is
                no clear indication of economic downturn impacting MSFT
                specifically. Broader market themes include cautious investor
                sentiment around AI stocks with some volatility noted but
                Microsoft is not directly implicated in negative trends.
                Geopolitical and regulatory news, like the NRC overhaul and
                tariff discussions, appear unrelated to Microsoft’s core
                business impacts at this time.
            relevance:
              description: The relevance of the news to the ticker
              type: string
              example: >-
                The somewhat-bullish sentiment around Microsoft's industry
                competitiveness and upcoming earnings suggests potential
                positive market sentiment for MSFT shares. The absence of major
                negative news or direct economic headwinds specific to Microsoft
                implies stability and possible growth prospects, making MSFT an
                attractive consideration in a cautiously optimistic tech sector
                environment.
    Error:
      required:
        - type
        - message
      type: object
      properties:
        type:
          type: string
          description: A short, machine-readable identifier for the error type
          example: incorrect_query_format
        message:
          type: string
          description: A human-readable description of the error
          example: Ticker must be 2-4 alphabetic characters (e.g., AAPL, MSFT)
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````