components:
  schemas:
    CallRequest:
      properties:
        guard:
          properties:
            input:
              items:
                properties:
                  action:
                    type: string
                  applies_to:
                    type: string
                  check:
                    type: string
                  custom_patterns:
                    items:
                      type: string
                    type: array
                  engine:
                    type: string
                  kind:
                    type: string
                  model:
                    type: string
                  name:
                    type: string
                  patterns:
                    items:
                      properties:
                        name:
                          type: string
                        regex:
                          type: string
                      required:
                        - regex
                      type: object
                    type: array
                  presets:
                    items:
                      type: string
                    type: array
                  prompt:
                    type: string
                  replacement:
                    type: string
                  rule_id:
                    type: string
                  rule_name:
                    type: string
                  scope:
                    properties:
                      functions:
                        items:
                          type: string
                        type: array
                      kind:
                        type: string
                    required:
                      - kind
                    type: object
                  scope_type:
                    type: string
                  type:
                    type: string
                type: object
              type: array
            output:
              items:
                properties:
                  action:
                    type: string
                  applies_to:
                    type: string
                  check:
                    type: string
                  custom_patterns:
                    items:
                      type: string
                    type: array
                  engine:
                    type: string
                  kind:
                    type: string
                  model:
                    type: string
                  name:
                    type: string
                  patterns:
                    items:
                      properties:
                        name:
                          type: string
                        regex:
                          type: string
                      required:
                        - regex
                      type: object
                    type: array
                  presets:
                    items:
                      type: string
                    type: array
                  prompt:
                    type: string
                  replacement:
                    type: string
                  rule_id:
                    type: string
                  rule_name:
                    type: string
                  scope:
                    properties:
                      functions:
                        items:
                          type: string
                        type: array
                      kind:
                        type: string
                    required:
                      - kind
                    type: object
                  scope_type:
                    type: string
                  type:
                    type: string
                type: object
              type: array
          type: object
        input:
          description: Any value
        input_schema:
          description: JSON Schema for the input. Optional; defaults to string when omitted.
          type: object
        instructions:
          type: string
        model:
          oneOf:
            - description: Model identifier (e.g. "openai/gpt-4o")
              type: string
            - properties:
                extra_headers:
                  description: Extra HTTP headers to send with requests to this model
                  type: object
                name:
                  description: Model identifier (e.g. "openai/gpt-4o")
                  type: string
                options:
                  description: Per-model parameters (temperature, max_tokens, reasoning_effort, etc.)
                  type: object
              required:
                - name
              type: object
            - description: Fallback chain — models tried in order on retriable errors
              items:
                oneOf:
                  - type: string
                  - properties:
                      extra_headers:
                        description: Extra HTTP headers to send with requests to this model
                        type: object
                      name:
                        description: Model identifier (e.g. "openai/gpt-4o")
                        type: string
                      options:
                        description: Per-model parameters (temperature, max_tokens, reasoning_effort, etc.)
                        type: object
                    required:
                      - name
                    type: object
              type: array
        name:
          type: string
        output_schema:
          description: JSON Schema for the output. Optional; defaults to string when omitted.
          type: object
        parent_span_id:
          type: string
        reasoning_effort:
          description: Reasoning effort for reasoning-capable models. One of "low"
          type: string
        reasoning_summary:
          description: Opt into thought summary streaming. "auto"
          type: string
        route:
          properties:
            prefer:
              type: string
          type: object
        stream:
          type: boolean
        tools:
          items:
            properties:
              description:
                type: string
              name:
                type: string
              parameters:
                type: object
              type:
                type: string
            required:
              - name
            type: object
          type: array
      required:
        - name
        - input
      type: object
    ChatChoice:
      properties:
        finish_reason:
          type: string
        index:
          type: integer
        message:
          properties:
            content:
              type: string
            reasoning_content:
              type: string
            role:
              type: string
            tool_calls:
              items:
                properties:
                  function:
                    properties:
                      arguments:
                        type: string
                      name:
                        type: string
                    required:
                      - name
                      - arguments
                    type: object
                  id:
                    type: string
                  thought_signature:
                    type: string
                  type:
                    type: string
                required:
                  - id
                  - type
                  - function
                type: object
              type: array
          required:
            - role
            - content
          type: object
      required:
        - index
        - message
        - finish_reason
      type: object
    ChatFunctionCall:
      properties:
        arguments:
          type: string
        name:
          type: string
      required:
        - name
        - arguments
      type: object
    ChatMessage:
      properties:
        content:
          type: string
        reasoning_content:
          type: string
        role:
          type: string
        tool_calls:
          items:
            properties:
              function:
                properties:
                  arguments:
                    type: string
                  name:
                    type: string
                required:
                  - name
                  - arguments
                type: object
              id:
                type: string
              thought_signature:
                type: string
              type:
                type: string
            required:
              - id
              - type
              - function
            type: object
          type: array
      required:
        - role
        - content
      type: object
    ChatRequest:
      properties:
        max_completion_tokens:
          type: integer
        max_tokens:
          type: integer
        messages:
          items:
            properties:
              content:
                description: Any value
              name:
                type: string
              role:
                type: string
              tool_call_id:
                type: string
              tool_calls:
                items:
                  properties:
                    function:
                      properties:
                        arguments:
                          type: string
                        name:
                          type: string
                      required:
                        - name
                        - arguments
                      type: object
                    id:
                      type: string
                    thought_signature:
                      type: string
                    type:
                      type: string
                  required:
                    - id
                    - type
                    - function
                  type: object
                type: array
            required:
              - role
              - content
            type: object
          type: array
        model:
          type: string
        output_schema:
          type: object
        reasoning_effort:
          type: string
        response_format:
          type: object
        stop:
          items:
            type: string
          type: array
        stream:
          type: boolean
        stream_options:
          properties:
            include_usage:
              type: boolean
          type: object
        temperature:
          type: number
        tool_choice:
          description: Any value
        tools:
          items:
            properties:
              function:
                properties:
                  description:
                    type: string
                  name:
                    type: string
                  parameters:
                    type: object
                required:
                  - name
                type: object
              type:
                type: string
            required:
              - type
              - function
            type: object
          type: array
        top_p:
          type: number
      required:
        - messages
      type: object
    ChatRequestMessage:
      properties:
        content:
          description: Any value
        name:
          type: string
        role:
          type: string
        tool_call_id:
          type: string
        tool_calls:
          items:
            properties:
              function:
                properties:
                  arguments:
                    type: string
                  name:
                    type: string
                required:
                  - name
                  - arguments
                type: object
              id:
                type: string
              thought_signature:
                type: string
              type:
                type: string
            required:
              - id
              - type
              - function
            type: object
          type: array
      required:
        - role
        - content
      type: object
    ChatRequestTool:
      properties:
        function:
          properties:
            description:
              type: string
            name:
              type: string
            parameters:
              type: object
          required:
            - name
          type: object
        type:
          type: string
      required:
        - type
        - function
      type: object
    ChatRequestToolFunction:
      properties:
        description:
          type: string
        name:
          type: string
        parameters:
          type: object
      required:
        - name
      type: object
    ChatResponse:
      properties:
        choices:
          items:
            properties:
              finish_reason:
                type: string
              index:
                type: integer
              message:
                properties:
                  content:
                    type: string
                  reasoning_content:
                    type: string
                  role:
                    type: string
                  tool_calls:
                    items:
                      properties:
                        function:
                          properties:
                            arguments:
                              type: string
                            name:
                              type: string
                          required:
                            - name
                            - arguments
                          type: object
                        id:
                          type: string
                        thought_signature:
                          type: string
                        type:
                          type: string
                      required:
                        - id
                        - type
                        - function
                      type: object
                    type: array
                required:
                  - role
                  - content
                type: object
            required:
              - index
              - message
              - finish_reason
            type: object
          type: array
        cost:
          type: number
        created:
          type: integer
        id:
          type: string
        meta:
          properties:
            guards:
              items:
                properties:
                  code:
                    type: string
                  findings:
                    items:
                      description: Any value
                    type: array
                  flagged:
                    type: boolean
                  phase:
                    type: string
                  rule_id:
                    type: string
                  rule_name:
                    type: string
                  scope_type:
                    type: string
                  status:
                    type: string
                  type:
                    type: string
                required:
                  - type
                  - flagged
                type: object
              type: array
            trace_uuid:
              type: string
          type: object
        model:
          type: string
        object:
          type: string
        usage:
          properties:
            completion_tokens:
              type: integer
            completion_tokens_details:
              properties:
                reasoning_tokens:
                  type: integer
              required:
                - reasoning_tokens
              type: object
            prompt_tokens:
              type: integer
            prompt_tokens_details:
              properties:
                cache_creation_1h_tokens:
                  type: integer
                cache_creation_tokens:
                  type: integer
                cached_tokens:
                  type: integer
              type: object
            server_tool_use:
              type: object
            total_tokens:
              type: integer
          required:
            - prompt_tokens
            - completion_tokens
            - total_tokens
          type: object
      required:
        - id
        - object
        - created
        - model
        - choices
        - usage
      type: object
    ChatStreamChoice:
      properties:
        delta:
          properties:
            content:
              type: string
            reasoning_content:
              type: string
            role:
              type: string
            tool_calls:
              items:
                properties:
                  function:
                    properties:
                      arguments:
                        type: string
                      name:
                        type: string
                    type: object
                  id:
                    type: string
                  index:
                    type: integer
                  thought_signature:
                    type: string
                  type:
                    type: string
                required:
                  - index
                type: object
              type: array
          type: object
        finish_reason:
          type: string
        index:
          type: integer
      required:
        - index
        - delta
        - finish_reason
      type: object
    ChatStreamChunk:
      properties:
        choices:
          items:
            properties:
              delta:
                properties:
                  content:
                    type: string
                  reasoning_content:
                    type: string
                  role:
                    type: string
                  tool_calls:
                    items:
                      properties:
                        function:
                          properties:
                            arguments:
                              type: string
                            name:
                              type: string
                          type: object
                        id:
                          type: string
                        index:
                          type: integer
                        thought_signature:
                          type: string
                        type:
                          type: string
                      required:
                        - index
                      type: object
                    type: array
                type: object
              finish_reason:
                type: string
              index:
                type: integer
            required:
              - index
              - delta
              - finish_reason
            type: object
          type: array
        cost:
          type: number
        created:
          type: integer
        id:
          type: string
        meta:
          properties:
            guards:
              items:
                properties:
                  code:
                    type: string
                  findings:
                    items:
                      description: Any value
                    type: array
                  flagged:
                    type: boolean
                  phase:
                    type: string
                  rule_id:
                    type: string
                  rule_name:
                    type: string
                  scope_type:
                    type: string
                  status:
                    type: string
                  type:
                    type: string
                required:
                  - type
                  - flagged
                type: object
              type: array
            trace_uuid:
              type: string
          type: object
        model:
          type: string
        object:
          type: string
        time_to_first_token_ms:
          type: integer
        usage:
          properties:
            completion_tokens:
              type: integer
            completion_tokens_details:
              properties:
                reasoning_tokens:
                  type: integer
              required:
                - reasoning_tokens
              type: object
            prompt_tokens:
              type: integer
            prompt_tokens_details:
              properties:
                cache_creation_1h_tokens:
                  type: integer
                cache_creation_tokens:
                  type: integer
                cached_tokens:
                  type: integer
              type: object
            server_tool_use:
              type: object
            total_tokens:
              type: integer
          required:
            - prompt_tokens
            - completion_tokens
            - total_tokens
          type: object
      required:
        - id
        - object
        - created
        - model
        - choices
      type: object
    ChatStreamDelta:
      properties:
        content:
          type: string
        reasoning_content:
          type: string
        role:
          type: string
        tool_calls:
          items:
            properties:
              function:
                properties:
                  arguments:
                    type: string
                  name:
                    type: string
                type: object
              id:
                type: string
              index:
                type: integer
              thought_signature:
                type: string
              type:
                type: string
            required:
              - index
            type: object
          type: array
      type: object
    ChatToolCall:
      properties:
        function:
          properties:
            arguments:
              type: string
            name:
              type: string
          required:
            - name
            - arguments
          type: object
        id:
          type: string
        thought_signature:
          type: string
        type:
          type: string
      required:
        - id
        - type
        - function
      type: object
    ChatUsage:
      properties:
        completion_tokens:
          type: integer
        completion_tokens_details:
          properties:
            reasoning_tokens:
              type: integer
          required:
            - reasoning_tokens
          type: object
        prompt_tokens:
          type: integer
        prompt_tokens_details:
          properties:
            cache_creation_1h_tokens:
              type: integer
            cache_creation_tokens:
              type: integer
            cached_tokens:
              type: integer
          type: object
        server_tool_use:
          type: object
        total_tokens:
          type: integer
      required:
        - prompt_tokens
        - completion_tokens
        - total_tokens
      type: object
    CreateSpanRequest:
      properties:
        end_time:
          format: date-time
          type: string
        error:
          type: string
        input:
          type: string
        meta:
          type: object
        metadata:
          type: object
        name:
          type: string
        output:
          type: string
        parent_id:
          type: string
        start_time:
          format: date-time
          type: string
        tags:
          type: object
        trace_id:
          type: string
        type:
          type: string
      required:
        - name
      type: object
    CreateSpanResponse:
      properties:
        data:
          properties:
            id:
              type: string
            name:
              type: string
            parent_id:
              type: string
            trace_id:
              type: string
            type:
              type: string
          required:
            - id
            - trace_id
            - name
          type: object
      required:
        - data
      type: object
    EmbeddingsDataItem:
      properties:
        embedding:
          items:
            type: number
          type: array
        index:
          type: integer
        object:
          type: string
      required:
        - object
        - index
        - embedding
      type: object
    EmbeddingsRequest:
      properties:
        dimensions:
          type: integer
        encoding_format:
          type: string
        input:
          description: Any value
        model:
          type: string
        user:
          type: string
      required:
        - input
        - model
      type: object
    EmbeddingsResponse:
      properties:
        data:
          items:
            properties:
              embedding:
                items:
                  type: number
                type: array
              index:
                type: integer
              object:
                type: string
            required:
              - object
              - index
              - embedding
            type: object
          type: array
        model:
          type: string
        object:
          type: string
        usage:
          properties:
            prompt_tokens:
              type: integer
            total_tokens:
              type: integer
          required:
            - prompt_tokens
            - total_tokens
          type: object
      required:
        - object
        - data
        - model
        - usage
      type: object
    EmbeddingsUsageInfo:
      properties:
        prompt_tokens:
          type: integer
        total_tokens:
          type: integer
      required:
        - prompt_tokens
        - total_tokens
      type: object
    ErrorDetail:
      properties:
        code:
          type: string
        details:
          description: Any value
        message:
          type: string
      required:
        - code
        - message
      type: object
    ErrorResponse:
      properties:
        error:
          properties:
            code:
              type: string
            details:
              description: Any value
            message:
              type: string
          required:
            - code
            - message
          type: object
        meta:
          type: object
      required:
        - error
      type: object
    FunctionDetails:
      properties:
        generated_at:
          format: date-time
          type: string
        hit_count:
          type: integer
        input_schema:
          type: object
        name:
          type: string
        output_schema:
          type: object
        schema_hash:
          type: string
        source:
          type: string
      required:
        - name
        - schema_hash
        - generated_at
        - hit_count
        - source
        - input_schema
        - output_schema
      type: object
    FunctionInfo:
      properties:
        generated_at:
          format: date-time
          type: string
        has_script:
          type: boolean
        hit_count:
          type: integer
        name:
          type: string
        schema_hash:
          type: string
      required:
        - name
        - schema_hash
        - generated_at
        - hit_count
        - has_script
      type: object
    FunctionRevision:
      properties:
        created_at:
          format: date-time
          type: string
        input_schema:
          type: object
        output_schema:
          type: object
        revision_id:
          type: integer
        schema_hash:
          type: string
        source:
          type: string
      required:
        - revision_id
        - source
        - schema_hash
        - created_at
        - input_schema
        - output_schema
      type: object
    GenerationConfig:
      properties:
        max_output_tokens:
          type: integer
        response_mime_type:
          type: string
        response_schema:
          type: object
        stop_sequences:
          items:
            type: string
          type: array
        temperature:
          type: number
        thinking_config:
          properties:
            include_thoughts:
              type: boolean
            thinking_budget:
              type: integer
            thinking_level:
              type: string
          type: object
        thinking_level:
          type: string
        top_k:
          type: integer
        top_p:
          type: number
      type: object
    GetSpanResponse:
      properties:
        data:
          properties:
            end_time:
              format: date-time
              type: string
            error:
              type: string
            id:
              type: string
            input:
              description: Any value
            meta:
              type: object
            metadata:
              type: object
            name:
              type: string
            output:
              description: Any value
            parent_id:
              type: string
            start_time:
              format: date-time
              type: string
            status:
              type: string
            tags:
              type: object
            trace_id:
              type: string
            type:
              type: string
          required:
            - id
            - trace_id
            - name
          type: object
      required:
        - data
      type: object
    GetTraceResponse:
      properties:
        data:
          properties:
            duration_ms:
              type: integer
            end_time:
              format: date-time
              type: string
            events:
              items:
                properties:
                  created_at:
                    format: date-time
                    type: string
                  data:
                    type: object
                  id:
                    type: string
                  kind:
                    type: string
                  source:
                    type: string
                  span_id:
                    type: string
                  span_uuid:
                    type: string
                required:
                  - id
                  - span_id
                  - kind
                  - source
                  - data
                type: object
              type: array
            id:
              type: string
            name:
              type: string
            span_count:
              type: integer
            spans:
              items:
                properties:
                  end_time:
                    format: date-time
                    type: string
                  error:
                    type: string
                  id:
                    type: string
                  input:
                    description: Any value
                  meta:
                    type: object
                  metadata:
                    type: object
                  name:
                    type: string
                  output:
                    description: Any value
                  parent_id:
                    type: string
                  start_time:
                    format: date-time
                    type: string
                  status:
                    type: string
                  tags:
                    type: object
                  trace_id:
                    type: string
                  type:
                    type: string
                required:
                  - id
                  - trace_id
                  - name
                type: object
              type: array
            start_time:
              format: date-time
              type: string
            status:
              type: string
          required:
            - id
            - span_count
            - spans
          type: object
      required:
        - data
      type: object
    GuardInfo:
      properties:
        code:
          type: string
        findings:
          items:
            description: Any value
          type: array
        flagged:
          type: boolean
        phase:
          type: string
        rule_id:
          type: string
        rule_name:
          type: string
        scope_type:
          type: string
        status:
          type: string
        type:
          type: string
      required:
        - type
        - flagged
      type: object
    GuardrailConfig:
      properties:
        action:
          type: string
        applies_to:
          type: string
        check:
          type: string
        custom_patterns:
          items:
            type: string
          type: array
        engine:
          type: string
        kind:
          type: string
        model:
          type: string
        name:
          type: string
        patterns:
          items:
            properties:
              name:
                type: string
              regex:
                type: string
            required:
              - regex
            type: object
          type: array
        presets:
          items:
            type: string
          type: array
        prompt:
          type: string
        replacement:
          type: string
        rule_id:
          type: string
        rule_name:
          type: string
        scope:
          properties:
            functions:
              items:
                type: string
              type: array
            kind:
              type: string
          required:
            - kind
          type: object
        scope_type:
          type: string
        type:
          type: string
      type: object
    InteractionsError:
      properties:
        code:
          type: string
        message:
          type: string
      required:
        - code
        - message
      type: object
    InteractionsFunction:
      properties:
        description:
          type: string
        name:
          type: string
        parameters:
          type: object
      required:
        - name
      type: object
    InteractionsOutput:
      properties:
        args:
          type: object
        data:
          type: string
        id:
          type: string
        mime_type:
          type: string
        name:
          type: string
        summary:
          type: string
        text:
          type: string
        thought:
          type: string
        thoughtSignature:
          type: string
        type:
          type: string
      required:
        - type
      type: object
    InteractionsRequest:
      properties:
        agent:
          type: string
        background:
          type: boolean
        contents:
          description: Any value
        generation_config:
          properties:
            max_output_tokens:
              type: integer
            response_mime_type:
              type: string
            response_schema:
              type: object
            stop_sequences:
              items:
                type: string
              type: array
            temperature:
              type: number
            thinking_config:
              properties:
                include_thoughts:
                  type: boolean
                thinking_budget:
                  type: integer
                thinking_level:
                  type: string
              type: object
            thinking_level:
              type: string
            top_k:
              type: integer
            top_p:
              type: number
          type: object
        input:
          description: Any value
        model:
          type: string
        previous_interaction_id:
          type: string
        response_format:
          type: object
        safety_settings:
          items:
            properties:
              category:
                type: string
              threshold:
                type: string
            type: object
          type: array
        store:
          type: boolean
        stream:
          type: boolean
        system_instruction:
          properties:
            Text:
              type: string
          required:
            - Text
          type: object
        tool_config:
          properties:
            function_calling_config:
              properties:
                allowed_function_names:
                  items:
                    type: string
                  type: array
                mode:
                  type: string
              type: object
          type: object
        tools:
          items:
            properties:
              function_declarations:
                items:
                  properties:
                    description:
                      type: string
                    name:
                      type: string
                    parameters:
                      type: object
                  required:
                    - name
                  type: object
                type: array
              type:
                type: string
            type: object
          type: array
      required:
        - input
        - contents
      type: object
    InteractionsResponse:
      properties:
        agent:
          type: string
        error:
          properties:
            code:
              type: string
            message:
              type: string
          required:
            - code
            - message
          type: object
        id:
          type: string
        input:
          description: Any value
        model:
          type: string
        outputs:
          items:
            properties:
              args:
                type: object
              data:
                type: string
              id:
                type: string
              mime_type:
                type: string
              name:
                type: string
              summary:
                type: string
              text:
                type: string
              thought:
                type: string
              thoughtSignature:
                type: string
              type:
                type: string
            required:
              - type
            type: object
          type: array
        previous_interaction_id:
          type: string
        status:
          type: string
        usageMetadata:
          properties:
            cachedContentTokenCount:
              type: integer
            candidatesTokenCount:
              type: integer
            promptTokenCount:
              type: integer
            thoughtsTokenCount:
              type: integer
            totalTokenCount:
              type: integer
          required:
            - promptTokenCount
            - candidatesTokenCount
            - totalTokenCount
          type: object
      required:
        - id
        - outputs
        - status
      type: object
    InteractionsTool:
      properties:
        function_declarations:
          items:
            properties:
              description:
                type: string
              name:
                type: string
              parameters:
                type: object
            required:
              - name
            type: object
          type: array
        type:
          type: string
      type: object
    InteractionsUsageMetadata:
      properties:
        cachedContentTokenCount:
          type: integer
        candidatesTokenCount:
          type: integer
        promptTokenCount:
          type: integer
        thoughtsTokenCount:
          type: integer
        totalTokenCount:
          type: integer
      required:
        - promptTokenCount
        - candidatesTokenCount
        - totalTokenCount
      type: object
    ListTracesItem:
      properties:
        duration_ms:
          type: integer
        end_time:
          format: date-time
          type: string
        id:
          type: string
        name:
          type: string
        span_count:
          type: integer
        start_time:
          format: date-time
          type: string
        status:
          type: string
      required:
        - id
        - span_count
      type: object
    MessagesMessage:
      properties:
        content:
          description: Any value
        role:
          type: string
      required:
        - role
        - content
      type: object
    MessagesRequest:
      properties:
        max_tokens:
          type: integer
        messages:
          items:
            properties:
              content:
                description: Any value
              role:
                type: string
            required:
              - role
              - content
            type: object
          type: array
        model:
          type: string
        output_format:
          type: object
        stop_sequences:
          items:
            type: string
          type: array
        stream:
          type: boolean
        system:
          description: Any value
        temperature:
          type: number
        thinking:
          description: Any value
        tool_choice:
          description: Any value
        tools:
          items:
            properties:
              description:
                type: string
              input_schema:
                type: object
              name:
                type: string
              type:
                type: string
            required:
              - name
            type: object
          type: array
        top_k:
          type: integer
        top_p:
          type: number
      required:
        - model
        - messages
        - max_tokens
      type: object
    MessagesResponse:
      properties:
        content:
          items:
            description: Any value
          type: array
        id:
          type: string
        model:
          type: string
        role:
          type: string
        stop_reason:
          type: string
        stop_sequence:
          type: string
        type:
          type: string
        usage:
          properties:
            cache_creation_input_tokens:
              type: integer
            cache_read_input_tokens:
              type: integer
            input_tokens:
              type: integer
            output_tokens:
              type: integer
            server_tool_use:
              type: object
          required:
            - input_tokens
            - output_tokens
          type: object
      required:
        - id
        - type
        - role
        - content
        - model
        - stop_reason
        - stop_sequence
        - usage
      type: object
    MessagesResponseBlock:
      properties:
        id:
          type: string
        input:
          description: Any value
        name:
          type: string
        text:
          type: string
        type:
          type: string
      required:
        - type
      type: object
    MessagesTool:
      properties:
        description:
          type: string
        input_schema:
          type: object
        name:
          type: string
        type:
          type: string
      required:
        - name
      type: object
    MessagesUsage:
      properties:
        cache_creation_input_tokens:
          type: integer
        cache_read_input_tokens:
          type: integer
        input_tokens:
          type: integer
        output_tokens:
          type: integer
        server_tool_use:
          type: object
      required:
        - input_tokens
        - output_tokens
      type: object
    ModelInfo:
      properties:
        aliases:
          items:
            type: string
          type: array
        api_type:
          type: string
        capabilities:
          items:
            type: string
          type: array
        context_window:
          type: integer
        cost:
          type: number
        country:
          type: string
        description:
          type: string
        family:
          type: string
        featured:
          type: boolean
        id:
          type: string
        max_output_tokens:
          type: integer
        model_id:
          type: string
        name:
          type: string
        params:
          properties:
            default_max_tokens:
              type: integer
            embedding:
              properties:
                dimensions:
                  type: integer
                max_input_tokens:
                  type: integer
                supports_dimensions:
                  type: boolean
              required:
                - dimensions
              type: object
            image:
              properties:
                default:
                  type: string
                qualities:
                  items:
                    type: string
                  type: array
                sizes:
                  items:
                    type: string
                  type: array
                styles:
                  items:
                    type: string
                  type: array
              type: object
            image_edit:
              properties:
                aspect_ratios:
                  items:
                    type: string
                  type: array
                default:
                  type: string
              type: object
            max_tokens:
              type: boolean
            realtime:
              properties:
                default_voice:
                  type: string
                input_audio_format:
                  type: string
                output_audio_format:
                  type: string
                sample_rate:
                  type: integer
                supports_tools:
                  type: boolean
                supports_vad:
                  type: boolean
                voices:
                  items:
                    type: string
                  type: array
              type: object
            reasoning:
              properties:
                default:
                  type: string
                max_budget:
                  type: integer
                mode:
                  type: string
                supported:
                  items:
                    type: string
                  type: array
              required:
                - supported
                - default
              type: object
            stt:
              properties:
                default_language:
                  type: string
                formats:
                  items:
                    type: string
                  type: array
                languages:
                  items:
                    type: string
                  type: array
              type: object
            temperature:
              properties:
                default:
                  type: number
                max:
                  type: number
                min:
                  type: number
              required:
                - min
                - max
                - default
              type: object
            tts:
              properties:
                default_voice:
                  type: string
                max_length:
                  type: integer
                voices:
                  items:
                    type: string
                  type: array
              type: object
            video:
              properties:
                aspect_ratios:
                  items:
                    type: string
                  type: array
                max_duration:
                  type: integer
                max_fps:
                  type: integer
                max_frames:
                  type: integer
                resolutions:
                  items:
                    type: string
                  type: array
                speed_modes:
                  items:
                    type: string
                  type: array
                supports_seed:
                  type: boolean
              type: object
          required:
            - default_max_tokens
          type: object
        pricing:
          properties:
            cache_creation:
              items:
                type: number
              type: array
            cache_creation_1h:
              items:
                type: number
              type: array
            cached_input:
              items:
                type: number
              type: array
            image_prices:
              additionalProperties:
                additionalProperties:
                  type: number
                type: object
              type: object
            input:
              items:
                type: number
              type: array
            output:
              items:
                type: number
              type: array
            price_per_generation:
              type: number
            price_per_m_chars:
              type: number
            price_per_minute:
              type: number
            price_per_page:
              type: number
            price_per_second:
              type: number
            reasoning:
              items:
                type: number
              type: array
            thresholds:
              items:
                type: integer
              type: array
            web_fetch_price_per_request:
              type: number
            web_search_price_per_request:
              type: number
          required:
            - input
            - output
          type: object
        provider:
          type: string
        provider_display_name:
          type: string
        quality:
          type: string
        region:
          type: string
        retired_at:
          format: date-time
          type: string
        speed:
          type: string
        successor:
          type: string
        thinking:
          type: boolean
        type:
          type: string
      required:
        - id
        - type
        - provider
        - provider_display_name
        - name
        - model_id
        - capabilities
        - speed
        - cost
        - quality
        - context_window
        - description
      type: object
    ModelResolveRequest:
      properties:
        messages:
          items:
            properties:
              cache_control:
                type: object
              content:
                description: Any value
              name:
                type: string
              role:
                type: string
              tool_call_id:
                type: string
              tool_calls:
                items:
                  properties:
                    arguments:
                      type: object
                    id:
                      type: string
                    name:
                      type: string
                    thought_signature:
                      type: string
                  required:
                    - id
                    - name
                    - arguments
                  type: object
                type: array
            required:
              - role
              - content
            type: object
          type: array
        overrides:
          additionalProperties:
            type: string
          type: object
      required:
        - messages
      type: object
    ModelResolveResponse:
      properties:
        category:
          type: string
        model:
          properties:
            aliases:
              items:
                type: string
              type: array
            api_type:
              type: string
            capabilities:
              items:
                type: string
              type: array
            context_window:
              type: integer
            cost:
              type: number
            country:
              type: string
            description:
              type: string
            family:
              type: string
            featured:
              type: boolean
            id:
              type: string
            max_output_tokens:
              type: integer
            model_id:
              type: string
            name:
              type: string
            params:
              properties:
                default_max_tokens:
                  type: integer
                embedding:
                  properties:
                    dimensions:
                      type: integer
                    max_input_tokens:
                      type: integer
                    supports_dimensions:
                      type: boolean
                  required:
                    - dimensions
                  type: object
                image:
                  properties:
                    default:
                      type: string
                    qualities:
                      items:
                        type: string
                      type: array
                    sizes:
                      items:
                        type: string
                      type: array
                    styles:
                      items:
                        type: string
                      type: array
                  type: object
                image_edit:
                  properties:
                    aspect_ratios:
                      items:
                        type: string
                      type: array
                    default:
                      type: string
                  type: object
                max_tokens:
                  type: boolean
                realtime:
                  properties:
                    default_voice:
                      type: string
                    input_audio_format:
                      type: string
                    output_audio_format:
                      type: string
                    sample_rate:
                      type: integer
                    supports_tools:
                      type: boolean
                    supports_vad:
                      type: boolean
                    voices:
                      items:
                        type: string
                      type: array
                  type: object
                reasoning:
                  properties:
                    default:
                      type: string
                    max_budget:
                      type: integer
                    mode:
                      type: string
                    supported:
                      items:
                        type: string
                      type: array
                  required:
                    - supported
                    - default
                  type: object
                stt:
                  properties:
                    default_language:
                      type: string
                    formats:
                      items:
                        type: string
                      type: array
                    languages:
                      items:
                        type: string
                      type: array
                  type: object
                temperature:
                  properties:
                    default:
                      type: number
                    max:
                      type: number
                    min:
                      type: number
                  required:
                    - min
                    - max
                    - default
                  type: object
                tts:
                  properties:
                    default_voice:
                      type: string
                    max_length:
                      type: integer
                    voices:
                      items:
                        type: string
                      type: array
                  type: object
                video:
                  properties:
                    aspect_ratios:
                      items:
                        type: string
                      type: array
                    max_duration:
                      type: integer
                    max_fps:
                      type: integer
                    max_frames:
                      type: integer
                    resolutions:
                      items:
                        type: string
                      type: array
                    speed_modes:
                      items:
                        type: string
                      type: array
                    supports_seed:
                      type: boolean
                  type: object
              required:
                - default_max_tokens
              type: object
            pricing:
              properties:
                cache_creation:
                  items:
                    type: number
                  type: array
                cache_creation_1h:
                  items:
                    type: number
                  type: array
                cached_input:
                  items:
                    type: number
                  type: array
                image_prices:
                  additionalProperties:
                    additionalProperties:
                      type: number
                    type: object
                  type: object
                input:
                  items:
                    type: number
                  type: array
                output:
                  items:
                    type: number
                  type: array
                price_per_generation:
                  type: number
                price_per_m_chars:
                  type: number
                price_per_minute:
                  type: number
                price_per_page:
                  type: number
                price_per_second:
                  type: number
                reasoning:
                  items:
                    type: number
                  type: array
                thresholds:
                  items:
                    type: integer
                  type: array
                web_fetch_price_per_request:
                  type: number
                web_search_price_per_request:
                  type: number
              required:
                - input
                - output
              type: object
            provider:
              type: string
            provider_display_name:
              type: string
            quality:
              type: string
            region:
              type: string
            retired_at:
              format: date-time
              type: string
            speed:
              type: string
            successor:
              type: string
            thinking:
              type: boolean
            type:
              type: string
          required:
            - id
            - type
            - provider
            - provider_display_name
            - name
            - model_id
            - capabilities
            - speed
            - cost
            - quality
            - context_window
            - description
          type: object
        model_id:
          type: string
        reasoning:
          type: string
      required:
        - model
        - model_id
        - category
        - reasoning
      type: object
    ModelsResponse:
      properties:
        limit:
          type: integer
        models:
          items:
            properties:
              aliases:
                items:
                  type: string
                type: array
              api_type:
                type: string
              capabilities:
                items:
                  type: string
                type: array
              context_window:
                type: integer
              cost:
                type: number
              country:
                type: string
              description:
                type: string
              family:
                type: string
              featured:
                type: boolean
              id:
                type: string
              max_output_tokens:
                type: integer
              model_id:
                type: string
              name:
                type: string
              params:
                properties:
                  default_max_tokens:
                    type: integer
                  embedding:
                    properties:
                      dimensions:
                        type: integer
                      max_input_tokens:
                        type: integer
                      supports_dimensions:
                        type: boolean
                    required:
                      - dimensions
                    type: object
                  image:
                    properties:
                      default:
                        type: string
                      qualities:
                        items:
                          type: string
                        type: array
                      sizes:
                        items:
                          type: string
                        type: array
                      styles:
                        items:
                          type: string
                        type: array
                    type: object
                  image_edit:
                    properties:
                      aspect_ratios:
                        items:
                          type: string
                        type: array
                      default:
                        type: string
                    type: object
                  max_tokens:
                    type: boolean
                  realtime:
                    properties:
                      default_voice:
                        type: string
                      input_audio_format:
                        type: string
                      output_audio_format:
                        type: string
                      sample_rate:
                        type: integer
                      supports_tools:
                        type: boolean
                      supports_vad:
                        type: boolean
                      voices:
                        items:
                          type: string
                        type: array
                    type: object
                  reasoning:
                    properties:
                      default:
                        type: string
                      max_budget:
                        type: integer
                      mode:
                        type: string
                      supported:
                        items:
                          type: string
                        type: array
                    required:
                      - supported
                      - default
                    type: object
                  stt:
                    properties:
                      default_language:
                        type: string
                      formats:
                        items:
                          type: string
                        type: array
                      languages:
                        items:
                          type: string
                        type: array
                    type: object
                  temperature:
                    properties:
                      default:
                        type: number
                      max:
                        type: number
                      min:
                        type: number
                    required:
                      - min
                      - max
                      - default
                    type: object
                  tts:
                    properties:
                      default_voice:
                        type: string
                      max_length:
                        type: integer
                      voices:
                        items:
                          type: string
                        type: array
                    type: object
                  video:
                    properties:
                      aspect_ratios:
                        items:
                          type: string
                        type: array
                      max_duration:
                        type: integer
                      max_fps:
                        type: integer
                      max_frames:
                        type: integer
                      resolutions:
                        items:
                          type: string
                        type: array
                      speed_modes:
                        items:
                          type: string
                        type: array
                      supports_seed:
                        type: boolean
                    type: object
                required:
                  - default_max_tokens
                type: object
              pricing:
                properties:
                  cache_creation:
                    items:
                      type: number
                    type: array
                  cache_creation_1h:
                    items:
                      type: number
                    type: array
                  cached_input:
                    items:
                      type: number
                    type: array
                  image_prices:
                    additionalProperties:
                      additionalProperties:
                        type: number
                      type: object
                    type: object
                  input:
                    items:
                      type: number
                    type: array
                  output:
                    items:
                      type: number
                    type: array
                  price_per_generation:
                    type: number
                  price_per_m_chars:
                    type: number
                  price_per_minute:
                    type: number
                  price_per_page:
                    type: number
                  price_per_second:
                    type: number
                  reasoning:
                    items:
                      type: number
                    type: array
                  thresholds:
                    items:
                      type: integer
                    type: array
                  web_fetch_price_per_request:
                    type: number
                  web_search_price_per_request:
                    type: number
                required:
                  - input
                  - output
                type: object
              provider:
                type: string
              provider_display_name:
                type: string
              quality:
                type: string
              region:
                type: string
              retired_at:
                format: date-time
                type: string
              speed:
                type: string
              successor:
                type: string
              thinking:
                type: boolean
              type:
                type: string
            required:
              - id
              - type
              - provider
              - provider_display_name
              - name
              - model_id
              - capabilities
              - speed
              - cost
              - quality
              - context_window
              - description
            type: object
          type: array
        offset:
          type: integer
        total:
          type: integer
      required:
        - models
        - total
        - offset
        - limit
      type: object
    ORError:
      properties:
        code:
          type: string
        message:
          type: string
        param:
          type: string
        type:
          type: string
      required:
        - message
        - type
      type: object
    ORInputTokensDetails:
      properties:
        cached_tokens:
          type: integer
      required:
        - cached_tokens
      type: object
    OROutputContent:
      properties:
        annotations:
          items:
            description: Any value
          type: array
        refusal:
          type: string
        text:
          type: string
        type:
          type: string
      required:
        - type
        - text
      type: object
    OROutputItem:
      properties:
        action:
          type: string
        arguments:
          type: string
        cache_creation_tokens:
          type: integer
        cache_read_tokens:
          type: integer
        call_id:
          type: string
        content:
          items:
            properties:
              annotations:
                items:
                  description: Any value
                type: array
              refusal:
                type: string
              text:
                type: string
              type:
                type: string
            required:
              - type
              - text
            type: object
          type: array
        cost_usd:
          type: number
        encrypted_content:
          type: string
        execution_ms:
          type: integer
        findings:
          items:
            description: Any value
          type: array
        flagged:
          type: boolean
        guard_type:
          type: string
        id:
          type: string
        model_warnings:
          items:
            type: string
          type: array
        models_used:
          items:
            type: string
          type: array
        name:
          type: string
        role:
          type: string
        status:
          type: string
        summary:
          items:
            properties:
              text:
                type: string
              type:
                type: string
            required:
              - type
              - text
            type: object
          type: array
        type:
          type: string
      required:
        - type
      type: object
    OROutputTokensDetails:
      properties:
        reasoning_tokens:
          type: integer
      required:
        - reasoning_tokens
      type: object
    ORReasoning:
      properties:
        effort:
          type: string
        summary:
          type: string
      type: object
    ORRequest:
      properties:
        frequency_penalty:
          type: number
        include:
          items:
            type: string
          type: array
        input:
          properties:
            Items:
              items:
                properties:
                  type:
                    type: string
                required:
                  - type
                type: object
              type: array
            Text:
              type: string
          required:
            - Text
            - Items
          type: object
        instructions:
          type: string
        max_output_tokens:
          type: integer
        max_tool_calls:
          type: integer
        metadata:
          type: object
        model:
          type: string
        parallel_tool_calls:
          type: boolean
        presence_penalty:
          type: number
        previous_response_id:
          type: string
        reasoning:
          properties:
            effort:
              type: string
            summary:
              type: string
          type: object
        service_tier:
          type: string
        store:
          type: boolean
        stream:
          type: boolean
        temperature:
          type: number
        text:
          properties:
            format:
              properties:
                name:
                  type: string
                schema:
                  type: object
                type:
                  type: string
              required:
                - type
              type: object
          type: object
        tool_choice:
          description: Any value
        tools:
          items:
            properties:
              description:
                type: string
              name:
                type: string
              parameters:
                type: object
              strict:
                type: boolean
              type:
                type: string
            required:
              - type
            type: object
          type: array
        top_p:
          type: number
        truncation:
          type: string
      type: object
    ORResponse:
      properties:
        completed_at:
          type: integer
        created_at:
          type: integer
        error:
          properties:
            code:
              type: string
            message:
              type: string
            param:
              type: string
            type:
              type: string
          required:
            - message
            - type
          type: object
        frequency_penalty:
          type: number
        id:
          type: string
        incomplete_details:
          description: Any value
        instructions:
          type: string
        max_output_tokens:
          type: integer
        metadata:
          type: object
        model:
          type: string
        object:
          type: string
        output:
          items:
            properties:
              action:
                type: string
              arguments:
                type: string
              cache_creation_tokens:
                type: integer
              cache_read_tokens:
                type: integer
              call_id:
                type: string
              content:
                items:
                  properties:
                    annotations:
                      items:
                        description: Any value
                      type: array
                    refusal:
                      type: string
                    text:
                      type: string
                    type:
                      type: string
                  required:
                    - type
                    - text
                  type: object
                type: array
              cost_usd:
                type: number
              encrypted_content:
                type: string
              execution_ms:
                type: integer
              findings:
                items:
                  description: Any value
                type: array
              flagged:
                type: boolean
              guard_type:
                type: string
              id:
                type: string
              model_warnings:
                items:
                  type: string
                type: array
              models_used:
                items:
                  type: string
                type: array
              name:
                type: string
              role:
                type: string
              status:
                type: string
              summary:
                items:
                  properties:
                    text:
                      type: string
                    type:
                      type: string
                  required:
                    - type
                    - text
                  type: object
                type: array
              type:
                type: string
            required:
              - type
            type: object
          type: array
        presence_penalty:
          type: number
        reasoning:
          properties:
            effort:
              type: string
            summary:
              type: string
          type: object
        service_tier:
          type: string
        status:
          type: string
        temperature:
          type: number
        text:
          properties:
            format:
              properties:
                name:
                  type: string
                schema:
                  type: object
                type:
                  type: string
              required:
                - type
              type: object
          type: object
        tool_choice:
          description: Any value
        tools:
          items:
            properties:
              description:
                type: string
              name:
                type: string
              parameters:
                type: object
              strict:
                type: boolean
              type:
                type: string
            required:
              - type
            type: object
          type: array
        top_p:
          type: number
        truncation:
          type: string
        usage:
          properties:
            input_tokens:
              type: integer
            input_tokens_details:
              properties:
                cached_tokens:
                  type: integer
              required:
                - cached_tokens
              type: object
            output_tokens:
              type: integer
            output_tokens_details:
              properties:
                reasoning_tokens:
                  type: integer
              required:
                - reasoning_tokens
              type: object
            total_tokens:
              type: integer
          required:
            - input_tokens
            - output_tokens
            - total_tokens
          type: object
      required:
        - id
        - object
        - created_at
        - completed_at
        - status
        - model
        - output
        - error
        - incomplete_details
        - tool_choice
      type: object
    ORSummaryText:
      properties:
        text:
          type: string
        type:
          type: string
      required:
        - type
        - text
      type: object
    ORTextConfig:
      properties:
        format:
          properties:
            name:
              type: string
            schema:
              type: object
            type:
              type: string
          required:
            - type
          type: object
      type: object
    ORTextFormat:
      properties:
        name:
          type: string
        schema:
          type: object
        type:
          type: string
      required:
        - type
      type: object
    ORToolDef:
      properties:
        description:
          type: string
        name:
          type: string
        parameters:
          type: object
        strict:
          type: boolean
        type:
          type: string
      required:
        - type
      type: object
    ORUsage:
      properties:
        input_tokens:
          type: integer
        input_tokens_details:
          properties:
            cached_tokens:
              type: integer
          required:
            - cached_tokens
          type: object
        output_tokens:
          type: integer
        output_tokens_details:
          properties:
            reasoning_tokens:
              type: integer
          required:
            - reasoning_tokens
          type: object
        total_tokens:
          type: integer
      required:
        - input_tokens
        - output_tokens
        - total_tokens
      type: object
    PendingOperation:
      properties:
        id:
          type: string
        status_url:
          type: string
        type:
          type: string
      required:
        - id
        - status_url
        - type
      type: object
    PendingResponse:
      properties:
        data:
          description: Any value
        meta:
          properties:
            execution_ms:
              type: integer
            function_name:
              type: string
            pending_operations:
              items:
                properties:
                  id:
                    type: string
                  status_url:
                    type: string
                  type:
                    type: string
                required:
                  - id
                  - status_url
                  - type
                type: object
              type: array
            status:
              enum:
                - pending
              type: string
          required:
            - function_name
            - status
            - execution_ms
            - pending_operations
          type: object
      required:
        - data
        - meta
      type: object
    PendingResponseMeta:
      properties:
        execution_ms:
          type: integer
        function_name:
          type: string
        pending_operations:
          items:
            properties:
              id:
                type: string
              status_url:
                type: string
              type:
                type: string
            required:
              - id
              - status_url
              - type
            type: object
          type: array
        status:
          enum:
            - pending
          type: string
      required:
        - function_name
        - status
        - execution_ms
        - pending_operations
      type: object
    RealtimeCreateRequest:
      properties:
        instructions:
          type: string
        model:
          type: string
        provider:
          type: string
        tools:
          items:
            properties:
              description:
                type: string
              name:
                type: string
              parameters:
                type: object
              type:
                type: string
            required:
              - name
            type: object
          type: array
        voice:
          type: string
      required:
        - instructions
      type: object
    RealtimeCreateResponse:
      properties:
        cached:
          type: boolean
        name:
          type: string
        reasoning:
          type: string
        script:
          type: string
      required:
        - name
        - script
        - cached
      type: object
    ReasoningConfig:
      properties:
        effort:
          type: string
        summary:
          type: string
      type: object
    ResponseMeta:
      properties:
        cost:
          type: number
        execution_ms:
          type: integer
        function_name:
          type: string
        generation_ms:
          type: integer
        guards:
          items:
            properties:
              code:
                type: string
              findings:
                items:
                  description: Any value
                type: array
              flagged:
                type: boolean
              phase:
                type: string
              rule_id:
                type: string
              rule_name:
                type: string
              scope_type:
                type: string
              status:
                type: string
              type:
                type: string
            required:
              - type
              - flagged
            type: object
          type: array
        image_gen_calls:
          type: integer
        llm_calls:
          type: integer
        message:
          type: string
        model_warnings:
          items:
            type: string
          type: array
        models_used:
          items:
            type: string
          type: array
        pending_operations:
          items:
            properties:
              id:
                type: string
              status_url:
                type: string
              type:
                type: string
            required:
              - id
              - status_url
              - type
            type: object
          type: array
        script_cached:
          type: boolean
        status:
          type: string
        trace_uuid:
          type: string
        tts_calls:
          type: integer
        usage:
          properties:
            cache_creation_1h_tokens:
              type: integer
            cache_creation_tokens:
              type: integer
            cache_read_tokens:
              type: integer
            input_tokens:
              type: integer
            output_tokens:
              type: integer
            reasoning_tokens:
              type: integer
          required:
            - input_tokens
            - output_tokens
          type: object
      required:
        - function_name
        - script_cached
        - execution_ms
        - llm_calls
        - tts_calls
        - image_gen_calls
      type: object
    ResponsesError:
      properties:
        code:
          type: string
        message:
          type: string
      required:
        - code
        - message
      type: object
    ResponsesOutputContent:
      properties:
        annotations:
          items:
            description: Any value
          type: array
        text:
          type: string
        type:
          type: string
      required:
        - type
        - text
      type: object
    ResponsesOutputItem:
      properties:
        arguments:
          type: string
        call_id:
          type: string
        content:
          items:
            properties:
              annotations:
                items:
                  description: Any value
                type: array
              text:
                type: string
              type:
                type: string
            required:
              - type
              - text
            type: object
          type: array
        encrypted_content:
          type: string
        id:
          type: string
        name:
          type: string
        role:
          type: string
        status:
          type: string
        summary:
          items:
            properties:
              text:
                type: string
              type:
                type: string
            required:
              - type
              - text
            type: object
          type: array
        type:
          type: string
      required:
        - type
      type: object
    ResponsesRequest:
      properties:
        include:
          items:
            type: string
          type: array
        input:
          properties:
            Items:
              items:
                properties:
                  type:
                    type: string
                required:
                  - type
                type: object
              type: array
            Text:
              type: string
          required:
            - Text
            - Items
          type: object
        instructions:
          type: string
        max_output_tokens:
          type: integer
        metadata:
          type: object
        model:
          type: string
        previous_response_id:
          type: string
        reasoning:
          properties:
            effort:
              type: string
            summary:
              type: string
          type: object
        store:
          type: boolean
        stream:
          type: boolean
        temperature:
          type: number
        text:
          properties:
            format:
              properties:
                name:
                  type: string
                schema:
                  type: object
                type:
                  type: string
              required:
                - type
              type: object
          type: object
        tool_choice:
          description: Any value
        tools:
          items:
            properties:
              description:
                type: string
              headers:
                additionalProperties:
                  type: string
                type: object
              name:
                type: string
              parameters:
                type: object
              require_approval:
                type: string
              server_label:
                type: string
              server_url:
                type: string
              type:
                type: string
            required:
              - type
            type: object
          type: array
        top_p:
          type: number
        user:
          type: string
      type: object
    ResponsesResponse:
      properties:
        cost:
          type: number
        created_at:
          type: number
        error:
          properties:
            code:
              type: string
            message:
              type: string
          required:
            - code
            - message
          type: object
        id:
          type: string
        incomplete_details:
          description: Any value
        instructions:
          type: string
        max_output_tokens:
          type: integer
        metadata:
          type: object
        model:
          type: string
        object:
          type: string
        output:
          items:
            properties:
              arguments:
                type: string
              call_id:
                type: string
              content:
                items:
                  properties:
                    annotations:
                      items:
                        description: Any value
                      type: array
                    text:
                      type: string
                    type:
                      type: string
                  required:
                    - type
                    - text
                  type: object
                type: array
              encrypted_content:
                type: string
              id:
                type: string
              name:
                type: string
              role:
                type: string
              status:
                type: string
              summary:
                items:
                  properties:
                    text:
                      type: string
                    type:
                      type: string
                  required:
                    - type
                    - text
                  type: object
                type: array
              type:
                type: string
            required:
              - type
            type: object
          type: array
        output_text:
          type: string
        previous_response_id:
          type: string
        reasoning:
          properties:
            effort:
              type: string
            summary:
              type: string
          type: object
        status:
          type: string
        temperature:
          type: number
        tool_choice:
          description: Any value
        tools:
          items:
            properties:
              description:
                type: string
              headers:
                additionalProperties:
                  type: string
                type: object
              name:
                type: string
              parameters:
                type: object
              require_approval:
                type: string
              server_label:
                type: string
              server_url:
                type: string
              type:
                type: string
            required:
              - type
            type: object
          type: array
        top_p:
          type: number
        usage:
          properties:
            input_tokens:
              type: integer
            input_tokens_details:
              properties:
                cached_tokens:
                  type: integer
              type: object
            output_tokens:
              type: integer
            output_tokens_details:
              properties:
                reasoning_tokens:
                  type: integer
              type: object
            total_tokens:
              type: integer
          required:
            - input_tokens
            - output_tokens
            - total_tokens
          type: object
        user:
          type: string
      required:
        - id
        - object
        - created_at
        - model
        - status
        - output
        - error
        - incomplete_details
        - tool_choice
      type: object
    ResponsesTool:
      properties:
        description:
          type: string
        headers:
          additionalProperties:
            type: string
          type: object
        name:
          type: string
        parameters:
          type: object
        require_approval:
          type: string
        server_label:
          type: string
        server_url:
          type: string
        type:
          type: string
      required:
        - type
      type: object
    ResponsesUsage:
      properties:
        input_tokens:
          type: integer
        input_tokens_details:
          properties:
            cached_tokens:
              type: integer
          type: object
        output_tokens:
          type: integer
        output_tokens_details:
          properties:
            reasoning_tokens:
              type: integer
          type: object
        total_tokens:
          type: integer
      required:
        - input_tokens
        - output_tokens
        - total_tokens
      type: object
    RevisionInfo:
      properties:
        created_at:
          format: date-time
          type: string
        is_current:
          type: boolean
        revision_id:
          type: integer
        schema_hash:
          type: string
      required:
        - revision_id
        - created_at
        - schema_hash
        - is_current
      type: object
    RoundtableModelResult:
      properties:
        cost:
          description: USD cost for this model call summed across retries.
          type: number
        data:
          description: Raw model output. When output_schema is supplied this is a JSON string that validated against the schema.
          type: string
        duration_ms:
          description: Wall-clock time for this model call in milliseconds including retries.
          type: integer
        error:
          description: Provider or transport error message. Empty on success.
          type: string
        index:
          description: Position of this model in the request's models array (0-based).
          type: integer
        model:
          description: Name of the model that produced this result.
          type: string
        schema_error:
          description: Why the output failed schema validation. Empty when schema_valid is true or absent.
          type: string
        schema_valid:
          description: Whether the model's output validated against the request's output_schema. Absent when no output_schema was supplied.
          type: boolean
        usage:
          description: Token counts aggregated across all retry attempts.
          properties:
            cache_creation_1h_tokens:
              type: integer
            cache_creation_tokens:
              type: integer
            cache_read_tokens:
              type: integer
            extra:
              type: object
            input_audio_tokens:
              type: integer
            input_tokens:
              type: integer
            output_audio_tokens:
              type: integer
            output_tokens:
              type: integer
            reasoning_tokens:
              type: integer
            web_fetch_requests:
              type: integer
            web_search_requests:
              type: integer
          required:
            - input_tokens
            - output_tokens
          type: object
      required:
        - index
        - model
        - data
        - duration_ms
      type: object
    RoundtableModelSpec:
      properties:
        max_tokens:
          description: Override max output tokens for this model. Falls back to the model's configured default or 8192 when unspecified.
          type: integer
        name:
          description: Model identifier (e.g. gpt-4o or anthropic/claude-sonnet-4-20250514)
          type: string
        reasoning:
          description: "Reasoning effort: low/medium/high/max"
          type: string
        temperature:
          description: Override temperature for this model (0.0-2.0)
          type: number
        top_p:
          description: Override top_p for this model
          type: number
      required:
        - name
      type: object
    RoundtableRequest:
      properties:
        choices:
          description: Literal options for multiple_choice resolution
          items:
            type: string
          type: array
        input:
          description: The question or prompt sent to all models
          type: string
        instructions:
          description: System prompt shared across all model calls
          type: string
        max_retries:
          description: Per-model retry count on transient errors (default 1 / max 3)
          type: integer
        models:
          description: Models to query in parallel
          items:
            properties:
              max_tokens:
                description: Override max output tokens for this model. Falls back to the model's configured default or 8192 when unspecified.
                type: integer
              name:
                description: Model identifier (e.g. gpt-4o or anthropic/claude-sonnet-4-20250514)
                type: string
              reasoning:
                description: "Reasoning effort: low/medium/high/max"
                type: string
              temperature:
                description: Override temperature for this model (0.0-2.0)
                type: number
              top_p:
                description: Override top_p for this model
                type: number
            required:
              - name
            type: object
          type: array
        output_schema:
          description: JSON Schema for structured output — applied to all model calls and the consolidation call
          type: object
        resolution:
          description: "Resolution mode: summary (default) / fast / multiple_choice"
          type: string
        stream:
          description: Enable SSE streaming
          type: boolean
        summary_model:
          description: Override the model used for consolidation in summary mode
          type: string
        timeout_ms:
          description: Per-model timeout in milliseconds covering all retries (default 120000 / max 300000)
          type: integer
      required:
        - input
        - models
      type: object
    RoundtableResponse:
      properties:
        data:
          description: Final consolidated output. Null in fast mode (no consolidation runs).
          type: string
        id:
          description: Stable identifier for this roundtable call.
          type: string
        meta:
          description: Aggregated call metadata.
          properties:
            models_used:
              description: Names of the models queried in parallel.
              items:
                type: string
              type: array
            resolution:
              description: Resolution mode that produced this response (summary / fast / multiple_choice).
              type: string
            summary_model:
              description: Model used for the consolidation call. Only set in summary mode.
              type: string
            summary_usage:
              description: Token counts for the consolidation call aggregated across retries.
              properties:
                cache_creation_1h_tokens:
                  type: integer
                cache_creation_tokens:
                  type: integer
                cache_read_tokens:
                  type: integer
                extra:
                  type: object
                input_audio_tokens:
                  type: integer
                input_tokens:
                  type: integer
                output_audio_tokens:
                  type: integer
                output_tokens:
                  type: integer
                reasoning_tokens:
                  type: integer
                web_fetch_requests:
                  type: integer
                web_search_requests:
                  type: integer
              required:
                - input_tokens
                - output_tokens
              type: object
            total_cost:
              description: USD cost summed across all fan-out models and the consolidation call.
              type: number
            total_duration_ms:
              description: End-to-end request duration in milliseconds.
              type: integer
            trace_uuid:
              description: UUID of the trace span for this roundtable call.
              type: string
          required:
            - resolution
            - models_used
            - total_cost
            - total_duration_ms
          type: object
        model_results:
          description: Per-model fan-out results in the order they appeared in the request.
          items:
            properties:
              cost:
                description: USD cost for this model call summed across retries.
                type: number
              data:
                description: Raw model output. When output_schema is supplied this is a JSON string that validated against the schema.
                type: string
              duration_ms:
                description: Wall-clock time for this model call in milliseconds including retries.
                type: integer
              error:
                description: Provider or transport error message. Empty on success.
                type: string
              index:
                description: Position of this model in the request's models array (0-based).
                type: integer
              model:
                description: Name of the model that produced this result.
                type: string
              schema_error:
                description: Why the output failed schema validation. Empty when schema_valid is true or absent.
                type: string
              schema_valid:
                description: Whether the model's output validated against the request's output_schema. Absent when no output_schema was supplied.
                type: boolean
              usage:
                description: Token counts aggregated across all retry attempts.
                properties:
                  cache_creation_1h_tokens:
                    type: integer
                  cache_creation_tokens:
                    type: integer
                  cache_read_tokens:
                    type: integer
                  extra:
                    type: object
                  input_audio_tokens:
                    type: integer
                  input_tokens:
                    type: integer
                  output_audio_tokens:
                    type: integer
                  output_tokens:
                    type: integer
                  reasoning_tokens:
                    type: integer
                  web_fetch_requests:
                    type: integer
                  web_search_requests:
                    type: integer
                required:
                  - input_tokens
                  - output_tokens
                type: object
            required:
              - index
              - model
              - data
              - duration_ms
            type: object
          type: array
      required:
        - id
        - data
        - meta
        - model_results
      type: object
    RoundtableResponseMeta:
      properties:
        models_used:
          description: Names of the models queried in parallel.
          items:
            type: string
          type: array
        resolution:
          description: Resolution mode that produced this response (summary / fast / multiple_choice).
          type: string
        summary_model:
          description: Model used for the consolidation call. Only set in summary mode.
          type: string
        summary_usage:
          description: Token counts for the consolidation call aggregated across retries.
          properties:
            cache_creation_1h_tokens:
              type: integer
            cache_creation_tokens:
              type: integer
            cache_read_tokens:
              type: integer
            extra:
              type: object
            input_audio_tokens:
              type: integer
            input_tokens:
              type: integer
            output_audio_tokens:
              type: integer
            output_tokens:
              type: integer
            reasoning_tokens:
              type: integer
            web_fetch_requests:
              type: integer
            web_search_requests:
              type: integer
          required:
            - input_tokens
            - output_tokens
          type: object
        total_cost:
          description: USD cost summed across all fan-out models and the consolidation call.
          type: number
        total_duration_ms:
          description: End-to-end request duration in milliseconds.
          type: integer
        trace_uuid:
          description: UUID of the trace span for this roundtable call.
          type: string
      required:
        - resolution
        - models_used
        - total_cost
        - total_duration_ms
      type: object
    RoundtableStreamChunk:
      properties:
        cost:
          description: USD cost for the model that just completed (on model_done / resolution_done).
          type: number
        data:
          description: Full accumulated content on model_done and resolution_done events.
          type: string
        delta:
          description: Incremental text payload on model_delta and resolution_delta events.
          type: string
        error:
          description: Error message for this event.
          type: string
        meta:
          description: Aggregated response meta. Only set on the final done event.
          properties:
            models_used:
              description: Names of the models queried in parallel.
              items:
                type: string
              type: array
            resolution:
              description: Resolution mode that produced this response (summary / fast / multiple_choice).
              type: string
            summary_model:
              description: Model used for the consolidation call. Only set in summary mode.
              type: string
            summary_usage:
              description: Token counts for the consolidation call aggregated across retries.
              properties:
                cache_creation_1h_tokens:
                  type: integer
                cache_creation_tokens:
                  type: integer
                cache_read_tokens:
                  type: integer
                extra:
                  type: object
                input_audio_tokens:
                  type: integer
                input_tokens:
                  type: integer
                output_audio_tokens:
                  type: integer
                output_tokens:
                  type: integer
                reasoning_tokens:
                  type: integer
                web_fetch_requests:
                  type: integer
                web_search_requests:
                  type: integer
              required:
                - input_tokens
                - output_tokens
              type: object
            total_cost:
              description: USD cost summed across all fan-out models and the consolidation call.
              type: number
            total_duration_ms:
              description: End-to-end request duration in milliseconds.
              type: integer
            trace_uuid:
              description: UUID of the trace span for this roundtable call.
              type: string
          required:
            - resolution
            - models_used
            - total_cost
            - total_duration_ms
          type: object
        model:
          description: Model name. Set on model_start / model_done and resolution_start.
          type: string
        model_index:
          description: Index of the fan-out model this event refers to. Present on model_* events.
          type: integer
        schema_error:
          description: Validation failure detail when schema_valid is false.
          type: string
        schema_valid:
          description: output_schema validation result on model_done and resolution_done. Absent when no output_schema was supplied.
          type: boolean
        type:
          description: "Event type: model_start / model_delta / model_done / resolution_start / resolution_delta / resolution_done / done."
          type: string
        usage:
          description: Token counts for the model that just completed (on model_done / resolution_done).
          properties:
            cache_creation_1h_tokens:
              type: integer
            cache_creation_tokens:
              type: integer
            cache_read_tokens:
              type: integer
            extra:
              type: object
            input_audio_tokens:
              type: integer
            input_tokens:
              type: integer
            output_audio_tokens:
              type: integer
            output_tokens:
              type: integer
            reasoning_tokens:
              type: integer
            web_fetch_requests:
              type: integer
            web_search_requests:
              type: integer
          required:
            - input_tokens
            - output_tokens
          type: object
      required:
        - type
      type: object
    RunRequest:
      properties:
        guard:
          properties:
            input:
              items:
                properties:
                  action:
                    type: string
                  applies_to:
                    type: string
                  check:
                    type: string
                  custom_patterns:
                    items:
                      type: string
                    type: array
                  engine:
                    type: string
                  kind:
                    type: string
                  model:
                    type: string
                  name:
                    type: string
                  patterns:
                    items:
                      properties:
                        name:
                          type: string
                        regex:
                          type: string
                      required:
                        - regex
                      type: object
                    type: array
                  presets:
                    items:
                      type: string
                    type: array
                  prompt:
                    type: string
                  replacement:
                    type: string
                  rule_id:
                    type: string
                  rule_name:
                    type: string
                  scope:
                    properties:
                      functions:
                        items:
                          type: string
                        type: array
                      kind:
                        type: string
                    required:
                      - kind
                    type: object
                  scope_type:
                    type: string
                  type:
                    type: string
                type: object
              type: array
            output:
              items:
                properties:
                  action:
                    type: string
                  applies_to:
                    type: string
                  check:
                    type: string
                  custom_patterns:
                    items:
                      type: string
                    type: array
                  engine:
                    type: string
                  kind:
                    type: string
                  model:
                    type: string
                  name:
                    type: string
                  patterns:
                    items:
                      properties:
                        name:
                          type: string
                        regex:
                          type: string
                      required:
                        - regex
                      type: object
                    type: array
                  presets:
                    items:
                      type: string
                    type: array
                  prompt:
                    type: string
                  replacement:
                    type: string
                  rule_id:
                    type: string
                  rule_name:
                    type: string
                  scope:
                    properties:
                      functions:
                        items:
                          type: string
                        type: array
                      kind:
                        type: string
                    required:
                      - kind
                    type: object
                  scope_type:
                    type: string
                  type:
                    type: string
                type: object
              type: array
          type: object
        input:
          description: Any value
        input_schema:
          description: JSON Schema for the input. Optional; defaults to string when omitted.
          type: object
        instructions:
          type: string
        model:
          oneOf:
            - description: Model identifier (e.g. "openai/gpt-4o")
              type: string
            - properties:
                extra_headers:
                  description: Extra HTTP headers to send with requests to this model
                  type: object
                name:
                  description: Model identifier (e.g. "openai/gpt-4o")
                  type: string
                options:
                  description: Per-model parameters (temperature, max_tokens, reasoning_effort, etc.)
                  type: object
              required:
                - name
              type: object
            - description: Fallback chain — models tried in order on retriable errors
              items:
                oneOf:
                  - type: string
                  - properties:
                      extra_headers:
                        description: Extra HTTP headers to send with requests to this model
                        type: object
                      name:
                        description: Model identifier (e.g. "openai/gpt-4o")
                        type: string
                      options:
                        description: Per-model parameters (temperature, max_tokens, reasoning_effort, etc.)
                        type: object
                    required:
                      - name
                    type: object
              type: array
        name:
          type: string
        output_schema:
          description: JSON Schema for the output. Optional; defaults to string when omitted.
          type: object
        parent_span_id:
          type: string
        reasoning_effort:
          description: Reasoning effort for reasoning-capable models. One of "low"
          type: string
        reasoning_summary:
          description: Opt into thought summary streaming. "auto"
          type: string
        route:
          properties:
            prefer:
              type: string
          type: object
        stream:
          type: boolean
        tools:
          items:
            properties:
              description:
                type: string
              name:
                type: string
              parameters:
                type: object
              type:
                type: string
            required:
              - name
            type: object
          type: array
      required:
        - input
      type: object
    RunResponse:
      properties:
        data:
          description: Any value
        meta:
          properties:
            cost:
              type: number
            execution_ms:
              type: integer
            function_name:
              type: string
            generation_ms:
              type: integer
            guards:
              items:
                properties:
                  code:
                    type: string
                  findings:
                    items:
                      description: Any value
                    type: array
                  flagged:
                    type: boolean
                  phase:
                    type: string
                  rule_id:
                    type: string
                  rule_name:
                    type: string
                  scope_type:
                    type: string
                  status:
                    type: string
                  type:
                    type: string
                required:
                  - type
                  - flagged
                type: object
              type: array
            image_gen_calls:
              type: integer
            llm_calls:
              type: integer
            message:
              type: string
            model_warnings:
              items:
                type: string
              type: array
            models_used:
              items:
                type: string
              type: array
            pending_operations:
              items:
                properties:
                  id:
                    type: string
                  status_url:
                    type: string
                  type:
                    type: string
                required:
                  - id
                  - status_url
                  - type
                type: object
              type: array
            script_cached:
              type: boolean
            status:
              type: string
            trace_uuid:
              type: string
            tts_calls:
              type: integer
            usage:
              properties:
                cache_creation_1h_tokens:
                  type: integer
                cache_creation_tokens:
                  type: integer
                cache_read_tokens:
                  type: integer
                input_tokens:
                  type: integer
                output_tokens:
                  type: integer
                reasoning_tokens:
                  type: integer
              required:
                - input_tokens
                - output_tokens
              type: object
          required:
            - function_name
            - script_cached
            - execution_ms
            - llm_calls
            - tts_calls
            - image_gen_calls
          type: object
      required:
        - data
      type: object
    StreamOptions:
      properties:
        include_usage:
          type: boolean
      type: object
    Tool:
      properties:
        description:
          type: string
        name:
          type: string
        parameters:
          type: object
        type:
          type: string
      required:
        - name
      type: object
    UpdateFunctionRequest:
      properties:
        source:
          type: string
      required:
        - source
      type: object
    UpdateSpanRequest:
      properties:
        end_time:
          format: date-time
          type: string
        error:
          type: string
        meta:
          type: object
        metadata:
          type: object
        output:
          type: string
        tags:
          type: object
      type: object
    UsageInfo:
      properties:
        cache_creation_1h_tokens:
          type: integer
        cache_creation_tokens:
          type: integer
        cache_read_tokens:
          type: integer
        input_tokens:
          type: integer
        output_tokens:
          type: integer
        reasoning_tokens:
          type: integer
      required:
        - input_tokens
        - output_tokens
      type: object
    WebFetchRequest:
      properties:
        url:
          type: string
      required:
        - url
      type: object
    WebFetchResponse:
      properties:
        content:
          type: string
        title:
          type: string
        url:
          type: string
      required:
        - url
        - title
        - content
      type: object
    WebSearchRequest:
      properties:
        max_results:
          type: integer
        query:
          type: string
      required:
        - query
      type: object
    WebSearchResponse:
      properties:
        results:
          items:
            properties:
              published_at:
                type: string
              snippet:
                type: string
              title:
                type: string
              url:
                type: string
            required:
              - title
              - url
              - snippet
            type: object
          type: array
      required:
        - results
      type: object
    WebSearchResult:
      properties:
        published_at:
          type: string
        snippet:
          type: string
        title:
          type: string
        url:
          type: string
      required:
        - title
        - url
        - snippet
      type: object
  securitySchemes:
    BearerAuth:
      bearerFormat: API Key
      description: API key authentication. Pass your API key as a Bearer token.
      scheme: bearer
      type: http
