{
 "openapi": "3.1.0",
 "info": {
  "title": "VAIATA Inference GPU API",
  "version": "1",
  "description": "Rent NVIDIA RTX PRO 6000 Blackwell 96 GB GPUs (2, 4 or 8 on one server) or one DGX Spark GB10 (gpus 1: arm64 image or preset vllm), held now, billed per GPU-minute. Human docs: GET /docs (Markdown). Public price list: GET /prices.json (no auth). All API routes are under /v1 and need `Authorization: Bearer <api_key>`. MCP server for AI agents: POST /mcp (Streamable HTTP, same Bearer key), server card GET /mcp/server-card. Terms: GET /legal/terms, privacy: GET /legal/privacy. Limits: 20 req/s per key (429 rate_limited, Retry-After). Request bodies at most 64 KiB (413 too_large).",
  "termsOfService": "https://api.vaiata-inference.com/legal/terms"
 },
 "servers": [
  {
   "url": "https://api.vaiata-inference.com"
  }
 ],
 "security": [
  {
   "bearerAuth": []
  }
 ],
 "paths": {
  "/health": {
   "get": {
    "operationId": "health",
    "security": [],
    "summary": "Service health (no auth)",
    "responses": {
     "200": {
      "description": "ok",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Health"
        }
       }
      }
     },
     "503": {
      "description": "bookings temporarily impossible (engine_online false)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Health"
        }
       }
      }
     }
    }
   }
  },
  "/prices.json": {
   "get": {
    "operationId": "prices",
    "security": [],
    "summary": "Public price list and live availability (no auth)",
    "description": "No auth, CORS `Access-Control-Allow-Origin: *`, `Cache-Control: public, max-age=60`. `sizes` = GPU counts bookable right now ([] = none free now; queue with max_wait_minutes). `flex_price_per_gpu_hour` = price when max_wait_minutes >= 360 and the booking is held from the queue (up to 10% off, never below our floor).",
    "responses": {
     "200": {
      "description": "prices",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Prices"
        },
        "example": {
         "updated_at": "2026-11-01T12:00:00Z",
         "status": "ok",
         "currency": "USD",
         "billing": "per minute",
         "docs": "https://api.vaiata-inference.com/docs",
         "offers": [
          {
           "gpu_type": "rtx-pro-6000-96gb",
           "name": "RTX PRO 6000 96 GB",
           "arch": "amd64",
           "memory_gb": 96,
           "location": "Marseille, FR",
           "price_per_gpu_hour": "1.44",
           "flex_price_per_gpu_hour": "1.39",
           "sizes": [
            2,
            4
           ]
          },
          {
           "gpu_type": "gb10-128gb",
           "name": "DGX Spark GB10 128 GB",
           "arch": "arm64",
           "memory_gb": 128,
           "location": "Marseille, FR",
           "price_per_gpu_hour": "0.40",
           "flex_price_per_gpu_hour": "0.36",
           "sizes": []
          }
         ]
        }
       }
      }
     }
    }
   }
  },
  "/v1/availability": {
   "get": {
    "operationId": "availability",
    "summary": "Sizes bookable right now and prices",
    "description": "`sizes` = RTX sizes free now (empty = no capacity now; use POST /v1/bookings with max_wait_minutes to queue). `offers` lists every GPU type, including the GB10 Spark (`gpus: 1`).",
    "responses": {
     "200": {
      "description": "availability",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Availability"
        },
        "example": {
         "gpu_type": "rtx-pro-6000-96gb",
         "location": "marseille-fr",
         "sizes": [
          2,
          4
         ],
         "price_per_gpu_hour": "1.44",
         "currency": "USD",
         "max_hours": 72,
         "offers": [
          {
           "gpu_type": "rtx-pro-6000-96gb",
           "arch": "amd64",
           "sizes": [
            2,
            4
           ],
           "price_per_gpu_hour": "1.44"
          },
          {
           "gpu_type": "gb10-128gb",
           "arch": "arm64",
           "sizes": [
            1
           ],
           "price_per_gpu_hour": "0.40",
           "image": "arm64 or multi-arch image, or preset vllm"
          }
         ]
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "503": {
      "description": "engine_unavailable: temporary outage on our side (not a capacity shortage), retry in a few minutes",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v1/images": {
   "get": {
    "operationId": "images",
    "security": [],
    "summary": "Presets (base, vllm) and the image option",
    "responses": {
     "200": {
      "description": "presets",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   }
  },
  "/v1/bookings": {
   "post": {
    "operationId": "createBooking",
    "summary": "Hold GPUs now (or queue with max_wait_minutes)",
    "description": "Holds N GPUs on one server for `hours`. Billing starts at `held_at`. Send `Idempotency-Key` to retry safely. 409 no_capacity = nothing held, nothing billed: retry later or resend with `max_wait_minutes` to be queued (202 waiting).",
    "parameters": [
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": false,
      "schema": {
       "type": "string",
       "maxLength": 100
      },
      "description": "same key + same body returns the same booking; same key + different body \u2192 422 idempotency_mismatch"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/BookingRequest"
       },
       "examples": {
        "vllm": {
         "summary": "2 RTX GPUs, vLLM serving a Hugging Face model",
         "value": {
          "gpus": 2,
          "hours": 3,
          "ssh_public_key": "ssh-ed25519 AAAA... user@host",
          "preset": "vllm",
          "model": "Qwen/Qwen3-8B"
         }
        },
        "base": {
         "summary": "4 RTX GPUs, CUDA image with SSH",
         "value": {
          "gpus": 4,
          "hours": 6,
          "ssh_public_key": "ssh-ed25519 AAAA... user@host",
          "preset": "base",
          "disk_gb": 200,
          "reference": "your-id-123"
         }
        },
        "spark": {
         "summary": "1 GB10 Spark with a multi-arch image",
         "value": {
          "gpus": 1,
          "hours": 1,
          "ssh_public_key": "ssh-ed25519 AAAA... user@host",
          "image": "nvcr.io/nvidia/pytorch:25.09-py3"
         }
        },
        "queued": {
         "summary": "8 GPUs, wait up to 2 h if none free",
         "value": {
          "gpus": 8,
          "hours": 4,
          "ssh_public_key": "ssh-ed25519 AAAA... user@host",
          "max_wait_minutes": 120
         }
        }
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "held: GPUs are yours, billing started. Poll GET /v1/bookings/{id} until status ready for ssh/api_url/api_token.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Booking"
        }
       }
      }
     },
     "202": {
      "description": "status requested (hold takes longer than ~50 s) or waiting (queued, max_wait_minutes set): poll GET /v1/bookings/{id}",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Booking"
        }
       }
      }
     },
     "400": {
      "description": "invalid input or unknown field",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "409": {
      "description": "no_capacity: nothing held, nothing billed; `sizes` = sizes free now; header Retry-After: 30. Resend with max_wait_minutes to queue.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        },
        "example": {
         "error": "no_capacity",
         "message": "No 8 free GPUs on one machine now",
         "sizes": [
          2,
          4
         ]
        }
       }
      }
     },
     "422": {
      "description": "idempotency_mismatch",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "quota: customer GPU quota reached; queue_full: 4 waiting requests already; rate_limited (Retry-After)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "502": {
      "description": "hold refused by the provider; nothing billed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "engine_unavailable: temporary outage on our side (not a capacity shortage), retry in a few minutes",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "200": {
      "description": "dry_run result {valid, available_now, sizes, price_per_gpu_hour, discount, max_cost, within_limit}, or idempotent replay of an existing booking",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "402": {
      "description": "spend_limit: committed spend + this booking's max cost would exceed the monthly spend limit (GET /v1/account); nothing booked",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/SpendLimitError"
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/Suspended"
     },
     "413": {
      "description": "too_large: body over 64 KiB",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "get": {
    "operationId": "listBookings",
    "summary": "List bookings",
    "parameters": [
     {
      "name": "status",
      "in": "query",
      "schema": {
       "type": "string",
       "enum": [
        "active",
        "ended"
       ]
      },
      "description": "active includes waiting; ended includes failed, expired, cancelled"
     },
     {
      "name": "from",
      "in": "query",
      "schema": {
       "type": "string",
       "format": "date"
      },
      "description": "created on/after, YYYY-MM-DD"
     },
     {
      "name": "to",
      "in": "query",
      "schema": {
       "type": "string",
       "format": "date"
      },
      "description": "created before, YYYY-MM-DD"
     }
    ],
    "responses": {
     "200": {
      "description": "bookings, newest first",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "bookings": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/Booking"
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "400": {
      "description": "invalid: status not active|ended, or from/to not YYYY-MM-DD",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v1/bookings/{id}": {
   "parameters": [
    {
     "name": "id",
     "in": "path",
     "required": true,
     "schema": {
      "type": "string"
     },
     "example": "bk_2f1c9a7e0b3d4c5a"
    }
   ],
   "get": {
    "operationId": "getBooking",
    "summary": "Booking status, endpoints, cost",
    "description": "Authoritative state. `held` \u2192 `ready` (SSH up; for vllm, /v1/models answers) \u2192 `ended`. Endpoints (`ssh`, `api_url`, `api_token`) are filled once ready. Blocking wait: `?wait=ready&timeout=S` answers as soon as status is ready or final (failed, expired, ended, cancelled), else the current state after S seconds with timed_out true (loop). Through api.vaiata-inference.com the wait is capped at 90 s (Cloudflare 100 s limit).",
    "responses": {
     "200": {
      "description": "booking",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Booking"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "400": {
      "description": "invalid wait/timeout",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "too_many_waiters: header Retry-After 5; retry or poll without wait",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "parameters": [
     {
      "name": "wait",
      "in": "query",
      "schema": {
       "type": "string",
       "enum": [
        "ready"
       ]
      },
      "description": "block until ready or final"
     },
     {
      "name": "timeout",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 0,
       "maximum": 600,
       "default": 300
      },
      "description": "seconds to wait (90 max through api.vaiata-inference.com)"
     }
    ]
   },
   "patch": {
    "operationId": "extendBooking",
    "summary": "Extend or shorten the window",
    "description": "Change `end_at` (absolute UTC time, at least 2 min ahead, at most 72 h after held_at; to extend by N hours send current end_at + N h) and/or `auto_end_idle_minutes` (applied at once). `end_at` changes only on 200. An extension above the monthly spend limit gets 402.",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
         "end_at": {
          "type": "string",
          "format": "date-time",
          "example": "2026-11-02T20:00:00Z"
         },
         "auto_end_idle_minutes": {
          "type": [
           "integer",
           "null"
          ],
          "minimum": 15,
          "maximum": 1440
         }
        },
        "minProperties": 1
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "applied",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Booking"
        }
       }
      }
     },
     "202": {
      "description": "still applying (also when too many waits run at once): end_at not changed yet; poll GET",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Booking"
        }
       }
      }
     },
     "400": {
      "description": "invalid end_at or unknown field",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "description": "conflict: booking not active / no longer extendable, or an earlier extension still being applied (retry once its end_at shows)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "502": {
      "description": "engine_error: not applied, retry",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "engine_unavailable: temporary outage on our side (not a capacity shortage), retry in a few minutes",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "402": {
      "description": "spend_limit: extension would exceed the monthly spend limit; nothing changed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/SpendLimitError"
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/Suspended"
     }
    }
   },
   "delete": {
    "operationId": "endBooking",
    "summary": "End now (or cancel a waiting request)",
    "description": "Returns the final booking (ended_at, billed_minutes, cost). A waiting request becomes cancelled. 202 status ending if destruction takes longer than 60 s.",
    "responses": {
     "200": {
      "description": "ended / cancelled",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Booking"
        }
       }
      }
     },
     "202": {
      "description": "ending; poll GET",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Booking"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "502": {
      "description": "engine_error: destruction failed, retried automatically; billing stops when destroyed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v1/usage": {
   "get": {
    "operationId": "usage",
    "summary": "Billed lines and total for a period",
    "description": "Basis of the monthly invoice. Each line bills only the minutes inside [from, to). `partial: true` = booking still running. For the current month: from=YYYY-MM-01, to=first day of next month.",
    "parameters": [
     {
      "name": "from",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "format": "date"
      },
      "example": "2026-11-01"
     },
     {
      "name": "to",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "format": "date"
      },
      "example": "2026-12-01"
     }
    ],
    "responses": {
     "200": {
      "description": "usage",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Usage"
        }
       }
      }
     },
     "400": {
      "description": "from and to required, YYYY-MM-DD",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   }
  },
  "/v1/account": {
   "get": {
    "operationId": "getAccount",
    "summary": "Quota, monthly spend limit, committed spend",
    "responses": {
     "200": {
      "description": "account",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Account"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   },
   "patch": {
    "operationId": "setSpendLimit",
    "summary": "Set your own monthly spend limit",
    "description": "`monthly_spend_limit_usd` (USD, >= 0) or null to remove your own limit; cannot exceed monthly_spend_cap_usd.",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "monthly_spend_limit_usd"
        ],
        "additionalProperties": false,
        "properties": {
         "monthly_spend_limit_usd": {
          "type": [
           "number",
           "null"
          ],
          "minimum": 0,
          "example": 200
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "updated account",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Account"
        }
       }
      }
     },
     "400": {
      "description": "invalid or above the cap",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Suspended"
     }
    }
   }
  },
  "/v1/watches": {
   "post": {
    "operationId": "createWatch",
    "summary": "Notify me when a size is free",
    "description": "Sends one signed webhook `capacity.available` ({event, watch, gpus, offer with prices}) as soon as the size is bookable, then status fired. Nothing is held or reserved: book with POST /v1/bookings. Expires after 7 days; at most 5 active. webhook_url default: your account's webhook (https, public host only). Email notification not available.",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "gpus"
        ],
        "additionalProperties": false,
        "properties": {
         "gpus": {
          "type": "integer",
          "enum": [
           1,
           2,
           4,
           8
          ]
         },
         "gpu_type": {
          "type": "string",
          "enum": [
           "rtx-pro-6000-96gb",
           "gb10-128gb"
          ],
          "description": "optional, implied by gpus"
         },
         "webhook_url": {
          "type": "string",
          "format": "uri",
          "description": "https; default: your account's webhook"
         }
        }
       },
       "example": {
        "gpus": 8
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "watch",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Watch"
        }
       }
      }
     },
     "400": {
      "description": "invalid, private webhook host, or no_webhook (account without webhook)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Suspended"
     },
     "429": {
      "description": "too_many_watches (5 active)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "get": {
    "operationId": "listWatches",
    "summary": "Your watches, newest first",
    "responses": {
     "200": {
      "description": "watches",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "watches": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/Watch"
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   }
  },
  "/v1/watches/{id}": {
   "delete": {
    "operationId": "cancelWatch",
    "summary": "Cancel an active watch",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "watch (cancelled, or its final status)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Watch"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   }
  }
 },
 "components": {
  "securitySchemes": {
   "bearerAuth": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "responses": {
   "Unauthorized": {
    "description": "missing or bad API key",
    "content": {
     "application/json": {
      "schema": {
       "$ref": "#/components/schemas/Error"
      }
     }
    }
   },
   "NotFound": {
    "description": "no such booking for this key",
    "content": {
     "application/json": {
      "schema": {
       "$ref": "#/components/schemas/Error"
      }
     }
    }
   },
   "Suspended": {
    "description": "suspended: account suspended after abuse detection (reading and ending bookings still work)",
    "content": {
     "application/json": {
      "schema": {
       "$ref": "#/components/schemas/Error"
      }
     }
    }
   }
  },
  "schemas": {
   "Error": {
    "type": "object",
    "required": [
     "error",
     "message"
    ],
    "properties": {
     "error": {
      "type": "string",
      "enum": [
       "invalid",
       "unauthorized",
       "forbidden",
       "not_found",
       "no_capacity",
       "conflict",
       "idempotency_mismatch",
       "quota",
       "engine_error",
       "engine_unavailable",
       "error",
       "spend_limit",
       "too_many_waiters",
       "rate_limited",
       "queue_full",
       "suspended",
       "too_large"
      ]
     },
     "message": {
      "type": "string",
      "description": "what is wrong and how to fix it"
     },
     "hint": {
      "type": "string",
      "description": "next step, when there is one"
     },
     "sizes": {
      "type": "array",
      "items": {
       "type": "integer"
      },
      "description": "no_capacity only: sizes free now"
     },
     "retry_after_s": {
      "type": "integer",
      "description": "rate_limited only: seconds to wait"
     }
    }
   },
   "Health": {
    "type": "object",
    "properties": {
     "ok": {
      "type": "boolean"
     },
     "engine_online": {
      "type": "boolean"
     },
     "paused_feed_age_s": {
      "type": [
       "number",
       "null"
      ]
     }
    }
   },
   "Offer": {
    "type": "object",
    "properties": {
     "gpu_type": {
      "type": "string"
     },
     "arch": {
      "type": "string",
      "enum": [
       "amd64",
       "arm64"
      ]
     },
     "sizes": {
      "type": "array",
      "items": {
       "type": "integer"
      }
     },
     "price_per_gpu_hour": {
      "type": [
       "string",
       "null"
      ]
     },
     "image": {
      "type": "string"
     },
     "next_free": {
      "type": "object",
      "description": "Per size not bookable now (key = GPU count): when it should free up. An estimate from past rental durations, not a promise or reservation. Absent when status is degraded.",
      "additionalProperties": {
       "type": [
        "object",
        "null"
       ],
       "description": "null = no estimate",
       "properties": {
        "at": {
         "type": "string",
         "format": "date-time",
         "description": "median estimate"
        },
        "p80_at": {
         "type": [
          "string",
          "null"
         ],
         "format": "date-time",
         "description": "80% likely free by then; null = unknown"
        },
        "basis": {
         "type": "string",
         "enum": [
          "exact",
          "estimate"
         ],
         "description": "exact = only our own bookings' end times; estimate = past rental durations"
        },
        "sample": {
         "type": [
          "integer",
          "null"
         ],
         "description": "comparable past contracts behind the estimate (smallest used); null when exact"
        }
       }
      },
      "example": {
       "8": {
        "at": "2026-11-01T15:20:00Z",
        "p80_at": "2026-11-01T19:00:00Z",
        "basis": "estimate",
        "sample": 42
       }
      }
     },
     "next_free_note": {
      "type": "string",
      "example": "estimate from past rental durations; not a reservation"
     }
    }
   },
   "Availability": {
    "type": "object",
    "properties": {
     "gpu_type": {
      "type": "string"
     },
     "location": {
      "type": "string"
     },
     "sizes": {
      "type": "array",
      "items": {
       "type": "integer"
      },
      "description": "RTX sizes bookable right now"
     },
     "price_per_gpu_hour": {
      "type": "string"
     },
     "currency": {
      "type": "string"
     },
     "max_hours": {
      "type": "number"
     },
     "offers": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/Offer"
      }
     }
    }
   },
   "BookingRequest": {
    "type": "object",
    "required": [
     "gpus",
     "hours",
     "ssh_public_key"
    ],
    "additionalProperties": false,
    "description": "Exactly one of: preset base (default), preset vllm + model, or image. Unknown fields are rejected (400).",
    "properties": {
     "gpus": {
      "type": "integer",
      "enum": [
       1,
       2,
       4,
       8
      ],
      "description": "2, 4 or 8 RTX PRO 6000 on one server; 1 = one GB10 Spark (arm64: image or preset vllm)"
     },
     "hours": {
      "type": "number",
      "minimum": 0.25,
      "maximum": 72,
      "description": "window length from the hold; extend later with PATCH end_at"
     },
     "ssh_public_key": {
      "type": "string",
      "description": "one OpenSSH public key line, e.g. `ssh-ed25519 AAAA... user@host`"
     },
     "preset": {
      "type": "string",
      "enum": [
       "base",
       "vllm"
      ],
      "default": "base",
      "description": "base = CUDA image with SSH; vllm = OpenAI-compatible HTTPS endpoint, needs model. base is RTX only; vllm also on gpus 1 (DGX Spark)."
     },
     "model": {
      "type": "string",
      "description": "Hugging Face model id, preset vllm only",
      "example": "Qwen/Qwen3-8B"
     },
     "vllm_args": {
      "type": "string",
      "maxLength": 500,
      "description": "extra vLLM CLI args, preset vllm only",
      "example": "--max-model-len 32768"
     },
     "hf_token": {
      "type": "string",
      "description": "Hugging Face token for gated models"
     },
     "image": {
      "type": [
       "string",
       "null"
      ],
      "description": "any public Docker image with SSH, instead of a preset; arm64 or multi-arch for gpus 1",
      "example": "nvcr.io/nvidia/pytorch:25.09-py3"
     },
     "disk_gb": {
      "type": "integer",
      "minimum": 50,
      "maximum": 2000,
      "default": 200
     },
     "reference": {
      "type": "string",
      "maxLength": 100,
      "description": "your own id, echoed back"
     },
     "max_wait_minutes": {
      "type": [
       "integer",
       "null"
      ],
      "minimum": 1,
      "maximum": 1440,
      "description": "queue instead of 409 when the size is not free; 202 waiting, held as soon as GPUs free up; >= 360 = flex: up to 10% off price_per_gpu_hour when held from the queue (an immediate hold pays full price)"
     },
     "dry_run": {
      "type": "boolean",
      "description": "Validate and price only: 200 with valid, available_now, sizes, price_per_gpu_hour, discount, max_cost (flex price when max_wait_minutes >= 360 and not available now); nothing held or billed."
     },
     "auto_end_idle_minutes": {
      "type": [
       "integer",
       "null"
      ],
      "minimum": 15,
      "maximum": 1440,
      "description": "end automatically after this many consecutive idle minutes (all GPUs 0%, network < 1 MB/min); null = off (default)"
     }
    }
   },
   "Booking": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "example": "bk_2f1c9a7e0b3d4c5a"
     },
     "status": {
      "type": "string",
      "enum": [
       "requested",
       "waiting",
       "held",
       "ready",
       "ending",
       "ended",
       "failed",
       "expired",
       "cancelled"
      ],
      "description": "held = GPUs yours, container starting; ready = ssh up (vllm: /v1/models answers); ended = finished. waiting/expired/cancelled/failed are never billed."
     },
     "gpus": {
      "type": "integer"
     },
     "hours": {
      "type": "number"
     },
     "preset": {
      "type": [
       "string",
       "null"
      ]
     },
     "model": {
      "type": [
       "string",
       "null"
      ]
     },
     "image": {
      "type": [
       "string",
       "null"
      ]
     },
     "reference": {
      "type": [
       "string",
       "null"
      ]
     },
     "disk_gb": {
      "type": [
       "integer",
       "null"
      ]
     },
     "created_at": {
      "type": "string",
      "format": "date-time"
     },
     "held_at": {
      "type": [
       "string",
       "null"
      ],
      "format": "date-time"
     },
     "ready_at": {
      "type": [
       "string",
       "null"
      ],
      "format": "date-time"
     },
     "end_at": {
      "type": [
       "string",
       "null"
      ],
      "format": "date-time",
      "description": "scheduled end; change with PATCH"
     },
     "ended_at": {
      "type": [
       "string",
       "null"
      ],
      "format": "date-time"
     },
     "end_reason": {
      "type": [
       "string",
       "null"
      ],
      "description": "ended, window_end, idle (auto-end), credit (prepaid credit at zero), ..."
     },
     "wait_until": {
      "type": "string",
      "format": "date-time",
      "description": "queued requests only: deadline"
     },
     "error": {
      "type": [
       "string",
       "null"
      ]
     },
     "message": {
      "type": [
       "string",
       "null"
      ]
     },
     "ssh": {
      "type": [
       "string",
       "null"
      ],
      "description": "SSH command once ready",
      "example": "ssh -p 41022 root@1.2.3.4"
     },
     "ssh_host_key": {
      "type": [
       "string",
       "null"
      ]
     },
     "api_url": {
      "type": [
       "string",
       "null"
      ],
      "description": "vllm: OpenAI-compatible base URL once ready. Usually https://bk-<id>.vaiata-inference.com/v1 with a publicly trusted certificate (paths under /v1/ only; use stream=true for responses that take over 125 s to start). Otherwise same as api_url_direct (self-signed: skip certificate verification for this URL only, or use an SSH tunnel; ssh_host_key pins the host)",
      "example": "https://bk-0123456789abcdef.vaiata-inference.com/v1"
     },
     "api_url_direct": {
      "type": [
       "string",
       "null"
      ],
      "description": "vllm: same endpoint by IP and port, HTTPS with a self-signed certificate (api_token authenticates)",
      "example": "https://1.2.3.4:41080/v1"
     },
     "api_token": {
      "type": [
       "string",
       "null"
      ],
      "description": "vllm: bearer token for api_url"
     },
     "price_per_gpu_hour": {
      "type": "string",
      "description": "USD, locked at hold (flex discount included)"
     },
     "billed_minutes": {
      "type": "integer"
     },
     "cost": {
      "type": "string",
      "description": "USD so far"
     },
     "discount": {
      "type": "integer",
      "description": "percent off the standard price already applied: 1..10 = flex (max_wait_minutes >= 360, held from the queue), else 0"
     },
     "auto_end_idle_minutes": {
      "type": [
       "integer",
       "null"
      ],
      "description": "idle auto-end threshold in minutes; null = off"
     },
     "idle_minutes": {
      "type": "integer",
      "description": "current consecutive idle minutes (all GPUs 0% and < 1 MB/min network)"
     },
     "waited": {
      "type": "boolean",
      "description": "only with ?wait=ready"
     },
     "timed_out": {
      "type": "boolean",
      "description": "only with ?wait=ready: true = not ready/final when the wait ran out; call again"
     },
     "wait_timeout_s": {
      "type": "integer",
      "description": "only with ?wait=ready: effective wait (capped at 90 through api.vaiata-inference.com)"
     }
    }
   },
   "UsageLine": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string"
     },
     "reference": {
      "type": [
       "string",
       "null"
      ]
     },
     "gpus": {
      "type": "integer"
     },
     "held_at": {
      "type": "string"
     },
     "ended_at": {
      "type": [
       "string",
       "null"
      ]
     },
     "status": {
      "type": "string"
     },
     "billed_minutes": {
      "type": "integer"
     },
     "price_per_gpu_hour": {
      "type": "string"
     },
     "cost": {
      "type": "string"
     },
     "partial": {
      "type": "boolean"
     }
    }
   },
   "Usage": {
    "type": "object",
    "properties": {
     "from": {
      "type": "string"
     },
     "to": {
      "type": "string"
     },
     "currency": {
      "type": "string"
     },
     "lines": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/UsageLine"
      }
     },
     "total": {
      "type": "string",
      "description": "USD for the period"
     }
    }
   },
   "Prices": {
    "type": "object",
    "required": [
     "updated_at",
     "status",
     "currency",
     "billing",
     "docs",
     "offers"
    ],
    "properties": {
     "updated_at": {
      "type": "string",
      "format": "date-time",
      "description": "last availability sync"
     },
     "status": {
      "type": "string",
      "enum": [
       "ok",
       "degraded"
      ],
      "description": "degraded = bookings temporarily paused on our side (sizes [], not a capacity shortage)"
     },
     "currency": {
      "type": "string",
      "enum": [
       "USD"
      ]
     },
     "billing": {
      "type": "string",
      "example": "per minute"
     },
     "docs": {
      "type": "string",
      "format": "uri"
     },
     "offers": {
      "type": "array",
      "items": {
       "type": "object",
       "required": [
        "gpu_type",
        "name",
        "arch",
        "memory_gb",
        "location",
        "price_per_gpu_hour",
        "flex_price_per_gpu_hour",
        "sizes"
       ],
       "properties": {
        "gpu_type": {
         "type": "string"
        },
        "name": {
         "type": "string"
        },
        "arch": {
         "type": "string",
         "enum": [
          "amd64",
          "arm64"
         ]
        },
        "memory_gb": {
         "type": "integer"
        },
        "location": {
         "type": "string",
         "example": "Marseille, FR"
        },
        "price_per_gpu_hour": {
         "type": "string",
         "description": "USD"
        },
        "flex_price_per_gpu_hour": {
         "type": "string",
         "description": "USD, max_wait_minutes >= 360 and held from the queue"
        },
        "sizes": {
         "type": "array",
         "items": {
          "type": "integer"
         },
         "description": "bookable right now"
        },
        "next_free": {
         "type": "object",
         "description": "Per size not bookable now (key = GPU count): when it should free up. An estimate from past rental durations, not a promise or reservation. Absent when status is degraded.",
         "additionalProperties": {
          "type": [
           "object",
           "null"
          ],
          "description": "null = no estimate",
          "properties": {
           "at": {
            "type": "string",
            "format": "date-time",
            "description": "median estimate"
           },
           "p80_at": {
            "type": [
             "string",
             "null"
            ],
            "format": "date-time",
            "description": "80% likely free by then; null = unknown"
           },
           "basis": {
            "type": "string",
            "enum": [
             "exact",
             "estimate"
            ],
            "description": "exact = only our own bookings' end times; estimate = past rental durations"
           },
           "sample": {
            "type": [
             "integer",
             "null"
            ],
            "description": "comparable past contracts behind the estimate (smallest used); null when exact"
           }
          }
         },
         "example": {
          "8": {
           "at": "2026-11-01T15:20:00Z",
           "p80_at": "2026-11-01T19:00:00Z",
           "basis": "estimate",
           "sample": 42
          }
         }
        },
        "next_free_note": {
         "type": "string",
         "example": "estimate from past rental durations; not a reservation"
        }
       }
      }
     }
    }
   },
   "SpendLimitError": {
    "allOf": [
     {
      "$ref": "#/components/schemas/Error"
     },
     {
      "type": "object",
      "properties": {
       "limit": {
        "type": "string",
        "example": "100.00"
       },
       "committed": {
        "type": "string",
        "example": "95.20"
       },
       "requested": {
        "type": "string",
        "example": "11.52"
       },
       "currency": {
        "type": "string"
       }
      }
     }
    ],
    "example": {
     "error": "spend_limit",
     "message": "monthly spend limit 100.00 USD: committed 95.20 + requested 11.52 exceeds it",
     "hint": "raise your limit with PATCH /v1/account ...",
     "limit": "100.00",
     "committed": "95.20",
     "requested": "11.52",
     "currency": "USD"
    }
   },
   "Account": {
    "type": "object",
    "properties": {
     "customer": {
      "type": "string"
     },
     "quota_gpus": {
      "type": "integer"
     },
     "active_gpus": {
      "type": "integer"
     },
     "month": {
      "type": "string",
      "example": "2026-11"
     },
     "monthly_spend_limit_usd": {
      "type": [
       "string",
       "null"
      ],
      "description": "effective limit = lower of your own limit and our cap; null = none"
     },
     "monthly_spend_cap_usd": {
      "type": [
       "string",
       "null"
      ],
      "description": "cap set by VAIATA Inference; your own limit cannot exceed it"
     },
     "spent_this_month_usd": {
      "type": "string"
     },
     "committed_usd": {
      "type": "string",
      "description": "this month's usage + maximum remaining cost of active and queued bookings"
     },
     "available_usd": {
      "type": [
       "string",
       "null"
      ]
     },
     "currency": {
      "type": "string"
     },
     "credit_usd": {
      "type": "string",
      "description": "prepaid (self-serve) accounts only: top-up credit left"
     },
     "trial_usd": {
      "type": "string",
      "description": "prepaid accounts only: trial credit left, DGX Spark only"
     },
     "credit_expiring": {
      "type": [
       "object",
       "null"
      ],
      "description": "prepaid accounts only: next credit expiry {at, usd}"
     }
    }
   },
   "Watch": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "example": "wt_..."
     },
     "gpu_type": {
      "type": "string",
      "enum": [
       "rtx-pro-6000-96gb",
       "gb10-128gb"
      ]
     },
     "gpus": {
      "type": "integer",
      "enum": [
       1,
       2,
       4,
       8
      ]
     },
     "webhook_url": {
      "type": "string",
      "format": "uri"
     },
     "status": {
      "type": "string",
      "enum": [
       "active",
       "fired",
       "expired",
       "cancelled"
      ]
     },
     "created_at": {
      "type": "string",
      "format": "date-time"
     },
     "expires_at": {
      "type": "string",
      "format": "date-time"
     },
     "fired_at": {
      "type": [
       "string",
       "null"
      ],
      "format": "date-time"
     }
    }
   }
  }
 }
}