{
  "info": {
    "name": "BatchRouter — OpenAI Batch in five minutes",
    "description": "Native quote-then-batch flow and the OpenAI-compatible file-then-batch surface. Fields match the public OpenAPI (https://api.batchrouter.com/openapi.json). Set batchrouterApiKey to a br_live_ key. Copy model ids from GET /v1/catalog/models.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    { "key": "baseUrl", "value": "https://api.batchrouter.com" },
    { "key": "batchrouterApiKey", "value": "" },
    { "key": "quoteId", "value": "" },
    { "key": "batchId", "value": "" },
    { "key": "inputFileId", "value": "" }
  ],
  "item": [
    {
      "name": "Native batch",
      "item": [
        {
          "name": "List catalog models",
          "request": {
            "method": "GET",
            "header": [],
            "url": "{{baseUrl}}/v1/catalog/models",
            "description": "Public catalog. Use a model value from the response in the quote and batch items."
          }
        },
        {
          "name": "Create a model quote",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Authorization", "value": "Bearer {{batchrouterApiKey}}" },
              { "key": "Content-Type", "value": "application/json" }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"model\": \"gpt-5.4\",\n  \"items\": [\n    {\n      \"customer_item_id\": \"item-1\",\n      \"operation\": \"responses\",\n      \"model\": \"gpt-5.4\",\n      \"input\": {\n        \"messages\": [\n          { \"role\": \"user\", \"content\": \"Summarize: BatchRouter routes batch-AI workloads across providers.\" }\n        ]\n      }\n    }\n  ]\n}\n"
            },
            "url": "{{baseUrl}}/v1/quotes/model",
            "description": "POST /v1/quotes/model. items is required (ModelQuoteRequest). Save the returned quote_id into the quoteId variable."
          }
        },
        {
          "name": "Create a batch",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Authorization", "value": "Bearer {{batchrouterApiKey}}" },
              { "key": "Content-Type", "value": "application/json" },
              { "key": "Idempotency-Key", "value": "five-min-{{$guid}}" }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"quote_id\": \"{{quoteId}}\",\n  \"items\": [\n    {\n      \"customer_item_id\": \"item-1\",\n      \"operation\": \"responses\",\n      \"model\": \"gpt-5.4\",\n      \"input\": {\n        \"messages\": [\n          { \"role\": \"user\", \"content\": \"Summarize: BatchRouter routes batch-AI workloads across providers.\" }\n        ]\n      }\n    }\n  ]\n}\n"
            },
            "url": "{{baseUrl}}/v1/batches",
            "description": "POST /v1/batches. Idempotency-Key is required (8-128 characters). Provide items or input_file_id, not both. Save batch id into batchId."
          }
        },
        {
          "name": "Get a batch",
          "request": {
            "method": "GET",
            "header": [
              { "key": "Authorization", "value": "Bearer {{batchrouterApiKey}}" }
            ],
            "url": "{{baseUrl}}/v1/batches/{{batchId}}",
            "description": "GET /v1/batches/{batch_id}."
          }
        }
      ]
    },
    {
      "name": "OpenAI-compatible",
      "item": [
        {
          "name": "Upload a batch input file",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Authorization", "value": "Bearer {{batchrouterApiKey}}" }
            ],
            "body": {
              "mode": "formdata",
              "formdata": [
                { "key": "purpose", "value": "batch", "type": "text" },
                { "key": "file", "type": "file", "src": "" }
              ]
            },
            "url": "{{baseUrl}}/v1/openai/v1/files",
            "description": "POST /v1/openai/v1/files. multipart fields file and purpose=batch. Each JSONL row is { custom_id, method, url, body }. Save the returned file id into inputFileId."
          }
        },
        {
          "name": "Create a batch (OpenAI-compatible)",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Authorization", "value": "Bearer {{batchrouterApiKey}}" },
              { "key": "Content-Type", "value": "application/json" }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"input_file_id\": \"{{inputFileId}}\",\n  \"endpoint\": \"/v1/chat/completions\",\n  \"completion_window\": \"24h\"\n}\n"
            },
            "url": "{{baseUrl}}/v1/openai/v1/batches",
            "description": "POST /v1/openai/v1/batches. Required: input_file_id, endpoint. endpoint is one of /v1/chat/completions, /v1/responses, /v1/embeddings. completion_window is 24h."
          }
        }
      ]
    }
  ]
}