info:
  description: Schema-driven generative API that orchestrates LLM-powered workflows.
  title: Task API
  version: 3.0.0
openapi: 3.1.0
paths:
  /health:
    get:
      description: Returns server health status.
      operationId: healthCheck
      responses:
        "200":
          content:
            application/json:
              schema:
                properties:
                  status:
                    example: ok
                    type: string
                type: object
          description: Successful response
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Bad request
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Internal server error
      security: []
      summary: Health check
      tags:
        - System
  /v3/artifacts/{id}/status:
    get:
      description: Poll for async artifact generation status. Returns a presigned download URL when the generation is complete.
      operationId: getArtifactStatus
      parameters:
        - description: Artifact generation ID
          in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                properties:
                  error:
                    description: Error message (only when failed)
                    type: string
                  id:
                    type: string
                  mime_type:
                    type: string
                  status:
                    enum:
                      - processing
                      - completed
                      - failed
                    type: string
                  url:
                    description: Presigned download URL (only when completed)
                    type: string
                type: object
          description: Successful response
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Bad request
        "401":
          description: "Unauthorized - missing or invalid API key"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Internal server error
      summary: Get artifact generation status
      tags:
        - Artifacts
  /v3/call:
    post:
      description: Execute a function by name (passed in the request body). If no cached script exists, one is generated automatically.
      operationId: call
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CallRequest"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RunResponse"
          description: Successful response
        "202":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PendingResponse"
          description: Accepted – async operation pending. Poll the status URL in meta.pending_operations.
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Bad request
        "401":
          description: "Unauthorized - missing or invalid API key"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Internal server error
      summary: Call function by name
      tags:
        - Functions
  /v3/call/stream:
    post:
      description: Execute a function by name (passed in the request body) with SSE streaming output.
      operationId: callStream
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CallRequest"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RunResponse"
            text/event-stream:
              schema:
                description: "Server-Sent Events stream. Each event is a JSON object prefixed with 'data: ' and terminated with the '[DONE]' sentinel."
                type: string
          description: Successful response
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Bad request
        "401":
          description: "Unauthorized - missing or invalid API key"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Internal server error
      summary: Stream function by name
      tags:
        - Functions
  /v3/compat/chat/completions:
    post:
      description: OpenAI-compatible chat completions endpoint. Supports streaming via the stream parameter.
      operationId: chatCompletions
      parameters:
        - description: Function name for tracing and routing.
          in: header
          name: X-Opper-Name
          schema:
            type: string
        - description: Parent span ID for distributed tracing context.
          in: header
          name: X-Opper-Parent-Span-Id
          schema:
            format: uuid
            type: string
        - description: Comma-separated input guardrail checks (e.g. "pii,secrets").
          in: header
          name: X-Opper-Guard-Input
          schema:
            type: string
        - description: Comma-separated output guardrail checks (e.g. "toxicity").
          in: header
          name: X-Opper-Guard-Output
          schema:
            type: string
        - description: "Action for guardrail violations: \"flag\" (default), \"block\", or \"redact\"."
          in: header
          name: X-Opper-Guard-Action
          schema:
            default: flag
            enum:
              - flag
              - block
              - redact
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ChatRequest"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ChatResponse"
            text/event-stream:
              schema:
                description: "Server-Sent Events stream. Each event is a JSON object prefixed with 'data: ' and terminated with the '[DONE]' sentinel."
                type: string
          description: Successful response
          headers:
            X-Opper-Cost:
              description: Execution cost of the request as a floating-point number.
              schema:
                format: double
                type: number
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Bad request
        "401":
          description: "Unauthorized - missing or invalid API key"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Internal server error
      summary: Chat Completions API
      tags:
        - Compatibility
  /v3/compat/embeddings:
    post:
      description: OpenAI-compatible embeddings endpoint.
      operationId: createEmbeddings
      parameters:
        - description: Function name for tracing and routing.
          in: header
          name: X-Opper-Name
          schema:
            type: string
        - description: Parent span ID for distributed tracing context.
          in: header
          name: X-Opper-Parent-Span-Id
          schema:
            format: uuid
            type: string
        - description: Comma-separated input guardrail checks (e.g. "pii,secrets").
          in: header
          name: X-Opper-Guard-Input
          schema:
            type: string
        - description: Comma-separated output guardrail checks (e.g. "toxicity").
          in: header
          name: X-Opper-Guard-Output
          schema:
            type: string
        - description: "Action for guardrail violations: \"flag\" (default), \"block\", or \"redact\"."
          in: header
          name: X-Opper-Guard-Action
          schema:
            default: flag
            enum:
              - flag
              - block
              - redact
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/EmbeddingsRequest"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/EmbeddingsResponse"
          description: Successful response
          headers:
            X-Opper-Cost:
              description: Execution cost of the request as a floating-point number.
              schema:
                format: double
                type: number
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Bad request
        "401":
          description: "Unauthorized - missing or invalid API key"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Internal server error
      summary: Embeddings API
      tags:
        - Compatibility
  /v3/compat/openresponses:
    post:
      description: "OpenResponses-compatible endpoint with multi-provider support and opper: extension items."
      operationId: createOpenResponse
      parameters:
        - description: Function name for tracing and routing.
          in: header
          name: X-Opper-Name
          schema:
            type: string
        - description: Parent span ID for distributed tracing context.
          in: header
          name: X-Opper-Parent-Span-Id
          schema:
            format: uuid
            type: string
        - description: Comma-separated input guardrail checks (e.g. "pii,secrets").
          in: header
          name: X-Opper-Guard-Input
          schema:
            type: string
        - description: Comma-separated output guardrail checks (e.g. "toxicity").
          in: header
          name: X-Opper-Guard-Output
          schema:
            type: string
        - description: "Action for guardrail violations: \"flag\" (default), \"block\", or \"redact\"."
          in: header
          name: X-Opper-Guard-Action
          schema:
            default: flag
            enum:
              - flag
              - block
              - redact
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ORRequest"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ORResponse"
            text/event-stream:
              schema:
                description: "Server-Sent Events stream. Each event is a JSON object prefixed with 'data: ' and terminated with the '[DONE]' sentinel."
                type: string
          description: Successful response
          headers:
            X-Opper-Cost:
              description: Execution cost of the request as a floating-point number.
              schema:
                format: double
                type: number
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Bad request
        "401":
          description: "Unauthorized - missing or invalid API key"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Internal server error
      summary: OpenResponses API
      tags:
        - Compatibility
  /v3/compat/responses:
    post:
      description: OpenAI Responses API compatible endpoint. Supports streaming via the stream parameter.
      operationId: createResponse
      parameters:
        - description: Function name for tracing and routing.
          in: header
          name: X-Opper-Name
          schema:
            type: string
        - description: Parent span ID for distributed tracing context.
          in: header
          name: X-Opper-Parent-Span-Id
          schema:
            format: uuid
            type: string
        - description: Comma-separated input guardrail checks (e.g. "pii,secrets").
          in: header
          name: X-Opper-Guard-Input
          schema:
            type: string
        - description: Comma-separated output guardrail checks (e.g. "toxicity").
          in: header
          name: X-Opper-Guard-Output
          schema:
            type: string
        - description: "Action for guardrail violations: \"flag\" (default), \"block\", or \"redact\"."
          in: header
          name: X-Opper-Guard-Action
          schema:
            default: flag
            enum:
              - flag
              - block
              - redact
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ResponsesRequest"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ResponsesResponse"
            text/event-stream:
              schema:
                description: "Server-Sent Events stream. Each event is a JSON object prefixed with 'data: ' and terminated with the '[DONE]' sentinel."
                type: string
          description: Successful response
          headers:
            X-Opper-Cost:
              description: Execution cost of the request as a floating-point number.
              schema:
                format: double
                type: number
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Bad request
        "401":
          description: "Unauthorized - missing or invalid API key"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Internal server error
      summary: Responses API
      tags:
        - Compatibility
  /v3/compat/v1/messages:
    post:
      description: Anthropic Messages API compatible endpoint. Supports streaming via the stream parameter.
      operationId: createMessage
      parameters:
        - description: Function name for tracing and routing.
          in: header
          name: X-Opper-Name
          schema:
            type: string
        - description: Parent span ID for distributed tracing context.
          in: header
          name: X-Opper-Parent-Span-Id
          schema:
            format: uuid
            type: string
        - description: Comma-separated input guardrail checks (e.g. "pii,secrets").
          in: header
          name: X-Opper-Guard-Input
          schema:
            type: string
        - description: Comma-separated output guardrail checks (e.g. "toxicity").
          in: header
          name: X-Opper-Guard-Output
          schema:
            type: string
        - description: "Action for guardrail violations: \"flag\" (default), \"block\", or \"redact\"."
          in: header
          name: X-Opper-Guard-Action
          schema:
            default: flag
            enum:
              - flag
              - block
              - redact
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/MessagesRequest"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MessagesResponse"
            text/event-stream:
              schema:
                description: "Server-Sent Events stream. Each event is a JSON object prefixed with 'data: ' and terminated with the '[DONE]' sentinel."
                type: string
          description: Successful response
          headers:
            X-Opper-Cost:
              description: Execution cost of the request as a floating-point number.
              schema:
                format: double
                type: number
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Bad request
        "401":
          description: "Unauthorized - missing or invalid API key"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Internal server error
      summary: Messages API
      tags:
        - Compatibility
  /v3/compat/v1beta/interactions:
    post:
      description: Google Interactions API compatible endpoint. Supports streaming via the stream parameter.
      operationId: createInteraction
      parameters:
        - description: Function name for tracing and routing.
          in: header
          name: X-Opper-Name
          schema:
            type: string
        - description: Parent span ID for distributed tracing context.
          in: header
          name: X-Opper-Parent-Span-Id
          schema:
            format: uuid
            type: string
        - description: Comma-separated input guardrail checks (e.g. "pii,secrets").
          in: header
          name: X-Opper-Guard-Input
          schema:
            type: string
        - description: Comma-separated output guardrail checks (e.g. "toxicity").
          in: header
          name: X-Opper-Guard-Output
          schema:
            type: string
        - description: "Action for guardrail violations: \"flag\" (default), \"block\", or \"redact\"."
          in: header
          name: X-Opper-Guard-Action
          schema:
            default: flag
            enum:
              - flag
              - block
              - redact
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/InteractionsRequest"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/InteractionsResponse"
            text/event-stream:
              schema:
                description: "Server-Sent Events stream. Each event is a JSON object prefixed with 'data: ' and terminated with the '[DONE]' sentinel."
                type: string
          description: Successful response
          headers:
            X-Opper-Cost:
              description: Execution cost of the request as a floating-point number.
              schema:
                format: double
                type: number
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Bad request
        "401":
          description: "Unauthorized - missing or invalid API key"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Internal server error
      summary: Interactions API
      tags:
        - Compatibility
  /v3/functions:
    get:
      description: List all cached functions for the authenticated project.
      operationId: listFunctions
      responses:
        "200":
          content:
            application/json:
              schema:
                properties:
                  functions:
                    items:
                      $ref: "#/components/schemas/FunctionInfo"
                    type: array
                type: object
          description: Successful response
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Bad request
        "401":
          description: "Unauthorized - missing or invalid API key"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Internal server error
      summary: List functions
      tags:
        - Functions
  /v3/functions/{name}:
    delete:
      description: Delete a cached function.
      operationId: deleteFunction
      parameters:
        - description: Function name
          in: path
          name: name
          required: true
          schema:
            type: string
      responses:
        "204":
          description: No content
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Bad request
        "401":
          description: "Unauthorized - missing or invalid API key"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Internal server error
      summary: Delete function
      tags:
        - Functions
    get:
      description: Get details of a specific function including its script source.
      operationId: getFunction
      parameters:
        - description: Function name
          in: path
          name: name
          required: true
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FunctionDetails"
          description: Successful response
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Bad request
        "401":
          description: "Unauthorized - missing or invalid API key"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Internal server error
      summary: Get function
      tags:
        - Functions
    put:
      description: Update the source code of a function.
      operationId: updateFunction
      parameters:
        - description: Function name
          in: path
          name: name
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpdateFunctionRequest"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FunctionDetails"
          description: Successful response
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Bad request
        "401":
          description: "Unauthorized - missing or invalid API key"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Internal server error
      summary: Update function
      tags:
        - Functions
  /v3/functions/{name}/call:
    post:
      description: Execute a function with the given input. If no cached script exists, one is generated automatically.
      operationId: callFunction
      parameters:
        - description: Function name
          in: path
          name: name
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RunRequest"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RunResponse"
          description: Successful response
        "202":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PendingResponse"
          description: Accepted – async operation pending. Poll the status URL in meta.pending_operations.
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Bad request
        "401":
          description: "Unauthorized - missing or invalid API key"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Internal server error
      summary: Call function
      tags:
        - Functions
  /v3/functions/{name}/examples:
    get:
      description: List few-shot examples for a function with optional tag filter.
      operationId: listExamples
      parameters:
        - description: Function name
          in: path
          name: name
          required: true
          schema:
            type: string
        - description: Max items to return (default 50, max 200)
          in: query
          name: limit
          schema:
            default: 50
            type: integer
        - description: Number of items to skip (default 0)
          in: query
          name: offset
          schema:
            default: 0
            type: integer
        - description: Filter by tag (e.g. train, test, golden)
          in: query
          name: tag
          schema:
            type: string
      responses:
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Bad request
        "401":
          description: "Unauthorized - missing or invalid API key"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Internal server error
      summary: List examples
      tags:
        - Examples
    post:
      description: Create a single few-shot example for a function.
      operationId: createExample
      parameters:
        - description: Function name
          in: path
          name: name
          required: true
          schema:
            type: string
      responses:
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Bad request
        "401":
          description: "Unauthorized - missing or invalid API key"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Internal server error
      summary: Create example
      tags:
        - Examples
  /v3/functions/{name}/examples/batch:
    post:
      description: Upload multiple few-shot examples for a function.
      operationId: createExampleBatch
      parameters:
        - description: Function name
          in: path
          name: name
          required: true
          schema:
            type: string
      responses:
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Bad request
        "401":
          description: "Unauthorized - missing or invalid API key"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Internal server error
      summary: Batch create examples
      tags:
        - Examples
  /v3/functions/{name}/examples/{uuid}:
    delete:
      description: Delete a single few-shot example by UUID.
      operationId: deleteExample
      parameters:
        - description: Function name
          in: path
          name: name
          required: true
          schema:
            type: string
        - description: Example UUID
          in: path
          name: uuid
          required: true
          schema:
            type: string
      responses:
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Bad request
        "401":
          description: "Unauthorized - missing or invalid API key"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Internal server error
      summary: Delete example
      tags:
        - Examples
  /v3/functions/{name}/realtime:
    post:
      description: Generate a realtime voice agent function.
      operationId: createRealtimeFunction
      parameters:
        - description: Function name
          in: path
          name: name
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RealtimeCreateRequest"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RealtimeCreateResponse"
          description: Successful response
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Bad request
        "401":
          description: "Unauthorized - missing or invalid API key"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Internal server error
      summary: Create realtime function
      tags:
        - Functions
  /v3/functions/{name}/revisions:
    get:
      description: List all revisions of a function.
      operationId: listRevisions
      parameters:
        - description: Function name
          in: path
          name: name
          required: true
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                properties:
                  revisions:
                    items:
                      $ref: "#/components/schemas/RevisionInfo"
                    type: array
                type: object
          description: Successful response
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Bad request
        "401":
          description: "Unauthorized - missing or invalid API key"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Internal server error
      summary: List revisions
      tags:
        - Functions
  /v3/functions/{name}/revisions/{revisionID}:
    get:
      description: Get a specific revision of a function.
      operationId: getRevision
      parameters:
        - description: Function name
          in: path
          name: name
          required: true
          schema:
            type: string
        - description: Revision ID
          in: path
          name: revisionID
          required: true
          schema:
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FunctionRevision"
          description: Successful response
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Bad request
        "401":
          description: "Unauthorized - missing or invalid API key"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Internal server error
      summary: Get revision
      tags:
        - Functions
  /v3/functions/{name}/revisions/{revisionID}/revert:
    post:
      description: Revert a function to a previous revision.
      operationId: revertRevision
      parameters:
        - description: Function name
          in: path
          name: name
          required: true
          schema:
            type: string
        - description: Revision ID
          in: path
          name: revisionID
          required: true
          schema:
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FunctionDetails"
          description: Successful response
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Bad request
        "401":
          description: "Unauthorized - missing or invalid API key"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Internal server error
      summary: Revert to revision
      tags:
        - Functions
  /v3/functions/{name}/stream:
    post:
      description: Execute a function with SSE streaming output.
      operationId: streamFunction
      parameters:
        - description: Function name
          in: path
          name: name
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RunRequest"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RunResponse"
            text/event-stream:
              schema:
                description: "Server-Sent Events stream. Each event is a JSON object prefixed with 'data: ' and terminated with the '[DONE]' sentinel."
                type: string
          description: Successful response
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Bad request
        "401":
          description: "Unauthorized - missing or invalid API key"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Internal server error
      summary: Stream function
      tags:
        - Functions
  /v3/generations:
    get:
      description: List recorded HTTP request/response generations with pagination.
      operationId: listGenerations
      parameters:
        - description: Semantic search query (uses hybrid dense+sparse search)
          in: query
          name: query
          schema:
            type: string
        - description: Page number (default 1)
          in: query
          name: page
          schema:
            default: 1
            type: integer
        - description: Items per page (default 50)
          in: query
          name: page_size
          schema:
            default: 50
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                properties:
                  data:
                    items:
                      type: object
                    type: array
                  meta:
                    properties:
                      page:
                        type: integer
                      page_size:
                        type: integer
                      total:
                        type: integer
                      total_pages:
                        type: integer
                    type: object
                type: object
          description: Successful response
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Bad request
        "401":
          description: "Unauthorized - missing or invalid API key"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Internal server error
      summary: List generations
      tags:
        - Generations
  /v3/generations/{id}:
    delete:
      description: Delete a specific recorded generation.
      operationId: deleteGeneration
      parameters:
        - description: Generation ID
          in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                properties:
                  deleted:
                    type: boolean
                type: object
          description: Successful response
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Bad request
        "401":
          description: "Unauthorized - missing or invalid API key"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Internal server error
      summary: Delete generation
      tags:
        - Generations
    get:
      description: Get a specific recorded generation by ID.
      operationId: getGeneration
      parameters:
        - description: Generation ID
          in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                description: Recorded generation with request and response data
                type: object
          description: Successful response
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Bad request
        "401":
          description: "Unauthorized - missing or invalid API key"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Internal server error
      summary: Get generation
      tags:
        - Generations
  /v3/models:
    get:
      description: List all available models with their capabilities and parameters.
      operationId: listModels
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ModelsResponse"
          description: Successful response
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Bad request
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Internal server error
      security: []
      summary: List models
      tags:
        - Models
  /v3/openapi.json:
    get:
      description: Returns the OpenAPI specification in JSON format.
      operationId: getOpenAPISpecJSON
      responses:
        "200":
          content:
            application/json:
              schema:
                description: OpenAPI specification
                type: object
          description: Successful response
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Bad request
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Internal server error
      security: []
      summary: OpenAPI spec (JSON)
      tags:
        - System
  /v3/openapi.yaml:
    get:
      description: Returns the OpenAPI specification in YAML format.
      operationId: getOpenAPISpecYAML
      responses:
        "200":
          content:
            application/json:
              schema:
                description: OpenAPI specification in YAML format
                type: string
          description: Successful response
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Bad request
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Internal server error
      security: []
      summary: OpenAPI spec (YAML)
      tags:
        - System
  /v3/realtime/{name}:
    get:
      description: WebSocket endpoint for realtime voice agent communication. The client must send an HTTP Upgrade request; a successful connection returns 101 Switching Protocols. OpenAPI 3.1 does not natively support WebSocket, so this is documented descriptively.
      operationId: realtimeWebSocket
      parameters:
        - description: Function name
          in: path
          name: name
          required: true
          schema:
            type: string
      responses:
        "101":
          description: Switching Protocols – WebSocket connection established
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Bad request
        "401":
          description: "Unauthorized - missing or invalid API key"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Internal server error
      summary: Realtime WebSocket
      tags:
        - Functions
  /v3/roundtable:
    post:
      description: Send a query to multiple models in parallel and combine results using a configurable resolution strategy (summary, fast, multiple_choice).
      operationId: createRoundtable
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RoundtableRequest"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RoundtableResponse"
            text/event-stream:
              schema:
                description: "Server-Sent Events stream. Each event is a JSON object prefixed with 'data: ' and terminated with the '[DONE]' sentinel."
                type: string
          description: Successful response
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Bad request
        "401":
          description: "Unauthorized - missing or invalid API key"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Internal server error
      summary: Roundtable
      tags:
        - Roundtable
      x-beta: true
  /v3/spans:
    post:
      description: Create a new trace span.
      operationId: createSpan
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateSpanRequest"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CreateSpanResponse"
          description: Successful response
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Bad request
        "401":
          description: "Unauthorized - missing or invalid API key"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Internal server error
      summary: Create span
      tags:
        - Spans
  /v3/spans/{id}:
    delete:
      description: Delete a trace span.
      operationId: deleteSpan
      parameters:
        - description: Generation ID
          in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "204":
          description: No content
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Bad request
        "401":
          description: "Unauthorized - missing or invalid API key"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Internal server error
      summary: Delete span
      tags:
        - Spans
    get:
      description: Get a trace span by ID.
      operationId: getSpan
      parameters:
        - description: Generation ID
          in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetSpanResponse"
          description: Successful response
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Bad request
        "401":
          description: "Unauthorized - missing or invalid API key"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Internal server error
      summary: Get span
      tags:
        - Spans
    patch:
      description: Update an existing trace span.
      operationId: updateSpan
      parameters:
        - description: Generation ID
          in: path
          name: id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpdateSpanRequest"
        required: true
      responses:
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Bad request
        "401":
          description: "Unauthorized - missing or invalid API key"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Internal server error
      summary: Update span
      tags:
        - Spans
  /v3/spans/{id}/events:
    get:
      description: List events for a span.
      operationId: listSpanEvents
      parameters:
        - description: Generation ID
          in: path
          name: id
          required: true
          schema:
            type: string
        - description: Filter by event kind (guardrail, feedback, evaluation)
          in: query
          name: kind
          schema:
            type: string
      responses:
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Bad request
        "401":
          description: "Unauthorized - missing or invalid API key"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Internal server error
      summary: List span events
      tags:
        - Spans
    post:
      description: Record an event (guardrail, feedback, evaluation) on a span.
      operationId: createSpanEvent
      parameters:
        - description: Generation ID
          in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Bad request
        "401":
          description: "Unauthorized - missing or invalid API key"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Internal server error
      summary: Create span event
      tags:
        - Spans
  /v3/tools/models/resolve:
    post:
      description: Select the best model matching the given requirements and preference.
      operationId: resolveModel
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ModelResolveRequest"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ModelResolveResponse"
          description: Successful response
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Bad request
        "401":
          description: "Unauthorized - missing or invalid API key"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Internal server error
      summary: Resolve model
      tags:
        - Tools
      x-beta: true
  /v3/tools/web/fetch:
    post:
      description: Fetch a URL and return its content as markdown.
      operationId: webFetch
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/WebFetchRequest"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/WebFetchResponse"
          description: Successful response
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Bad request
        "401":
          description: "Unauthorized - missing or invalid API key"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Internal server error
      summary: Web fetch
      tags:
        - Tools
      x-beta: true
  /v3/tools/web/search:
    post:
      description: Search the web and return results with title, URL, and snippet.
      operationId: webSearch
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/WebSearchRequest"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/WebSearchResponse"
          description: Successful response
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Bad request
        "401":
          description: "Unauthorized - missing or invalid API key"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Internal server error
      summary: Web search
      tags:
        - Tools
      x-beta: true
  /v3/traces:
    get:
      description: List traces with pagination.
      operationId: listTraces
      parameters:
        - description: Max items to return (default 100, max 100)
          in: query
          name: limit
          schema:
            default: 100
            type: integer
        - description: Number of items to skip (default 0)
          in: query
          name: offset
          schema:
            default: 0
            type: integer
        - description: Filter by trace name (case-insensitive substring match)
          in: query
          name: name
          schema:
            type: string
      responses:
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Bad request
        "401":
          description: "Unauthorized - missing or invalid API key"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Internal server error
      summary: List traces
      tags:
        - Traces
  /v3/traces/{id}:
    delete:
      description: Delete a trace and all its spans.
      operationId: deleteTrace
      parameters:
        - description: Generation ID
          in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "204":
          description: No content
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Bad request
        "401":
          description: "Unauthorized - missing or invalid API key"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Internal server error
      summary: Delete trace
      tags:
        - Traces
    get:
      description: Get a trace with all its spans.
      operationId: getTrace
      parameters:
        - description: Generation ID
          in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetTraceResponse"
          description: Successful response
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Bad request
        "401":
          description: "Unauthorized - missing or invalid API key"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Internal server error
      summary: Get trace
      tags:
        - Traces
  /v3/traces/{id}/events:
    get:
      description: List all events across all spans in a trace.
      operationId: listTraceEvents
      parameters:
        - description: Generation ID
          in: path
          name: id
          required: true
          schema:
            type: string
        - description: Filter by event kind (guardrail, feedback, evaluation)
          in: query
          name: kind
          schema:
            type: string
      responses:
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Bad request
        "401":
          description: "Unauthorized - missing or invalid API key"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Internal server error
      summary: List trace events
      tags:
        - Traces
security:
  - BearerAuth: []
servers:
  - description: Production
    url: https://api.opper.ai
  - description: Local development
    url: http://localhost:8080
tags:
  - description: Schema-driven function management and execution
    name: Functions
  - description: OpenAI-compatible chat completions
    name: Chat
  - description: OpenAI Responses API compatible endpoint
    name: Responses
  - description: Google-compatible interactions endpoint
    name: Interactions
  - description: Model registry and capabilities
    name: Models
  - description: OpenAI-compatible embeddings
    name: Embeddings
  - description: Recorded HTTP request/response generations
    name: Generations
  - description: System health and status
    name: System
  - description: Roundtable endpoint — fan out a query to multiple LLMs and combine results
    name: Roundtable
  - description: Web search, fetch, and other utility tools
    name: Tools
