{
  "openapi": "3.1.0",
  "info": {
    "title": "ClaimGPT Claims API Proxy",
    "version": "1.1.0",
    "description": "PHI-conscious proxy for health checks, ICD-10 benchmarking, and FHIR R4 claim operations. Claim decisions require authorized human review."
  },
  "servers": [{ "url": "https://claim-gpt.com" }],
  "components": {
    "securitySchemes": {
      "apiKey": { "type": "http", "scheme": "bearer", "description": "ClaimGPT console access key" }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": ["error", "requestId"],
        "properties": { "error": { "type": "string" }, "requestId": { "type": "string", "format": "uuid" } }
      }
    }
  },
  "paths": {
    "/api/v1/health": {
      "get": { "summary": "Check ClaimsAPI connectivity", "responses": { "200": { "description": "Connection state" } } }
    },
    "/api/v1/benchmark": {
      "post": {
        "summary": "Benchmark ICD-10 codes",
        "security": [{ "apiKey": [] }],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": ["icd_codes", "service_date"], "properties": { "icd_codes": { "type": "array", "minItems": 1, "items": { "type": "string" } }, "service_date": { "type": "string", "format": "date" } } } } } },
        "responses": { "200": { "description": "Benchmark result" }, "400": { "description": "Invalid request" }, "401": { "description": "Missing or invalid key" }, "429": { "description": "Rate limited" } }
      }
    },
    "/api/v1/claim/submit": {
      "post": {
        "summary": "Submit a FHIR R4 Claim",
        "security": [{ "apiKey": [] }],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": ["claim"], "properties": { "claim": { "type": "object", "additionalProperties": true }, "idempotencyKey": { "type": "string" } } } } } },
        "responses": { "200": { "description": "Claim submission response" }, "400": { "description": "Invalid request" }, "401": { "description": "Missing or invalid key" }, "429": { "description": "Rate limited" } }
      }
    },
    "/api/v1/claim/response/{responseId}": {
      "get": { "summary": "Retrieve a ClaimResponse", "security": [{ "apiKey": [] }], "parameters": [{ "name": "responseId", "in": "path", "required": true, "schema": { "type": "string" } }], "responses": { "200": { "description": "ClaimResponse" }, "401": { "description": "Missing or invalid key" } } }
    },
    "/api/v1/claim/status/{responseId}": {
      "get": { "summary": "Retrieve claim status", "security": [{ "apiKey": [] }], "parameters": [{ "name": "responseId", "in": "path", "required": true, "schema": { "type": "string" } }], "responses": { "200": { "description": "Claim status" }, "401": { "description": "Missing or invalid key" } } }
    }
  }
}
