{
  "info": {
    "_postman_id": "00000000-0000-0000-0000-00000005a5e1",
    "name": "Uzbek ASR Service",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "description": "Uzbek ASR Service API (rubaiSTT v2 Medium + GigaAM Multilingual Large).\n\nSet the environment (base_url, api_key). File requests use sample-uz.wav and invalid-audio.wav from the postman/ folder: in Postman set Settings → General → Working directory to that folder (or re-select the files in the Body tab).\n\nNewman: newman run Uzbek-ASR.postman_collection.json -e Local.postman_environment.json --working-dir ."
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{api_key}}",
        "type": "string"
      }
    ]
  },
  "item": [
    {
      "name": "1. Health Check",
      "event": [
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [
              "pm.test('response time < 60 s', () => pm.expect(pm.response.responseTime).to.be.below(60000));",
              "pm.test('status 200', () => pm.response.to.have.status(200));",
              "pm.test('ok', () => pm.expect(pm.response.json().status).to.eql('ok'));"
            ]
          }
        }
      ],
      "request": {
        "method": "GET",
        "header": [],
        "url": {
          "raw": "{{base_url}}/health",
          "host": [
            "{{base_url}}"
          ],
          "path": [
            "health"
          ]
        },
        "description": "Liveness. No key needed.",
        "auth": {
          "type": "noauth"
        }
      }
    },
    {
      "name": "2. Readiness Check",
      "event": [
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [
              "pm.test('response time < 60 s', () => pm.expect(pm.response.responseTime).to.be.below(60000));",
              "pm.test('status 200 (at least one model ready)', () => pm.response.to.have.status(200));",
              "pm.test('models listed', () => pm.expect(pm.response.json().models).to.have.keys('rubai','gigaam'));"
            ]
          }
        }
      ],
      "request": {
        "method": "GET",
        "header": [],
        "url": {
          "raw": "{{base_url}}/ready",
          "host": [
            "{{base_url}}"
          ],
          "path": [
            "ready"
          ]
        },
        "description": "",
        "auth": {
          "type": "noauth"
        }
      }
    },
    {
      "name": "3. List Models",
      "event": [
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [
              "pm.test('response time < 60 s', () => pm.expect(pm.response.responseTime).to.be.below(60000));",
              "pm.test('status 200', () => pm.response.to.have.status(200));",
              "const ids = pm.response.json().data.map(m => m.id);",
              "pm.test('all four modes', () => pm.expect(ids).to.include.members(['rubai','gigaam','auto','ensemble']));"
            ]
          }
        }
      ],
      "request": {
        "method": "GET",
        "header": [],
        "url": {
          "raw": "{{base_url}}/v1/models",
          "host": [
            "{{base_url}}"
          ],
          "path": [
            "v1",
            "models"
          ]
        },
        "description": ""
      }
    },
    {
      "name": "4. Transcribe — Rubai",
      "event": [
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [
              "pm.test('response time < 60 s', () => pm.expect(pm.response.responseTime).to.be.below(60000));",
              "pm.test('status 200', () => pm.response.to.have.status(200));",
              "const j = pm.response.json();",
              "pm.test('no error', () => pm.expect(j.status).to.eql('success'));",
              "pm.test('mode is rubai', () => pm.expect(j.mode).to.eql('rubai'));",
              "pm.test('text is not empty', () => pm.expect(j.text.length).to.be.above(0));",
              "pm.environment.set('request_id', j.request_id);"
            ]
          }
        }
      ],
      "request": {
        "method": "POST",
        "header": [],
        "url": {
          "raw": "{{base_url}}/v1/audio/transcriptions",
          "host": [
            "{{base_url}}"
          ],
          "path": [
            "v1",
            "audio",
            "transcriptions"
          ]
        },
        "description": "",
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "file",
              "type": "file",
              "src": "sample-uz.wav"
            },
            {
              "key": "model",
              "value": "rubai",
              "type": "text"
            },
            {
              "key": "language",
              "value": "uz",
              "type": "text"
            },
            {
              "key": "response_format",
              "value": "verbose_json",
              "type": "text"
            }
          ]
        }
      }
    },
    {
      "name": "5. Transcribe — GigaAM",
      "event": [
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [
              "pm.test('response time < 60 s', () => pm.expect(pm.response.responseTime).to.be.below(60000));",
              "pm.test('status 200', () => pm.response.to.have.status(200));",
              "const j = pm.response.json();",
              "pm.test('no error', () => pm.expect(j.status).to.eql('success'));",
              "pm.test('mode is gigaam', () => pm.expect(j.mode).to.eql('gigaam'));",
              "pm.test('text is not empty', () => pm.expect(j.text.length).to.be.above(0));",
              "pm.environment.set('request_id', j.request_id);"
            ]
          }
        }
      ],
      "request": {
        "method": "POST",
        "header": [],
        "url": {
          "raw": "{{base_url}}/v1/audio/transcriptions",
          "host": [
            "{{base_url}}"
          ],
          "path": [
            "v1",
            "audio",
            "transcriptions"
          ]
        },
        "description": "",
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "file",
              "type": "file",
              "src": "sample-uz.wav"
            },
            {
              "key": "model",
              "value": "gigaam",
              "type": "text"
            },
            {
              "key": "language",
              "value": "uz",
              "type": "text"
            },
            {
              "key": "response_format",
              "value": "verbose_json",
              "type": "text"
            }
          ]
        }
      }
    },
    {
      "name": "6. Transcribe — Auto",
      "event": [
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [
              "pm.test('response time < 60 s', () => pm.expect(pm.response.responseTime).to.be.below(60000));",
              "pm.test('status 200', () => pm.response.to.have.status(200));",
              "const j = pm.response.json();",
              "pm.test('no error', () => pm.expect(j.status).to.eql('success'));",
              "pm.test('mode is auto', () => pm.expect(j.mode).to.eql('auto'));",
              "pm.test('text is not empty', () => pm.expect(j.text.length).to.be.above(0));",
              "pm.environment.set('request_id', j.request_id);"
            ]
          }
        }
      ],
      "request": {
        "method": "POST",
        "header": [],
        "url": {
          "raw": "{{base_url}}/v1/audio/transcriptions",
          "host": [
            "{{base_url}}"
          ],
          "path": [
            "v1",
            "audio",
            "transcriptions"
          ]
        },
        "description": "",
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "file",
              "type": "file",
              "src": "sample-uz.wav"
            },
            {
              "key": "model",
              "value": "auto",
              "type": "text"
            },
            {
              "key": "language",
              "value": "uz",
              "type": "text"
            },
            {
              "key": "response_format",
              "value": "verbose_json",
              "type": "text"
            },
            {
              "key": "timestamps",
              "value": "true",
              "type": "text"
            }
          ]
        }
      }
    },
    {
      "name": "7. Transcribe — Ensemble",
      "event": [
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [
              "pm.test('response time < 60 s', () => pm.expect(pm.response.responseTime).to.be.below(60000));",
              "pm.test('status 200', () => pm.response.to.have.status(200));",
              "const j = pm.response.json();",
              "pm.test('mode ensemble', () => pm.expect(j.mode).to.eql('ensemble'));",
              "pm.test('alternatives present', () => pm.expect(j.alternatives).to.be.an('object'));"
            ]
          }
        }
      ],
      "request": {
        "method": "POST",
        "header": [],
        "url": {
          "raw": "{{base_url}}/v1/audio/transcriptions",
          "host": [
            "{{base_url}}"
          ],
          "path": [
            "v1",
            "audio",
            "transcriptions"
          ]
        },
        "description": "",
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "file",
              "type": "file",
              "src": "sample-uz.wav"
            },
            {
              "key": "model",
              "value": "ensemble",
              "type": "text"
            },
            {
              "key": "language",
              "value": "uz",
              "type": "text"
            },
            {
              "key": "response_format",
              "value": "verbose_json",
              "type": "text"
            },
            {
              "key": "return_alternatives",
              "value": "true",
              "type": "text"
            }
          ]
        }
      }
    },
    {
      "name": "8. Compare Models",
      "event": [
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [
              "pm.test('response time < 60 s', () => pm.expect(pm.response.responseTime).to.be.below(60000));",
              "pm.test('status 200', () => pm.response.to.have.status(200));",
              "const j = pm.response.json();",
              "pm.test('both texts', () => { pm.expect(j.rubai.text).to.be.a('string'); pm.expect(j.gigaam.text).to.be.a('string'); });",
              "pm.test('agreement 0..1', () => pm.expect(j.agreement).to.be.within(0,1));"
            ]
          }
        }
      ],
      "request": {
        "method": "POST",
        "header": [],
        "url": {
          "raw": "{{base_url}}/v1/audio/compare",
          "host": [
            "{{base_url}}"
          ],
          "path": [
            "v1",
            "audio",
            "compare"
          ]
        },
        "description": "",
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "file",
              "type": "file",
              "src": "sample-uz.wav"
            },
            {
              "key": "language",
              "value": "uz",
              "type": "text"
            }
          ]
        }
      }
    },
    {
      "name": "9. Service Status",
      "event": [
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [
              "pm.test('response time < 60 s', () => pm.expect(pm.response.responseTime).to.be.below(60000));",
              "pm.test('status 200', () => pm.response.to.have.status(200));",
              "pm.test('workers block', () => pm.expect(pm.response.json().workers).to.have.keys('rubai','gigaam'));"
            ]
          }
        }
      ],
      "request": {
        "method": "GET",
        "header": [],
        "url": {
          "raw": "{{base_url}}/v1/status",
          "host": [
            "{{base_url}}"
          ],
          "path": [
            "v1",
            "status"
          ]
        },
        "description": ""
      }
    },
    {
      "name": "10. Invalid API Key Test",
      "event": [
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [
              "pm.test('response time < 60 s', () => pm.expect(pm.response.responseTime).to.be.below(60000));",
              "pm.test('401', () => pm.response.to.have.status(401));",
              "const j = pm.response.json();",
              "pm.test('error format', () => { pm.expect(j.status).to.eql('error'); pm.expect(j.error.code).to.eql('unauthorized'); });"
            ]
          }
        }
      ],
      "request": {
        "method": "GET",
        "header": [],
        "url": {
          "raw": "{{base_url}}/v1/models",
          "host": [
            "{{base_url}}"
          ],
          "path": [
            "v1",
            "models"
          ]
        },
        "description": "Expects 401 when the server has ASR_API_KEY set.",
        "auth": {
          "type": "bearer",
          "bearer": [
            {
              "key": "token",
              "value": "definitely-wrong-key",
              "type": "string"
            }
          ]
        }
      }
    },
    {
      "name": "11. Invalid Audio Test",
      "event": [
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [
              "pm.test('response time < 60 s', () => pm.expect(pm.response.responseTime).to.be.below(60000));",
              "pm.test('415 or 400', () => pm.expect(pm.response.code).to.be.oneOf([400,415]));",
              "const j = pm.response.json();",
              "pm.test('structured error', () => { pm.expect(j.status).to.eql('error'); pm.expect(j.error.code).to.be.a('string'); pm.expect(j.request_id).to.be.a('string'); });"
            ]
          }
        }
      ],
      "request": {
        "method": "POST",
        "header": [],
        "url": {
          "raw": "{{base_url}}/v1/audio/transcriptions",
          "host": [
            "{{base_url}}"
          ],
          "path": [
            "v1",
            "audio",
            "transcriptions"
          ]
        },
        "description": "",
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "file",
              "type": "file",
              "src": "invalid-audio.wav"
            },
            {
              "key": "model",
              "value": "auto",
              "type": "text"
            },
            {
              "key": "language",
              "value": "uz",
              "type": "text"
            },
            {
              "key": "response_format",
              "value": "verbose_json",
              "type": "text"
            }
          ]
        }
      }
    },
    {
      "name": "12. Response Schema Test",
      "event": [
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [
              "pm.test('response time < 60 s', () => pm.expect(pm.response.responseTime).to.be.below(60000));",
              "pm.test('status 200', () => pm.response.to.have.status(200));",
              "const schema = {type:'object', required:['request_id','status','text','language','mode','needs_review','audio_duration_seconds','processing_time_ms','warnings'],",
              "  properties:{request_id:{type:'string'}, status:{const:'success'}, text:{type:'string'}, language:{type:'string'},",
              "  mode:{enum:['auto','rubai','gigaam','ensemble']}, selected_model:{type:['string','null']}, confidence:{type:['number','null']},",
              "  needs_review:{type:'boolean'}, audio_duration_seconds:{type:'number'}, processing_time_ms:{type:'number'}, warnings:{type:'array'}}};",
              "pm.test('matches the documented schema', () => pm.response.to.have.jsonSchema(schema));",
              "pm.test('X-Request-ID header', () => pm.response.to.have.header('X-Request-ID'));"
            ]
          }
        }
      ],
      "request": {
        "method": "POST",
        "header": [],
        "url": {
          "raw": "{{base_url}}/v1/audio/transcriptions",
          "host": [
            "{{base_url}}"
          ],
          "path": [
            "v1",
            "audio",
            "transcriptions"
          ]
        },
        "description": "",
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "file",
              "type": "file",
              "src": "sample-uz.wav"
            },
            {
              "key": "model",
              "value": "auto",
              "type": "text"
            },
            {
              "key": "language",
              "value": "uz",
              "type": "text"
            },
            {
              "key": "response_format",
              "value": "verbose_json",
              "type": "text"
            }
          ]
        }
      }
    }
  ],
  "variable": []
}