{
  "openapi": "3.1.0",
  "info": {
    "title": "SDM-1 API",
    "version": "2.0.1",
    "description": "Proposes the next settings to evaluate, from a parameter space and the values observed so far.\n\nThe service is stateless and deterministic: every call carries the whole history, and an unchanged request returns the same proposals.\n\n**The loop.** A call carries the parameter space, every result obtained so far as `history`, and the number of\nsettings wanted as `batch`. After evaluation, the results are appended to `history` for the next call. A request\nwithout new results returns the same batch.\n\n**One objective or several.** A request takes one of two forms.\n\n- One objective: the request carries `goal`, and every history row carries `value`, a number or null. `noise` is\n  optional.\n- Two or more objectives: the request carries `objectives` in place of `goal`, and every history row carries\n  `values`, an object naming every objective, each a number or null. A single objective is sent in the first form.\n\n**Weights and trade-offs.** With two or more objectives, `mode` is `weighted` (the default) or `pareto`.\n\n- In `weighted`, every objective carries a `weight` greater than 0: the worth of one unit of that objective against\n  one unit of the others. A request without a weight on every objective is refused with 400.\n- In `pareto`, the objectives carry no weight, and the proposals follow every trade-off between them. A\n  `reference` per objective, the worst value still worth having, is optional, for every objective or for none.\n- A request that cannot state a trade-off uses `pareto`.\n\n**Failed and partial runs.** A run without any result is a failed run: `\"value\": null` with one objective;\n`\"values\": null`, or every objective null, with several. The setting counts as tried and infeasible and is excluded\nfrom later proposals. A row with some objectives null counts for the objectives it reports, and the null ones are\nunmeasured.\n\n**Retries.** 429 and 503 carry `Retry-After`; the same call succeeds after that interval. Any other 4xx requires a\ncorrected request or a new token. Clients set a timeout of 60 seconds.\n\n**Tokens.** Tokens are issued at [https://provigen.ai/sdm1](https://provigen.ai/sdm1). A trial token serves 20 calls at once; the\nlink sent by email raises the allowance to 50 calls a day and 500 in total. Each token is limited\nto 10 requests a minute.\n\nThe whole contract as one Markdown file, for agents: [https://provigen.ai/sdm1/api.md](https://provigen.ai/sdm1/api.md). The index for agents is\n[https://api.provigen.ai/llms.txt](https://api.provigen.ai/llms.txt).",
    "contact": {
      "name": "ProviGen",
      "url": "https://provigen.ai"
    }
  },
  "servers": [
    {
      "url": "https://api.provigen.ai"
    }
  ],
  "security": [
    {
      "bearer": []
    }
  ],
  "tags": [
    {
      "name": "optimisation",
      "description": "Proposal of the next settings to evaluate."
    },
    {
      "name": "account",
      "description": "Consumption and remaining allowance of a token."
    },
    {
      "name": "service",
      "description": "Service state."
    },
    {
      "name": "discovery",
      "description": "Routes served without a token."
    }
  ],
  "paths": {
    "/v1/propose": {
      "post": {
        "tags": [
          "optimisation"
        ],
        "summary": "The next settings to evaluate",
        "description": "Returns `batch` settings to evaluate next, from the parameter space and every result obtained so far. Clients set a timeout of 60 seconds.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProposeRequest"
              },
              "examples": {
                "first_call": {
                  "summary": "One outcome, a failed run in the history",
                  "value": {
                    "space": [
                      {
                        "name": "temperature",
                        "type": "continuous",
                        "low": 20,
                        "high": 80
                      },
                      {
                        "name": "catalyst",
                        "type": "categorical",
                        "choices": [
                          "A",
                          "B",
                          "C"
                        ]
                      }
                    ],
                    "history": [
                      {
                        "params": {
                          "temperature": 35,
                          "catalyst": "A"
                        },
                        "value": 0.42
                      },
                      {
                        "params": {
                          "temperature": 70,
                          "catalyst": "B"
                        },
                        "value": null
                      }
                    ],
                    "batch": 2,
                    "goal": "maximize"
                  }
                },
                "several_objectives": {
                  "summary": "Two outcomes, weighted: a full, a partial and a failed run",
                  "value": {
                    "space": [
                      {
                        "name": "temperature",
                        "type": "continuous",
                        "low": 20,
                        "high": 80
                      },
                      {
                        "name": "time_min",
                        "type": "integer",
                        "low": 5,
                        "high": 120
                      }
                    ],
                    "objectives": [
                      {
                        "name": "yield",
                        "goal": "maximize",
                        "weight": 10
                      },
                      {
                        "name": "cost",
                        "goal": "minimize",
                        "weight": 1
                      }
                    ],
                    "history": [
                      {
                        "params": {
                          "temperature": 35,
                          "time_min": 30
                        },
                        "values": {
                          "yield": 0.62,
                          "cost": 0.22
                        }
                      },
                      {
                        "params": {
                          "temperature": 50,
                          "time_min": 60
                        },
                        "values": {
                          "yield": 0.71,
                          "cost": null
                        }
                      },
                      {
                        "params": {
                          "temperature": 70,
                          "time_min": 90
                        },
                        "values": null
                      }
                    ],
                    "batch": 2
                  }
                },
                "pareto": {
                  "summary": "Two outcomes, every trade-off",
                  "value": {
                    "space": [
                      {
                        "name": "temperature",
                        "type": "continuous",
                        "low": 20,
                        "high": 80
                      },
                      {
                        "name": "pressure_bar",
                        "type": "continuous",
                        "low": 1,
                        "high": 10
                      }
                    ],
                    "objectives": [
                      {
                        "name": "yield",
                        "goal": "maximize",
                        "reference": 0
                      },
                      {
                        "name": "cost",
                        "goal": "minimize",
                        "reference": 10
                      }
                    ],
                    "mode": "pareto",
                    "history": [
                      {
                        "params": {
                          "temperature": 30,
                          "pressure_bar": 8
                        },
                        "values": {
                          "yield": 0.5,
                          "cost": 4
                        }
                      },
                      {
                        "params": {
                          "temperature": 70,
                          "pressure_bar": 2
                        },
                        "values": {
                          "yield": 0.9,
                          "cost": 7.5
                        }
                      }
                    ],
                    "batch": 2
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The proposals.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProposeAnswer"
                }
              }
            }
          },
          "400": {
            "description": "The request is outside the contract, or its predicted computation exceeds the time limit; the message names the field, or what to reduce. The same body is refused again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid_request": {
                    "value": {
                      "error": "invalid_request",
                      "message": "space must be a non-empty list of parameters",
                      "docs": "https://provigen.ai/sdm1/api.md"
                    }
                  },
                  "missing_value": {
                    "value": {
                      "error": "invalid_request",
                      "message": "history[0]: value is required: a number, or null for a failed run",
                      "docs": "https://provigen.ai/sdm1/api.md"
                    }
                  },
                  "missing_weight": {
                    "value": {
                      "error": "invalid_request",
                      "message": "objective 'cost': weight is required in mode 'weighted' (the default): a number > 0, the worth of one unit of this objective against the others. Without a stated trade-off, use mode 'pareto'.",
                      "docs": "https://provigen.ai/sdm1/api.md"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "The request carries no Authorization header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "unauthorized": {
                    "value": {
                      "error": "unauthorized",
                      "message": "Authorization header required. A token is issued at https://provigen.ai/sdm1",
                      "docs": "https://provigen.ai/sdm1/api.md"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "The token is unknown, replaced or revoked. A new token is issued by the Get access form at https://provigen.ai/sdm1.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "forbidden": {
                    "value": {
                      "error": "forbidden",
                      "message": "This token is unknown, replaced or revoked. A new token is issued at https://provigen.ai/sdm1",
                      "docs": "https://provigen.ai/sdm1/api.md"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Either the per-minute limit is reached, and the same call succeeds after the Retry-After interval, or an allowance is exhausted, shown by the absence of retry_after_s.",
            "headers": {
              "Retry-After": {
                "description": "The interval in seconds after which the same call succeeds.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "rate_limited": {
                    "value": {
                      "error": "rate_limited",
                      "message": "Too many requests with this token; at most 10 requests a minute.",
                      "retry_after_s": 60,
                      "docs": "https://provigen.ai/sdm1/api.md"
                    }
                  },
                  "trial_used_up": {
                    "value": {
                      "error": "quota_exceeded",
                      "message": "The 20 trial calls for this address are used. Opening the confirmation link raises the allowance.",
                      "docs": "https://provigen.ai/sdm1/api.md"
                    }
                  },
                  "total_used_up": {
                    "value": {
                      "error": "quota_exceeded",
                      "message": "The 500 calls in total for this token are used. Contact ProviGen for more.",
                      "docs": "https://provigen.ai/sdm1/api.md"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "The service is under load or paused. The same call succeeds after the Retry-After interval.",
            "headers": {
              "Retry-After": {
                "description": "The interval in seconds after which the same call succeeds.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "high_demand": {
                    "value": {
                      "error": "high_demand",
                      "message": "The model is busy right now. Please try again shortly.",
                      "retry_after_s": 30,
                      "docs": "https://provigen.ai/sdm1/api.md"
                    }
                  },
                  "paused": {
                    "value": {
                      "error": "paused",
                      "message": "Paused for maintenance.",
                      "retry_after_s": 60,
                      "docs": "https://provigen.ai/sdm1/api.md"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/usage": {
      "get": {
        "tags": [
          "account"
        ],
        "summary": "Token consumption and remaining allowance",
        "description": "Counts toward the per-minute limit only.",
        "responses": {
          "200": {
            "description": "The allowance of a trial or a full token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Usage"
                },
                "examples": {
                  "usage_trial": {
                    "value": {
                      "tier": "trial",
                      "trial": {
                        "used": 7,
                        "limit": 20,
                        "remaining": 13
                      },
                      "trial_pool_open_today": true,
                      "per_minute": 10
                    }
                  },
                  "usage_full": {
                    "value": {
                      "tier": "full",
                      "daily": {
                        "used": 12,
                        "limit": 50,
                        "remaining": 38,
                        "resets_at": "2026-11-19T00:00:00Z"
                      },
                      "total": {
                        "used": 120,
                        "limit": 500,
                        "remaining": 380
                      },
                      "per_minute": 10
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "The request carries no Authorization header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "unauthorized": {
                    "value": {
                      "error": "unauthorized",
                      "message": "Authorization header required. A token is issued at https://provigen.ai/sdm1",
                      "docs": "https://provigen.ai/sdm1/api.md"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "The token is unknown, replaced or revoked. A new token is issued by the Get access form at https://provigen.ai/sdm1.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "forbidden": {
                    "value": {
                      "error": "forbidden",
                      "message": "This token is unknown, replaced or revoked. A new token is issued at https://provigen.ai/sdm1",
                      "docs": "https://provigen.ai/sdm1/api.md"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "The per-minute limit is reached; the same call succeeds after the Retry-After interval.",
            "headers": {
              "Retry-After": {
                "description": "The interval in seconds after which the same call succeeds.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "rate_limited": {
                    "value": {
                      "error": "rate_limited",
                      "message": "Too many requests with this token; at most 10 requests a minute.",
                      "retry_after_s": 60,
                      "docs": "https://provigen.ai/sdm1/api.md"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/status": {
      "get": {
        "tags": [
          "service"
        ],
        "summary": "Service state: available, under load, or paused",
        "description": "Each call counts toward the per-minute limit.",
        "responses": {
          "200": {
            "description": "The state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Status"
                }
              }
            }
          },
          "401": {
            "description": "The request carries no Authorization header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "unauthorized": {
                    "value": {
                      "error": "unauthorized",
                      "message": "Authorization header required. A token is issued at https://provigen.ai/sdm1",
                      "docs": "https://provigen.ai/sdm1/api.md"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "The token is unknown, replaced or revoked. A new token is issued by the Get access form at https://provigen.ai/sdm1.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "forbidden": {
                    "value": {
                      "error": "forbidden",
                      "message": "This token is unknown, replaced or revoked. A new token is issued at https://provigen.ai/sdm1",
                      "docs": "https://provigen.ai/sdm1/api.md"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/": {
      "get": {
        "security": [],
        "tags": [
          "discovery"
        ],
        "summary": "A JSON index of the API",
        "responses": {
          "200": {
            "description": "A JSON index of the API",
            "content": {
              "application/json": {}
            }
          }
        }
      }
    },
    "/llms.txt": {
      "get": {
        "security": [],
        "tags": [
          "discovery"
        ],
        "summary": "The index for agents, with a working first call",
        "responses": {
          "200": {
            "description": "The index for agents, with a working first call",
            "content": {
              "text/plain": {}
            }
          }
        }
      }
    },
    "/openapi.json": {
      "get": {
        "security": [],
        "tags": [
          "discovery"
        ],
        "summary": "This document",
        "responses": {
          "200": {
            "description": "This document",
            "content": {
              "application/json": {}
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "A personal token of the form sdm1_..., issued at https://provigen.ai/sdm1 and held in an environment variable."
      }
    },
    "schemas": {
      "ProposeRequest": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/OneObjectiveRequest"
          },
          {
            "$ref": "#/components/schemas/ObjectivesRequest"
          }
        ],
        "description": "One of two forms: `goal` for one objective, `objectives` for two or more. Unknown fields anywhere in the body are refused with 400."
      },
      "OneObjectiveRequest": {
        "title": "One objective",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "space",
          "history",
          "batch",
          "goal"
        ],
        "description": "One measured outcome per run: `goal`, and `value` in every history row.",
        "properties": {
          "space": {
            "type": "array",
            "minItems": 1,
            "maxItems": 24,
            "items": {
              "$ref": "#/components/schemas/Parameter"
            }
          },
          "history": {
            "type": "array",
            "maxItems": 200,
            "description": "Every run so far, failed runs included. May be empty.",
            "items": {
              "$ref": "#/components/schemas/HistoryRow"
            }
          },
          "batch": {
            "type": "integer",
            "minimum": 1,
            "maximum": 8,
            "description": "The number of settings to propose: 1 to 8."
          },
          "goal": {
            "enum": [
              "maximize",
              "minimize"
            ],
            "description": "Whether a larger or a smaller `value` is better."
          },
          "method": {
            "type": "string",
            "default": "sdm-1",
            "description": "Left unset; the default is 'sdm-1'."
          },
          "noise": {
            "type": "number",
            "minimum": 0,
            "description": "How much repeated measurements of the same setting vary, as a standard deviation in the units of `value`; finite and at least 0, with 0 for exact."
          }
        }
      },
      "ObjectivesRequest": {
        "title": "Two or more objectives",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "space",
          "history",
          "batch",
          "objectives"
        ],
        "description": "Several measured outcomes per run: `objectives`, and `values` in every history row. In mode `weighted` (the default) every objective carries a `weight`; in mode `pareto` none does.",
        "properties": {
          "space": {
            "type": "array",
            "minItems": 1,
            "maxItems": 24,
            "items": {
              "$ref": "#/components/schemas/Parameter"
            }
          },
          "history": {
            "type": "array",
            "maxItems": 200,
            "description": "Every run so far, failed runs included. May be empty.",
            "items": {
              "$ref": "#/components/schemas/ObjectivesHistoryRow"
            }
          },
          "batch": {
            "type": "integer",
            "minimum": 1,
            "maximum": 8,
            "description": "The number of settings to propose: 1 to 8."
          },
          "objectives": {
            "type": "array",
            "minItems": 2,
            "maxItems": 24,
            "items": {
              "$ref": "#/components/schemas/Objective"
            },
            "description": "Two or more objectives; one objective is sent as `goal`."
          },
          "method": {
            "type": "string",
            "default": "sdm-1",
            "description": "Left unset; the default is 'sdm-1'."
          },
          "mode": {
            "enum": [
              "weighted",
              "pareto"
            ],
            "default": "weighted",
            "description": "'weighted' uses the weight of every objective; 'pareto' proposes along every trade-off between the objectives, which then carry no weight."
          }
        },
        "allOf": [
          {
            "if": {
              "properties": {
                "mode": {
                  "const": "pareto"
                }
              },
              "required": [
                "mode"
              ]
            },
            "then": {
              "properties": {
                "objectives": {
                  "items": {
                    "not": {
                      "required": [
                        "weight"
                      ]
                    }
                  },
                  "anyOf": [
                    {
                      "items": {
                        "required": [
                          "reference"
                        ]
                      }
                    },
                    {
                      "items": {
                        "not": {
                          "required": [
                            "reference"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            },
            "else": {
              "properties": {
                "objectives": {
                  "items": {
                    "required": [
                      "weight"
                    ],
                    "not": {
                      "required": [
                        "reference"
                      ]
                    }
                  }
                }
              }
            }
          }
        ]
      },
      "Parameter": {
        "oneOf": [
          {
            "title": "continuous",
            "type": "object",
            "additionalProperties": false,
            "required": [
              "type",
              "low",
              "high"
            ],
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1
              },
              "type": {
                "const": "continuous"
              },
              "low": {
                "type": "number"
              },
              "high": {
                "type": "number"
              },
              "log": {
                "type": "boolean",
                "description": "a log scale; requires low > 0"
              }
            }
          },
          {
            "title": "integer",
            "type": "object",
            "additionalProperties": false,
            "required": [
              "type",
              "low",
              "high"
            ],
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1
              },
              "type": {
                "const": "integer"
              },
              "low": {
                "type": "integer"
              },
              "high": {
                "type": "integer"
              }
            }
          },
          {
            "title": "categorical",
            "type": "object",
            "additionalProperties": false,
            "required": [
              "type",
              "choices"
            ],
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1
              },
              "type": {
                "const": "categorical"
              },
              "choices": {
                "type": "array",
                "minItems": 1,
                "uniqueItems": true,
                "items": {
                  "type": "string"
                }
              }
            }
          }
        ],
        "description": "Unnamed parameters are x1, x2, ... by position; names must be unique. low < high."
      },
      "HistoryRow": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "params",
          "value"
        ],
        "description": "A run with one objective.",
        "properties": {
          "params": {
            "type": "object",
            "description": "Exactly every parameter of the space, inside its range.",
            "additionalProperties": {
              "type": [
                "number",
                "string"
              ]
            }
          },
          "value": {
            "type": [
              "number",
              "null"
            ],
            "description": "The result, or null for a failed run."
          }
        }
      },
      "ObjectivesHistoryRow": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "params",
          "values"
        ],
        "description": "A run with two or more objectives.",
        "properties": {
          "params": {
            "type": "object",
            "description": "Exactly every parameter of the space, inside its range.",
            "additionalProperties": {
              "type": [
                "number",
                "string"
              ]
            }
          },
          "values": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": {
              "type": [
                "number",
                "null"
              ]
            },
            "description": "An object naming every objective, each a number or null; a name left out or not among the objectives is refused with 400. With every objective null, or with `values` null, the run is a failed run. With some objectives null, the row counts for the objectives it reports, and the null ones are unmeasured."
          }
        }
      },
      "Objective": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "goal"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "description": "Unnamed objectives are y1, y2, ... by position; names must be unique."
          },
          "goal": {
            "enum": [
              "maximize",
              "minimize"
            ]
          },
          "weight": {
            "type": "number",
            "exclusiveMinimum": 0,
            "description": "Required in mode 'weighted', refused in mode 'pareto': the worth of one unit of this objective against one unit of the others, greater than 0. A request that cannot state this trade-off uses mode 'pareto'."
          },
          "reference": {
            "type": "number",
            "description": "Mode 'pareto' only: the worst value still worth having; for every objective or for none."
          }
        }
      },
      "ProposeAnswer": {
        "type": "object",
        "required": [
          "proposals",
          "model",
          "version"
        ],
        "properties": {
          "proposals": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "params"
              ],
              "properties": {
                "params": {
                  "type": "object"
                }
              }
            }
          },
          "model": {
            "type": "string",
            "description": "the model that answered"
          },
          "version": {
            "type": "string",
            "pattern": "^[a-z0-9-]+-[0-9a-f]{12}$",
            "examples": [
              "sdm-1-3f9a0c2b7d41"
            ],
            "description": "an opaque identifier of the served model and a hash; it changes whenever the model changes"
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "error",
          "message"
        ],
        "properties": {
          "error": {
            "enum": [
              "invalid_request",
              "unauthorized",
              "forbidden",
              "not_found",
              "rate_limited",
              "quota_exceeded",
              "high_demand",
              "paused"
            ]
          },
          "message": {
            "type": "string"
          },
          "retry_after_s": {
            "type": "number",
            "description": "present when the same call succeeds after an interval; equal to Retry-After"
          },
          "docs": {
            "type": "string",
            "format": "uri",
            "const": "https://provigen.ai/sdm1/api.md"
          }
        }
      },
      "Usage": {
        "oneOf": [
          {
            "title": "trial",
            "type": "object",
            "required": [
              "tier",
              "trial",
              "trial_pool_open_today",
              "per_minute"
            ],
            "properties": {
              "tier": {
                "const": "trial"
              },
              "trial": {
                "type": "object",
                "required": [
                  "used",
                  "limit",
                  "remaining"
                ],
                "properties": {
                  "used": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "remaining": {
                    "type": "integer",
                    "minimum": 0
                  }
                }
              },
              "per_minute": {
                "type": "integer"
              },
              "trial_pool_open_today": {
                "type": "boolean",
                "description": "whether the daily allowance shared by all trial tokens has calls left"
              }
            }
          },
          {
            "title": "full",
            "type": "object",
            "required": [
              "tier",
              "daily",
              "total",
              "per_minute"
            ],
            "properties": {
              "tier": {
                "const": "full"
              },
              "per_minute": {
                "type": "integer"
              },
              "total": {
                "type": "object",
                "required": [
                  "used",
                  "limit",
                  "remaining"
                ],
                "properties": {
                  "used": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "remaining": {
                    "type": "integer",
                    "minimum": 0
                  }
                }
              },
              "daily": {
                "type": "object",
                "required": [
                  "used",
                  "limit",
                  "remaining",
                  "resets_at"
                ],
                "properties": {
                  "used": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "remaining": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "resets_at": {
                    "type": "string",
                    "format": "date-time"
                  }
                }
              }
            }
          }
        ]
      },
      "Status": {
        "type": "object",
        "required": [
          "state"
        ],
        "properties": {
          "state": {
            "enum": [
              "ok",
              "busy",
              "paused"
            ]
          },
          "message": {
            "type": "string"
          },
          "retry_after_s": {
            "type": "number"
          }
        }
      }
    }
  }
}
