{
  "openapi": "3.1.0",
  "info": {
    "title": "ASAS API",
    "version": "1.0.0",
    "description": "The ASAS public API — Arabic-first speech-to-text, text-to-speech, and retrieval-augmented generation, served as a metered, authenticated gateway that runs entirely inside KSA regions. All endpoints are versioned under `/v1`. Authenticate with a Bearer `asas_live_*` (or `asas_test_*`) key. Errors follow RFC 9457 `application/problem+json` with `code` + `request_id`.",
    "contact": {
      "name": "ASAS Sales",
      "url": "https://asas.flitc.tech/contact"
    }
  },
  "servers": [
    {
      "url": "https://api.asas.flitc.tech/v1",
      "description": "Production (KSA)"
    }
  ],
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "tags": [
    {
      "name": "TTS",
      "description": "Text to speech — Arabic voices, streaming synthesis"
    },
    {
      "name": "STT",
      "description": "Speech to text — batch + realtime transcription"
    },
    {
      "name": "RAG",
      "description": "Retrieval-augmented search over your documents"
    }
  ],
  "paths": {
    "/tts": {
      "post": {
        "tags": [
          "TTS"
        ],
        "operationId": "createSpeech",
        "summary": "Synthesize speech (blocking)",
        "description": "Generate audio for up to 500 characters of Arabic text and return the full clip. Billed by input characters at the quality-tier rate. For low-latency playback use `/tts/stream`.",
        "security": [
          {
            "ApiKeyAuth": [
              "tts:speak"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TtsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Synthesized audio",
            "content": {
              "audio/mpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "audio/wav": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Malformed request",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "Key lacks the required scope",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Request failed validation (e.g. text over 500 chars)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or credit quota exceeded",
            "headers": {
              "RateLimit-Limit": {
                "schema": {
                  "type": "integer"
                },
                "description": "Requests allowed in the window"
              },
              "RateLimit-Remaining": {
                "schema": {
                  "type": "integer"
                },
                "description": "Requests remaining"
              },
              "RateLimit-Reset": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds until the window resets"
              },
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "Gateway error",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "502": {
            "description": "Upstream FLITC service error",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "504": {
            "description": "Upstream timeout",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/tts/stream": {
      "post": {
        "tags": [
          "TTS"
        ],
        "operationId": "streamSpeech",
        "summary": "Synthesize speech (chunked stream)",
        "description": "Same body as `/tts` but the audio is streamed as chunked HTTP so playback can begin before synthesis finishes (p90 first-audio < 150 ms). A WebSocket variant (`/tts/realtime`) is documented under Products › TTS.",
        "security": [
          {
            "ApiKeyAuth": [
              "tts:speak"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TtsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Chunked audio stream",
            "content": {
              "audio/mpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Malformed request",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "Key lacks the required scope",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Request failed validation (e.g. text over 500 chars)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or credit quota exceeded",
            "headers": {
              "RateLimit-Limit": {
                "schema": {
                  "type": "integer"
                },
                "description": "Requests allowed in the window"
              },
              "RateLimit-Remaining": {
                "schema": {
                  "type": "integer"
                },
                "description": "Requests remaining"
              },
              "RateLimit-Reset": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds until the window resets"
              },
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "Gateway error",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "502": {
            "description": "Upstream FLITC service error",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "504": {
            "description": "Upstream timeout",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/stt/transcriptions": {
      "post": {
        "tags": [
          "STT"
        ],
        "operationId": "createTranscription",
        "summary": "Transcribe audio",
        "description": "Upload an audio file (WAV/MP3/M4A) for transcription. Short audio returns the transcript synchronously (200); long audio returns a job (202) whose result is delivered via the `stt.job.completed` webhook. Billed by decoded `audio_seconds` reported by the engine — never by client-declared bytes.",
        "security": [
          {
            "ApiKeyAuth": [
              "stt:transcribe"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "Audio file"
                  },
                  "language": {
                    "type": "string",
                    "default": "auto"
                  },
                  "model": {
                    "type": "string"
                  },
                  "diarize": {
                    "type": "boolean",
                    "default": false
                  },
                  "word_timestamps": {
                    "type": "boolean",
                    "default": false
                  }
                },
                "required": [
                  "file"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Synchronous transcription (short audio)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Synchronous transcription result (short audio).",
                  "properties": {
                    "text": {
                      "type": "string",
                      "description": "Full transcript"
                    },
                    "language": {
                      "type": "string"
                    },
                    "duration_seconds": {
                      "type": "number",
                      "description": "Decoded audio duration — the billing settlement authority (audio_seconds)."
                    },
                    "segments": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer"
                          },
                          "start": {
                            "type": "number",
                            "description": "Segment start (seconds)"
                          },
                          "end": {
                            "type": "number",
                            "description": "Segment end (seconds)"
                          },
                          "text": {
                            "type": "string"
                          },
                          "confidence": {
                            "type": "number"
                          },
                          "speaker": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Present when diarize=true"
                          }
                        },
                        "required": [
                          "id",
                          "start",
                          "end",
                          "text"
                        ]
                      }
                    },
                    "request_id": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "text",
                    "language",
                    "duration_seconds"
                  ]
                }
              }
            }
          },
          "202": {
            "description": "Async job accepted (long audio)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Async job accepted for long audio; completion is delivered via the stt.job.completed webhook.",
                  "properties": {
                    "job_id": {
                      "type": "string",
                      "examples": [
                        "stt_9f2c1a7b"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "processing"
                      ]
                    },
                    "request_id": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "job_id",
                    "status"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Malformed request",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "Key lacks the required scope",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Request failed validation (e.g. text over 500 chars)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or credit quota exceeded",
            "headers": {
              "RateLimit-Limit": {
                "schema": {
                  "type": "integer"
                },
                "description": "Requests allowed in the window"
              },
              "RateLimit-Remaining": {
                "schema": {
                  "type": "integer"
                },
                "description": "Requests remaining"
              },
              "RateLimit-Reset": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds until the window resets"
              },
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "Gateway error",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "502": {
            "description": "Upstream FLITC service error",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "504": {
            "description": "Upstream timeout",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/rag/search": {
      "post": {
        "tags": [
          "RAG"
        ],
        "operationId": "ragSearch",
        "summary": "Search your documents",
        "description": "Query an organization's document tenant. `mode` selects retrieve (citations only), answer (grounded answer), or analyze (multi-pass, 5–30 s). Returns a complete JSON response — the upstream does not token-stream. Billed per query, rated by mode (retrieve < answer < analyze). Requires an active RAG entitlement (provisioned tenant).",
        "security": [
          {
            "ApiKeyAuth": [
              "rag:query"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RagSearchRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Search result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Complete search result (JSON, not token-streamed).",
                  "properties": {
                    "mode": {
                      "type": "string",
                      "enum": [
                        "retrieve",
                        "answer",
                        "analyze"
                      ]
                    },
                    "answer": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Present for answer/analyze modes"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "document_id": {
                            "type": "string"
                          },
                          "chunk_id": {
                            "type": "string"
                          },
                          "score": {
                            "type": "number"
                          },
                          "text": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "document_id",
                          "score"
                        ]
                      }
                    },
                    "search_time_ms": {
                      "type": "integer"
                    },
                    "request_id": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "mode",
                    "results"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Malformed request",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "Key lacks the required scope",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "RAG tenant not yet provisioned / resuming from idle",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Request failed validation (e.g. text over 500 chars)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or credit quota exceeded",
            "headers": {
              "RateLimit-Limit": {
                "schema": {
                  "type": "integer"
                },
                "description": "Requests allowed in the window"
              },
              "RateLimit-Remaining": {
                "schema": {
                  "type": "integer"
                },
                "description": "Requests remaining"
              },
              "RateLimit-Reset": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds until the window resets"
              },
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "Gateway error",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "502": {
            "description": "Upstream FLITC service error",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "504": {
            "description": "Upstream timeout",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    }
  },
  "webhooks": {
    "ping": {
      "post": {
        "operationId": "webhook_ping",
        "summary": "Webhook: ping",
        "description": "Delivered to your registered endpoint when `ping` occurs. Signed with HMAC-SHA-256 over `${timestamp}.${body}` in the `ASAS-Signature` header (verify before trusting — see Webhooks).",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "event": {
                    "type": "string",
                    "enum": [
                      "ping"
                    ]
                  },
                  "createdAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": true
                  }
                },
                "required": [
                  "id",
                  "event",
                  "createdAt",
                  "data"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Acknowledged (return 2xx within 5 s or delivery retries)"
          }
        }
      }
    },
    "job.completed": {
      "post": {
        "operationId": "webhook_job_completed",
        "summary": "Webhook: job.completed",
        "description": "Delivered to your registered endpoint when `job.completed` occurs. Signed with HMAC-SHA-256 over `${timestamp}.${body}` in the `ASAS-Signature` header (verify before trusting — see Webhooks).",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "event": {
                    "type": "string",
                    "enum": [
                      "job.completed"
                    ]
                  },
                  "createdAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": true
                  }
                },
                "required": [
                  "id",
                  "event",
                  "createdAt",
                  "data"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Acknowledged (return 2xx within 5 s or delivery retries)"
          }
        }
      }
    },
    "quota.threshold": {
      "post": {
        "operationId": "webhook_quota_threshold",
        "summary": "Webhook: quota.threshold",
        "description": "Delivered to your registered endpoint when `quota.threshold` occurs. Signed with HMAC-SHA-256 over `${timestamp}.${body}` in the `ASAS-Signature` header (verify before trusting — see Webhooks).",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "event": {
                    "type": "string",
                    "enum": [
                      "quota.threshold"
                    ]
                  },
                  "createdAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": true
                  }
                },
                "required": [
                  "id",
                  "event",
                  "createdAt",
                  "data"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Acknowledged (return 2xx within 5 s or delivery retries)"
          }
        }
      }
    },
    "invoice.finalized": {
      "post": {
        "operationId": "webhook_invoice_finalized",
        "summary": "Webhook: invoice.finalized",
        "description": "Delivered to your registered endpoint when `invoice.finalized` occurs. Signed with HMAC-SHA-256 over `${timestamp}.${body}` in the `ASAS-Signature` header (verify before trusting — see Webhooks).",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "event": {
                    "type": "string",
                    "enum": [
                      "invoice.finalized"
                    ]
                  },
                  "createdAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": true
                  }
                },
                "required": [
                  "id",
                  "event",
                  "createdAt",
                  "data"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Acknowledged (return 2xx within 5 s or delivery retries)"
          }
        }
      }
    },
    "key.compromised": {
      "post": {
        "operationId": "webhook_key_compromised",
        "summary": "Webhook: key.compromised",
        "description": "Delivered to your registered endpoint when `key.compromised` occurs. Signed with HMAC-SHA-256 over `${timestamp}.${body}` in the `ASAS-Signature` header (verify before trusting — see Webhooks).",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "event": {
                    "type": "string",
                    "enum": [
                      "key.compromised"
                    ]
                  },
                  "createdAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": true
                  }
                },
                "required": [
                  "id",
                  "event",
                  "createdAt",
                  "data"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Acknowledged (return 2xx within 5 s or delivery retries)"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "ASAS API key as a Bearer token: `Authorization: Bearer asas_live_…` (or `asas_test_…` for test mode). Keys are scoped (`tts:speak`, `stt:transcribe`, `rag:query`) and shown once at creation."
      }
    },
    "schemas": {
      "TtsRequest": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          },
          "voice": {
            "type": "string",
            "minLength": 1
          },
          "speed": {
            "default": 1,
            "type": "number",
            "minimum": 0.5,
            "maximum": 2
          },
          "quality": {
            "default": "standard",
            "type": "string",
            "enum": [
              "fast",
              "standard",
              "high"
            ]
          }
        },
        "required": [
          "text",
          "voice",
          "speed",
          "quality"
        ],
        "additionalProperties": false
      },
      "SttTranscriptionParams": {
        "type": "object",
        "properties": {
          "language": {
            "default": "auto",
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "diarize": {
            "default": false,
            "type": "boolean"
          },
          "word_timestamps": {
            "default": false,
            "type": "boolean"
          }
        },
        "required": [
          "language",
          "diarize",
          "word_timestamps"
        ],
        "additionalProperties": false
      },
      "SttRealtimeStart": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "start"
          },
          "encoding": {
            "default": "pcm_s16le",
            "type": "string",
            "enum": [
              "pcm_s16le"
            ]
          },
          "sample_rate": {
            "default": 16000,
            "anyOf": [
              {
                "type": "number",
                "const": 8000
              },
              {
                "type": "number",
                "const": 16000
              }
            ]
          },
          "language": {
            "default": "ar",
            "type": "string"
          },
          "interim_results": {
            "default": true,
            "type": "boolean"
          }
        },
        "required": [
          "type",
          "encoding",
          "sample_rate",
          "language",
          "interim_results"
        ],
        "additionalProperties": false
      },
      "RagSearchRequest": {
        "type": "object",
        "properties": {
          "query": {
            "type": "string",
            "minLength": 1
          },
          "mode": {
            "default": "retrieve",
            "type": "string",
            "enum": [
              "retrieve",
              "answer",
              "analyze"
            ]
          },
          "top_k": {
            "default": 10,
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "min_score": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "detail": {
            "default": "full",
            "type": "string",
            "enum": [
              "minimal",
              "full"
            ]
          },
          "document_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "language": {
            "type": "string"
          },
          "file_type": {
            "type": "string"
          },
          "metadata_filters": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "enable_rewrite_search_query": {
            "default": false,
            "type": "boolean"
          },
          "rewrite_search_query_instructions": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "query",
          "mode",
          "top_k",
          "detail",
          "enable_rewrite_search_query"
        ],
        "additionalProperties": false
      },
      "WebhookEndpointInput": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "format": "uri"
          },
          "events": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "ping",
                "job.completed",
                "quota.threshold",
                "invoice.finalized",
                "key.compromised"
              ]
            }
          }
        },
        "required": [
          "url",
          "events"
        ],
        "additionalProperties": false
      },
      "Problem": {
        "type": "object",
        "properties": {
          "type": {
            "default": "about:blank",
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer",
            "minimum": 100,
            "maximum": 599
          },
          "detail": {
            "type": "string"
          },
          "instance": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "request_id": {
            "type": "string"
          }
        },
        "required": [
          "type",
          "title",
          "status",
          "code",
          "request_id"
        ],
        "additionalProperties": false
      }
    }
  }
}
