api-stock-com LLM API

The LLM API from api-stock-com — 3 operation(s) for llm.

Operations 3

POST /api/v1/chat/completions OpenAI-compatible chat completion. Set `stream: true` for server-sent events #
POST /api/v1/messages Anthropic Messages API-compatible endpoint (Claude models). #
GET /api/v1/models List available chat models with token pricing (USD per 1M tokens) #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • 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.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/api-stock-com:api-stock-com-llm-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API 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. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

api-stock-com-llm-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Stock Com LLM API
  version: '1.0'
  contact: {}
  description: 'Operations tagged LLM across 2 of this provider''s published API definitions: api-stock-com-openapi.json, api-stock-com-openapi.json. Each path carries the servers of the definition it was published in.'
servers:
- url: https://api.api-stock.com
  description: Production
tags:
- name: LLM
paths:
  /api/v1/chat/completions:
    post:
      operationId: LlmController_createChatCompletion
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatCompletionRequestDto'
      responses:
        '200':
          description: Chat completion. When `stream` is true the response is a `text/event-stream` of deltas.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatCompletionResponseDto'
        '400':
          description: Bad Request - unknown model or invalid parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseDto'
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseDto'
        '402':
          description: Payment Required - Insufficient account balance
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentRequiredErrorResponseDto'
        '500':
          description: Internal Server Error - Server error occurred
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerErrorResponseDto'
      security:
      - apiKey: []
      summary: 'OpenAI-compatible chat completion. Set `stream: true` for server-sent events'
      tags:
      - LLM
    servers:
    - url: https://api.api-stock.com
      description: Production
  /api/v1/messages:
    post:
      operationId: LlmController_createMessage
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AnthropicMessageRequestDto'
      responses:
        '200':
          description: Anthropic message. When `stream` is true the response is a `text/event-stream` of events.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnthropicMessageResponseDto'
        '400':
          description: Bad Request - unknown model or invalid parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseDto'
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseDto'
        '402':
          description: Payment Required - Insufficient account balance
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentRequiredErrorResponseDto'
        '500':
          description: Internal Server Error - Server error occurred
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerErrorResponseDto'
      security:
      - apiKey: []
      summary: Anthropic Messages API-compatible endpoint (Claude models).
      tags:
      - LLM
    servers:
    - url: https://api.api-stock.com
      description: Production
  /api/v1/models:
    get:
      operationId: LlmController_listModels
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelListResponseDto'
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseDto'
      security:
      - apiKey: []
      summary: List available chat models with token pricing (USD per 1M tokens)
      tags:
      - LLM
    servers:
    - url: https://api.api-stock.com
      description: Production
