{
  "openapi": "3.1.0",
  "info": {
    "title": "Oruk Resonance 2 Affect API",
    "version": "1.0.0-draft",
    "description": "Available in preview. Same existing plan minutes and Resonance 1 affect pricing. See https://oruk.ai/docs#resonance-2."
  },
  "servers": [
    {
      "url": "https://speech-api.oruk.ai"
    }
  ],
  "paths": {
    "/v1/audio/resonance-2/health": {
      "get": {
        "tags": [
          "Affect"
        ],
        "summary": "Check the Resonance emotion sidecar",
        "operationId": "health_v1_audio_resonance_2_health_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/v1/audio/resonance-2": {
      "post": {
        "tags": [
          "Affect"
        ],
        "summary": "Classify emotion and delivery with Resonance-2",
        "description": "Returns six signed opposite axes, 19 unipolar scores, all 31 category scores, and calibrated selected labels. Opposite labels cannot both be selected. Send 0.1\u2013120 seconds of audio, at most 30 MiB. Longer files use nonoverlapping 20-second windows and average logits before calibration. Digital silence abstains with zero scores; there is no forced top label. Use regime=f1 (default) or regime=precision as a query parameter. Same shared plan minutes and affect tariff as Resonance 1: $0.0100 per audio minute for legacy metered accounts, one-second minimum. Requires approved organization access; existing accounts retain access. Request at /v1/models/oruk-resonance-2/access.",
        "operationId": "classify_v1_audio_resonance_2_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "regime",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "f1",
                "precision"
              ],
              "type": "string",
              "default": "f1",
              "title": "Regime"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Resonance2SidecarResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "403": {
            "description": "model_access_required: organization approval required. No inference or billing occurs."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file"
                ],
                "additionalProperties": false,
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  },
                  "model": {
                    "type": "string",
                    "enum": [
                      "oruk-resonance-2",
                      "resonance-2"
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/models/oruk-resonance-2/access": {
      "get": {
        "summary": "Read organization Resonance-2 access",
        "operationId": "getResonance2Access",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Organization model access status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "model",
                    "status",
                    "approved"
                  ],
                  "properties": {
                    "model": {
                      "type": "string",
                      "const": "oruk-resonance-2"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "not_requested",
                        "pending",
                        "approved",
                        "denied",
                        "revoked"
                      ]
                    },
                    "approved": {
                      "type": "boolean"
                    },
                    "request_access_url": {
                      "type": "string",
                      "format": "uri"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key"
          }
        }
      },
      "post": {
        "summary": "Request Resonance-2 access",
        "operationId": "requestResonance2Access",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "use_case"
                ],
                "properties": {
                  "use_case": {
                    "type": "string",
                    "minLength": 10,
                    "maxLength": 2000
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Organization model access status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "model",
                    "status",
                    "approved"
                  ],
                  "properties": {
                    "model": {
                      "type": "string",
                      "const": "oruk-resonance-2"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "not_requested",
                        "pending",
                        "approved",
                        "denied",
                        "revoked"
                      ]
                    },
                    "approved": {
                      "type": "boolean"
                    },
                    "request_access_url": {
                      "type": "string",
                      "format": "uri"
                    }
                  }
                }
              }
            }
          },
          "200": {
            "description": "Organization model access status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "model",
                    "status",
                    "approved"
                  ],
                  "properties": {
                    "model": {
                      "type": "string",
                      "const": "oruk-resonance-2"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "not_requested",
                        "pending",
                        "approved",
                        "denied",
                        "revoked"
                      ]
                    },
                    "approved": {
                      "type": "boolean"
                    },
                    "request_access_url": {
                      "type": "string",
                      "format": "uri"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid use case or JSON"
          },
          "401": {
            "description": "Invalid API key"
          },
          "413": {
            "description": "Body exceeds 12 KB"
          },
          "415": {
            "description": "Requires application/json"
          },
          "429": {
            "description": "Too many requests"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "Resonance2SidecarResponse": {
        "properties": {
          "model": {
            "type": "string",
            "const": "oruk-resonance-2",
            "title": "Model",
            "default": "oruk-resonance-2"
          },
          "model_revision": {
            "type": "string",
            "const": "b34570175184c22066f9d3b595d52ef62281adb9a1d51c332d3874b8ff66832b",
            "title": "Model Revision",
            "default": "b34570175184c22066f9d3b595d52ef62281adb9a1d51c332d3874b8ff66832b"
          },
          "calibration_revision": {
            "type": "string",
            "const": "ccd5948dc3a3cbfd628b158ccf9f95ac582da38c2e8f242128c1e465615e1c07",
            "title": "Calibration Revision",
            "default": "ccd5948dc3a3cbfd628b158ccf9f95ac582da38c2e8f242128c1e465615e1c07"
          },
          "duration": {
            "type": "number",
            "maximum": 120.0,
            "minimum": 0.1,
            "title": "Duration"
          },
          "window_count": {
            "type": "integer",
            "maximum": 6.0,
            "minimum": 1.0,
            "title": "Window Count"
          },
          "aggregation": {
            "type": "string",
            "const": "mean_window_logits",
            "title": "Aggregation",
            "default": "mean_window_logits"
          },
          "scores": {
            "additionalProperties": {
              "type": "number",
              "maximum": 1.0,
              "minimum": 0.0
            },
            "type": "object",
            "title": "Scores"
          },
          "axes": {
            "additionalProperties": {
              "type": "number",
              "maximum": 1.0,
              "minimum": -1.0
            },
            "type": "object",
            "title": "Axes"
          },
          "unipolar": {
            "additionalProperties": {
              "type": "number",
              "maximum": 1.0,
              "minimum": 0.0
            },
            "type": "object",
            "title": "Unipolar"
          },
          "labels": {
            "items": {
              "$ref": "#/components/schemas/SelectedLabel"
            },
            "type": "array",
            "maxItems": 31,
            "title": "Labels"
          },
          "regime": {
            "type": "string",
            "enum": [
              "f1",
              "precision"
            ],
            "title": "Regime"
          },
          "calibrated": {
            "type": "boolean",
            "const": true,
            "title": "Calibrated"
          },
          "abstained": {
            "type": "boolean",
            "title": "Abstained"
          },
          "abstention_reason": {
            "anyOf": [
              {
                "type": "string",
                "const": "digital_silence"
              },
              {
                "type": "null"
              }
            ],
            "title": "Abstention Reason"
          },
          "inference_ms": {
            "type": "number",
            "minimum": 0.0,
            "title": "Inference Ms"
          },
          "id": {
            "type": "string",
            "title": "Id"
          },
          "object": {
            "type": "string",
            "const": "speech.affect.result",
            "title": "Object",
            "default": "speech.affect.result"
          },
          "task": {
            "type": "string",
            "const": "affect",
            "title": "Task",
            "default": "affect"
          },
          "usage": {
            "$ref": "#/components/schemas/Resonance2SidecarUsage"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "duration",
          "window_count",
          "scores",
          "axes",
          "unipolar",
          "labels",
          "regime",
          "calibrated",
          "abstained",
          "abstention_reason",
          "inference_ms",
          "id",
          "usage"
        ],
        "title": "Resonance2SidecarResponse"
      },
      "Resonance2SidecarUsage": {
        "properties": {
          "audio_seconds": {
            "type": "number",
            "title": "Audio Seconds",
            "description": "Measured audio duration"
          },
          "billable_seconds": {
            "type": "number",
            "title": "Billable Seconds",
            "description": "Duration used for billing; one-second minimum"
          },
          "rate_per_minute_usd": {
            "type": "string",
            "title": "Rate Per Minute Usd"
          },
          "estimated_cost_usd": {
            "type": "string",
            "title": "Estimated Cost Usd"
          },
          "pricing_version": {
            "type": "string",
            "title": "Pricing Version"
          },
          "billing_unit": {
            "type": "string",
            "enum": [
              "audio_second",
              "request"
            ],
            "title": "Billing Unit",
            "default": "audio_second"
          },
          "rate_per_request_usd": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rate Per Request Usd",
            "description": "Flat price per billable check"
          },
          "rate_per_hour_usd": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rate Per Hour Usd"
          }
        },
        "type": "object",
        "required": [
          "audio_seconds",
          "billable_seconds",
          "rate_per_minute_usd",
          "estimated_cost_usd",
          "pricing_version"
        ],
        "title": "Resonance2SidecarUsage"
      },
      "SelectedLabel": {
        "properties": {
          "label": {
            "type": "string",
            "title": "Label"
          },
          "score": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Score"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "label",
          "score"
        ],
        "title": "SelectedLabel"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          },
          "input": {
            "title": "Input"
          },
          "ctx": {
            "type": "object",
            "title": "Context"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      }
    },
    "securitySchemes": {
      "HTTPBearer": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "x-availability": "preview"
}
