# API reference

Every gateway endpoint, parameter, schema, and response from the OpenAPI contract.

This reference is generated from the local OpenAPI contract. Expand fields and response codes to inspect their schemas. Generated schema illustrations contain placeholder values; replace them with your own inputs.

Download the [OpenAPI document](/openapi.json) to use the same contract in your tools.

## POST /v1/decide

Choose one offered option

Complete formatted model input is limited to 2048 tokens; inference checks its exact tokenizer before encoding and never truncates (413). Body limit is 4 MB compressed and decompressed (413). JSON nesting is limited to 64 (400). Supports gzip, x-gzip and zstd, one layer only. Choice takes 2 to 255 options and score 2 to 10 levels (422 outside). Probabilities cover offered options only. probability is the chosen option's probability. The routing gate acts when probability >= threshold (default 0.9), otherwise asks a human. This configurable routing rule is not a certified precision guarantee. One question per request: send situation (text) or state (JSON), a question, a type and its options or levels. Unknown fields are rejected at every level. Requests that can never succeed are rejected before rate limiting and never get 429. Every response carries X-Request-Id; error bodies are {code, message} and never repeat request content.

```json
{
  "operationId": "decide",
  "summary": "Choose one offered option",
  "description": "Complete formatted model input is limited to 2048 tokens; inference checks its exact tokenizer before encoding and never truncates (413). Body limit is 4 MB compressed and decompressed (413). JSON nesting is limited to 64 (400). Supports gzip, x-gzip and zstd, one layer only. Choice takes 2 to 255 options and score 2 to 10 levels (422 outside). Probabilities cover offered options only. probability is the chosen option's probability. The routing gate acts when probability >= threshold (default 0.9), otherwise asks a human. This configurable routing rule is not a certified precision guarantee. One question per request: send situation (text) or state (JSON), a question, a type and its options or levels. Unknown fields are rejected at every level. Requests that can never succeed are rejected before rate limiting and never get 429. Every response carries X-Request-Id; error bodies are {code, message} and never repeat request content.",
  "security": [
    {
      "ApiKey": []
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/DecideRequest"
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "Decision with typed fields, routing gate and exact input-token usage",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/DecideResponse"
          }
        }
      },
      "headers": {
        "X-Request-Id": {
          "$ref": "#/components/headers/RequestId"
        },
        "X-RateLimit-Limit": {
          "$ref": "#/components/headers/RateLimitLimit"
        },
        "X-RateLimit-Remaining": {
          "$ref": "#/components/headers/RateLimitRemaining"
        },
        "X-RateLimit-Reset": {
          "$ref": "#/components/headers/RateLimitReset"
        }
      }
    },
    "400": {
      "description": "Malformed JSON or compression, or JSON nested deeper than 64 levels; unknown model IDs return unknown_model and name ren-1.1.0, ren-latest, ren-preview",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "headers": {
        "X-Request-Id": {
          "$ref": "#/components/headers/RequestId"
        }
      }
    },
    "401": {
      "description": "Invalid authentication",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "headers": {
        "X-Request-Id": {
          "$ref": "#/components/headers/RequestId"
        }
      }
    },
    "402": {
      "description": "Insufficient organization credits when BILLING_ENFORCED is enabled. Charging is off by default.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "headers": {
        "X-Request-Id": {
          "$ref": "#/components/headers/RequestId"
        }
      }
    },
    "413": {
      "description": "Body over 4 MB or input over 2048 tokens; never truncated",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "headers": {
        "X-Request-Id": {
          "$ref": "#/components/headers/RequestId"
        }
      }
    },
    "415": {
      "description": "Unsupported content type or content encoding",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "headers": {
        "X-Request-Id": {
          "$ref": "#/components/headers/RequestId"
        }
      }
    },
    "422": {
      "description": "Request does not match the schema: unknown field, option or level count, or blank text",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "headers": {
        "X-Request-Id": {
          "$ref": "#/components/headers/RequestId"
        }
      }
    },
    "429": {
      "description": "Rate limited; wait Retry-After seconds (retry-after-ms milliseconds). Only for requests that can succeed later",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "headers": {
        "X-Request-Id": {
          "$ref": "#/components/headers/RequestId"
        },
        "X-RateLimit-Limit": {
          "$ref": "#/components/headers/RateLimitLimit"
        },
        "X-RateLimit-Remaining": {
          "$ref": "#/components/headers/RateLimitRemaining"
        },
        "X-RateLimit-Reset": {
          "$ref": "#/components/headers/RateLimitReset"
        },
        "Retry-After": {
          "$ref": "#/components/headers/RetryAfter"
        },
        "retry-after-ms": {
          "$ref": "#/components/headers/RetryAfterMs"
        }
      }
    },
    "502": {
      "description": "Invalid inference response",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "headers": {
        "X-Request-Id": {
          "$ref": "#/components/headers/RequestId"
        }
      }
    },
    "503": {
      "description": "Service unavailable",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "headers": {
        "X-Request-Id": {
          "$ref": "#/components/headers/RequestId"
        }
      }
    },
    "504": {
      "description": "Inference timeout",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "headers": {
        "X-Request-Id": {
          "$ref": "#/components/headers/RequestId"
        }
      }
    },
    "529": {
      "description": "Inference is overloaded; retry with backoff",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "headers": {
        "X-Request-Id": {
          "$ref": "#/components/headers/RequestId"
        }
      }
    }
  }
}
```

