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

# Create a message

> Anthropic Messages API compatible endpoint. Generates a model response for the supplied conversation. Authentication accepts either the bearer `Authorization: Bearer <key>` header (SambaNova SDK default) or the `x-api-key` header (Anthropic SDK default); the same API key is used in both cases. When `stream: true` is set, the response is a sequence of Server-Sent Events whose payloads conform to `MessageStreamEvent`; otherwise the response is a single `Message` object.



## OpenAPI

````yaml https://app.stainless.com/api/spec/documented/sambanova/openapi.documented.yml post /messages
openapi: 3.1.1
info:
  title: SambaNova cloud API
  description: SambaNova cloud API Specification
  version: 1.2.0
  termsOfService: https://sambanova.ai/cloud-end-user-license-agreement
  contact:
    email: info@sambanova.ai
    name: SambaNova information
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
servers:
  - url: https://api.sambanova.ai/v1
security:
  - api_key: []
externalDocs:
  description: Find out more in the official SambaNova docs
  url: https://docs.sambanova.ai/docs/en/api-reference/overview
paths:
  /messages:
    post:
      tags:
        - Messages
      summary: Create a message
      description: >-
        Anthropic Messages API compatible endpoint. Generates a model response
        for the supplied conversation. Authentication accepts either the bearer
        `Authorization: Bearer <key>` header (SambaNova SDK default) or the
        `x-api-key` header (Anthropic SDK default); the same API key is used in
        both cases. When `stream: true` is set, the response is a sequence of
        Server-Sent Events whose payloads conform to `MessageStreamEvent`;
        otherwise the response is a single `Message` object.
      operationId: createMessage
      parameters:
        - in: header
          name: anthropic-version
          required: false
          description: >-
            Anthropic API version header sent by the official `anthropic` SDK.
            Accepted (any value) but currently has no effect on response shape —
            included for drop-in SDK compatibility.
          schema:
            title: Anthropic Version
            type: string
            example: '2023-06-01'
      requestBody:
        required: true
        description: Message creation parameters.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MessageCreateRequest'
      responses:
        '200':
          description: >-
            Successful response. Returns a `Message` object (non-streaming), or
            a stream of Server-Sent Events whose payloads conform to
            `MessageStreamEvent` ending with a `message_stop` event (when
            `stream: true`).
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Message'
                  - $ref: '#/components/schemas/MessageStreamEvent'
        '400':
          description: >-
            Bad Request — `invalid_request_error`. Returned for missing or
            invalid parameters, unsupported feature flags (e.g. `thinking` with
            `type:"enabled"` or `"adaptive"`), unsupported tool types
            (`web_search`, `code_execution`, `bash`, `text_editor`, `memory`,
            `tool_search` variants), image source `type:"url"`, `document`
            content blocks, or non-object request bodies.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageErrorResponse'
        '401':
          description: Unauthorized — `authentication_error`. Invalid or missing API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageErrorResponse'
        '403':
          description: >-
            Forbidden — `permission_error`. API key lacks access to the
            requested resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageErrorResponse'
        '404':
          description: >-
            Not Found — `not_found_error`. Model does not exist or is not
            accessible.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageErrorResponse'
        '413':
          description: >-
            Payload Too Large — `request_too_large`. Request exceeds the maximum
            allowed size.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageErrorResponse'
        '429':
          description: Too Many Requests — `rate_limit_error`. Rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageErrorResponse'
        '500':
          description: >-
            Internal Server Error — `api_error`. Unexpected issue on the server
            side.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageErrorResponse'
        '501':
          description: >-
            Not Implemented — `not_implemented_error`. Currently returned when
            `stream: true` is set, until streaming support lands (PRD Phase 4).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageErrorResponse'
        '503':
          description: >-
            Service Unavailable — `overloaded_error`. Backend is temporarily
            over capacity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageErrorResponse'
      security:
        - api_key: []
        - x_api_key: []
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import SambaNova from 'sambanova';

            const client = new SambaNova({
              apiKey: process.env['SAMBANOVA_API_KEY'], // This is the default and can be omitted
            });

            const message = await client.messages.create({
              max_tokens: 1024,
              messages: [{ content: 'Hello, Claude!', role: 'user' }],
              model: 'DeepSeek-V3.1',
            });

            console.log(message);
        - lang: Python
          source: |-
            import os
            from sambanova import SambaNova

            client = SambaNova(
                api_key=os.environ.get("SAMBANOVA_API_KEY"),  # This is the default and can be omitted
            )
            for message in client.messages.create(
                max_tokens=1024,
                messages=[{
                    "content": "Hello, Claude!",
                    "role": "user",
                }],
                model="DeepSeek-V3.1",
            ):
              print(message)