components:
  schemas:
    ChatCompletionResponseDto:
      type: object
      properties:
        id:
          type: string
          example: chatcmpl-abc123
        object:
          type: string
          example: chat.completion
        created:
          type: number
          example: 1700000000
        model:
          type: string
          example: gemini-3.5-flash
        choices:
          type: array
          items:
            $ref: '#/components/schemas/ChatCompletionChoiceDto'
        usage:
          $ref: '#/components/schemas/ChatCompletionUsageDto'
      required:
      - id
      - object
      - created
      - model
      - choices
      - usage
    ChatMessageDto:
      type: object
      properties:
        role:
          type: string
          description: Role of the message author
          example: user
        content:
          type: object
          description: Message content. Either a string or an array of content parts (multimodal).
          example: Hello!
        name:
          type: string
          description: Optional author name
      required:
      - role
      - content
    AnthropicMessageRequestDto:
      type: object
      properties:
        model:
          type: string
          description: Model id
          example: claude-sonnet-5
        max_tokens:
          type: number
          description: Maximum number of tokens to generate (required by Anthropic).
          example: 1024
        messages:
          description: Conversation messages
          type: array
          items:
            $ref: '#/components/schemas/AnthropicMessageDto'
        stream:
          type: boolean
          description: Stream partial deltas as server-sent events
          default: false
      required:
      - model
      - max_tokens
      - messages
    ModelListResponseDto:
      type: object
      properties:
        object:
          type: string
          example: list
        data:
          type: array
          items:
            $ref: '#/components/schemas/ModelObjectDto'
      required:
      - object
      - data
    ChatCompletionUsageDto:
      type: object
      properties:
        prompt_tokens:
          type: number
          example: 12
        completion_tokens:
          type: number
          example: 34
        total_tokens:
          type: number
          example: 46
      required:
      - prompt_tokens
      - completion_tokens
      - total_tokens
    ChatCompletionRequestDto:
      type: object
      properties:
        model:
          type: string
          description: Model id
          example: gemini-3.5-flash
        messages:
          description: Conversation messages
          type: array
          items:
            $ref: '#/components/schemas/ChatMessageDto'
        stream:
          type: boolean
          description: Stream partial deltas as server-sent events
          default: false
        temperature:
          type: number
          description: Sampling temperature (0-2)
        top_p:
          type: number
          description: Nucleus sampling probability
        max_tokens:
          type: number
          description: Maximum tokens to generate
        max_completion_tokens:
          type: number
          description: Alias for max_tokens; capped by API Stock
        n:
          type: number
          description: Number of completions. API Stock currently supports one.
          default: 1
          maximum: 1
      required:
      - model
      - messages
    BadRequestErrorResponseDto:
      type: object
      properties:
        code:
          type: number
          description: HTTP status code
          example: 400
        error:
          description: Error details
          allOf:
          - $ref: '#/components/schemas/ErrorDetails'
      required:
      - code
      - error
    UnauthorizedErrorResponseDto:
      type: object
      properties:
        code:
          type: number
          description: HTTP status code
          example: 401
        error:
          description: Error details
          allOf:
          - $ref: '#/components/schemas/ErrorDetails'
      required:
      - code
      - error
    AnthropicMessageDto:
      type: object
      properties:
        role:
          type: string
          description: Role of the message author
          example: user
        content:
          type: object
          description: Message content. Either a string or an array of content blocks (text/image).
          example: Explain rate limiting in three sentences.
      required:
      - role
      - content
    ModelLongContextPricingDto:
      type: object
      properties:
        thresholdTokens:
          type: number
          example: 272000
          description: Total input tokens above which these rates replace the base ones
        input:
          type: number
          example: 2.8
          description: Input token price
        output:
          type: number
          example: 12.6
          description: Output token price
        cacheRead:
          type: number
          example: 0.28
          description: Cache-read token price
        cacheWrite:
          type: number
          example: 10
          description: Cache-write token price
      required:
      - thresholdTokens
      - input
      - output
      - cacheRead
    PaymentRequiredErrorResponseDto:
      type: object
      properties:
        code:
          type: number
          description: HTTP status code
          example: 402
        error:
          description: Error details
          allOf:
          - $ref: '#/components/schemas/ErrorDetails'
      required:
      - code
      - error
    ModelPricingDto:
      type: object
      properties:
        currency:
          type: string
          example: USD
        unit:
          type: string
          example: 1M_tokens
          description: Pricing unit
        input:
          type: number
          example: 1.4
          description: Input token price
        output:
          type: number
          example: 8.4
          description: Output token price
        cacheRead:
          type: number
          example: 0.14
          description: Cache-read token price
        cacheWrite:
          type: number
          example: 5
          description: Cache-write token price (Anthropic models)
        longContext:
          description: Higher rates that replace the ones above for the whole request once its total input exceeds `thresholdTokens`. Absent when the model is priced flat at any context size.
          allOf:
          - $ref: '#/components/schemas/ModelLongContextPricingDto'
      required:
      - currency
      - unit
      - input
      - output
      - cacheRead
    ErrorDetails:
      type: object
      properties:
        message:
          type: string
          description: Human-readable cause. English, stable — safe to log, not meant for display to end users in other languages.
        type:
          type: string
          description: Error type
        code:
          type: string
          description: Stable machine-readable code. Match on this rather than on `message` — clients use it to render their own localized wording.
          example: insufficient_balance
      required:
      - message
      - type
      - code
    ModelObjectDto:
      type: object
      properties:
        id:
          type: string
          example: gemini-3.5-flash
        object:
          type: string
          example: model
        created:
          type: number
          example: 1700000000
        owned_by:
          type: string
          example: api-stock
        pricing:
          description: User-facing token pricing (USD per 1M tokens); null if not configured
          type:
          - object
          - 'null'
          allOf:
          - $ref: '#/components/schemas/ModelPricingDto'
      required:
      - id
      - object
      - created
      - owned_by
    AnthropicUsageDto:
      type: object
      properties:
        input_tokens:
          type: number
          example: 10
        output_tokens:
          type: number
          example: 13
      required:
      - input_tokens
      - output_tokens
    ChatCompletionChoiceDto:
      type: object
      properties:
        index:
          type: number
          example: 0
        message:
          type: object
          example:
            role: assistant
            content: Hi there!
        finish_reason:
          type:
          - string
          - 'null'
          example: stop
      required:
      - index
      - message
      - finish_reason
    AnthropicMessageResponseDto:
      type: object
      properties:
        id:
          type: string
          example: msg_013zva2CMHNLnXJNN3QKQ2EF
        type:
          type: string
          example: message
        role:
          type: string
          example: assistant
        content:
          example:
          - type: text
            text: Hello! I'm Claude.
          type: array
          items:
            type: string
        model:
          type: string
          example: claude-sonnet-5
        stop_reason:
          type:
          - string
          - 'null'
          example: end_turn
        usage:
          $ref: '#/components/schemas/AnthropicUsageDto'
      required:
      - id
      - type
      - role
      - content
      - model
      - stop_reason
      - usage
    InternalServerErrorResponseDto:
      type: object
      properties:
        code:
          type: number
          description: HTTP status code
          example: 500
        error:
          description: Error details
          allOf:
          - $ref: '#/components/schemas/ErrorDetails'
      required:
      - code
      - error
  securitySchemes:
    apiKey:
      scheme: bearer
      bearerFormat: API Key
      type: http
      description: Enter your API key
externalDocs:
  description: API Stock documentation
  url: https://docs.api-stock.com
x-refined-from:
- api-stock-com-openapi.json
- api-stock-com-openapi.json