## GET /v1/models





```json
{
  "operationId": "models",
  "responses": {
    "200": {
      "description": "Pinned model, aliases and configured limits",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "required": [
              "data"
            ],
            "properties": {
              "data": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "id",
                    "aliases",
                    "max_options",
                    "max_input_tokens",
                    "price_per_million_input_tokens_usd",
                    "release_date"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "pattern": "^ren-(?:\\d+\\.\\d+\\.\\d+|latest|preview)$"
                    },
                    "aliases": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "max_options": {
                      "type": "integer",
                      "const": 255
                    },
                    "max_input_tokens": {
                      "type": "integer",
                      "const": 2048
                    },
                    "price_per_million_input_tokens_usd": {
                      "type": "number",
                      "minimum": 0
                    },
                    "release_date": {
                      "type": "string",
                      "format": "date",
                      "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                      "description": "Release date of the resolved model (YYYY-MM-DD).",
                      "example": "2026-11-13"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "headers": {
        "X-Request-Id": {
          "$ref": "#/components/headers/RequestId"
        }
      }
    },
    "401": {
      "description": "Invalid authentication",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "headers": {
        "X-Request-Id": {
          "$ref": "#/components/headers/RequestId"
        }
      }
    }
  },
  "security": [
    {
      "ApiKey": []
    }
  ]
}
```

## GET /admin/keys





```json
{
  "operationId": "listKeys",
  "security": [
    {
      "Session": []
    }
  ],
  "responses": {
    "200": {
      "description": "Keys without plaintext",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "required": [
              "keys"
            ],
            "properties": {
              "keys": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ApiKey"
                }
              }
            }
          }
        }
      },
      "headers": {
        "X-Request-Id": {
          "$ref": "#/components/headers/RequestId"
        }
      }
    },
    "400": {
      "description": "Malformed JSON or compression, or JSON nested deeper than 64 levels",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "headers": {
        "X-Request-Id": {
          "$ref": "#/components/headers/RequestId"
        }
      }
    },
    "401": {
      "description": "Invalid authentication",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "headers": {
        "X-Request-Id": {
          "$ref": "#/components/headers/RequestId"
        }
      }
    },
    "403": {
      "description": "Signed in without private beta access",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "headers": {
        "X-Request-Id": {
          "$ref": "#/components/headers/RequestId"
        }
      }
    },
    "413": {
      "description": "Body over 4 MB or input over 2048 tokens; never truncated",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "headers": {
        "X-Request-Id": {
          "$ref": "#/components/headers/RequestId"
        }
      }
    },
    "422": {
      "description": "Request does not match the schema: unknown field, option or level count, or blank text",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "headers": {
        "X-Request-Id": {
          "$ref": "#/components/headers/RequestId"
        }
      }
    },
    "429": {
      "description": "Rate limited; wait Retry-After seconds (retry-after-ms milliseconds). Only for requests that can succeed later",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "headers": {
        "X-Request-Id": {
          "$ref": "#/components/headers/RequestId"
        },
        "Retry-After": {
          "$ref": "#/components/headers/RetryAfter"
        },
        "retry-after-ms": {
          "$ref": "#/components/headers/RetryAfterMs"
        }
      }
    },
    "502": {
      "description": "Invalid inference response",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "headers": {
        "X-Request-Id": {
          "$ref": "#/components/headers/RequestId"
        }
      }
    },
    "503": {
      "description": "Service unavailable",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "headers": {
        "X-Request-Id": {
          "$ref": "#/components/headers/RequestId"
        }
      }
    },
    "504": {
      "description": "Inference timeout",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "headers": {
        "X-Request-Id": {
          "$ref": "#/components/headers/RequestId"
        }
      }
    }
  }
}
```

