{
  "info": {
    "name": "RuntimeAI v1 API",
    "description": "Quote → submit → poll flow for RuntimeAI evaluations.\n\nSetup:\n1. Create environment with variables: baseUrl, token, quote_id, evaluation_id\n2. baseUrl = https://www.vantageai.cc/api/runtimeai/v1\n3. token = your RUNTIMEAI_API_TOKEN from Render\n4. Run requests 01 → 05 in order",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{token}}",
        "type": "string"
      }
    ]
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://www.vantageai.cc/api/runtimeai/v1"
    },
    {
      "key": "token",
      "value": ""
    },
    {
      "key": "quote_id",
      "value": ""
    },
    {
      "key": "evaluation_id",
      "value": ""
    }
  ],
  "item": [
    {
      "name": "01 Health (no auth)",
      "request": {
        "auth": {
          "type": "noauth"
        },
        "method": "GET",
        "header": [],
        "url": "{{baseUrl}}/health"
      },
      "event": [
        {
          "listen": "test",
          "script": {
            "exec": [
              "pm.test('Status 200', () => pm.response.to.have.status(200));",
              "pm.test('ok true', () => {",
              "  const j = pm.response.json();",
              "  pm.expect(j.ok).to.eql(true);",
              "  pm.expect(j.product).to.eql('runtimeai');",
              "  pm.expect(j.api_path).to.eql('v1');",
              "});"
            ],
            "type": "text/javascript"
          }
        }
      ]
    },
    {
      "name": "02 List scenarios",
      "request": {
        "method": "GET",
        "header": [],
        "url": "{{baseUrl}}/scenarios"
      },
      "event": [
        {
          "listen": "test",
          "script": {
            "exec": [
              "pm.test('Status 200', () => pm.response.to.have.status(200));"
            ],
            "type": "text/javascript"
          }
        }
      ]
    },
    {
      "name": "02b List permitted models (trial sample)",
      "request": {
        "method": "GET",
        "header": [],
        "url": {
          "raw": "{{baseUrl}}/models?scenario_id=support_escalation_v1&turns=8&provider=openrouter",
          "host": ["{{baseUrl}}"],
          "path": ["models"],
          "query": [
            { "key": "scenario_id", "value": "support_escalation_v1" },
            { "key": "turns", "value": "8" },
            { "key": "provider", "value": "openrouter" }
          ]
        }
      },
      "event": [
        {
          "listen": "test",
          "script": {
            "exec": [
              "pm.test('Status 200', () => pm.response.to.have.status(200));",
              "const body = pm.response.json();",
              "pm.test('Cheapest tier policy', () => {",
              "  pm.expect(body.cheapest_price_tiers).to.eql(5);",
              "  pm.expect(body.max_parallel_models).to.eql(5);",
              "});"
            ],
            "type": "text/javascript"
          }
        }
      ]
    },
    {
      "name": "03 Quote evaluation",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"scenario_id\": \"support_escalation_v1\",\n  \"models\": [\n    \"openai/gpt-5-nano\",\n    \"meta-llama/llama-3.1-8b-instruct\"\n  ],\n  \"turns\": 8,\n  \"provider\": \"openrouter\",\n  \"preflight\": false\n}"
        },
        "url": "{{baseUrl}}/evaluations/quote"
      },
      "event": [
        {
          "listen": "test",
          "script": {
            "exec": [
              "pm.test('Status 200', () => pm.response.to.have.status(200));",
              "const body = pm.response.json();",
              "if (body.quote_id) {",
              "  pm.collectionVariables.set('quote_id', body.quote_id);",
              "  pm.environment.set('quote_id', body.quote_id);",
              "  console.log('Saved quote_id:', body.quote_id);",
              "}",
              "pm.test('Has ready model', () => {",
              "  pm.expect(body.summary.ready_count).to.be.above(0);",
              "});"
            ],
            "type": "text/javascript"
          }
        }
      ]
    },
    {
      "name": "04 Submit evaluation",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"quote_id\": \"{{quote_id}}\",\n  \"confirm\": true\n}"
        },
        "url": "{{baseUrl}}/evaluations"
      },
      "event": [
        {
          "listen": "test",
          "script": {
            "exec": [
              "pm.test('Status 202', () => pm.response.to.have.status(202));",
              "const body = pm.response.json();",
              "if (body.evaluation_id) {",
              "  pm.collectionVariables.set('evaluation_id', body.evaluation_id);",
              "  pm.environment.set('evaluation_id', body.evaluation_id);",
              "  console.log('Saved evaluation_id:', body.evaluation_id);",
              "}",
              "pm.test('Status running', () => {",
              "  pm.expect(body.status).to.eql('running');",
              "});"
            ],
            "type": "text/javascript"
          }
        }
      ]
    },
    {
      "name": "05 Poll evaluation status",
      "request": {
        "method": "GET",
        "header": [],
        "url": "{{baseUrl}}/evaluations/{{evaluation_id}}"
      },
      "event": [
        {
          "listen": "test",
          "script": {
            "exec": [
              "pm.test('Status 200', () => pm.response.to.have.status(200));",
              "const body = pm.response.json();",
              "console.log('Aggregate status:', body.status);",
              "console.log('Progress:', JSON.stringify(body.progress));",
              "if (body.status !== 'running') {",
              "  console.log('Done — check runs[].links for PDF/scorecard URLs');",
              "}"
            ],
            "type": "text/javascript"
          }
        }
      ]
    }
  ]
}
