openapi: 3.1.0
info:
  title: Prism Inference API
  version: 0.1.0
  description: OpenAI Chat Completions, OpenAI Responses, and Anthropic Messages compatible inference.
  termsOfService: https://prisminference.com/terms
  contact:
    name: Prism Support
    url: https://prisminference.com
  x-privacy-policy: https://prisminference.com/privacy
  license:
    name: Proprietary
    identifier: LicenseRef-Proprietary
servers:
  - url: https://api.prisminference.com
security:
  - BearerAuth: []
  - ApiKeyAuth: []
tags:
  - name: OpenAI
    description: OpenAI-compatible inference.
  - name: Models
    description: OpenAI-compatible model discovery.
  - name: Anthropic
    description: Anthropic-compatible inference.
paths:
  /:
    get:
      summary: API information
      operationId: getApiInformation
      security: []
      responses:
        "200":
          description: Prism API metadata and discovery links.
          content:
            application/json:
              schema:
                type: object
                required:
                  - name
                  - documentation
                  - health
                  - models
                properties:
                  name:
                    type: string
                    const: Prism Inference API
                  documentation:
                    type: string
                    format: uri
                  health:
                    type: string
                    const: /health
                  models:
                    type: string
                    const: /models
  /health:
    get:
      summary: Health check
      operationId: getHealth
      security: []
      responses:
        "200":
          description: API availability status.
          content:
            application/json:
              schema:
                type: object
                required:
                  - status
                properties:
                  status:
                    type: string
                    const: ok
  /models:
    get:
      tags:
        - Models
      summary: List models
      operationId: listModels
      security: []
      responses:
        "200":
          description: Models currently available through Prism.
          content:
            application/json:
              schema:
                type: object
                required:
                  - object
                  - data
                properties:
                  object:
                    type: string
                    const: list
                  data:
                    type: array
                    items:
                      $ref: "#/components/schemas/Model"
        default:
          $ref: "#/components/responses/OpenAIError"
  /models/{model}:
    get:
      tags:
        - Models
      summary: Retrieve a model
      operationId: retrieveModel
      security: []
      parameters:
        - name: model
          in: path
          required: true
          schema:
            type: string
      responses:
        "200":
          description: The requested model.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Model"
        "404":
          $ref: "#/components/responses/OpenAIError"
        default:
          $ref: "#/components/responses/OpenAIError"
  /v1/chat/completions:
    post:
      tags:
        - OpenAI
      summary: Create a chat completion
      operationId: createChatCompletion
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ChatCompletionRequest"
      responses:
        "200":
          description: A completion or Server-Sent Event stream.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ChatCompletion"
            text/event-stream:
              schema:
                type: string
        "400":
          $ref: "#/components/responses/OpenAIError"
        "401":
          $ref: "#/components/responses/OpenAIError"
        "413":
          $ref: "#/components/responses/OpenAIError"
        "429":
          $ref: "#/components/responses/OpenAIError"
        default:
          $ref: "#/components/responses/OpenAIError"
  /v1/responses:
    post:
      tags:
        - OpenAI
      summary: Create a response
      operationId: createResponse
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ResponseRequest"
      responses:
        "200":
          description: A response or typed Server-Sent Event stream.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Response"
            text/event-stream:
              schema:
                type: string
        default:
          $ref: "#/components/responses/OpenAIError"
  /v1/messages:
    post:
      tags:
        - Anthropic
      summary: Create a message
      operationId: createMessage
      parameters:
        - $ref: "#/components/parameters/AnthropicVersion"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/MessageRequest"
      responses:
        "200":
          description: A message or Anthropic Server-Sent Event stream.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
            text/event-stream:
              schema:
                type: string
        default:
          $ref: "#/components/responses/AnthropicError"
  /v1/messages/count_tokens:
    post:
      tags:
        - Anthropic
      summary: Count message input tokens
      operationId: countMessageTokens
      parameters:
        - $ref: "#/components/parameters/AnthropicVersion"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/TokenCountRequest"
      responses:
        "200":
          description: Input token count.
          content:
            application/json:
              schema:
                type: object
                required:
                  - input_tokens
                properties:
                  input_tokens:
                    type: integer
                    minimum: 0
        default:
          $ref: "#/components/responses/AnthropicError"
  /v1/models:
    get:
      tags:
        - Models
      summary: List models
      operationId: listModelsOpenAI
      security: []
      responses:
        "200":
          description: Models currently available through Prism.
          content:
            application/json:
              schema:
                type: object
                required:
                  - object
                  - data
                properties:
                  object:
                    type: string
                    const: list
                  data:
                    type: array
                    items:
                      $ref: "#/components/schemas/Model"
        default:
          $ref: "#/components/responses/OpenAIError"
  /v1/models/{model}:
    get:
      tags:
        - Models
      summary: Retrieve a model
      operationId: retrieveModelOpenAI
      security: []
      parameters:
        - name: model
          in: path
          required: true
          schema:
            type: string
      responses:
        "200":
          description: The requested model.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Model"
        "404":
          $ref: "#/components/responses/OpenAIError"
        default:
          $ref: "#/components/responses/OpenAIError"
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
  parameters:
    AnthropicVersion:
      name: anthropic-version
      in: header
      required: true
      schema:
        type: string
        default: "2023-06-01"
  responses:
    OpenAIError:
      description: OpenAI-compatible error.
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/OpenAIError"
    AnthropicError:
      description: Anthropic-compatible error.
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/AnthropicError"
  schemas:
    ModelId:
      type: string
      enum:
        - deepseek-v4.1-flash
        - gemma-4-31b
    ChatCompletionRequest:
      type: object
      required:
        - model
        - messages
      properties:
        model:
          $ref: "#/components/schemas/ModelId"
        messages:
          type: array
          minItems: 1
          description: >-
            User image parts are supported by deepseek-v4.1-flash and gemma-4-31b.
          items:
            $ref: "#/components/schemas/ChatMessage"
        stream:
          type: boolean
          default: false
        stream_options:
          type: object
          properties:
            include_usage:
              type: boolean
        max_tokens:
          type: integer
          minimum: 1
        temperature:
          type: number
          minimum: 0
          maximum: 2
        top_p:
          type: number
          minimum: 0
          maximum: 1
        stop:
          oneOf:
            - type: string
            - type: array
              items:
                type: string
        tools:
          type: array
          items:
            $ref: "#/components/schemas/OpenAITool"
        tool_choice: {}
        response_format:
          type: object
          additionalProperties: true
        reasoning_effort:
          $ref: "#/components/schemas/ReasoningEffort"
        reasoning:
          type: object
          description: >-
            OpenRouter-style reasoning controls. `enabled: false` is equivalent
            to `reasoning_effort: "none"`. When both fields are present,
            `reasoning_effort` wins unless `enabled` is `false`.
          properties:
            enabled:
              type: boolean
            effort:
              $ref: "#/components/schemas/ReasoningEffort"
      additionalProperties: true
    ReasoningEffort:
      type: string
      description: >-
        How much the model reasons before answering. Reasoning is on at `high`
        when no control is sent. `none` disables reasoning so the first token
        is answer text. Reasoning tokens count toward `max_tokens` and
        `usage.completion_tokens`.
      enum:
        - none
        - minimal
        - low
        - medium
        - high
        - xhigh
        - max
    ResponseRequest:
      type: object
      required:
        - model
        - input
      additionalProperties: false
      properties:
        model:
          $ref: "#/components/schemas/ModelId"
        input:
          oneOf:
            - type: string
            - type: array
              minItems: 1
              items:
                $ref: "#/components/schemas/ResponseInputItem"
        instructions:
          type:
            - string
            - "null"
        stream:
          type:
            - boolean
            - "null"
          default: false
        max_output_tokens:
          type:
            - integer
            - "null"
          minimum: 1
        temperature:
          type:
            - number
            - "null"
          minimum: 0
          maximum: 2
        top_p:
          type:
            - number
            - "null"
          minimum: 0
          maximum: 1
        tools:
          type: array
          items:
            $ref: "#/components/schemas/ResponseFunctionTool"
        tool_choice:
          oneOf:
            - type: string
              enum:
                - none
                - auto
                - required
            - type: object
              required:
                - type
                - name
              additionalProperties: false
              properties:
                type:
                  type: string
                  const: function
                name:
                  type: string
        parallel_tool_calls:
          type:
            - boolean
            - "null"
        text:
          type: object
          additionalProperties: false
          properties:
            format:
              type: object
              additionalProperties: true
            verbosity:
              type:
                - string
                - "null"
              enum:
                - low
                - medium
                - high
                - null
        reasoning:
          oneOf:
            - type: "null"
            - type: object
              additionalProperties: false
              properties:
                effort:
                  type:
                    - string
                    - "null"
                  description: >-
                    Reasoning is on at `high` when unset. `none` disables it.
                  enum:
                    - none
                    - low
                    - medium
                    - high
                    - null
                summary:
                  type:
                    - string
                    - "null"
                  enum:
                    - auto
                    - concise
                    - detailed
                    - null
        store:
          type:
            - boolean
            - "null"
          description: Must be false or null.
        background:
          type:
            - boolean
            - "null"
          description: Must be false or null.
        previous_response_id:
          type: "null"
        metadata:
          oneOf:
            - type: "null"
            - type: object
              additionalProperties:
                type: string
        truncation:
          type:
            - string
            - "null"
          enum:
            - auto
            - disabled
            - null
        top_logprobs:
          type:
            - integer
            - "null"
          minimum: 0
          maximum: 20
    ResponseInputItem:
      oneOf:
        - $ref: "#/components/schemas/ResponseMessage"
        - type: object
          required:
            - type
            - call_id
            - name
            - arguments
          additionalProperties: true
          properties:
            type:
              type: string
              const: function_call
            call_id:
              type: string
            name:
              type: string
            arguments:
              type: string
        - type: object
          required:
            - type
            - call_id
            - output
          additionalProperties: true
          properties:
            type:
              type: string
              const: function_call_output
            call_id:
              type: string
            output:
              oneOf:
                - type: string
                - type: array
                  items:
                    type: object
                    additionalProperties: true
        - type: object
          required:
            - type
          additionalProperties: true
          properties:
            type:
              type: string
              const: reasoning
    ResponseFunctionTool:
      type: object
      required:
        - type
        - name
      additionalProperties: false
      properties:
        type:
          type: string
          const: function
        name:
          type: string
        description:
          type:
            - string
            - "null"
        parameters:
          oneOf:
            - type: "null"
            - type: object
              additionalProperties: true
        strict:
          type:
            - boolean
            - "null"
    Response:
      type: object
      required:
        - id
        - object
        - created_at
        - status
        - model
        - output
        - output_text
        - usage
      properties:
        id:
          type: string
        object:
          type: string
          const: response
        created_at:
          type: integer
        completed_at:
          type:
            - integer
            - "null"
        status:
          type: string
          enum:
            - in_progress
            - completed
            - incomplete
            - failed
        model:
          type: string
        output:
          type: array
          items:
            type: object
            additionalProperties: true
        output_text:
          type: string
        usage:
          oneOf:
            - type: "null"
            - $ref: "#/components/schemas/ResponseUsage"
      additionalProperties: true
    ResponseUsage:
      type: object
      required:
        - input_tokens
        - output_tokens
        - total_tokens
      properties:
        input_tokens:
          type: integer
          minimum: 0
        output_tokens:
          type: integer
          minimum: 0
        total_tokens:
          type: integer
          minimum: 0
        input_tokens_details:
          type: object
          properties:
            cached_tokens:
              type: integer
              minimum: 0
        output_tokens_details:
          type: object
          properties:
            reasoning_tokens:
              type: integer
              minimum: 0
    ChatMessage:
      oneOf:
        - type: object
          required:
            - role
            - content
          properties:
            role:
              type: string
              const: user
            content:
              oneOf:
                - type: string
                - type: array
                  minItems: 1
                  items:
                    $ref: "#/components/schemas/ChatContentPart"
          additionalProperties: true
        - type: object
          required:
            - role
            - content
          properties:
            role:
              type: string
              enum:
                - system
                - developer
            content:
              oneOf:
                - type: string
                - type: array
                  minItems: 1
                  items:
                    $ref: "#/components/schemas/ChatTextContentPart"
          additionalProperties: true
        - type: object
          required:
            - role
          properties:
            role:
              type: string
              const: assistant
            content:
              oneOf:
                - type: string
                - type: array
                  minItems: 1
                  items:
                    $ref: "#/components/schemas/ChatTextContentPart"
                - type: "null"
            tool_calls:
              type: array
              items:
                $ref: "#/components/schemas/OpenAIToolCall"
          additionalProperties: true
        - type: object
          required:
            - role
            - content
            - tool_call_id
          properties:
            role:
              type: string
              const: tool
            content:
              type: string
            tool_call_id:
              type: string
          additionalProperties: true
    ChatContentPart:
      oneOf:
        - $ref: "#/components/schemas/ChatTextContentPart"
        - type: object
          required:
            - type
            - image_url
          additionalProperties: false
          properties:
            type:
              type: string
              const: image_url
            image_url:
              type: object
              required:
                - url
              additionalProperties: false
              properties:
                url:
                  $ref: "#/components/schemas/ImageDataUrl"
                detail:
                  type: string
                  enum:
                    - auto
                    - low
                    - high
    ChatTextContentPart:
      type: object
      required:
        - type
        - text
      additionalProperties: false
      properties:
        type:
          type: string
          const: text
        text:
          type: string
    ImageDataUrl:
      type: string
      description: JPEG, PNG, GIF, or WebP base64 data URL. Remote URLs are unsupported.
      pattern: "^data:image/(jpeg|png|gif|webp);base64,(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)$"
    ResponseMessage:
      oneOf:
        - type: object
          required:
            - role
            - content
          additionalProperties: false
          properties:
            type:
              type: string
              const: message
            id:
              type: string
            status:
              type: string
              enum: [in_progress, completed, incomplete]
            role:
              type: string
              const: user
            content:
              oneOf:
                - type: string
                - type: array
                  minItems: 1
                  items:
                    $ref: "#/components/schemas/ResponseInputContentPart"
        - type: object
          required:
            - role
            - content
          additionalProperties: false
          properties:
            type:
              type: string
              const: message
            id:
              type: string
            status:
              type: string
              enum: [in_progress, completed, incomplete]
            role:
              type: string
              enum:
                - system
                - developer
            content:
              oneOf:
                - type: string
                - type: array
                  minItems: 1
                  items:
                    $ref: "#/components/schemas/ResponseInputTextContentPart"
        - type: object
          required:
            - role
            - content
          additionalProperties: false
          properties:
            type:
              type: string
              const: message
            id:
              type: string
            status:
              type: string
              enum: [in_progress, completed, incomplete]
            role:
              type: string
              const: assistant
            content:
              oneOf:
                - type: string
                - type: array
                  minItems: 1
                  items:
                    $ref: "#/components/schemas/ResponseOutputContentPart"
    ResponseInputContentPart:
      oneOf:
        - $ref: "#/components/schemas/ResponseInputTextContentPart"
        - type: object
          required:
            - type
            - image_url
          additionalProperties: false
          properties:
            type:
              type: string
              const: input_image
            image_url:
              $ref: "#/components/schemas/ImageDataUrl"
            detail:
              type: string
              enum:
                - auto
                - low
                - high
    ResponseInputTextContentPart:
      type: object
      required:
        - type
        - text
      additionalProperties: false
      properties:
        type:
          type: string
          const: input_text
        text:
          type: string
    ResponseOutputContentPart:
      oneOf:
        - type: object
          required:
            - type
            - text
          additionalProperties: true
          properties:
            type:
              type: string
              const: output_text
            text:
              type: string
        - type: object
          required:
            - type
            - refusal
          additionalProperties: false
          properties:
            type:
              type: string
              const: refusal
            refusal:
              type: string
    OpenAITool:
      type: object
      required:
        - type
        - function
      properties:
        type:
          type: string
          const: function
        function:
          type: object
          required:
            - name
            - parameters
          properties:
            name:
              type: string
            description:
              type: string
            parameters:
              type: object
              additionalProperties: true
            strict:
              type: boolean
    OpenAIToolCall:
      type: object
      required:
        - id
        - type
        - function
      properties:
        id:
          type: string
        type:
          type: string
          const: function
        function:
          type: object
          required:
            - name
            - arguments
          properties:
            name:
              type: string
            arguments:
              type: string
    ChatCompletion:
      type: object
      required:
        - id
        - object
        - created
        - model
        - choices
      properties:
        id:
          type: string
        object:
          type: string
          const: chat.completion
        created:
          type: integer
        model:
          type: string
        choices:
          type: array
          items:
            type: object
            required:
              - index
              - message
              - finish_reason
            properties:
              index:
                type: integer
              message:
                $ref: "#/components/schemas/ChatMessage"
              finish_reason:
                type:
                  - string
                  - "null"
        usage:
          $ref: "#/components/schemas/OpenAIUsage"
    OpenAIUsage:
      type: object
      required:
        - prompt_tokens
        - completion_tokens
        - total_tokens
      properties:
        prompt_tokens:
          type: integer
        completion_tokens:
          type: integer
        total_tokens:
          type: integer
    Model:
      type: object
      required:
        - id
        - object
        - created
        - owned_by
        - context_length
        - max_completion_tokens
        - architecture
        - pricing
      properties:
        id:
          type: string
        object:
          type: string
          const: model
        created:
          type: integer
        owned_by:
          type: string
        context_length:
          type: integer
          description: Maximum input context window, in tokens.
        max_completion_tokens:
          type: integer
          description: Maximum number of output tokens the model can generate.
        architecture:
          type: object
          required:
            - input_modalities
          properties:
            input_modalities:
              type: array
              items:
                type: string
                enum: [text, image]
        pricing:
          type: object
          required:
            - prompt
            - completion
            - input_cache_read
          properties:
            prompt:
              type: string
              description: USD cost per input token.
            completion:
              type: string
              description: USD cost per output token.
            input_cache_read:
              type: string
              description: USD cost per cached input token.
    MessageRequest:
      type: object
      required:
        - model
        - max_tokens
        - messages
      properties:
        model:
          $ref: "#/components/schemas/ModelId"
        max_tokens:
          type: integer
          minimum: 1
        messages:
          type: array
          minItems: 1
          description: >-
            Image blocks are supported by deepseek-v4.1-flash and gemma-4-31b.
          items:
            $ref: "#/components/schemas/AnthropicInputMessage"
        system:
          oneOf:
            - type: string
            - type: array
              items:
                $ref: "#/components/schemas/AnthropicTextBlock"
        stream:
          type: boolean
          default: false
        temperature:
          type: number
          minimum: 0
          maximum: 1
        top_p:
          type: number
          minimum: 0
          maximum: 1
        stop_sequences:
          type: array
          items:
            type: string
        tools:
          type: array
          items:
            $ref: "#/components/schemas/AnthropicTool"
        tool_choice:
          type: object
          additionalProperties: true
        thinking:
          description: >-
            Reasoning is on by default. `disabled` turns it off so the first
            content block is text. `budget_tokens` is accepted for client
            compatibility; `max_tokens` bounds thinking and answer together.
          oneOf:
            - type: object
              required:
                - type
              properties:
                type:
                  const: disabled
              additionalProperties: false
            - type: object
              required:
                - type
                - budget_tokens
              properties:
                type:
                  const: enabled
                budget_tokens:
                  type: integer
                  minimum: 1024
              additionalProperties: false
      additionalProperties: true
    TokenCountRequest:
      type: object
      required:
        - model
        - messages
      properties:
        model:
          $ref: "#/components/schemas/ModelId"
        messages:
          type: array
          minItems: 1
          items:
            $ref: "#/components/schemas/AnthropicTokenCountInputMessage"
        system:
          oneOf:
            - type: string
            - type: array
              items:
                $ref: "#/components/schemas/AnthropicTextBlock"
        tools:
          type: array
          items:
            $ref: "#/components/schemas/AnthropicTool"
      additionalProperties: true
    AnthropicInputMessage:
      oneOf:
        - type: object
          required:
            - role
            - content
          additionalProperties: false
          properties:
            role:
              type: string
              const: user
            content:
              oneOf:
                - type: string
                - type: array
                  minItems: 1
                  items:
                    $ref: "#/components/schemas/AnthropicUserContentBlock"
        - type: object
          required:
            - role
            - content
          additionalProperties: false
          properties:
            role:
              type: string
              const: assistant
            content:
              oneOf:
                - type: string
                - type: array
                  minItems: 1
                  items:
                    $ref: "#/components/schemas/AnthropicAssistantContentBlock"
    AnthropicTokenCountInputMessage:
      oneOf:
        - type: object
          required:
            - role
            - content
          additionalProperties: false
          properties:
            role:
              type: string
              const: user
            content:
              oneOf:
                - type: string
                - type: array
                  minItems: 1
                  items:
                    $ref: "#/components/schemas/AnthropicTextToolResultBlock"
        - type: object
          required:
            - role
            - content
          additionalProperties: false
          properties:
            role:
              type: string
              const: assistant
            content:
              oneOf:
                - type: string
                - type: array
                  minItems: 1
                  items:
                    $ref: "#/components/schemas/AnthropicAssistantContentBlock"
    AnthropicUserContentBlock:
      oneOf:
        - $ref: "#/components/schemas/AnthropicTextToolResultBlock"
        - type: object
          required:
            - type
            - source
          additionalProperties: false
          properties:
            type:
              type: string
              const: image
            source:
              type: object
              required:
                - type
                - media_type
                - data
              additionalProperties: false
              properties:
                type:
                  type: string
                  const: base64
                media_type:
                  type: string
                  enum:
                    - image/jpeg
                    - image/png
                    - image/gif
                    - image/webp
                data:
                  type: string
                  contentEncoding: base64
            cache_control:
              $ref: "#/components/schemas/AnthropicCacheControl"
    AnthropicTextToolResultBlock:
      oneOf:
        - $ref: "#/components/schemas/AnthropicTextBlock"
        - $ref: "#/components/schemas/AnthropicToolResultBlock"
    AnthropicAssistantContentBlock:
      oneOf:
        - $ref: "#/components/schemas/AnthropicTextBlock"
        - $ref: "#/components/schemas/AnthropicToolUseBlock"
        - $ref: "#/components/schemas/AnthropicThinkingBlock"
    AnthropicTextBlock:
      type: object
      required:
        - type
        - text
      additionalProperties: false
      properties:
        type:
          type: string
          const: text
        text:
          type: string
        cache_control:
          $ref: "#/components/schemas/AnthropicCacheControl"
    AnthropicToolResultBlock:
      type: object
      required:
        - type
        - tool_use_id
      additionalProperties: false
      properties:
        type:
          type: string
          const: tool_result
        tool_use_id:
          type: string
        content:
          oneOf:
            - type: string
            - type: array
              minItems: 1
              items:
                $ref: "#/components/schemas/AnthropicTextBlock"
        is_error:
          type: boolean
        cache_control:
          $ref: "#/components/schemas/AnthropicCacheControl"
    AnthropicToolUseBlock:
      type: object
      required:
        - type
        - id
        - name
        - input
      additionalProperties: false
      properties:
        type:
          type: string
          const: tool_use
        id:
          type: string
        name:
          type: string
        input:
          type: object
          additionalProperties: true
        cache_control:
          $ref: "#/components/schemas/AnthropicCacheControl"
    AnthropicThinkingBlock:
      type: object
      required:
        - type
        - thinking
        - signature
      additionalProperties: false
      properties:
        type:
          type: string
          const: thinking
        thinking:
          type: string
        signature:
          type: string
        cache_control:
          $ref: "#/components/schemas/AnthropicCacheControl"
    AnthropicCacheControl:
      type: object
      required:
        - type
      additionalProperties: false
      properties:
        type:
          type: string
          const: ephemeral
        ttl:
          type: string
          enum: [5m, 1h]
    AnthropicTool:
      type: object
      required:
        - name
        - input_schema
      properties:
        name:
          type: string
        description:
          type: string
        input_schema:
          type: object
          additionalProperties: true
    Message:
      type: object
      required:
        - id
        - type
        - role
        - model
        - content
        - stop_reason
        - usage
      properties:
        id:
          type: string
        type:
          type: string
          const: message
        role:
          type: string
          const: assistant
        model:
          type: string
        content:
          type: array
          items:
            type: object
            additionalProperties: true
        stop_reason:
          type:
            - string
            - "null"
        stop_sequence:
          type:
            - string
            - "null"
        usage:
          type: object
          required:
            - input_tokens
            - output_tokens
          properties:
            input_tokens:
              type: integer
            output_tokens:
              type: integer
          additionalProperties: true
    OpenAIError:
      type: object
      description: >-
        OpenAI-compatible error envelope. Every error carries a stable
        machine-readable `code`, a `retryable` flag, a `fix` hint, and a
        `docs_url` for the matching entry on the error reference.
      required:
        - error
      properties:
        error:
          type: object
          required:
            - message
            - code
            - retryable
          properties:
            message:
              type: string
            type:
              type: string
            param:
              type:
                - string
                - "null"
            code:
              type: string
              description: Stable machine-readable error code.
              example: rate_limit_exceeded
            retryable:
              type: boolean
              description: Whether the request is safe to retry unchanged.
            fix:
              type: string
              description: Short remediation guidance.
            docs_url:
              type: string
              format: uri
              description: Link to the error reference for this code.
    AnthropicError:
      type: object
      required:
        - type
        - error
      properties:
        type:
          type: string
          const: error
        error:
          type: object
          required:
            - type
            - message
          properties:
            type:
              type: string
            message:
              type: string