## POST /admin/keys





```json
{
  "operationId": "createKey",
  "security": [
    {
      "Session": []
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/CreateKeyRequest"
        }
      }
    }
  },
  "responses": {
    "201": {
      "description": "Plaintext key returned once",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/CreatedKey"
          }
        }
      },
      "headers": {
        "X-Request-Id": {
          "$ref": "#/components/headers/RequestId"
        }
      }
    },
    "400": {
      "description": "Malformed JSON or compression, or JSON nested deeper than 64 levels",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "headers": {
        "X-Request-Id": {
          "$ref": "#/components/headers/RequestId"
        }
      }
    },
    "401": {
      "description": "Invalid authentication",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "headers": {
        "X-Request-Id": {
          "$ref": "#/components/headers/RequestId"
        }
      }
    },
    "403": {
      "description": "Signed in without private beta access",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "headers": {
        "X-Request-Id": {
          "$ref": "#/components/headers/RequestId"
        }
      }
    },
    "413": {
      "description": "Body over 4 MB or input over 2048 tokens; never truncated",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "headers": {
        "X-Request-Id": {
          "$ref": "#/components/headers/RequestId"
        }
      }
    },
    "422": {
      "description": "Request does not match the schema: unknown field, option or level count, or blank text",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "headers": {
        "X-Request-Id": {
          "$ref": "#/components/headers/RequestId"
        }
      }
    },
    "429": {
      "description": "Rate limited; wait Retry-After seconds (retry-after-ms milliseconds). Only for requests that can succeed later",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "headers": {
        "X-Request-Id": {
          "$ref": "#/components/headers/RequestId"
        },
        "Retry-After": {
          "$ref": "#/components/headers/RetryAfter"
        },
        "retry-after-ms": {
          "$ref": "#/components/headers/RetryAfterMs"
        }
      }
    },
    "502": {
      "description": "Invalid inference response",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "headers": {
        "X-Request-Id": {
          "$ref": "#/components/headers/RequestId"
        }
      }
    },
    "503": {
      "description": "Service unavailable",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "headers": {
        "X-Request-Id": {
          "$ref": "#/components/headers/RequestId"
        }
      }
    },
    "504": {
      "description": "Inference timeout",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "headers": {
        "X-Request-Id": {
          "$ref": "#/components/headers/RequestId"
        }
      }
    }
  }
}
```

## DELETE /admin/keys/{id}





