{
  "openapi": "3.1.0",
  "info": {
    "title": "Bornsky API",
    "version": "0.1.0",
    "description": "Invite-only developer beta. Server-side Bearer keys; no consumer sessions or birth-profile persistence. Calculations use a pinned shared engine. Pilot allowances are not commercial prices. See docs/api.md for compatibility, limits and privacy."
  },
  "servers": [
    {
      "url": "https://bornsky-api-staging.bornsky-cloud.workers.dev",
      "description": "Bornsky API staging"
    }
  ],
  "paths": {
    "/v1/charts/natal": {
      "post": {
        "operationId": "natal",
        "summary": "Calculate one natal chart.",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[a-zA-Z0-9_-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NatalRequest"
              },
              "example": {
                "profile": {
                  "date": "1990-06-15",
                  "time": "14:30:00",
                  "timezone": "UTC",
                  "latitude": 51.5,
                  "longitude": -0.12
                },
                "house_system": "placidus"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful result. 1 usage unit(s); no additional charge for an identical successful retry.",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Server-Timing": {
                "schema": {
                  "type": "string"
                },
                "description": "Diagnostic durations in milliseconds: admit (authentication and quota), compute (calculation or cache lookup), settle (usage finalization), app (total application), and gateway (edge forwarding including possible startup). Durations overlap; do not add totals to their components."
              },
              "X-Compute-Cache": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "hit",
                    "miss"
                  ]
                },
                "description": "Short-lived process-local calculation cache. All requests still authenticate and follow usage/idempotency rules; a hit does not imply a free new request."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NatalResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or revoked API key.",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Server-Timing": {
                "schema": {
                  "type": "string"
                },
                "description": "Diagnostic durations in milliseconds: admit (authentication and quota), compute (calculation or cache lookup), settle (usage finalization), app (total application), and gateway (edge forwarding including possible startup). Durations overlap; do not add totals to their components."
              },
              "X-Compute-Cache": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "hit",
                    "miss"
                  ]
                },
                "description": "Short-lived process-local calculation cache. All requests still authenticate and follow usage/idempotency rules; a hit does not imply a free new request."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency key conflicts or the prior attempt is running.",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Server-Timing": {
                "schema": {
                  "type": "string"
                },
                "description": "Diagnostic durations in milliseconds: admit (authentication and quota), compute (calculation or cache lookup), settle (usage finalization), app (total application), and gateway (edge forwarding including possible startup). Durations overlap; do not add totals to their components."
              },
              "X-Compute-Cache": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "hit",
                    "miss"
                  ]
                },
                "description": "Short-lived process-local calculation cache. All requests still authenticate and follow usage/idempotency rules; a hit does not imply a free new request."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request body exceeds 32 KiB.",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Server-Timing": {
                "schema": {
                  "type": "string"
                },
                "description": "Diagnostic durations in milliseconds: admit (authentication and quota), compute (calculation or cache lookup), settle (usage finalization), app (total application), and gateway (edge forwarding including possible startup). Durations overlap; do not add totals to their components."
              },
              "X-Compute-Cache": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "hit",
                    "miss"
                  ]
                },
                "description": "Short-lived process-local calculation cache. All requests still authenticate and follow usage/idempotency rules; a hit does not imply a free new request."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid input, settings, timezone or idempotency key. No units charged.",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Server-Timing": {
                "schema": {
                  "type": "string"
                },
                "description": "Diagnostic durations in milliseconds: admit (authentication and quota), compute (calculation or cache lookup), settle (usage finalization), app (total application), and gateway (edge forwarding including possible startup). Durations overlap; do not add totals to their components."
              },
              "X-Compute-Cache": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "hit",
                    "miss"
                  ]
                },
                "description": "Short-lived process-local calculation cache. All requests still authenticate and follow usage/idempotency rules; a hit does not imply a free new request."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate, concurrency or monthly cap exceeded. No overage charging. See error code and limit policy.",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Server-Timing": {
                "schema": {
                  "type": "string"
                },
                "description": "Diagnostic durations in milliseconds: admit (authentication and quota), compute (calculation or cache lookup), settle (usage finalization), app (total application), and gateway (edge forwarding including possible startup). Durations overlap; do not add totals to their components."
              },
              "X-Compute-Cache": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "hit",
                    "miss"
                  ]
                },
                "description": "Short-lived process-local calculation cache. All requests still authenticate and follow usage/idempotency rules; a hit does not imply a free new request."
              },
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Dependency, timeout or service unavailable. Failed calculations are refunded.",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Server-Timing": {
                "schema": {
                  "type": "string"
                },
                "description": "Diagnostic durations in milliseconds: admit (authentication and quota), compute (calculation or cache lookup), settle (usage finalization), app (total application), and gateway (edge forwarding including possible startup). Durations overlap; do not add totals to their components."
              },
              "X-Compute-Cache": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "hit",
                    "miss"
                  ]
                },
                "description": "Short-lived process-local calculation cache. All requests still authenticate and follow usage/idempotency rules; a hit does not imply a free new request."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/matches/synastry": {
      "post": {
        "operationId": "synastry",
        "summary": "Calculate cross-chart contacts. No compatibility score or relationship interpretation is returned.",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[a-zA-Z0-9_-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SynastryRequest"
              },
              "example": {
                "a": {
                  "date": "1990-06-15",
                  "time": "14:30:00",
                  "timezone": "UTC",
                  "latitude": 51.5,
                  "longitude": -0.12
                },
                "b": {
                  "date": "1992-03-20",
                  "time": null,
                  "timezone": "UTC",
                  "latitude": 51.5,
                  "longitude": -0.12
                },
                "house_system": "equal"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful result. 2 usage unit(s); no additional charge for an identical successful retry.",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Server-Timing": {
                "schema": {
                  "type": "string"
                },
                "description": "Diagnostic durations in milliseconds: admit (authentication and quota), compute (calculation or cache lookup), settle (usage finalization), app (total application), and gateway (edge forwarding including possible startup). Durations overlap; do not add totals to their components."
              },
              "X-Compute-Cache": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "hit",
                    "miss"
                  ]
                },
                "description": "Short-lived process-local calculation cache. All requests still authenticate and follow usage/idempotency rules; a hit does not imply a free new request."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SynastryResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or revoked API key.",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Server-Timing": {
                "schema": {
                  "type": "string"
                },
                "description": "Diagnostic durations in milliseconds: admit (authentication and quota), compute (calculation or cache lookup), settle (usage finalization), app (total application), and gateway (edge forwarding including possible startup). Durations overlap; do not add totals to their components."
              },
              "X-Compute-Cache": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "hit",
                    "miss"
                  ]
                },
                "description": "Short-lived process-local calculation cache. All requests still authenticate and follow usage/idempotency rules; a hit does not imply a free new request."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency key conflicts or the prior attempt is running.",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Server-Timing": {
                "schema": {
                  "type": "string"
                },
                "description": "Diagnostic durations in milliseconds: admit (authentication and quota), compute (calculation or cache lookup), settle (usage finalization), app (total application), and gateway (edge forwarding including possible startup). Durations overlap; do not add totals to their components."
              },
              "X-Compute-Cache": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "hit",
                    "miss"
                  ]
                },
                "description": "Short-lived process-local calculation cache. All requests still authenticate and follow usage/idempotency rules; a hit does not imply a free new request."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request body exceeds 32 KiB.",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Server-Timing": {
                "schema": {
                  "type": "string"
                },
                "description": "Diagnostic durations in milliseconds: admit (authentication and quota), compute (calculation or cache lookup), settle (usage finalization), app (total application), and gateway (edge forwarding including possible startup). Durations overlap; do not add totals to their components."
              },
              "X-Compute-Cache": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "hit",
                    "miss"
                  ]
                },
                "description": "Short-lived process-local calculation cache. All requests still authenticate and follow usage/idempotency rules; a hit does not imply a free new request."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid input, settings, timezone or idempotency key. No units charged.",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Server-Timing": {
                "schema": {
                  "type": "string"
                },
                "description": "Diagnostic durations in milliseconds: admit (authentication and quota), compute (calculation or cache lookup), settle (usage finalization), app (total application), and gateway (edge forwarding including possible startup). Durations overlap; do not add totals to their components."
              },
              "X-Compute-Cache": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "hit",
                    "miss"
                  ]
                },
                "description": "Short-lived process-local calculation cache. All requests still authenticate and follow usage/idempotency rules; a hit does not imply a free new request."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate, concurrency or monthly cap exceeded. No overage charging. See error code and limit policy.",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Server-Timing": {
                "schema": {
                  "type": "string"
                },
                "description": "Diagnostic durations in milliseconds: admit (authentication and quota), compute (calculation or cache lookup), settle (usage finalization), app (total application), and gateway (edge forwarding including possible startup). Durations overlap; do not add totals to their components."
              },
              "X-Compute-Cache": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "hit",
                    "miss"
                  ]
                },
                "description": "Short-lived process-local calculation cache. All requests still authenticate and follow usage/idempotency rules; a hit does not imply a free new request."
              },
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Dependency, timeout or service unavailable. Failed calculations are refunded.",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Server-Timing": {
                "schema": {
                  "type": "string"
                },
                "description": "Diagnostic durations in milliseconds: admit (authentication and quota), compute (calculation or cache lookup), settle (usage finalization), app (total application), and gateway (edge forwarding including possible startup). Durations overlap; do not add totals to their components."
              },
              "X-Compute-Cache": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "hit",
                    "miss"
                  ]
                },
                "description": "Short-lived process-local calculation cache. All requests still authenticate and follow usage/idempotency rules; a hit does not imply a free new request."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/transits": {
      "post": {
        "operationId": "transit",
        "summary": "Calculate personal contacts at one explicit instant.",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[a-zA-Z0-9_-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TransitRequest"
              },
              "example": {
                "profile": {
                  "date": "1990-06-15",
                  "time": "14:30:00",
                  "timezone": "UTC",
                  "latitude": 51.5,
                  "longitude": -0.12
                },
                "house_system": "equal",
                "at": "2026-01-01T00:00:00Z"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful result. 3 usage unit(s); no additional charge for an identical successful retry.",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Server-Timing": {
                "schema": {
                  "type": "string"
                },
                "description": "Diagnostic durations in milliseconds: admit (authentication and quota), compute (calculation or cache lookup), settle (usage finalization), app (total application), and gateway (edge forwarding including possible startup). Durations overlap; do not add totals to their components."
              },
              "X-Compute-Cache": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "hit",
                    "miss"
                  ]
                },
                "description": "Short-lived process-local calculation cache. All requests still authenticate and follow usage/idempotency rules; a hit does not imply a free new request."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransitResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or revoked API key.",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Server-Timing": {
                "schema": {
                  "type": "string"
                },
                "description": "Diagnostic durations in milliseconds: admit (authentication and quota), compute (calculation or cache lookup), settle (usage finalization), app (total application), and gateway (edge forwarding including possible startup). Durations overlap; do not add totals to their components."
              },
              "X-Compute-Cache": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "hit",
                    "miss"
                  ]
                },
                "description": "Short-lived process-local calculation cache. All requests still authenticate and follow usage/idempotency rules; a hit does not imply a free new request."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency key conflicts or the prior attempt is running.",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Server-Timing": {
                "schema": {
                  "type": "string"
                },
                "description": "Diagnostic durations in milliseconds: admit (authentication and quota), compute (calculation or cache lookup), settle (usage finalization), app (total application), and gateway (edge forwarding including possible startup). Durations overlap; do not add totals to their components."
              },
              "X-Compute-Cache": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "hit",
                    "miss"
                  ]
                },
                "description": "Short-lived process-local calculation cache. All requests still authenticate and follow usage/idempotency rules; a hit does not imply a free new request."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request body exceeds 32 KiB.",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Server-Timing": {
                "schema": {
                  "type": "string"
                },
                "description": "Diagnostic durations in milliseconds: admit (authentication and quota), compute (calculation or cache lookup), settle (usage finalization), app (total application), and gateway (edge forwarding including possible startup). Durations overlap; do not add totals to their components."
              },
              "X-Compute-Cache": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "hit",
                    "miss"
                  ]
                },
                "description": "Short-lived process-local calculation cache. All requests still authenticate and follow usage/idempotency rules; a hit does not imply a free new request."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid input, settings, timezone or idempotency key. No units charged.",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Server-Timing": {
                "schema": {
                  "type": "string"
                },
                "description": "Diagnostic durations in milliseconds: admit (authentication and quota), compute (calculation or cache lookup), settle (usage finalization), app (total application), and gateway (edge forwarding including possible startup). Durations overlap; do not add totals to their components."
              },
              "X-Compute-Cache": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "hit",
                    "miss"
                  ]
                },
                "description": "Short-lived process-local calculation cache. All requests still authenticate and follow usage/idempotency rules; a hit does not imply a free new request."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate, concurrency or monthly cap exceeded. No overage charging. See error code and limit policy.",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Server-Timing": {
                "schema": {
                  "type": "string"
                },
                "description": "Diagnostic durations in milliseconds: admit (authentication and quota), compute (calculation or cache lookup), settle (usage finalization), app (total application), and gateway (edge forwarding including possible startup). Durations overlap; do not add totals to their components."
              },
              "X-Compute-Cache": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "hit",
                    "miss"
                  ]
                },
                "description": "Short-lived process-local calculation cache. All requests still authenticate and follow usage/idempotency rules; a hit does not imply a free new request."
              },
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Dependency, timeout or service unavailable. Failed calculations are refunded.",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Server-Timing": {
                "schema": {
                  "type": "string"
                },
                "description": "Diagnostic durations in milliseconds: admit (authentication and quota), compute (calculation or cache lookup), settle (usage finalization), app (total application), and gateway (edge forwarding including possible startup). Durations overlap; do not add totals to their components."
              },
              "X-Compute-Cache": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "hit",
                    "miss"
                  ]
                },
                "description": "Short-lived process-local calculation cache. All requests still authenticate and follow usage/idempotency rules; a hit does not imply a free new request."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/readings": {
      "post": {
        "operationId": "reading",
        "summary": "Static natal catalog fragments. Disabled until catalog redistribution rights are approved. Every fragment reports its actual locale; English fallback is explicit.",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[a-zA-Z0-9_-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReadingRequest"
              },
              "example": {
                "profile": {
                  "date": "1990-06-15",
                  "time": "14:30:00",
                  "timezone": "UTC",
                  "latitude": 51.5,
                  "longitude": -0.12
                },
                "house_system": "equal",
                "locale": "de"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful result. 2 usage unit(s); no additional charge for an identical successful retry.",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Server-Timing": {
                "schema": {
                  "type": "string"
                },
                "description": "Diagnostic durations in milliseconds: admit (authentication and quota), compute (calculation or cache lookup), settle (usage finalization), app (total application), and gateway (edge forwarding including possible startup). Durations overlap; do not add totals to their components."
              },
              "X-Compute-Cache": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "hit",
                    "miss"
                  ]
                },
                "description": "Short-lived process-local calculation cache. All requests still authenticate and follow usage/idempotency rules; a hit does not imply a free new request."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReadingResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or revoked API key.",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Server-Timing": {
                "schema": {
                  "type": "string"
                },
                "description": "Diagnostic durations in milliseconds: admit (authentication and quota), compute (calculation or cache lookup), settle (usage finalization), app (total application), and gateway (edge forwarding including possible startup). Durations overlap; do not add totals to their components."
              },
              "X-Compute-Cache": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "hit",
                    "miss"
                  ]
                },
                "description": "Short-lived process-local calculation cache. All requests still authenticate and follow usage/idempotency rules; a hit does not imply a free new request."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency key conflicts or the prior attempt is running.",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Server-Timing": {
                "schema": {
                  "type": "string"
                },
                "description": "Diagnostic durations in milliseconds: admit (authentication and quota), compute (calculation or cache lookup), settle (usage finalization), app (total application), and gateway (edge forwarding including possible startup). Durations overlap; do not add totals to their components."
              },
              "X-Compute-Cache": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "hit",
                    "miss"
                  ]
                },
                "description": "Short-lived process-local calculation cache. All requests still authenticate and follow usage/idempotency rules; a hit does not imply a free new request."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request body exceeds 32 KiB.",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Server-Timing": {
                "schema": {
                  "type": "string"
                },
                "description": "Diagnostic durations in milliseconds: admit (authentication and quota), compute (calculation or cache lookup), settle (usage finalization), app (total application), and gateway (edge forwarding including possible startup). Durations overlap; do not add totals to their components."
              },
              "X-Compute-Cache": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "hit",
                    "miss"
                  ]
                },
                "description": "Short-lived process-local calculation cache. All requests still authenticate and follow usage/idempotency rules; a hit does not imply a free new request."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid input, settings, timezone or idempotency key. No units charged.",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Server-Timing": {
                "schema": {
                  "type": "string"
                },
                "description": "Diagnostic durations in milliseconds: admit (authentication and quota), compute (calculation or cache lookup), settle (usage finalization), app (total application), and gateway (edge forwarding including possible startup). Durations overlap; do not add totals to their components."
              },
              "X-Compute-Cache": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "hit",
                    "miss"
                  ]
                },
                "description": "Short-lived process-local calculation cache. All requests still authenticate and follow usage/idempotency rules; a hit does not imply a free new request."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate, concurrency or monthly cap exceeded. No overage charging. See error code and limit policy.",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Server-Timing": {
                "schema": {
                  "type": "string"
                },
                "description": "Diagnostic durations in milliseconds: admit (authentication and quota), compute (calculation or cache lookup), settle (usage finalization), app (total application), and gateway (edge forwarding including possible startup). Durations overlap; do not add totals to their components."
              },
              "X-Compute-Cache": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "hit",
                    "miss"
                  ]
                },
                "description": "Short-lived process-local calculation cache. All requests still authenticate and follow usage/idempotency rules; a hit does not imply a free new request."
              },
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Dependency, timeout or service unavailable. Failed calculations are refunded.",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Server-Timing": {
                "schema": {
                  "type": "string"
                },
                "description": "Diagnostic durations in milliseconds: admit (authentication and quota), compute (calculation or cache lookup), settle (usage finalization), app (total application), and gateway (edge forwarding including possible startup). Durations overlap; do not add totals to their components."
              },
              "X-Compute-Cache": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "hit",
                    "miss"
                  ]
                },
                "description": "Short-lived process-local calculation cache. All requests still authenticate and follow usage/idempotency rules; a hit does not imply a free new request."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "bsk_live_…"
      }
    },
    "schemas": {
      "Profile": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "date": {
            "type": "string",
            "format": "date",
            "description": "Proleptic Gregorian date; supported years 1550–2650, additionally constrained by the resolved engine instant."
          },
          "time": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$",
            "description": "HH:MM:SS local time, whole seconds. Omit or null for unknown time: local noon estimate, no houses or angles."
          },
          "timezone": {
            "type": "string",
            "description": "IANA timezone, e.g. Europe/Berlin. Numeric offsets alone are not accepted."
          },
          "latitude": {
            "type": "number",
            "exclusiveMinimum": -90,
            "exclusiveMaximum": 90
          },
          "longitude": {
            "type": "number",
            "minimum": -180,
            "maximum": 180
          },
          "utc_offset_seconds": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Required to disambiguate repeated local times. If supplied it must match the named timezone at the supplied instant."
          }
        },
        "required": [
          "date",
          "timezone",
          "latitude",
          "longitude"
        ]
      },
      "HouseSystem": {
        "type": "string",
        "enum": [
          "placidus",
          "whole_sign",
          "equal",
          "porphyry",
          "regiomontanus"
        ]
      },
      "Locale": {
        "type": "string",
        "enum": [
          "en",
          "de",
          "tr"
        ]
      },
      "Aspect": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "conjunction",
              "sextile",
              "square",
              "trine",
              "opposition",
              "semi_sextile",
              "semi_square",
              "sesquiquadrate",
              "quincunx"
            ]
          },
          "orb": {
            "type": "number"
          },
          "applying": {
            "type": [
              "boolean",
              "null"
            ]
          }
        },
        "required": [
          "kind",
          "orb",
          "applying"
        ]
      },
      "Body": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "body": {
            "type": "string"
          },
          "lon_deg": {
            "type": "number"
          },
          "lat_deg": {
            "type": "number"
          },
          "dist_au": {
            "type": "number"
          },
          "speed": {
            "type": "number"
          },
          "retrograde": {
            "type": "boolean"
          },
          "sign": {
            "type": "string"
          },
          "house": {
            "type": "integer",
            "minimum": 1,
            "maximum": 12
          }
        },
        "required": [
          "body",
          "lon_deg",
          "lat_deg",
          "dist_au",
          "speed",
          "retrograde",
          "sign"
        ]
      },
      "Houses": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "system": {
            "$ref": "#/components/schemas/HouseSystem"
          },
          "ascendant": {
            "type": "number"
          },
          "midheaven": {
            "type": "number"
          },
          "cusps": {
            "type": "array",
            "items": {
              "type": "number"
            },
            "maxItems": 12,
            "minItems": 12
          },
          "fell_back_to_porphyry": {
            "type": "boolean"
          }
        },
        "required": [
          "system",
          "ascendant",
          "midheaven",
          "cusps",
          "fell_back_to_porphyry"
        ]
      },
      "Chart": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "bodies": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Body"
            },
            "maxItems": 32
          },
          "houses": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Houses"
              },
              {
                "type": "null"
              }
            ]
          },
          "aspects": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "a": {
                  "type": "string"
                },
                "b": {
                  "type": "string"
                },
                "aspect": {
                  "$ref": "#/components/schemas/Aspect"
                }
              },
              "required": [
                "a",
                "b",
                "aspect"
              ]
            },
            "maxItems": 512
          },
          "unavailable": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 32
          }
        },
        "required": [
          "bodies",
          "houses",
          "aspects",
          "unavailable"
        ]
      },
      "Settings": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "zodiac": {
            "const": "tropical"
          },
          "house_system": {
            "$ref": "#/components/schemas/HouseSystem"
          },
          "aspect_policy": {
            "type": "string"
          },
          "timezone_database": {
            "type": "string"
          },
          "calendar": {
            "const": "proleptic_gregorian"
          },
          "reference_frame": {
            "const": "geocentric_apparent_ecliptic_of_date"
          }
        },
        "required": [
          "zodiac",
          "house_system",
          "aspect_policy",
          "timezone_database",
          "calendar",
          "reference_frame"
        ]
      },
      "Fragment": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "subject": {
            "type": "string"
          },
          "object": {
            "type": "string"
          },
          "context": {
            "type": "string"
          },
          "locale": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "rule_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 256
          }
        },
        "required": [
          "subject",
          "object",
          "context",
          "locale",
          "text",
          "rule_ids"
        ]
      },
      "Error": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "error": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ]
          }
        },
        "required": [
          "error"
        ]
      },
      "NatalRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "profile": {
            "$ref": "#/components/schemas/Profile"
          },
          "house_system": {
            "$ref": "#/components/schemas/HouseSystem"
          }
        },
        "required": [
          "profile",
          "house_system"
        ]
      },
      "SynastryRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "a": {
            "$ref": "#/components/schemas/Profile"
          },
          "b": {
            "$ref": "#/components/schemas/Profile"
          },
          "house_system": {
            "$ref": "#/components/schemas/HouseSystem"
          }
        },
        "required": [
          "a",
          "b",
          "house_system"
        ]
      },
      "TransitRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "profile": {
            "$ref": "#/components/schemas/Profile"
          },
          "house_system": {
            "$ref": "#/components/schemas/HouseSystem"
          },
          "at": {
            "type": "string",
            "format": "date-time",
            "description": "One explicit RFC3339 instant, whole seconds; same engine date range as natal. No interval or unbounded search."
          }
        },
        "required": [
          "profile",
          "house_system",
          "at"
        ]
      },
      "ReadingRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "profile": {
            "$ref": "#/components/schemas/Profile"
          },
          "house_system": {
            "$ref": "#/components/schemas/HouseSystem"
          },
          "locale": {
            "$ref": "#/components/schemas/Locale"
          }
        },
        "required": [
          "profile",
          "house_system",
          "locale"
        ]
      },
      "NatalData": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "calculation": {
            "$ref": "#/components/schemas/Chart"
          },
          "settings": {
            "$ref": "#/components/schemas/Settings"
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 256
          }
        },
        "required": [
          "calculation",
          "settings",
          "warnings"
        ]
      },
      "SynastryData": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "calculation": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "a": {
                "$ref": "#/components/schemas/Chart"
              },
              "b": {
                "$ref": "#/components/schemas/Chart"
              },
              "contacts": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "a": {
                      "type": "string"
                    },
                    "b": {
                      "type": "string"
                    },
                    "aspect": {
                      "$ref": "#/components/schemas/Aspect"
                    },
                    "orb_cap_deg": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "a",
                    "b",
                    "aspect",
                    "orb_cap_deg"
                  ]
                },
                "maxItems": 1024
              }
            },
            "required": [
              "a",
              "b",
              "contacts"
            ]
          },
          "settings": {
            "$ref": "#/components/schemas/Settings"
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 256
          }
        },
        "required": [
          "calculation",
          "settings",
          "warnings"
        ]
      },
      "TransitData": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "calculation": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "contacts": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "transiting": {
                      "type": "string"
                    },
                    "natal": {
                      "type": "string"
                    },
                    "aspect": {
                      "$ref": "#/components/schemas/Aspect"
                    }
                  },
                  "required": [
                    "transiting",
                    "natal",
                    "aspect"
                  ]
                },
                "maxItems": 1024
              },
              "natal": {
                "$ref": "#/components/schemas/Chart"
              },
              "transiting_unavailable": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "maxItems": 32
              }
            },
            "required": [
              "contacts",
              "natal",
              "transiting_unavailable"
            ]
          },
          "at": {
            "type": "string",
            "format": "date-time"
          },
          "settings": {
            "$ref": "#/components/schemas/Settings"
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 256
          }
        },
        "required": [
          "calculation",
          "at",
          "settings",
          "warnings"
        ]
      },
      "ReadingData": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "calculation": {
            "$ref": "#/components/schemas/Chart"
          },
          "interpretations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Fragment"
            },
            "maxItems": 512
          },
          "locale": {
            "$ref": "#/components/schemas/Locale"
          },
          "kind": {
            "const": "static_natal"
          },
          "settings": {
            "$ref": "#/components/schemas/Settings"
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 256
          }
        },
        "required": [
          "calculation",
          "interpretations",
          "locale",
          "kind",
          "settings",
          "warnings"
        ]
      },
      "NatalResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "request_id": {
            "type": "string",
            "format": "uuid",
            "description": "Matches X-Request-Id; unique for each HTTP attempt."
          },
          "usage_id": {
            "type": "string",
            "format": "uuid",
            "description": "Stable ledger identity for an idempotent operation."
          },
          "api_version": {
            "const": "v1"
          },
          "engine_version": {
            "type": "integer"
          },
          "engine_revision": {
            "type": "string",
            "pattern": "^[a-f0-9]{40}$"
          },
          "catalog_version": {
            "type": "integer"
          },
          "replayed": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/NatalData"
          }
        },
        "required": [
          "request_id",
          "usage_id",
          "api_version",
          "engine_version",
          "engine_revision",
          "catalog_version",
          "replayed",
          "data"
        ]
      },
      "SynastryResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "request_id": {
            "type": "string",
            "format": "uuid",
            "description": "Matches X-Request-Id; unique for each HTTP attempt."
          },
          "usage_id": {
            "type": "string",
            "format": "uuid",
            "description": "Stable ledger identity for an idempotent operation."
          },
          "api_version": {
            "const": "v1"
          },
          "engine_version": {
            "type": "integer"
          },
          "engine_revision": {
            "type": "string",
            "pattern": "^[a-f0-9]{40}$"
          },
          "catalog_version": {
            "type": "integer"
          },
          "replayed": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/SynastryData"
          }
        },
        "required": [
          "request_id",
          "usage_id",
          "api_version",
          "engine_version",
          "engine_revision",
          "catalog_version",
          "replayed",
          "data"
        ]
      },
      "TransitResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "request_id": {
            "type": "string",
            "format": "uuid",
            "description": "Matches X-Request-Id; unique for each HTTP attempt."
          },
          "usage_id": {
            "type": "string",
            "format": "uuid",
            "description": "Stable ledger identity for an idempotent operation."
          },
          "api_version": {
            "const": "v1"
          },
          "engine_version": {
            "type": "integer"
          },
          "engine_revision": {
            "type": "string",
            "pattern": "^[a-f0-9]{40}$"
          },
          "catalog_version": {
            "type": "integer"
          },
          "replayed": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/TransitData"
          }
        },
        "required": [
          "request_id",
          "usage_id",
          "api_version",
          "engine_version",
          "engine_revision",
          "catalog_version",
          "replayed",
          "data"
        ]
      },
      "ReadingResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "request_id": {
            "type": "string",
            "format": "uuid",
            "description": "Matches X-Request-Id; unique for each HTTP attempt."
          },
          "usage_id": {
            "type": "string",
            "format": "uuid",
            "description": "Stable ledger identity for an idempotent operation."
          },
          "api_version": {
            "const": "v1"
          },
          "engine_version": {
            "type": "integer"
          },
          "engine_revision": {
            "type": "string",
            "pattern": "^[a-f0-9]{40}$"
          },
          "catalog_version": {
            "type": "integer"
          },
          "replayed": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/ReadingData"
          }
        },
        "required": [
          "request_id",
          "usage_id",
          "api_version",
          "engine_version",
          "engine_revision",
          "catalog_version",
          "replayed",
          "data"
        ]
      }
    }
  }
}
