{
  "openapi": "3.1.0",
  "info": {
    "title": "Potok Speech API & Remote MCP",
    "version": "1.1.0",
    "description": "Live production OpenAI-compatible Speech-to-Text REST API and Remote Streamable HTTP MCP for Potok (potok.now). Single API key (ptk_live_...) works across Whisper-compatible sync transcription, async batch jobs up to 2 GB / 10h, and 10 Remote MCP tools. First 120 minutes free sandbox on every account.",
    "contact": {
      "name": "Potok",
      "url": "https://potok.now/docs"
    }
  },
  "servers": [
    {
      "url": "https://api.potok.now",
      "description": "Potok Production Gateway (RF 152-FZ perimeter)"
    }
  ],
  "security": [
    {
      "BearerAuth": []
    },
    {
      "ApiKeyAuth": []
    }
  ],
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Personal API key with ptk_live_ prefix (Authorization: Bearer ptk_live_...)"
      },
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "Personal API key passed in X-API-Key header"
      }
    }
  },
  "paths": {
    "/app-api/v1/models": {
      "get": {
        "summary": "List available ASR models",
        "security": [],
        "responses": {
          "200": {
            "description": "OpenAI-compatible models list"
          }
        }
      }
    },
    "/app-api/v1/audio/transcriptions": {
      "post": {
        "summary": "Transcribe audio/video synchronously (OpenAI Whisper API drop-in, up to 64 MB)",
        "description": "Supports multipart/form-data (file, model=potok-asr-v3|whisper-1, language, response_format=json|verbose_json|text|srt|vtt, timestamp_granularities[], diarize, summary) OR application/json with public media URL.",
        "responses": {
          "200": {
            "description": "Transcript JSON or text/srt/vtt"
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Insufficient API balance"
          }
        }
      }
    },
    "/app-api/v1/jobs": {
      "post": {
        "summary": "Create async batch transcription job (URL up to 2 GB / 10 hours)",
        "description": "Supports model, url, language, diarize, summary, webhook_url, and X-External-Id tracking header.",
        "responses": {
          "202": {
            "description": "Queued job object with job id"
          },
          "401": {
            "description": "Invalid API key"
          }
        }
      }
    },
    "/app-api/v1/jobs/{job_id}": {
      "get": {
        "summary": "Get async job status, transcript, segments, speakers, and AI summary",
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Job status and completed result"
          },
          "404": {
            "description": "Job not found"
          }
        }
      }
    },
    "/mcp": {
      "get": {
        "summary": "Remote Streamable HTTP MCP discovery (metadata & tool list)",
        "security": [],
        "responses": {
          "200": {
            "description": "MCP server metadata and 10 potok_* tool names"
          }
        }
      },
      "post": {
        "summary": "Remote Streamable HTTP MCP JSON-RPC 2.0 (protocolVersion 2025-03-26)",
        "description": "Supports initialize, notifications/initialized, ping, tools/list, and tools/call for potok_get_workspace, potok_list_transcriptions, potok_get_transcription, potok_search_transcriptions, potok_export_transcription, potok_transcribe_url, potok_run_report, potok_list_projects, potok_list_tasks, and potok_manage_task. Alias: /app-api/mcp.",
        "responses": {
          "200": {
            "description": "JSON-RPC 2.0 response"
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      }
    }
  }
}