```json
{
  "operationId": "revokeKey",
  "security": [
    {
      "Session": []
    }
  ],
  "parameters": [
    {
      "in": "path",
      "name": "id",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "204": {
      "description": "Revoked",
      "headers": {
        "X-Request-Id": {
          "$ref": "#/components/headers/RequestId"
        }
      }
    },
    "400": {
      "description": "Malformed JSON or compression, or JSON nested deeper than 64 levels",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "headers": {
        "X-Request-Id": {
          "$ref": "#/components/headers/RequestId"
        }
      }
    },
    "401": {
      "description": "Invalid authentication",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "headers": {
        "X-Request-Id": {
          "$ref": "#/components/headers/RequestId"
        }
      }
    },
    "403": {
      "description": "Signed in without private beta access",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "headers": {
        "X-Request-Id": {
          "$ref": "#/components/headers/RequestId"
        }
      }
    },
    "404": {
      "description": "Unknown key",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "headers": {
        "X-Request-Id": {
          "$ref": "#/components/headers/RequestId"
        }
      }
    },
    "413": {
      "description": "Body over 4 MB or input over 2048 tokens; never truncated",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "headers": {
        "X-Request-Id": {
          "$ref": "#/components/headers/RequestId"
        }
      }
    },
    "422": {
      "description": "Request does not match the schema: unknown field, option or level count, or blank text",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "headers": {
        "X-Request-Id": {
          "$ref": "#/components/headers/RequestId"
        }
      }
    },
    "429": {
      "description": "Rate limited; wait Retry-After seconds (retry-after-ms milliseconds). Only for requests that can succeed later",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "headers": {
        "X-Request-Id": {
          "$ref": "#/components/headers/RequestId"
        },
        "Retry-After": {
          "$ref": "#/components/headers/RetryAfter"
        },
        "retry-after-ms": {
          "$ref": "#/components/headers/RetryAfterMs"
        }
      }
    },
    "502": {
      "description": "Invalid inference response",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "headers": {
        "X-Request-Id": {
          "$ref": "#/components/headers/RequestId"
        }
      }
    },
    "503": {
      "description": "Service unavailable",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "headers": {
        "X-Request-Id": {
          "$ref": "#/components/headers/RequestId"
        }
      }
    },
    "504": {
      "description": "Inference timeout",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "headers": {
        "X-Request-Id": {
          "$ref": "#/components/headers/RequestId"
        }
      }
    }
  }
}
```

## GET /admin/usage





```json
{
  "operationId": "usage",
  "security": [
    {
      "Session": []
    }
  ],
  "parameters": [
    {
      "in": "query",
      "name": "limit",
      "schema": {
        "type": "integer",
        "minimum": 1,
        "maximum": 100,
        "default": 50
      }
    }
  ],
  "responses": {
    "200": {
      "description": "Recent account-scoped request metadata",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/AccountUsage"
          }
        }
      },
      "headers": {
        "X-Request-Id": {
          "$ref": "#/components/headers/RequestId"
        }
      }
    },
    "400": {
      "description": "Malformed JSON or compression, or JSON nested deeper than 64 levels",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "headers": {
        "X-Request-Id": {
          "$ref": "#/components/headers/RequestId"
        }
      }
    },
    "401": {
      "description": "Invalid authentication",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "headers": {
        "X-Request-Id": {
          "$ref": "#/components/headers/RequestId"
        }
      }
    },
    "403": {
      "description": "Signed in without private beta access",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "headers": {
        "X-Request-Id": {
          "$ref": "#/components/headers/RequestId"
        }
      }
    },
    "413": {
      "description": "Body over 4 MB or input over 2048 tokens; never truncated",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "headers": {
        "X-Request-Id": {
          "$ref": "#/components/headers/RequestId"
        }
      }
    },
    "422": {
      "description": "Request does not match the schema: unknown field, option or level count, or blank text",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "headers": {
        "X-Request-Id": {
          "$ref": "#/components/headers/RequestId"
        }
      }
    },
    "429": {
      "description": "Rate limited; wait Retry-After seconds (retry-after-ms milliseconds). Only for requests that can succeed later",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "headers": {
        "X-Request-Id": {
          "$ref": "#/components/headers/RequestId"
        },
        "Retry-After": {
          "$ref": "#/components/headers/RetryAfter"
        },
        "retry-after-ms": {
          "$ref": "#/components/headers/RetryAfterMs"
        }
      }
    },
    "502": {
      "description": "Invalid inference response",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "headers": {
        "X-Request-Id": {
          "$ref": "#/components/headers/RequestId"
        }
      }
    },
    "503": {
      "description": "Service unavailable",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "headers": {
        "X-Request-Id": {
          "$ref": "#/components/headers/RequestId"
        }
      }
    },
    "504": {
      "description": "Inference timeout",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "headers": {
        "X-Request-Id": {
          "$ref": "#/components/headers/RequestId"
        }
      }
    }
  }
}
```

## GET /openapi.json