components:
  schemas:
    MessageCreateRequest:
      title: Message Create Request
      type: object
      description: >-
        Request body for `POST /messages`. Wire-compatible with the official
        Anthropic Messages API. Required fields: `model`, `max_tokens`,
        `messages`.
      additionalProperties: true
      properties:
        model:
          title: Model
          description: >-
            The model ID to use (e.g. gpt-oss-120b).  See available
            [models](https://docs.sambanova.ai/docs/en/models/sambacloud-models)
          anyOf:
            - type: string
            - enum:
                - Meta-Llama-3.3-70B-Instruct
                - Meta-Llama-3.2-1B-Instruct
                - Meta-Llama-3.2-3B-Instruct
                - Llama-3.2-11B-Vision-Instruct
                - Llama-3.2-90B-Vision-Instruct
                - Meta-Llama-3.1-8B-Instruct
                - Meta-Llama-3.1-70B-Instruct
                - Meta-Llama-3.1-405B-Instruct
                - Qwen2.5-Coder-32B-Instruct
                - Qwen2.5-72B-Instruct
                - QwQ-32B-Preview
                - Meta-Llama-Guard-3-8B
                - DeepSeek-R1
                - DeepSeek-R1-0528
                - DeepSeek-V3-0324
                - DeepSeek-V3.1
                - DeepSeek-V3.1-cb
                - DeepSeek-V3.1-Terminus
                - DeepSeek-V3.2
                - DeepSeek-R1-Distill-Llama-70B
                - Llama-4-Maverick-17B-128E-Instruct
                - Llama-4-Scout-17B-16E-Instruct
                - Qwen3-32B
                - Qwen3-235B
                - Llama-3.3-Swallow-70B-Instruct-v0.4
                - gpt-oss-120b
                - ALLaM-7B-Instruct-preview
                - MiniMax-M2.5
                - MiniMax-M2.7
                - gemma-3-12b-it
          example: gpt-oss-120b
        max_tokens:
          title: Max Tokens
          type: integer
          minimum: 1
          description: >-
            Maximum number of tokens to generate. The combined input + output
            token count is bounded by the model's context window.
          example: 1024
        messages:
          title: Messages
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/MessageInputMessage'
          description: Conversation turns.
        system:
          $ref: '#/components/schemas/MessageSystemPrompt'
        temperature:
          title: Temperature
          type: number
          minimum: 0
          maximum: 2
          nullable: true
          description: >-
            Sampling temperature in `[0.0, 2.0]`. Higher values produce more
            random output, lower values more deterministic. Adjust only one of
            `temperature`, `top_p`, `top_k`.
          example: 1
        top_p:
          title: Top P
          type: number
          minimum: 0
          maximum: 1
          nullable: true
          description: >-
            Nucleus sampling. Considers tokens with cumulative probability mass
            up to `top_p`.
        top_k:
          title: Top K
          type: integer
          minimum: 0
          nullable: true
          description: >-
            Top-k sampling. Considers only the K most likely tokens at each
            step. Set to 0 to disable.
        stop_sequences:
          title: Stop Sequences
          type: array
          items:
            type: string
          nullable: true
          description: Custom strings that, when generated, cause the model to stop.
        stream:
          title: Stream
          type: boolean
          default: false
          nullable: true
          description: >-
            If true, the response is a sequence of Server-Sent Events whose
            payloads conform to `MessageStreamEvent`.
        metadata:
          $ref: '#/components/schemas/MessageMetadata'
        thinking:
          $ref: '#/components/schemas/MessageThinkingConfig'
        tools:
          title: Tools
          type: array
          items:
            $ref: '#/components/schemas/MessageTool'
          nullable: true
          description: Tool definitions the model may call.
        tool_choice:
          allOf:
            - $ref: '#/components/schemas/MessageToolChoice'
          nullable: true
          description: Controls how the model selects from `tools`.
        service_tier:
          title: Service Tier
          type: string
          enum:
            - auto
            - standard_only
          nullable: true
          description: 'Service-tier preference. **In v1**: silently dropped'
        container:
          title: Container
          type: string
          nullable: true
          description: >-
            Existing code-execution container ID to reuse. **In v1**: silently
            dropped
      required:
        - model
        - max_tokens
        - messages
      example:
        model: DeepSeek-V3.1
        max_tokens: 1024
        messages:
          - role: user
            content: Hello, Claude!
    Message:
      title: Message
      type: object
      description: >-
        Non-streaming response from `POST /messages`. Wire-compatible with the
        official Anthropic Messages API.
      properties:
        id:
          type: string
          description: Unique identifier for this message.
        type:
          type: string
          enum:
            - message
          const: message
        role:
          type: string
          enum:
            - assistant
          const: assistant
        content:
          type: array
          items:
            $ref: '#/components/schemas/MessageOutputContentBlock'
        model:
          type: string
          description: Model that produced the response.
        stop_reason:
          allOf:
            - $ref: '#/components/schemas/MessageStopReason'
          nullable: true
        stop_sequence:
          type: string
          nullable: true
          description: >-
            The matched stop sequence that triggered termination. Present when
            `stop_reason` is `stop_sequence`; `null` otherwise.
        stop_details:
          allOf:
            - $ref: '#/components/schemas/MessageStopDetails'
          nullable: true
        usage:
          $ref: '#/components/schemas/MessageUsage'
        container:
          allOf:
            - $ref: '#/components/schemas/MessageContainer'
          nullable: true
      required:
        - id
        - type
        - role
        - content
        - model
        - stop_reason
        - usage
    MessageStreamEvent:
      title: Message Stream Event
      description: >-
        Discriminated union of SSE events emitted during a streaming `POST
        /messages` call. Event order: `message_start` -> (`content_block_start`
        -> `content_block_delta`×N -> `content_block_stop`) × blocks ->
        `message_delta` -> `message_stop`. A `ping` may appear at any point; an
        `error` event terminates the stream.
      oneOf:
        - $ref: '#/components/schemas/MessageStartEvent'
        - $ref: '#/components/schemas/MessageContentBlockStartEvent'
        - $ref: '#/components/schemas/MessageContentBlockDeltaEvent'
        - $ref: '#/components/schemas/MessageContentBlockStopEvent'
        - $ref: '#/components/schemas/MessageDeltaEvent'
        - $ref: '#/components/schemas/MessageStopEvent'
        - $ref: '#/components/schemas/MessagePingEvent'
        - $ref: '#/components/schemas/MessageStreamErrorEvent'
      discriminator:
        propertyName: type
        mapping:
          message_start:
            $ref: '#/components/schemas/MessageStartEvent'
          content_block_start:
            $ref: '#/components/schemas/MessageContentBlockStartEvent'
          content_block_delta:
            $ref: '#/components/schemas/MessageContentBlockDeltaEvent'
          content_block_stop:
            $ref: '#/components/schemas/MessageContentBlockStopEvent'
          message_delta:
            $ref: '#/components/schemas/MessageDeltaEvent'
          message_stop:
            $ref: '#/components/schemas/MessageStopEvent'
          ping:
            $ref: '#/components/schemas/MessagePingEvent'
          error:
            $ref: '#/components/schemas/MessageStreamErrorEvent'
    MessageErrorResponse:
      title: Message Error Response
      type: object
      description: >-
        Top-level error envelope returned by the Messages API on any non-2xx
        response. Shape matches Anthropic's wire format. This envelope is used
        ONLY on `/messages` and `/messages/count_tokens`
      properties:
        type:
          title: Type
          type: string
          description: Always `error` for error envelopes.
          enum:
            - error
          const: error
        error:
          $ref: '#/components/schemas/MessageError'
        request_id:
          title: Request Id
          type: string
          description: >-
            Opaque request identifier echoed by the server, useful for
            correlating client-side failures with server-side logs.
          nullable: true
      required:
        - type
        - error
    MessageInputMessage:
      title: Message Input Message
      type: object
      description: A turn in the conversation.
      properties:
        role:
          type: string
          enum:
            - user
            - assistant
          description: >-
            Conversational role. `user` for the human-side turn, `assistant` for
            prior model output.
        content:
          anyOf:
            - type: string
            - title: Content Block Array
              type: array
              items:
                $ref: '#/components/schemas/MessageInputContentBlock'
      required:
        - role
        - content
    MessageSystemPrompt:
      title: Message System Prompt
      description: >-
        System prompt for the conversation. Accepts either a single string (most
        common) or an array of text blocks (used when individual segments need
        `cache_control` markers). Multiple text blocks are joined with newlines
        and prepended to the conversation as a `role: system` message.
      anyOf:
        - type: string
        - title: System Text Block Array
          type: array
          items:
            $ref: '#/components/schemas/MessageSystemTextBlock'
    MessageMetadata:
      title: Message Metadata
      type: object
      description: >-
        Free-form metadata attached to the request. Currently only `user_id`
        Additional fields are accepted but ignored.
      properties:
        user_id:
          title: User Id
          type: string
          description: >-
            External identifier for the end-user making the request. Mapped
            internally to the Chat Completions `user` field.
          nullable: true
      additionalProperties: true
    MessageThinkingConfig:
      title: Message Thinking Config
      description: >-
        Controls Anthropic-style extended thinking. **In v1**: only
        `type:"disabled"` is silently accepted as a no-op; `type:"enabled"` and
        `type:"adaptive"` return a 400 `invalid_request_error`
        (`unsupported_parameter`).
      oneOf:
        - $ref: '#/components/schemas/MessageThinkingDisabled'
        - $ref: '#/components/schemas/MessageThinkingEnabled'
        - $ref: '#/components/schemas/MessageThinkingAdaptive'
      discriminator:
        propertyName: type
        mapping:
          disabled:
            $ref: '#/components/schemas/MessageThinkingDisabled'
          enabled:
            $ref: '#/components/schemas/MessageThinkingEnabled'
          adaptive:
            $ref: '#/components/schemas/MessageThinkingAdaptive'
    MessageTool:
      title: Message Tool
      type: object
      description: >-
        User-defined function tool definition. Only custom function tools are
        supported (Anthropic's `type:"custom"` style or the absent-type Beta
        style). Anthropic-hosted server tools (`web_search`, `code_execution`,
        `bash`, `text_editor`, `memory`, `tool_search` variants) return 400
        `unsupported_tool_type` if sent.
      properties:
        name:
          type: string
          description: Tool name. Must match `^[a-zA-Z0-9_-]+$`.
        type:
          type: string
          enum:
            - custom
          nullable: true
          description: >-
            Tool-type discriminator. May be omitted (defaults to custom) or set
            to `custom`. Other values return 400 `unsupported_tool_type`.
        description:
          type: string
          nullable: true
          description: Human-readable description of when the tool should be used.
        input_schema:
          type: object
          additionalProperties: true
          nullable: true
          description: >-
            JSON Schema describing the tool's expected input. Required by the
            Anthropic spec; accepted as optional by SambaNova.
        cache_control:
          allOf:
            - $ref: '#/components/schemas/MessageCacheControl'
          nullable: true
          description: >-
            Silently dropped on tool definitions (only content and system cache
            markers participate in caching).
        input_examples:
          type: array
          items:
            type: object
            additionalProperties: true
          nullable: true
          description: Silently dropped.
        allowed_callers:
          type: array
          items:
            type: string
          nullable: true
          description: Silently dropped.
        defer_loading:
          type: boolean
          nullable: true
          description: Silently dropped.
        eager_input_streaming:
          type: boolean
          nullable: true
          description: Silently dropped.
        strict:
          type: boolean
          nullable: true
          description: Silently dropped.
      required:
        - name
    MessageToolChoice:
      title: Message Tool Choice
      description: How the model should choose from the provided tools.
      oneOf:
        - $ref: '#/components/schemas/MessageToolChoiceAuto'
        - $ref: '#/components/schemas/MessageToolChoiceAny'
        - $ref: '#/components/schemas/MessageToolChoiceNone'
        - $ref: '#/components/schemas/MessageToolChoiceTool'
      discriminator:
        propertyName: type
        mapping:
          auto:
            $ref: '#/components/schemas/MessageToolChoiceAuto'
          any:
            $ref: '#/components/schemas/MessageToolChoiceAny'
          none:
            $ref: '#/components/schemas/MessageToolChoiceNone'
          tool:
            $ref: '#/components/schemas/MessageToolChoiceTool'
    MessageOutputContentBlock:
      title: Message Output Content Block
      description: Typed content block in the model's response.
      oneOf:
        - $ref: '#/components/schemas/MessageOutputTextBlock'
        - $ref: '#/components/schemas/MessageOutputToolUseBlock'
        - $ref: '#/components/schemas/MessageOutputThinkingBlock'
        - $ref: '#/components/schemas/MessageOutputRedactedThinkingBlock'
        - $ref: '#/components/schemas/MessageOutputServerToolUseBlock'
        - $ref: '#/components/schemas/MessageOutputWebSearchToolResultBlock'
        - $ref: '#/components/schemas/MessageOutputWebFetchToolResultBlock'
        - $ref: '#/components/schemas/MessageOutputCodeExecutionToolResultBlock'
        - $ref: '#/components/schemas/MessageOutputBashCodeExecutionToolResultBlock'
        - $ref: >-
            #/components/schemas/MessageOutputTextEditorCodeExecutionToolResultBlock
        - $ref: '#/components/schemas/MessageOutputToolSearchToolResultBlock'
        - $ref: '#/components/schemas/MessageOutputContainerUploadBlock'
      discriminator:
        propertyName: type
        mapping:
          text:
            $ref: '#/components/schemas/MessageOutputTextBlock'
          tool_use:
            $ref: '#/components/schemas/MessageOutputToolUseBlock'
          thinking:
            $ref: '#/components/schemas/MessageOutputThinkingBlock'
          redacted_thinking:
            $ref: '#/components/schemas/MessageOutputRedactedThinkingBlock'
          server_tool_use:
            $ref: '#/components/schemas/MessageOutputServerToolUseBlock'
          web_search_tool_result:
            $ref: '#/components/schemas/MessageOutputWebSearchToolResultBlock'
          web_fetch_tool_result:
            $ref: '#/components/schemas/MessageOutputWebFetchToolResultBlock'
          code_execution_tool_result:
            $ref: '#/components/schemas/MessageOutputCodeExecutionToolResultBlock'
          bash_code_execution_tool_result:
            $ref: '#/components/schemas/MessageOutputBashCodeExecutionToolResultBlock'
          text_editor_code_execution_tool_result:
            $ref: >-
              #/components/schemas/MessageOutputTextEditorCodeExecutionToolResultBlock
          tool_search_tool_result:
            $ref: '#/components/schemas/MessageOutputToolSearchToolResultBlock'
          container_upload:
            $ref: '#/components/schemas/MessageOutputContainerUploadBlock'
    MessageStopReason:
      title: Message Stop Reason
      type: string
      description: >-
        Reason the model stopped generating. SambaNova emits `end_turn`,
        `max_tokens`, `tool_use`, and `stop_sequence`. The remaining values are
        defined for Anthropic SDK type-parity but never returned: `pause_turn`
        (server-tool loop limit, not produced); `refusal` (content filter, not
        exposed); `model_context_window_exceeded` (folded to `max_tokens`).
      enum:
        - end_turn
        - max_tokens
        - tool_use
        - pause_turn
        - refusal
        - stop_sequence
        - model_context_window_exceeded
    MessageStopDetails:
      title: Message Stop Details
      type: object
      description: >-
        Refusal stop details. Anthropic compatibility only — `refusal` is never
        emitted as a stop_reason by SambaNova (content filtering is not exposed
        at the API layer).
      properties:
        type:
          type: string
          enum:
            - refusal
          const: refusal
        category:
          type: string
          enum:
            - cyber
            - bio
      required:
        - type
    MessageUsage:
      title: Message Usage
      type: object
      description: Token accounting for the request.
      properties:
        input_tokens:
          type: integer
          description: Total tokens in the prompt (system + messages + tools).
        output_tokens:
          type: integer
          description: Total tokens generated by the model.
        cache_creation_input_tokens:
          type: integer
          nullable: true
          description: >-
            Tokens written to prompt cache. Absent in v1; emitted once prompt
            caching wiring lands (CP-2897).
        cache_read_input_tokens:
          type: integer
          nullable: true
          description: >-
            Tokens read from prompt cache. Absent in v1; emitted once prompt
            caching wiring lands (CP-2897).
        server_tool_use:
          type: object
          additionalProperties: true
          nullable: true
          description: >-
            Server-tool usage metrics (e.g. `web_search_requests`). Anthropic
            compatibility only — SambaNova does not run server tools, so this
            field is never emitted.
        service_tier:
          type: string
          nullable: true
          description: >-
            Service tier that processed the request. Anthropic compatibility
            only — SambaNova is single-tier and never emits this field.
        cache_creation:
          type: object
          additionalProperties: true
          nullable: true
          description: >-
            Anthropic SDK alias for cache write metrics. Always `null` in
            SambaNova responses; use `cache_creation_input_tokens` instead.
        inference_geo:
          type: string
          nullable: true
          description: >-
            Geographic region that served the request. Anthropic compatibility
            only - SambaNova does not expose geo routing, always `null`.
      required:
        - input_tokens
        - output_tokens
    MessageContainer:
      title: Message Container
      type: object
      description: >-
        Code-execution container reference. Anthropic compatibility only —
        SambaNova does not run server-side code execution, so this field is
        never emitted on responses.
      properties:
        id:
          type: string
        expires_at:
          type: string
          description: ISO-8601 timestamp.
      required:
        - id
        - expires_at
    MessageStartEvent:
      title: Message Start Event
      type: object
      description: >-
        First event of a stream. Carries the initial Message envelope (empty
        `content[]`, `stop_reason: null`) and token usage from prompt
        processing.
      properties:
        type:
          type: string
          enum:
            - message_start
          const: message_start
        message:
          $ref: '#/components/schemas/Message'
      required:
        - type
        - message
    MessageContentBlockStartEvent:
      title: Content Block Start Event
      type: object
      description: Opens a new content block. One per block in `content[]`.
      properties:
        type:
          type: string
          enum:
            - content_block_start
          const: content_block_start
        index:
          type: integer
          description: Zero-based index of the block within `content[]`.
        content_block:
          $ref: '#/components/schemas/MessageOutputContentBlock'
      required:
        - type
        - index
        - content_block
    MessageContentBlockDeltaEvent:
      title: Content Block Delta Event
      type: object
      description: Incremental update to the currently open content block.
      properties:
        type:
          type: string
          enum:
            - content_block_delta
          const: content_block_delta
        index:
          type: integer
          description: Zero-based index of the block within `content[]`.
        delta:
          $ref: '#/components/schemas/MessageContentBlockDelta'
      required:
        - type
        - index
        - delta
    MessageContentBlockStopEvent:
      title: Content Block Stop Event
      type: object
      description: Closes the current content block.
      properties:
        type:
          type: string
          enum:
            - content_block_stop
          const: content_block_stop
        index:
          type: integer
          description: Zero-based index of the block within `content[]`.
      required:
        - type
        - index
    MessageDeltaEvent:
      title: Message Delta Event
      type: object
      description: >-
        Penultimate event of the stream. Carries the final `stop_reason`,
        optional `stop_sequence`, and final usage counts.
      properties:
        type:
          type: string
          enum:
            - message_delta
          const: message_delta
        delta:
          type: object
          properties:
            stop_reason:
              $ref: '#/components/schemas/MessageStopReason'
            stop_sequence:
              type: string
              nullable: true
              description: >-
                Custom stop sequence that triggered termination. Field is
                emitted but value is always `null` in v1 (backend collapses
                `StopSequenceHit` and `EndOfText` into the same finish_reason).
            stop_details:
              allOf:
                - $ref: '#/components/schemas/MessageStopDetails'
              nullable: true
              description: >-
                Refusal stop details. Field is emitted but value is always
                `null` in v1 — `refusal` is not produced as a stop_reason.
          required:
            - stop_reason
        usage:
          $ref: '#/components/schemas/MessageDeltaUsage'
      required:
        - type
        - delta
        - usage
    MessageStopEvent:
      title: Message Stop Event
      type: object
      description: Final event of the stream. No fields beyond `type`.
      properties:
        type:
          type: string
          enum:
            - message_stop
          const: message_stop
      required:
        - type
    MessagePingEvent:
      title: Message Ping Event
      type: object
      description: Keepalive heartbeat. May appear at any point in the stream.
      properties:
        type:
          type: string
          enum:
            - ping
          const: ping
      required:
        - type
    MessageStreamErrorEvent:
      title: Message Stream Error Event
      type: object
      description: Streamed error envelope. Terminates the stream.
      properties:
        type:
          type: string
          enum:
            - error
          const: error
        error:
          $ref: '#/components/schemas/MessageError'
      required:
        - type
        - error
    MessageError:
      title: Message Error
      type: object
      description: >-
        Inner error object carried inside a `MessageErrorResponse`. The `type`
        value follows Anthropic's published error taxonomy.
      properties:
        type:
          title: Type
          type: string
          description: Error category. Values follow Anthropic's taxonomy.
          enum:
            - invalid_request_error
            - authentication_error
            - permission_error
            - not_found_error
            - request_too_large
            - rate_limit_error
            - api_error
            - overloaded_error
            - not_implemented_error
        message:
          title: Message
          type: string
          description: Human-readable explanation of the error.
      required:
        - type
        - message
    MessageInputContentBlock:
      title: Message Input Content Block
      description: Typed content block inside a message's `content` array.
      oneOf:
        - $ref: '#/components/schemas/MessageInputTextBlock'
        - $ref: '#/components/schemas/MessageInputImageBlock'
        - $ref: '#/components/schemas/MessageInputVideoBlock'
        - $ref: '#/components/schemas/MessageInputToolUseBlock'
        - $ref: '#/components/schemas/MessageInputToolResultBlock'
        - $ref: '#/components/schemas/MessageInputServerToolUseBlock'
        - $ref: '#/components/schemas/MessageInputSearchResultBlock'
        - $ref: '#/components/schemas/MessageInputWebSearchToolResultBlock'
        - $ref: '#/components/schemas/MessageInputWebFetchToolResultBlock'
        - $ref: '#/components/schemas/MessageInputCodeExecutionToolResultBlock'
        - $ref: '#/components/schemas/MessageInputBashCodeExecutionToolResultBlock'
        - $ref: >-
            #/components/schemas/MessageInputTextEditorCodeExecutionToolResultBlock
        - $ref: '#/components/schemas/MessageInputToolSearchToolResultBlock'
        - $ref: '#/components/schemas/MessageInputThinkingBlock'
        - $ref: '#/components/schemas/MessageInputRedactedThinkingBlock'
        - $ref: '#/components/schemas/MessageInputContainerUploadBlock'
        - $ref: '#/components/schemas/MessageInputDocumentBlock'
      discriminator:
        propertyName: type
        mapping:
          text:
            $ref: '#/components/schemas/MessageInputTextBlock'
          image:
            $ref: '#/components/schemas/MessageInputImageBlock'
          video:
            $ref: '#/components/schemas/MessageInputVideoBlock'
          tool_use:
            $ref: '#/components/schemas/MessageInputToolUseBlock'
          tool_result:
            $ref: '#/components/schemas/MessageInputToolResultBlock'
          server_tool_use:
            $ref: '#/components/schemas/MessageInputServerToolUseBlock'
          search_result:
            $ref: '#/components/schemas/MessageInputSearchResultBlock'
          web_search_tool_result:
            $ref: '#/components/schemas/MessageInputWebSearchToolResultBlock'
          web_fetch_tool_result:
            $ref: '#/components/schemas/MessageInputWebFetchToolResultBlock'
          code_execution_tool_result:
            $ref: '#/components/schemas/MessageInputCodeExecutionToolResultBlock'
          bash_code_execution_tool_result:
            $ref: '#/components/schemas/MessageInputBashCodeExecutionToolResultBlock'
          text_editor_code_execution_tool_result:
            $ref: >-
              #/components/schemas/MessageInputTextEditorCodeExecutionToolResultBlock
          tool_search_tool_result:
            $ref: '#/components/schemas/MessageInputToolSearchToolResultBlock'
          thinking:
            $ref: '#/components/schemas/MessageInputThinkingBlock'
          redacted_thinking:
            $ref: '#/components/schemas/MessageInputRedactedThinkingBlock'
          container_upload:
            $ref: '#/components/schemas/MessageInputContainerUploadBlock'
          document:
            $ref: '#/components/schemas/MessageInputDocumentBlock'
    MessageSystemTextBlock:
      title: Message System Text Block
      type: object
      description: >-
        A text segment within a structured `system` prompt array. Multiple text
        blocks are concatenated (with newlines) and prepended to the
        conversation as a `role: system` message at the chat-completions layer.
      properties:
        type:
          const: text
          enum:
            - text
          title: Type
          type: string
        text:
          title: Text
          type: string
          description: Plain-text content of the system prompt segment.
        cache_control:
          $ref: '#/components/schemas/MessageCacheControl'
        citations:
          title: Citations
          type: array
          description: 'Optional citations. **In v1**: silently dropped'
          items:
            type: object
            additionalProperties: true
          nullable: true
      required:
        - type
        - text
    MessageThinkingDisabled:
      title: Message Thinking Disabled
      type: object
      description: >-
        Disables Anthropic-style extended thinking. **In v1**: silently accepted
        as a no-op
      properties:
        type:
          title: Type
          type: string
          enum:
            - disabled
          const: disabled
      required:
        - type
    MessageThinkingEnabled:
      title: Message Thinking Enabled
      type: object
      description: >-
        Enables Anthropic-style extended thinking with a fixed budget. **In
        v1**: returns a 400 `invalid_request_error` (`unsupported_parameter`).
      properties:
        type:
          title: Type
          type: string
          enum:
            - enabled
          const: enabled
        budget_tokens:
          title: Budget Tokens
          type: integer
          minimum: 1024
          description: >-
            Maximum tokens the model may spend on extended thinking before
            producing the final answer.
      required:
        - type
        - budget_tokens
    MessageThinkingAdaptive:
      title: Message Thinking Adaptive
      type: object
      description: >-
        Enables Anthropic-style adaptive extended thinking. **In v1**: returns a
        400 `invalid_request_error` (`unsupported_parameter`).
      properties:
        type:
          title: Type
          type: string
          enum:
            - adaptive
          const: adaptive
        budget_tokens:
          title: Budget Tokens
          type: integer
          minimum: 1024
          nullable: true
          description: >-
            Optional upper bound on tokens spent on adaptive thinking. When
            omitted, the backend chooses based on prompt complexity.
      required:
        - type
    MessageCacheControl:
      title: Message Cache Control
      type: object
      description: >-
        Marks the preceding content block (or system text block) as a prompt-
        cache breakpoint. Marker positions are collected by the adapter; their
        wiring into the router's longest-prefix matching **In v1**: position is
        recorded; the `ttl` value is ignored.
      properties:
        type:
          title: Type
          type: string
          enum:
            - ephemeral
          const: ephemeral
          description: Cache breakpoint type. Only `ephemeral` is supported by Anthropic.
        ttl:
          title: TTL
          type: string
          description: >-
            Optional time-to-live hint (e.g. `"5m"`, `"1h"`). **Currently
            ignored** in v1
          nullable: true
      required:
        - type
    MessageToolChoiceAuto:
      title: Message Tool Choice (Auto)
      type: object
      description: Let the model decide whether and which tool to use.
      properties:
        type:
          type: string
          enum:
            - auto
          const: auto
        disable_parallel_tool_use:
          type: boolean
          nullable: true
          description: Silently dropped.
      required:
        - type
    MessageToolChoiceAny:
      title: Message Tool Choice (Any)
      type: object
      description: Require the model to call one of the provided tools.
      properties:
        type:
          type: string
          enum:
            - any
          const: any
        disable_parallel_tool_use:
          type: boolean
          nullable: true
          description: Silently dropped.
      required:
        - type
    MessageToolChoiceNone:
      title: Message Tool Choice (None)
      type: object
      description: Forbid the model from calling any tool.
      properties:
        type:
          type: string
          enum:
            - none
          const: none
      required:
        - type
    MessageToolChoiceTool:
      title: Message Tool Choice (Tool)
      type: object
      description: Force the model to call a specific tool by name.
      properties:
        type:
          type: string
          enum:
            - tool
          const: tool
        name:
          type: string
          description: Name of the required tool.
        disable_parallel_tool_use:
          type: boolean
          nullable: true
          description: Silently dropped.
      required:
        - type
        - name
    MessageOutputTextBlock:
      title: Message Output Text Block
      type: object
      description: Plain-text segment of the model's response.
      properties:
        type:
          type: string
          enum:
            - text
          const: text
        text:
          type: string
        citations:
          type: array
          items:
            type: object
            additionalProperties: true
          nullable: true
          description: Not emitted in v1.
      required:
        - type
        - text
    MessageOutputToolUseBlock:
      title: Message Output Tool Use Block
      type: object
      description: Tool call generated by the model.
      properties:
        type:
          type: string
          enum:
            - tool_use
          const: tool_use
        id:
          type: string
          description: Unique identifier for this tool call.
        name:
          type: string
          description: Name of the tool being called.
        input:
          type: object
          additionalProperties: true
          description: Tool inputs as a JSON object.
        caller:
          type: object
          additionalProperties: true
          nullable: true
          description: Anthropic routing metadata. Always `null` in SambaNova responses.
      required:
        - type
        - id
        - name
        - input
    MessageOutputThinkingBlock:
      title: Message Output Thinking Block
      type: object
      description: Extended-reasoning trace from the model. Emitted by reasoning models.
      properties:
        type:
          type: string
          enum:
            - thinking
          const: thinking
        thinking:
          type: string
        signature:
          type: string
          nullable: true
      required:
        - type
        - thinking
    MessageOutputRedactedThinkingBlock:
      title: Message Output Redacted Thinking Block
      type: object
      description: >-
        Anthropic compatibility only — SambaNova does not produce encrypted
        thinking output. Never emitted in responses.
      properties:
        type:
          type: string
          enum:
            - redacted_thinking
          const: redacted_thinking
        data:
          type: string
      required:
        - type
        - data
    MessageOutputServerToolUseBlock:
      title: Message Output Server Tool Use Block
      type: object
      description: >-
        Anthropic compatibility only — SambaNova does not run server-side tools.
        Never emitted in responses; defined for Anthropic SDK type-parity.
      properties:
        type:
          type: string
          enum:
            - server_tool_use
          const: server_tool_use
        id:
          type: string
        name:
          type: string
        input:
          type: object
          additionalProperties: true
      required:
        - type
        - id
        - name
        - input
    MessageOutputWebSearchToolResultBlock:
      title: Message Output Web Search Tool Result Block
      type: object
      description: >-
        Anthropic compatibility only — SambaNova does not run server-side
        `web_search`. Never emitted in responses.
      properties:
        type:
          type: string
          enum:
            - web_search_tool_result
          const: web_search_tool_result
        tool_use_id:
          type: string
        content:
          type: array
          items:
            type: object
            additionalProperties: true
      required:
        - type
        - tool_use_id
        - content
    MessageOutputWebFetchToolResultBlock:
      title: Message Output Web Fetch Tool Result Block
      type: object
      description: >-
        Anthropic compatibility only — SambaNova does not run server-side
        `web_fetch`. Never emitted in responses.
      properties:
        type:
          type: string
          enum:
            - web_fetch_tool_result
          const: web_fetch_tool_result
        tool_use_id:
          type: string
        content:
          type: object
          additionalProperties: true
      required:
        - type
        - tool_use_id
        - content
    MessageOutputCodeExecutionToolResultBlock:
      title: Message Output Code Execution Tool Result Block
      type: object
      description: >-
        Anthropic compatibility only — SambaNova does not run server-side
        `code_execution`. Never emitted in responses.
      properties:
        type:
          type: string
          enum:
            - code_execution_tool_result
          const: code_execution_tool_result
        tool_use_id:
          type: string
        content:
          type: object
          additionalProperties: true
      required:
        - type
        - tool_use_id
        - content
    MessageOutputBashCodeExecutionToolResultBlock:
      title: Message Output Bash Code Execution Tool Result Block
      type: object
      description: >-
        Anthropic compatibility only — SambaNova does not run server-side bash
        code execution. Never emitted in responses.
      properties:
        type:
          type: string
          enum:
            - bash_code_execution_tool_result
          const: bash_code_execution_tool_result
        tool_use_id:
          type: string
        content:
          type: object
          additionalProperties: true
      required:
        - type
        - tool_use_id
        - content
    MessageOutputTextEditorCodeExecutionToolResultBlock:
      title: Message Output Text Editor Code Execution Tool Result Block
      type: object
      description: >-
        Anthropic compatibility only — SambaNova does not run server-side
        text-editor code execution. Never emitted in responses.
      properties:
        type:
          type: string
          enum:
            - text_editor_code_execution_tool_result
          const: text_editor_code_execution_tool_result
        tool_use_id:
          type: string
        content:
          type: object
          additionalProperties: true
      required:
        - type
        - tool_use_id
        - content
    MessageOutputToolSearchToolResultBlock:
      title: Message Output Tool Search Tool Result Block
      type: object
      description: >-
        Anthropic compatibility only — SambaNova does not run server-side
        `tool_search`. Never emitted in responses.
      properties:
        type:
          type: string
          enum:
            - tool_search_tool_result
          const: tool_search_tool_result
        tool_use_id:
          type: string
        content:
          type: object
          additionalProperties: true
      required:
        - type
        - tool_use_id
        - content
    MessageOutputContainerUploadBlock:
      title: Message Output Container Upload Block
      type: object
      description: >-
        Anthropic compatibility only — SambaNova does not produce
        container_upload blocks (these come from Anthropic's server-side
        `code_execution` tool). Never emitted in responses.
      properties:
        type:
          type: string
          enum:
            - container_upload
          const: container_upload
        file_id:
          type: string
      required:
        - type
        - file_id
    MessageContentBlockDelta:
      title: Content Block Delta
      description: Incremental update to an open content block.
      oneOf:
        - $ref: '#/components/schemas/MessageContentBlockTextDelta'
        - $ref: '#/components/schemas/MessageContentBlockInputJsonDelta'
        - $ref: '#/components/schemas/MessageContentBlockThinkingDelta'
        - $ref: '#/components/schemas/MessageContentBlockSignatureDelta'
      discriminator:
        propertyName: type
        mapping:
          text_delta:
            $ref: '#/components/schemas/MessageContentBlockTextDelta'
          input_json_delta:
            $ref: '#/components/schemas/MessageContentBlockInputJsonDelta'
          thinking_delta:
            $ref: '#/components/schemas/MessageContentBlockThinkingDelta'
          signature_delta:
            $ref: '#/components/schemas/MessageContentBlockSignatureDelta'
    MessageDeltaUsage:
      title: Message Delta Usage
      type: object
      description: >-
        Final token accounting emitted in the closing `message_delta` event of a
        stream.
      properties:
        output_tokens:
          type: integer
          description: Total tokens generated (final count).
        input_tokens:
          type: integer
          nullable: true
          description: Total tokens in the prompt (echoed from `message_start`).
        cache_creation_input_tokens:
          type: integer
          nullable: true
          description: Tokens written to prompt cache. Absent in v1;
        cache_read_input_tokens:
          type: integer
          nullable: true
          description: Tokens read from prompt cache. Absent in v1;
        server_tool_use:
          type: object
          additionalProperties: true
          nullable: true
          description: >-
            Server-tool usage metrics. Anthropic compatibility only — SambaNova
            does not run server tools, so this field is never emitted.
      required:
        - output_tokens
    MessageInputTextBlock:
      title: Message Input Text Block
      type: object
      description: Plain-text segment of a message.
      properties:
        type:
          type: string
          enum:
            - text
          const: text
        text:
          type: string
        cache_control:
          $ref: '#/components/schemas/MessageCacheControl'
        citations:
          title: Citations
          type: array
          items:
            type: object
            additionalProperties: true
          nullable: true
      required:
        - type
        - text
    MessageInputImageBlock:
      title: Message Input Image Block
      type: object
      description: >-
        Image content. Only `source.type:"base64"` is supported in v1; URL
        sources return 400.
      properties:
        type:
          type: string
          enum:
            - image
          const: image
        source:
          oneOf:
            - $ref: '#/components/schemas/MessageInputImageSourceBase64'
            - $ref: '#/components/schemas/MessageInputImageSourceUrl'
          discriminator:
            propertyName: type
            mapping:
              base64:
                $ref: '#/components/schemas/MessageInputImageSourceBase64'
              url:
                $ref: '#/components/schemas/MessageInputImageSourceUrl'
        cache_control:
          $ref: '#/components/schemas/MessageCacheControl'
      required:
        - type
        - source
    MessageInputVideoBlock:
      title: Message Input Video Block
      type: object
      description: Video content.
      properties:
        type:
          type: string
          enum:
            - video
          const: video
        source:
          oneOf:
            - $ref: '#/components/schemas/MessageInputVideoSourceBase64'
            - $ref: '#/components/schemas/MessageInputVideoSourceUrl'
          discriminator:
            propertyName: type
            mapping:
              base64:
                $ref: '#/components/schemas/MessageInputVideoSourceBase64'
              url:
                $ref: '#/components/schemas/MessageInputVideoSourceUrl'
        cache_control:
          $ref: '#/components/schemas/MessageCacheControl'
      required:
        - type
        - source
    MessageInputToolUseBlock:
      title: Message Input Tool Use Block
      type: object
      description: A prior assistant turn that invoked a tool.
      properties:
        type:
          type: string
          enum:
            - tool_use
          const: tool_use
        id:
          type: string
          description: >-
            Unique identifier for the tool call (used to correlate
            `tool_result`).
        name:
          type: string
          description: Name of the tool being invoked.
        input:
          type: object
          additionalProperties: true
          description: Tool inputs as a JSON object.
        cache_control:
          $ref: '#/components/schemas/MessageCacheControl'
      required:
        - type
        - id
        - name
        - input
    MessageInputToolResultBlock:
      title: Message Input Tool Result Block
      type: object
      description: Result of a prior tool call.
      properties:
        type:
          type: string
          enum:
            - tool_result
          const: tool_result
        tool_use_id:
          type: string
          description: ID of the `tool_use` block this result corresponds to.
        content:
          anyOf:
            - type: string
            - title: Tool Result Content Array
              type: array
              items:
                $ref: '#/components/schemas/MessageInputToolResultContent'
        is_error:
          type: boolean
          nullable: true
          description: Silently dropped in v1.
        cache_control:
          $ref: '#/components/schemas/MessageCacheControl'
      required:
        - type
        - tool_use_id
    MessageInputServerToolUseBlock:
      title: Message Input Server Tool Use Block
      type: object
      description: >-
        Anthropic compatibility only — SambaNova does not run server-side tools.
        A prior assistant turn that invoked an Anthropic-hosted tool
        (web_search, code_execution, etc.). Accepted in conversation history
        (e.g. replaying an Anthropic-served session) but never originates from a
        SambaNova response. New `server_tool_use`-type tool definitions on
        outgoing requests are rejected with 400 `unsupported_tool_type`.
      properties:
        type:
          type: string
          enum:
            - server_tool_use
          const: server_tool_use
        id:
          type: string
        name:
          type: string
        input:
          type: object
          additionalProperties: true
        cache_control:
          $ref: '#/components/schemas/MessageCacheControl'
      required:
        - type
        - id
        - name
        - input
    MessageInputSearchResultBlock:
      title: Message Input Search Result Block
      type: object
      description: >-
        Inline search result content. In v1 the `title`, `source`, and
        `content[]` text are extracted into a text block; citations are dropped.
      properties:
        type:
          type: string
          enum:
            - search_result
          const: search_result
        title:
          type: string
        source:
          type: string
        content:
          type: array
          items:
            $ref: '#/components/schemas/MessageInputTextBlock'
        citations:
          type: object
          additionalProperties: true
          nullable: true
        cache_control:
          $ref: '#/components/schemas/MessageCacheControl'
      required:
        - type
    MessageInputWebSearchToolResultBlock:
      title: Message Input Web Search Tool Result Block
      type: object
      description: >-
        Anthropic compatibility only — SambaNova does not run server-side
        `web_search`. Echo of a prior Anthropic-served `web_search` tool call;
        accepted in conversation history but never originates from a SambaNova
        response. When present, only `title` (`url`) per result is extracted
        into a tool message.
      properties:
        type:
          type: string
          enum:
            - web_search_tool_result
          const: web_search_tool_result
        tool_use_id:
          type: string
        content:
          type: array
          items:
            type: object
            additionalProperties: true
        cache_control:
          $ref: '#/components/schemas/MessageCacheControl'
      required:
        - type
        - tool_use_id
        - content
    MessageInputWebFetchToolResultBlock:
      title: Message Input Web Fetch Tool Result Block
      type: object
      description: >-
        Anthropic compatibility only — SambaNova does not run server-side
        `web_fetch`. Echo of a prior Anthropic-served `web_fetch` tool call;
        accepted in conversation history but never originates from a SambaNova
        response. When present, only the text content is extracted.
      properties:
        type:
          type: string
          enum:
            - web_fetch_tool_result
          const: web_fetch_tool_result
        tool_use_id:
          type: string
        content:
          type: object
          additionalProperties: true
        cache_control:
          $ref: '#/components/schemas/MessageCacheControl'
      required:
        - type
        - tool_use_id
        - content
    MessageInputCodeExecutionToolResultBlock:
      title: Message Input Code Execution Tool Result Block
      type: object
      description: >-
        Anthropic compatibility only — SambaNova does not run server-side
        `code_execution`. Echo of a prior Anthropic-served `code_execution` tool
        call; accepted in conversation history but never originates from a
        SambaNova response. When present, only `stdout`, `stderr`, and
        `return_code` are extracted; image output is dropped.
      properties:
        type:
          type: string
          enum:
            - code_execution_tool_result
          const: code_execution_tool_result
        tool_use_id:
          type: string
        content:
          type: object
          additionalProperties: true
        cache_control:
          $ref: '#/components/schemas/MessageCacheControl'
      required:
        - type
        - tool_use_id
        - content
    MessageInputBashCodeExecutionToolResultBlock:
      title: Message Input Bash Code Execution Tool Result Block
      type: object
      description: >-
        Anthropic compatibility only — SambaNova does not run server-side bash
        code execution. Echo of a prior Anthropic-served bash tool call;
        accepted in conversation history but never originates from a SambaNova
        response. Same lossy extraction as `code_execution_tool_result`.
      properties:
        type:
          type: string
          enum:
            - bash_code_execution_tool_result
          const: bash_code_execution_tool_result
        tool_use_id:
          type: string
        content:
          type: object
          additionalProperties: true
        cache_control:
          $ref: '#/components/schemas/MessageCacheControl'
      required:
        - type
        - tool_use_id
        - content
    MessageInputTextEditorCodeExecutionToolResultBlock:
      title: Message Input Text Editor Code Execution Tool Result Block
      type: object
      description: >-
        Anthropic compatibility only — SambaNova does not run server-side
        text-editor code execution. Echo of a prior Anthropic-served text-editor
        tool call; accepted in conversation history but never originates from a
        SambaNova response. When present, only file content is extracted;
        metadata (line count, file type) is dropped.
      properties:
        type:
          type: string
          enum:
            - text_editor_code_execution_tool_result
          const: text_editor_code_execution_tool_result
        tool_use_id:
          type: string
        content:
          type: object
          additionalProperties: true
        cache_control:
          $ref: '#/components/schemas/MessageCacheControl'
      required:
        - type
        - tool_use_id
        - content
    MessageInputToolSearchToolResultBlock:
      title: Message Input Tool Search Tool Result Block
      type: object
      description: >-
        Anthropic compatibility only — SambaNova does not run server-side
        `tool_search`. Echo of a prior Anthropic-served `tool_search` tool call;
        accepted in conversation history but never originates from a SambaNova
        response. When present, an empty string is emitted to the tool message
        (no plain-text fields).
      properties:
        type:
          type: string
          enum:
            - tool_search_tool_result
          const: tool_search_tool_result
        tool_use_id:
          type: string
        content:
          type: object
          additionalProperties: true
        cache_control:
          $ref: '#/components/schemas/MessageCacheControl'
      required:
        - type
        - tool_use_id
        - content
    MessageInputThinkingBlock:
      title: Message Input Thinking Block
      type: object
      description: Extended-reasoning trace from a prior assistant turn.
      properties:
        type:
          type: string
          enum:
            - thinking
          const: thinking
        thinking:
          type: string
        signature:
          type: string
      required:
        - type
        - thinking
        - signature
    MessageInputRedactedThinkingBlock:
      title: Message Input Redacted Thinking Block
      type: object
      description: >-
        Anthropic compatibility only — SambaNova does not produce encrypted
        thinking output. Echo of a prior Anthropic-served response where
        `thinking.display:"omitted"` was set. Accepted in conversation history
        but never originates from a SambaNova response. Silently dropped on
        input.
      properties:
        type:
          type: string
          enum:
            - redacted_thinking
          const: redacted_thinking
        data:
          type: string
      required:
        - type
        - data
    MessageInputContainerUploadBlock:
      title: Message Input Container Upload Block
      type: object
      description: >-
        Anthropic compatibility only — SambaNova does not produce
        container_upload blocks (these come from Anthropic's server-side
        `code_execution` tool). Accepted in conversation history but never
        originates from a SambaNova response. Silently dropped on input.
      properties:
        type:
          type: string
          enum:
            - container_upload
          const: container_upload
        file_id:
          type: string
        cache_control:
          $ref: '#/components/schemas/MessageCacheControl'
      required:
        - type
        - file_id
    MessageInputDocumentBlock:
      title: Message Input Document Block
      type: object
      description: >-
        PDF or document content. **Returns 400** — no document-extraction
        pipeline available.
      properties:
        type:
          type: string
          enum:
            - document
          const: document
        source:
          type: object
          additionalProperties: true
        title:
          type: string
          nullable: true
        context:
          type: string
          nullable: true
        citations:
          type: object
          additionalProperties: true
          nullable: true
        cache_control:
          $ref: '#/components/schemas/MessageCacheControl'
      required:
        - type
        - source
    MessageContentBlockTextDelta:
      title: Content Block Text Delta
      type: object
      description: Incremental text chunk for an open text content block.
      properties:
        type:
          type: string
          enum:
            - text_delta
          const: text_delta
        text:
          type: string
      required:
        - type
        - text
    MessageContentBlockInputJsonDelta:
      title: Content Block Input JSON Delta
      type: object
      description: >-
        Incremental fragment of a tool_use block's `input` JSON. Concatenate
        successive `partial_json` strings to reconstruct the full input object.
      properties:
        type:
          type: string
          enum:
            - input_json_delta
          const: input_json_delta
        partial_json:
          type: string
      required:
        - type
        - partial_json
    MessageContentBlockThinkingDelta:
      title: Content Block Thinking Delta
      type: object
      description: >-
        Incremental thinking chunk for an open thinking block. Emitted by
        reasoning models.
      properties:
        type:
          type: string
          enum:
            - thinking_delta
          const: thinking_delta
        thinking:
          type: string
      required:
        - type
        - thinking
    MessageContentBlockSignatureDelta:
      title: Content Block Signature Delta
      type: object
      description: >-
        Signature for an open thinking block. Emitted at the end of a thinking
        stream (paired with the closing `content_block_stop`); the `signature`
        value may be an empty string when the backend has no signed payload to
        attach.
      properties:
        type:
          type: string
          enum:
            - signature_delta
          const: signature_delta
        signature:
          type: string
      required:
        - type
        - signature
    MessageInputImageSourceBase64:
      title: Message Input Image Source (Base64)
      type: object
      description: Inline image data encoded as base64.
      properties:
        type:
          type: string
          enum:
            - base64
          const: base64
        media_type:
          type: string
          enum:
            - image/jpeg
            - image/png
            - image/webp
          description: MIME type of the image bytes.
        data:
          type: string
          description: Base64-encoded image bytes (no `data:` URI prefix).
      required:
        - type
        - media_type
        - data
    MessageInputImageSourceUrl:
      title: Message Input Image Source (URL)
      type: object
      description: >-
        HTTPS URL pointing to an image. **Returns 400 in v1** — URL fetching is
        blocked. Use `type:"base64"` instead.
      properties:
        type:
          type: string
          enum:
            - url
          const: url
        url:
          type: string
          format: uri
      required:
        - type
        - url
    MessageInputVideoSourceBase64:
      title: Message Input Video Source (Base64)
      type: object
      description: Inline video data encoded as base64.
      properties:
        type:
          type: string
          enum:
            - base64
          const: base64
        media_type:
          type: string
          enum:
            - video/mp4
          description: MIME type of the video bytes.
        data:
          type: string
          description: Base64-encoded video bytes (no `data:` URI prefix).
      required:
        - type
        - media_type
        - data
    MessageInputVideoSourceUrl:
      title: Message Input Video Source (URL)
      type: object
      description: HTTPS URL pointing to a video.
      properties:
        type:
          type: string
          enum:
            - url
          const: url
        url:
          type: string
          format: uri
      required:
        - type
        - url
    MessageInputToolResultContent:
      title: Message Input Tool Result Content
      description: Content of a `tool_result` block. only text is forwarded.
      oneOf:
        - $ref: '#/components/schemas/MessageInputTextBlock'
        - $ref: '#/components/schemas/MessageInputImageBlock'
      discriminator:
        propertyName: type
        mapping:
          text:
            $ref: '#/components/schemas/MessageInputTextBlock'
          image:
            $ref: '#/components/schemas/MessageInputImageBlock'
  securitySchemes:
    api_key:
      type: http
      description: >-
        SambaNova API key, sent as a bearer token in the `Authorization` header
        (`Authorization: Bearer <key>`). Default authentication scheme used by
        the SambaNova SDK across every OpenAI compatible endpoint.
      scheme: bearer
      bearerFormat: apiKey
    x_api_key:
      type: apiKey
      description: >-
        SambaNova API key, sent in the `x-api-key` header. Accepted on the
        Messages API routes (`/messages`, `/messages/count_tokens`) so that
        callers can point the official Anthropic SDK at SambaNova by swapping
        `base_url` — no code changes. The credential value is the same as the
        bearer `api_key` scheme; only the transport differs.
      in: header
      name: x-api-key

````