```json
{
  "operationId": "openapi",
  "responses": {
    "200": {
      "description": "OpenAPI 3.1 contract",
      "content": {
        "application/json": {
          "schema": {
            "type": "object"
          }
        }
      },
      "headers": {
        "X-Request-Id": {
          "$ref": "#/components/headers/RequestId"
        }
      }
    }
  }
}
```

## Referenced components

```json
{
  "securitySchemes": {
    "ApiKey": {
      "type": "http",
      "scheme": "bearer"
    },
    "Session": {
      "type": "http",
      "scheme": "bearer",
      "description": "Console session token (Better Auth) for an invited account with beta access."
    }
  },
  "schemas": {
    "Option": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "description": {
          "type": "string"
        }
      }
    },
    "ChoiceRequest": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "model",
        "question",
        "type",
        "options"
      ],
      "properties": {
        "model": {
          "type": "string",
          "pattern": "^ren-(?:\\d+\\.\\d+\\.\\d+|latest|preview)$"
        },
        "situation": {
          "type": "string",
          "minLength": 1,
          "description": "Plain-text situation. Send exactly one of situation or state."
        },
        "state": {
          "description": "Structured situation as any non-null JSON value; a string must be nonblank. Send exactly one of situation or state.",
          "not": {
            "type": "null"
          }
        },
        "question": {
          "type": "string",
          "minLength": 1,
          "description": "The single question the model answers about the situation."
        },
        "type": {
          "const": "choice",
          "type": "string"
        },
        "options": {
          "type": "array",
          "minItems": 2,
          "maxItems": 255,
          "items": {
            "$ref": "#/components/schemas/Option"
          }
        },
        "threshold": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "description": "Routing threshold; defaults to 0.9 unless configured by the operator."
        }
      },
      "oneOf": [
        {
          "required": [
            "situation"
          ]
        },
        {
          "required": [
            "state"
          ]
        }
      ]
    },
    "ScoreRequest": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "model",
        "question",
        "type",
        "levels"
      ],
      "properties": {
        "model": {
          "type": "string",
          "pattern": "^ren-(?:\\d+\\.\\d+\\.\\d+|latest|preview)$"
        },
        "situation": {
          "type": "string",
          "minLength": 1,
          "description": "Plain-text situation. Send exactly one of situation or state."
        },
        "state": {
          "description": "Structured situation as any non-null JSON value; a string must be nonblank. Send exactly one of situation or state.",
          "not": {
            "type": "null"
          }
        },
        "question": {
          "type": "string",
          "minLength": 1,
          "description": "The single question the model answers about the situation."
        },
        "type": {
          "const": "score",
          "type": "string"
        },
        "levels": {
          "type": "array",
          "minItems": 2,
          "maxItems": 10,
          "items": {
            "$ref": "#/components/schemas/Option"
          }
        },
        "threshold": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "description": "Routing threshold; defaults to 0.9 unless configured by the operator."
        }
      },
      "description": "Levels have unique numeric string IDs from 1 through 10, ordered strictly increasingly. At least two levels are required by the engine.",
      "oneOf": [
        {
          "required": [
            "situation"
          ]
        },
        {
          "required": [
            "state"
          ]
        }
      ]
    },
    "DecideRequest": {
      "oneOf": [
        {
          "$ref": "#/components/schemas/ChoiceRequest"
        },
        {
          "$ref": "#/components/schemas/ScoreRequest"
        },
        {
          "$ref": "#/components/schemas/NoulRequest"
        }
      ]
    },
    "DecideResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "model",
        "choice",
        "probability",
        "probabilities",
        "action",
        "gate",
        "type",
        "threshold",
        "usage"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "model": {
          "type": "string",
          "pattern": "^ren-\\d+\\.\\d+\\.\\d+$"
        },
        "choice": {
          "type": "string"
        },
        "probabilities": {
          "type": "object",
          "minProperties": 2,
          "maxProperties": 255,
          "additionalProperties": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          }
        },
        "action": {
          "type": "string",
          "enum": [
            "act",
            "ask_human"
          ]
        },
        "gate": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "threshold"
          ],
          "properties": {
            "threshold": {
              "type": "number",
              "minimum": 0,
              "maximum": 1
            }
          }
        },
        "type": {
          "type": "string",
          "enum": [
            "choice",
            "score",
            "noul"
          ]
        },
        "threshold": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        },
        "expected_score": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "probability": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "description": "Calibrated probability of the chosen option. The gate acts when probability >= threshold. For noul, the probability of true is probabilities.true."
        },
        "usage": {
          "$ref": "#/components/schemas/Usage"
        }
      }
    },
    "Error": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "code",
        "message"
      ],
      "properties": {
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        }
      }
    },
    "ApiKey": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "name",
        "prefix",
        "created_at",
        "revoked_at"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 80
        },
        "prefix": {
          "type": "string"
        },
        "created_at": {
          "type": "string"
        },
        "revoked_at": {
          "type": [
            "string",
            "null"
          ]
        },
        "creator_id": {
          "type": [
            "string",
            "null"
          ],
          "description": "Original key creator. Organization access survives removal of this member."
        },
        "creator_name": {
          "type": [
            "string",
            "null"
          ],
          "description": "Creator display name when available."
        }
      }
    },
    "CreatedKey": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "name",
        "prefix",
        "created_at",
        "revoked_at",
        "key"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 80
        },
        "prefix": {
          "type": "string"
        },
        "created_at": {
          "type": "string"
        },
        "revoked_at": {
          "type": [
            "string",
            "null"
          ]
        },
        "key": {
          "type": "string"
        },
        "creator_id": {
          "type": [
            "string",
            "null"
          ],
          "description": "Original key creator. Organization access survives removal of this member."
        },
        "creator_name": {
          "type": [
            "string",
            "null"
          ],
          "description": "Creator display name when available."
        }
      }
    },
    "CreateKeyRequest": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "name"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 80
        }
      }
    },
    "UsageRow": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "key_id",
        "model",
        "status",
        "input_tokens",
        "latency_ms",
        "created_at",
        "output_tokens",
        "estimated_cost_usd"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "key_id": {
          "type": "string"
        },
        "model": {
          "type": "string"
        },
        "status": {
          "type": "integer"
        },
        "input_tokens": {
          "type": "integer",
          "minimum": 0
        },
        "latency_ms": {
          "type": "integer",
          "minimum": 0
        },
        "created_at": {
          "type": "string"
        },
        "output_tokens": {
          "type": "integer",
          "const": 0
        },
        "estimated_cost_usd": {
          "type": "number",
          "minimum": 0
        }
      }
    },
    "NoulRequest": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "model",
        "question",
        "type"
      ],
      "properties": {
        "model": {
          "type": "string",
          "pattern": "^ren-(?:\\d+\\.\\d+\\.\\d+|latest|preview)$"
        },
        "situation": {
          "type": "string",
          "minLength": 1,
          "description": "Plain-text situation. Send exactly one of situation or state."
        },
        "state": {
          "description": "Structured situation as any non-null JSON value; a string must be nonblank. Send exactly one of situation or state.",
          "not": {
            "type": "null"
          }
        },
        "question": {
          "type": "string",
          "minLength": 1,
          "description": "The single question the model answers about the situation."
        },
        "type": {
          "const": "noul",
          "type": "string"
        },
        "threshold": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "description": "Routing threshold; defaults to 0.9 unless configured by the operator."
        }
      },
      "oneOf": [
        {
          "required": [
            "situation"
          ]
        },
        {
          "required": [
            "state"
          ]
        }
      ]
    },
    "Usage": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "input_tokens",
        "output_tokens",
        "model"
      ],
      "properties": {
        "input_tokens": {
          "type": "integer",
          "minimum": 1,
          "maximum": 2048
        },
        "output_tokens": {
          "type": "integer",
          "const": 0
        },
        "model": {
          "type": "string",
          "pattern": "^ren-\\d+\\.\\d+\\.\\d+$"
        }
      }
    },
    "UsageSummary": {
      "type": "object",
      "required": [
        "requests",
        "input_tokens",
        "estimated_cost_usd"
      ],
      "properties": {
        "requests": {
          "type": "integer",
          "minimum": 0
        },
        "input_tokens": {
          "type": "integer",
          "minimum": 0
        },
        "estimated_cost_usd": {
          "type": "number",
          "minimum": 0
        }
      }
    },
    "AccountUsage": {
      "type": "object",
      "required": [
        "usage",
        "summary",
        "by_key",
        "by_model",
        "daily",
        "limits",
        "price_per_million_input_tokens_usd"
      ],
      "properties": {
        "usage": {
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/UsageRow"
          }
        },
        "summary": {
          "$ref": "#/components/schemas/UsageSummary"
        },
        "by_key": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "requests",
              "input_tokens",
              "estimated_cost_usd",
              "key_id"
            ],
            "properties": {
              "requests": {
                "type": "integer",
                "minimum": 0
              },
              "input_tokens": {
                "type": "integer",
                "minimum": 0
              },
              "estimated_cost_usd": {
                "type": "number",
                "minimum": 0
              },
              "key_id": {
                "type": "string"
              }
            }
          }
        },
        "by_model": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "requests",
              "input_tokens",
              "estimated_cost_usd",
              "model"
            ],
            "properties": {
              "requests": {
                "type": "integer",
                "minimum": 0
              },
              "input_tokens": {
                "type": "integer",
                "minimum": 0
              },
              "estimated_cost_usd": {
                "type": "number",
                "minimum": 0
              },
              "model": {
                "type": "string"
              }
            }
          }
        },
        "daily": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "requests",
              "input_tokens",
              "estimated_cost_usd",
              "day"
            ],
            "properties": {
              "requests": {
                "type": "integer",
                "minimum": 0
              },
              "input_tokens": {
                "type": "integer",
                "minimum": 0
              },
              "estimated_cost_usd": {
                "type": "number",
                "minimum": 0
              },
              "day": {
                "type": "string"
              }
            }
          }
        },
        "limits": {
          "type": "object",
          "required": [
            "per_key_requests_per_minute",
            "per_account_requests_per_minute"
          ],
          "properties": {
            "per_key_requests_per_minute": {
              "type": "integer"
            },
            "per_account_requests_per_minute": {
              "type": "integer"
            }
          }
        },
        "price_per_million_input_tokens_usd": {
          "type": "number",
          "minimum": 0
        }
      }
    },
    "ChoiceQuestion": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "question",
        "type",
        "options"
      ],
      "properties": {
        "question": {
          "type": "string",
          "minLength": 1,
          "description": "The single question the model answers about the situation."
        },
        "type": {
          "const": "choice",
          "type": "string"
        },
        "options": {
          "type": "array",
          "minItems": 2,
          "maxItems": 255,
          "items": {
            "$ref": "#/components/schemas/Option"
          }
        },
        "threshold": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "description": "Routing threshold; defaults to 0.9 unless configured by the operator."
        }
      }
    },
    "ScoreQuestion": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "question",
        "type",
        "levels"
      ],
      "properties": {
        "question": {
          "type": "string",
          "minLength": 1,
          "description": "The single question the model answers about the situation."
        },
        "type": {
          "const": "score",
          "type": "string"
        },
        "levels": {
          "type": "array",
          "minItems": 2,
          "maxItems": 10,
          "items": {
            "$ref": "#/components/schemas/Option"
          }
        },
        "threshold": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "description": "Routing threshold; defaults to 0.9 unless configured by the operator."
        }
      }
    },
    "NoulQuestion": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "question",
        "type"
      ],
      "properties": {
        "question": {
          "type": "string",
          "minLength": 1,
          "description": "The single question the model answers about the situation."
        },
        "type": {
          "const": "noul",
          "type": "string"
        },
        "threshold": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "description": "Routing threshold; defaults to 0.9 unless configured by the operator."
        }
      }
    },
    "Question": {
      "oneOf": [
        {
          "$ref": "#/components/schemas/ChoiceQuestion"
        },
        {
          "$ref": "#/components/schemas/ScoreQuestion"
        },
        {
          "$ref": "#/components/schemas/NoulQuestion"
        }
      ]
    },
    "MultiDecideRequest": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "model",
        "questions"
      ],
      "description": "Design only: not served. Behind the gateway flag MULTI_QUESTION_ENABLED (off); while off, a questions field is an unknown field (422). One situation or state shared by up to 64 named questions. The state is encoded and billed once; each question adds only its own text and options.",
      "properties": {
        "model": {
          "type": "string",
          "pattern": "^ren-(?:\\d+\\.\\d+\\.\\d+|latest|preview)$"
        },
        "situation": {
          "type": "string",
          "minLength": 1,
          "description": "Plain-text situation. Send exactly one of situation or state."
        },
        "state": {
          "description": "Structured situation as any non-null JSON value; a string must be nonblank. Send exactly one of situation or state.",
          "not": {
            "type": "null"
          }
        },
        "questions": {
          "type": "object",
          "minProperties": 1,
          "maxProperties": 64,
          "propertyNames": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,64}$"
          },
          "additionalProperties": {
            "$ref": "#/components/schemas/Question"
          }
        }
      },
      "oneOf": [
        {
          "required": [
            "situation"
          ]
        },
        {
          "required": [
            "state"
          ]
        }
      ]
    },
    "Answer": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "choice",
        "probability",
        "probabilities",
        "action",
        "gate",
        "type",
        "threshold"
      ],
      "properties": {
        "choice": {
          "type": "string"
        },
        "probabilities": {
          "type": "object",
          "minProperties": 2,
          "maxProperties": 255,
          "additionalProperties": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          }
        },
        "action": {
          "type": "string",
          "enum": [
            "act",
            "ask_human"
          ]
        },
        "gate": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "threshold"
          ],
          "properties": {
            "threshold": {
              "type": "number",
              "minimum": 0,
              "maximum": 1
            }
          }
        },
        "type": {
          "type": "string",
          "enum": [
            "choice",
            "score",
            "noul"
          ]
        },
        "threshold": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        },
        "expected_score": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "probability": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "description": "Calibrated probability of the chosen option. The gate acts when probability >= threshold. For noul, the probability of true is probabilities.true."
        }
      }
    },
    "MultiDecideResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "model",
        "answers",
        "usage"
      ],
      "description": "Design only: not served. Behind the gateway flag MULTI_QUESTION_ENABLED (off); while off, a questions field is an unknown field (422). Answers are keyed by question name; usage counts the shared state once.",
      "properties": {
        "id": {
          "type": "string"
        },
        "model": {
          "type": "string",
          "pattern": "^ren-\\d+\\.\\d+\\.\\d+$"
        },
        "answers": {
          "type": "object",
          "minProperties": 1,
          "maxProperties": 64,
          "propertyNames": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,64}$"
          },
          "additionalProperties": {
            "$ref": "#/components/schemas/Answer"
          }
        },
        "usage": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "input_tokens",
            "output_tokens",
            "model"
          ],
          "properties": {
            "input_tokens": {
              "type": "integer",
              "minimum": 1
            },
            "output_tokens": {
              "type": "integer",
              "const": 0
            },
            "model": {
              "type": "string",
              "pattern": "^ren-\\d+\\.\\d+\\.\\d+$"
            }
          },
          "description": "State counted once; each question adds its own text and options. Each question is limited to 2048 tokens with the state."
        }
      }
    }
  },
  "headers": {
    "RequestId": {
      "description": "Unique request ID; quote it when contacting support.",
      "schema": {
        "type": "string",
        "pattern": "^req_[0-9a-f]{32}$"
      }
    },
    "RetryAfter": {
      "description": "Whole seconds to wait before retrying.",
      "schema": {
        "type": "integer",
        "minimum": 1
      }
    },
    "RetryAfterMs": {
      "description": "Milliseconds to wait before retrying.",
      "schema": {
        "type": "integer",
        "minimum": 0
      }
    },
    "RateLimitLimit": {
      "description": "Requests allowed in the current one-minute window by the tightest limit (key or account).",
      "schema": {
        "type": "integer",
        "minimum": 1
      }
    },
    "RateLimitRemaining": {
      "description": "Requests left in the current window by the tightest limit.",
      "schema": {
        "type": "integer",
        "minimum": 0
      }
    },
    "RateLimitReset": {
      "description": "Seconds until the current window resets.",
      "schema": {
        "type": "integer",
        "minimum": 0
      }
    }
  }
}
```
