{
  "openapi": "3.0.3",
  "info": {
    "title": "Requesty Management API",
    "description": "Requesty Management API for API key management, groups, members, and organization settings.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api-v2.requesty.ai",
      "description": "Management API endpoint"
    }
  ],
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "paths": {
    "/v1/manage/apikey": {
      "servers": [
        {
          "url": "https://api-v2.requesty.ai",
          "description": "Management API endpoint"
        }
      ],
      "get": {
        "summary": "Get all API keys",
        "description": "Retrieve all existing API keys for the organization",
        "responses": {
          "200": {
            "description": "Successfully retrieved API keys",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetApiKeysResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - malformed payload or invalid parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or empty Authorization header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Payment required - organization balance exhausted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - invalid token or model not in access list.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found - provider/model not supported.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Retry after the Retry-After header value.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad gateway - upstream provider returned an invalid response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "listApiKeys"
      },
      "post": {
        "summary": "Create new API key",
        "description": "Create a new API key for the organization",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateApiKeyRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "API key created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateApiKeyResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - malformed payload or invalid parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or empty Authorization header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Payment required - organization balance exhausted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - invalid token or model not in access list.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found - provider/model not supported.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Retry after the Retry-After header value.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad gateway - upstream provider returned an invalid response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "createApiKey"
      }
    },
    "/v1/manage/apikey/{id}": {
      "servers": [
        {
          "url": "https://api-v2.requesty.ai",
          "description": "Management API endpoint"
        }
      ],
      "get": {
        "summary": "Get API key",
        "description": "Get information about a specific API key. An API key can query about itself, or about other keys if it has manage read permissions.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The UUID of the API key to retrieve, or 'self' to query the calling API key"
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved API key information",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyInfoResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - malformed payload or invalid parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or empty Authorization header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Payment required - organization balance exhausted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - invalid token or model not in access list.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found - provider/model not supported.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Retry after the Retry-After header value.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad gateway - upstream provider returned an invalid response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "getApiKey"
      },
      "delete": {
        "summary": "Delete API key",
        "description": "Delete a specific API key",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "API key deleted successfully"
          },
          "400": {
            "description": "Bad request - malformed payload or invalid parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or empty Authorization header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Payment required - organization balance exhausted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - invalid token or model not in access list.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found - provider/model not supported.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Retry after the Retry-After header value.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad gateway - upstream provider returned an invalid response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "deleteApiKey"
      }
    },
    "/v1/manage/apikey/{id}/usage": {
      "servers": [
        {
          "url": "https://api-v2.requesty.ai",
          "description": "Management API endpoint"
        }
      ],
      "get": {
        "summary": "Get API key usage",
        "description": "Get usage statistics for a specific API key within a date range",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GetApiKeyUsageRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully retrieved usage data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetApiKeyUsageResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - malformed payload or invalid parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or empty Authorization header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Payment required - organization balance exhausted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - invalid token or model not in access list.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found - provider/model not supported.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Retry after the Retry-After header value.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad gateway - upstream provider returned an invalid response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "getApiKeyUsage"
      }
    },
    "/v1/manage/apikey/{id}/limit": {
      "servers": [
        {
          "url": "https://api-v2.requesty.ai",
          "description": "Management API endpoint"
        }
      ],
      "post": {
        "summary": "Update API key monthly limit",
        "description": "Update the monthly spending limit for a specific API key",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateLimitRequest"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Monthly limit updated successfully"
          },
          "400": {
            "description": "Bad request - malformed payload or invalid parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or empty Authorization header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Payment required - organization balance exhausted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - invalid token or model not in access list.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found - provider/model not supported.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Retry after the Retry-After header value.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad gateway - upstream provider returned an invalid response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "updateApiKeyLimit"
      }
    },
    "/v1/manage/apikey/{id}/label": {
      "servers": [
        {
          "url": "https://api-v2.requesty.ai",
          "description": "Management API endpoint"
        }
      ],
      "post": {
        "summary": "Update API key labels",
        "description": "Update labels for an API key. Setting an empty object will remove all labels.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateLabelRequest"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Labels updated successfully"
          },
          "400": {
            "description": "Bad request - malformed payload or invalid parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or empty Authorization header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Payment required - organization balance exhausted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - invalid token or model not in access list.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found - provider/model not supported.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Retry after the Retry-After header value.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad gateway - upstream provider returned an invalid response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "updateApiKeyLabel"
      }
    },
    "/v1/manage/apikey/{id}/expiry": {
      "servers": [
        {
          "url": "https://api-v2.requesty.ai",
          "description": "Management API endpoint"
        }
      ],
      "post": {
        "summary": "Update API key expiry",
        "description": "Update the expiry date for an API key. If expires_at is not set or is null, the current expiry will be removed, making the API key non-expiring.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateExpiryRequest"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Expiry updated successfully"
          },
          "400": {
            "description": "Bad request - malformed payload or invalid parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or empty Authorization header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Payment required - organization balance exhausted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - invalid token or model not in access list.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found - provider/model not supported.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Retry after the Retry-After header value.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad gateway - upstream provider returned an invalid response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "updateApiKeyExpiry"
      }
    },
    "/v1/manage/group": {
      "servers": [
        {
          "url": "https://api-v2.requesty.ai",
          "description": "Management API endpoint"
        }
      ],
      "get": {
        "summary": "List groups",
        "description": "List all groups in your organization",
        "responses": {
          "200": {
            "description": "Successfully retrieved groups",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetGroupsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - malformed payload or invalid parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or empty Authorization header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Payment required - organization balance exhausted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - invalid token or model not in access list.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found - provider/model not supported.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Retry after the Retry-After header value.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad gateway - upstream provider returned an invalid response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "listGroups"
      },
      "post": {
        "summary": "Create group",
        "description": "Create a new group in your organization",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateGroupRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Group created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateGroupResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - malformed payload or invalid parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or empty Authorization header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Payment required - organization balance exhausted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - invalid token or model not in access list.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found - provider/model not supported.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Retry after the Retry-After header value.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad gateway - upstream provider returned an invalid response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "createGroup"
      }
    },
    "/v1/manage/group/{id}": {
      "servers": [
        {
          "url": "https://api-v2.requesty.ai",
          "description": "Management API endpoint"
        }
      ],
      "get": {
        "summary": "Get group",
        "description": "Get detailed information about a specific group including its members",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The group ID",
            "example": "123e4567-e89b-12d3-a456-426614174000"
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved group",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetGroupResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - malformed payload or invalid parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or empty Authorization header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Payment required - organization balance exhausted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - invalid token or model not in access list.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found - provider/model not supported.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Retry after the Retry-After header value.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad gateway - upstream provider returned an invalid response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "getGroup"
      },
      "delete": {
        "summary": "Delete group",
        "description": "Delete a group from your organization",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The group ID",
            "example": "123e4567-e89b-12d3-a456-426614174000"
          }
        ],
        "responses": {
          "204": {
            "description": "Group deleted successfully"
          },
          "400": {
            "description": "Bad request - malformed payload or invalid parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or empty Authorization header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Payment required - organization balance exhausted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - invalid token or model not in access list.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found - provider/model not supported.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Retry after the Retry-After header value.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad gateway - upstream provider returned an invalid response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "deleteGroup"
      }
    },
    "/v1/manage/group/{id}/member": {
      "servers": [
        {
          "url": "https://api-v2.requesty.ai",
          "description": "Management API endpoint"
        }
      ],
      "post": {
        "summary": "Add group member",
        "description": "Add a member to a group in your organization. The member will be assigned the specified role.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The group ID",
            "example": "123e4567-e89b-12d3-a456-426614174000"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddMemberRequest"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Member added successfully"
          },
          "400": {
            "description": "Bad request - malformed payload or invalid parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or empty Authorization header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Payment required - organization balance exhausted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - invalid token or model not in access list.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found - provider/model not supported.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict - member is already in the group"
          },
          "429": {
            "description": "Rate limit exceeded. Retry after the Retry-After header value.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad gateway - upstream provider returned an invalid response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "addGroupMember"
      },
      "delete": {
        "summary": "Remove group member",
        "description": "Remove a member from a group.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The group ID",
            "example": "123e4567-e89b-12d3-a456-426614174000"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RemoveMemberRequest"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Member removed successfully"
          },
          "400": {
            "description": "Bad request - malformed payload or invalid parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or empty Authorization header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Payment required - organization balance exhausted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - invalid token or model not in access list.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found - provider/model not supported.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Retry after the Retry-After header value.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad gateway - upstream provider returned an invalid response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "removeGroupMember"
      }
    },
    "/v1/manage/org/member": {
      "servers": [
        {
          "url": "https://api-v2.requesty.ai",
          "description": "Management API endpoint"
        }
      ],
      "get": {
        "summary": "List organization members",
        "description": "Retrieve all members of the organization. Returns each member's user ID, email, first name, and last name. Use the returned user IDs to add members to groups via the group member endpoints.",
        "responses": {
          "200": {
            "description": "Successfully retrieved organization members",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetOrgMembersResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - malformed payload or invalid parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or empty Authorization header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Payment required - organization balance exhausted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - invalid token or model not in access list.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found - provider/model not supported.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Retry after the Retry-After header value.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad gateway - upstream provider returned an invalid response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "listOrgMembers"
      }
    },
    "/v1/manage/org/member/{user_id}": {
      "delete": {
        "summary": "Delete organization member",
        "description": "Offboard a member from your organization. The member is removed from the organization in the identity provider so they can no longer access it, all API keys they created in the organization are invalidated, and they are removed from all of the organization's groups. The member keeps their account and any other organization memberships; if they sign in with no memberships left, a fresh default organization is created for them. Requires an API key with write manage permissions. The endpoint is idempotent: calling it for a user who is not (or no longer) a member returns 200, so it is safe to retry after a partial failure.",
        "parameters": [
          {
            "name": "user_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The user ID of the member, as returned by the list organization members endpoint",
            "example": "user_2abCdEfGhIjKlMnOpQrStUvWxYz"
          }
        ],
        "responses": {
          "200": {
            "description": "Member offboarded successfully (also returned when the user is not a member, making retries safe)"
          },
          "400": {
            "description": "Bad request - missing or invalid user ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or invalid Authorization header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - API key does not have write manage permissions.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad gateway - the identity provider could not remove the user from the organization. The user's API keys and data in your organization have already been invalidated; retry the request to complete the removal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "deleteOrgMember"
      }
    },
    "/v1/manage/org": {
      "servers": [
        {
          "url": "https://api-v2.requesty.ai",
          "description": "Management API endpoint"
        }
      ],
      "get": {
        "summary": "Get information about organization",
        "description": "Get information about organization",
        "responses": {
          "200": {
            "description": "Successfully retrieved organization info",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetOrgResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - malformed payload or invalid parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or empty Authorization header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Payment required - organization balance exhausted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - invalid token or model not in access list.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found - provider/model not supported.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Retry after the Retry-After header value.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad gateway - upstream provider returned an invalid response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "getOrg"
      }
    },
    "/v1/manage/org/usage": {
      "servers": [
        {
          "url": "https://api-v2.requesty.ai",
          "description": "Management API endpoint"
        }
      ],
      "get": {
        "summary": "Get organization usage",
        "description": "Get aggregated usage statistics for your entire organization within a date range. Supports aggregation by different time periods and optional grouping by user, model, or custom fields.",
        "parameters": [
          {
            "name": "start",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "2025-01-01T00:00:00Z"
            },
            "description": "Start date in RFC3339 format (e.g., 2025-01-01T00:00:00Z). Required. The date range cannot exceed 100 days from start to end."
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "2025-01-31T23:59:59Z"
            },
            "description": "End date in RFC3339 format (e.g., 2025-01-31T23:59:59Z). Optional. Defaults to 24 hours from start if not specified. Must be after start date. The date range cannot exceed 100 days."
          },
          {
            "name": "resolution",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "hour",
                "day",
                "month"
              ],
              "default": "day"
            },
            "description": "Time resolution for aggregation"
          },
          {
            "name": "group_by",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "description": "Fields to group by: group_name, group_id, member_id, member_email, user_id, api_key_id, model_requested, model_used, provider_used, is_byok, origin_title, or extra.<field_name>. Can be specified multiple times."
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved usage data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetOrgUsageResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - malformed payload or invalid parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or empty Authorization header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Payment required - organization balance exhausted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - invalid token or model not in access list.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found - provider/model not supported.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Retry after the Retry-After header value.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad gateway - upstream provider returned an invalid response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "getOrgUsage"
      }
    },
    "/v1/manage/group/{group_id}/member/{member_id}/role": {
      "servers": [
        {
          "url": "https://api-v2.requesty.ai",
          "description": "Management API endpoint"
        }
      ],
      "put": {
        "summary": "Update group member role",
        "description": "Update the role of a member in a group. Requires an API key with write manage permissions.",
        "parameters": [
          {
            "name": "group_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The group ID",
            "example": "123e4567-e89b-12d3-a456-426614174000"
          },
          {
            "name": "member_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The user ID of the member whose role should be updated",
            "example": "user_2abCdEfGhIjKlMnOpQrStUvWxYz"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateMemberRoleRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Member role updated successfully"
          },
          "400": {
            "description": "Bad request - invalid group ID, member ID, or role.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or invalid Authorization header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - API key does not have write manage permissions.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found - the group or member does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "updateGroupMemberRole"
      }
    },
    "/v1/manage/group/{group_id}/member/{member_id}/budget-override": {
      "servers": [
        {
          "url": "https://api-v2.requesty.ai",
          "description": "Management API endpoint"
        }
      ],
      "put": {
        "summary": "Update group member budget override",
        "description": "Set or clear a per-member monthly budget override within a group. When set, the member's spending is capped at this amount regardless of the group-level budget. Pass `null` to remove the override and fall back to the group budget. Requires an API key with write manage permissions.",
        "parameters": [
          {
            "name": "group_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The group ID",
            "example": "123e4567-e89b-12d3-a456-426614174000"
          },
          {
            "name": "member_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The user ID of the member whose budget override should be updated",
            "example": "user_2abCdEfGhIjKlMnOpQrStUvWxYz"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateMemberBudgetOverrideRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Budget override updated successfully"
          },
          "400": {
            "description": "Bad request - invalid group ID or member ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or invalid Authorization header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - API key does not have write manage permissions.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found - the group or member does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "updateGroupMemberBudgetOverride"
      }
    },
    "/v1/manage/access-list": {
      "servers": [
        {
          "url": "https://api-v2.requesty.ai",
          "description": "Management API endpoint"
        }
      ],
      "get": {
        "summary": "List access lists",
        "description": "Retrieve all access lists in the organization. Requires an API key with read manage permissions.",
        "responses": {
          "200": {
            "description": "Successfully retrieved access lists",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListAccessListsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or invalid Authorization header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - API key does not have read manage permissions.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "listAccessLists"
      },
      "post": {
        "summary": "Create access list",
        "description": "Create a new access list in the organization. An access list defines which models are allowed for API keys or groups it is attached to. Requires an API key with write manage permissions.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAccessListRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Access list created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateAccessListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - invalid name or model list.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or invalid Authorization header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - API key does not have write manage permissions.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "createAccessList"
      }
    },
    "/v1/manage/access-list/{access_list_id}": {
      "servers": [
        {
          "url": "https://api-v2.requesty.ai",
          "description": "Management API endpoint"
        }
      ],
      "get": {
        "summary": "Get access list",
        "description": "Retrieve a specific access list by ID. Requires an API key with read manage permissions.",
        "parameters": [
          {
            "name": "access_list_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The access list ID",
            "example": "123e4567-e89b-12d3-a456-426614174000"
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved access list",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetAccessListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - invalid access list ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or invalid Authorization header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - API key does not have read manage permissions.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found - access list does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "getAccessList"
      },
      "patch": {
        "summary": "Update access list",
        "description": "Update an access list's name, allowed models, or auto-approve setting. All fields are optional — only the fields you include are updated. Requires an API key with write manage permissions.",
        "parameters": [
          {
            "name": "access_list_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The access list ID",
            "example": "123e4567-e89b-12d3-a456-426614174000"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAccessListRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Access list updated successfully"
          },
          "400": {
            "description": "Bad request - invalid name or model list, or no fields provided.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or invalid Authorization header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - API key does not have write manage permissions.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found - access list does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "updateAccessList"
      },
      "delete": {
        "summary": "Delete access list",
        "description": "Delete an access list. The access list cannot be deleted if it is currently assigned to any group or API key. Requires an API key with write manage permissions.",
        "parameters": [
          {
            "name": "access_list_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The access list ID",
            "example": "123e4567-e89b-12d3-a456-426614174000"
          }
        ],
        "responses": {
          "200": {
            "description": "Access list deleted successfully"
          },
          "400": {
            "description": "Bad request - invalid access list ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or invalid Authorization header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - API key does not have write manage permissions.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found - access list does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict - access list is currently in use and cannot be deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "deleteAccessList"
      }
    },
    "/v1/manage/org/group/access-list": {
      "servers": [
        {
          "url": "https://api-v2.requesty.ai",
          "description": "Management API endpoint"
        }
      ],
      "post": {
        "summary": "Set default group access list",
        "description": "Set or clear the organization's default access list for groups. When set, any group that does not have its own explicit access list will use this one. Pass `null` for `access_list_id` to clear the default. Requires an API key with write manage permissions.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetGroupDefaultAccessListRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Default group access list updated successfully"
          },
          "400": {
            "description": "Bad request - invalid access list ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or invalid Authorization header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - API key does not have write manage permissions.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found - the specified access list does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "setDefaultGroupAccessList"
      }
    }
  },
  "components": {
    "schemas": {
      "APIKeyGroupInfo": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The unique identifier of the group"
          }
        },
        "required": [
          "id"
        ]
      },
      "AddMemberRequest": {
        "type": "object",
        "required": [
          "user_id",
          "role"
        ],
        "properties": {
          "user_id": {
            "type": "string",
            "description": "The ID of the user to add to the group",
            "example": "user-123"
          },
          "role": {
            "type": "string",
            "enum": [
              "admin",
              "member"
            ],
            "description": "The role to assign to the member",
            "example": "member"
          }
        },
        "example": {
          "user_id": "user-123",
          "role": "member"
        }
      },
      "ApiKeyInfo": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "monthly_limit": {
            "type": "number",
            "format": "decimal"
          },
          "monthly_spend": {
            "type": "number",
            "format": "decimal"
          },
          "permissions": {
            "$ref": "#/components/schemas/GetApiKeyPermissions"
          },
          "labels": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Key-value labels for the API key"
          },
          "created_by": {
            "$ref": "#/components/schemas/User"
          },
          "group": {
            "$ref": "#/components/schemas/APIKeyGroupInfo",
            "description": "Group information if the API key belongs to a group"
          }
        },
        "required": [
          "id",
          "name",
          "monthly_limit",
          "monthly_spend",
          "permissions"
        ]
      },
      "ApiKeyInfoResponse": {
        "type": "object",
        "required": [
          "id",
          "name",
          "logging",
          "monthly_spend",
          "monthly_limit",
          "permissions"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The unique identifier of the API key"
          },
          "name": {
            "type": "string",
            "description": "The name of the API key"
          },
          "logging": {
            "type": "boolean",
            "description": "Whether logging is enabled for this API key"
          },
          "monthly_spend": {
            "type": "number",
            "format": "decimal",
            "description": "The amount spent by this API key in the current month"
          },
          "monthly_limit": {
            "type": "number",
            "format": "decimal",
            "description": "The monthly spending limit for this API key (0 means unlimited)"
          },
          "permissions": {
            "type": "object",
            "properties": {
              "manage": {
                "type": "string",
                "enum": [
                  "none",
                  "read",
                  "write"
                ],
                "description": "Permission level for management operations"
              },
              "completions": {
                "type": "string",
                "enum": [
                  "none",
                  "read",
                  "write"
                ],
                "description": "Permission level for completions operations"
              }
            },
            "required": [
              "manage",
              "completions"
            ]
          },
          "group": {
            "$ref": "#/components/schemas/APIKeyGroupInfo",
            "description": "Group information if the API key belongs to a group"
          }
        }
      },
      "ApiKeyPermissions": {
        "type": "string",
        "enum": [
          "none",
          "read",
          "write"
        ]
      },
      "ApiKeyUsageEntry": {
        "type": "object",
        "properties": {
          "completions_requests": {
            "type": "integer"
          },
          "spend": {
            "type": "number",
            "format": "decimal"
          },
          "input_tokens": {
            "type": "integer"
          },
          "output_tokens": {
            "type": "integer"
          },
          "total_tokens": {
            "type": "integer"
          },
          "grouped_data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiKeyUsageGrouped"
            }
          }
        }
      },
      "ApiKeyUsageGrouped": {
        "type": "object",
        "properties": {
          "group_by_values": {
            "type": "object",
            "additionalProperties": true
          },
          "completions_requests": {
            "type": "integer"
          },
          "spend": {
            "type": "number",
            "format": "decimal"
          },
          "input_tokens": {
            "type": "integer"
          },
          "output_tokens": {
            "type": "integer"
          },
          "total_tokens": {
            "type": "integer"
          }
        }
      },
      "CreateApiKeyRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "monthly_limit": {
            "type": "number",
            "format": "decimal"
          },
          "permissions": {
            "$ref": "#/components/schemas/GetApiKeyPermissions"
          }
        },
        "required": [
          "name"
        ]
      },
      "CreateApiKeyResponse": {
        "type": "object",
        "properties": {
          "api_key_id": {
            "type": "string",
            "format": "uuid"
          },
          "api_key": {
            "type": "string"
          }
        },
        "required": [
          "api_key_id",
          "api_key"
        ]
      },
      "CreateGroupRequest": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "The name of the group",
            "example": "Engineering Team"
          },
          "monthly_limit": {
            "type": "number",
            "format": "double",
            "description": "Monthly spending limit for the group. 0 means unlimited.",
            "example": 1000
          }
        },
        "example": {
          "name": "Engineering Team",
          "monthly_limit": 1000
        }
      },
      "CreateGroupResponse": {
        "type": "object",
        "properties": {
          "group_id": {
            "type": "string",
            "format": "uuid",
            "description": "The ID of the created group",
            "example": "123e4567-e89b-12d3-a456-426614174000"
          }
        },
        "required": [
          "group_id"
        ]
      },
      "GetApiKeyPermissions": {
        "type": "object",
        "properties": {
          "manage": {
            "$ref": "#/components/schemas/ApiKeyPermissions"
          },
          "completions": {
            "$ref": "#/components/schemas/ApiKeyPermissions"
          }
        },
        "required": [
          "manage",
          "completions"
        ]
      },
      "GetApiKeyUsageRequest": {
        "type": "object",
        "properties": {
          "start": {
            "type": "string",
            "format": "date-time",
            "description": "Start date in RFC3339 format (e.g., 2025-01-01T00:00:00Z). Required. The date range cannot exceed 100 days from start to end.",
            "example": "2025-01-01T00:00:00Z"
          },
          "end": {
            "type": "string",
            "format": "date-time",
            "description": "End date in RFC3339 format (e.g., 2025-01-31T23:59:59Z). Optional. Defaults to 24 hours from start if not specified. Must be after start date. The date range cannot exceed 100 days.",
            "example": "2025-01-31T23:59:59Z"
          },
          "group_by": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Fields to group by: user_id, model_requested, or extra.<field_name>"
          },
          "resolution": {
            "type": "string",
            "enum": [
              "hour",
              "day",
              "month"
            ],
            "default": "day",
            "description": "Time resolution for aggregation"
          }
        },
        "required": [
          "start"
        ]
      },
      "GetApiKeyUsageResponse": {
        "type": "object",
        "properties": {
          "usage": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/ApiKeyUsageEntry"
            },
            "description": "Map of period (string) to usage entry"
          }
        },
        "required": [
          "usage"
        ]
      },
      "GetApiKeysResponse": {
        "type": "object",
        "properties": {
          "keys": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiKeyInfo"
            }
          }
        },
        "required": [
          "keys"
        ]
      },
      "GetGroupResponse": {
        "type": "object",
        "properties": {
          "group": {
            "$ref": "#/components/schemas/OrganizationGroup"
          }
        },
        "required": [
          "group"
        ]
      },
      "GetGroupsResponse": {
        "type": "object",
        "properties": {
          "groups": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrganizationGroupListItem"
            },
            "description": "List of groups"
          }
        },
        "required": [
          "groups"
        ]
      },
      "GetOrgMembersResponse": {
        "type": "object",
        "required": [
          "members"
        ],
        "properties": {
          "members": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrgMember"
            },
            "description": "List of organization members"
          }
        }
      },
      "OrgMember": {
        "type": "object",
        "required": [
          "user_id",
          "user_email"
        ],
        "properties": {
          "user_id": {
            "type": "string",
            "description": "Unique identifier of the member"
          },
          "user_email": {
            "type": "string",
            "format": "email",
            "description": "Email address of the member"
          },
          "first_name": {
            "type": "string",
            "description": "First name of the member"
          },
          "last_name": {
            "type": "string",
            "description": "Last name of the member"
          }
        }
      },
      "GetOrgResponse": {
        "type": "object",
        "required": [
          "name",
          "balance"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the organization"
          },
          "balance": {
            "type": "number",
            "format": "decimal",
            "description": "Balance of the organization"
          }
        }
      },
      "GetOrgUsageResponse": {
        "type": "object",
        "properties": {
          "usage": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/OrgUsageEntry"
            },
            "description": "Map of period (string) to usage entry"
          }
        },
        "required": [
          "usage"
        ]
      },
      "OrgUsageEntry": {
        "type": "object",
        "properties": {
          "completions_requests": {
            "type": "integer",
            "description": "Number of chat completion requests"
          },
          "embedding_requests": {
            "type": "integer",
            "description": "Number of embedding requests"
          },
          "image_requests": {
            "type": "integer",
            "description": "Number of image generation requests"
          },
          "speech_requests": {
            "type": "integer",
            "description": "Number of text-to-speech requests"
          },
          "transcription_requests": {
            "type": "integer",
            "description": "Number of speech-to-text requests"
          },
          "total_requests": {
            "type": "integer",
            "description": "Total number of requests across all modalities"
          },
          "spend": {
            "type": "number",
            "format": "decimal",
            "description": "Total spend for the period"
          },
          "input_tokens": {
            "type": "integer",
            "description": "Total input tokens consumed"
          },
          "output_tokens": {
            "type": "integer",
            "description": "Total output tokens generated"
          },
          "total_tokens": {
            "type": "integer",
            "description": "Total tokens (input + output)"
          },
          "grouped_data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrgUsageGrouped"
            },
            "description": "Breakdown by the requested group_by fields. Only present when group_by is specified."
          }
        }
      },
      "OrgUsageGrouped": {
        "type": "object",
        "properties": {
          "group_by_values": {
            "type": "object",
            "additionalProperties": true,
            "description": "Map of group_by field names to their values for this group"
          },
          "completions_requests": {
            "type": "integer"
          },
          "embedding_requests": {
            "type": "integer"
          },
          "image_requests": {
            "type": "integer"
          },
          "speech_requests": {
            "type": "integer"
          },
          "transcription_requests": {
            "type": "integer"
          },
          "total_requests": {
            "type": "integer"
          },
          "spend": {
            "type": "number",
            "format": "decimal"
          },
          "input_tokens": {
            "type": "integer"
          },
          "output_tokens": {
            "type": "integer"
          },
          "total_tokens": {
            "type": "integer"
          }
        }
      },
      "OrganizationGroup": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The group ID",
            "example": "123e4567-e89b-12d3-a456-426614174000"
          },
          "organization_id": {
            "type": "string",
            "description": "The organization ID",
            "example": "org-123"
          },
          "name": {
            "type": "string",
            "description": "The group name",
            "example": "Engineering Team"
          },
          "monthly_limit": {
            "type": "number",
            "format": "double",
            "description": "Monthly spending limit. null means unlimited.",
            "nullable": true,
            "example": 1000
          },
          "created_by": {
            "type": "string",
            "description": "User ID who created the group",
            "example": "user-123"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the group was created",
            "example": "2025-01-15T10:30:00Z"
          },
          "members": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrganizationGroupMember"
            },
            "description": "List of group members"
          }
        },
        "required": [
          "id",
          "organization_id",
          "name",
          "created_by",
          "created_at",
          "members"
        ]
      },
      "OrganizationGroupListItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The group ID",
            "example": "123e4567-e89b-12d3-a456-426614174000"
          },
          "organization_id": {
            "type": "string",
            "description": "The organization ID",
            "example": "org-123"
          },
          "name": {
            "type": "string",
            "description": "The group name",
            "example": "Engineering Team"
          },
          "members_count": {
            "type": "integer",
            "description": "Number of members in the group",
            "example": 5
          },
          "monthly_spend": {
            "type": "number",
            "format": "double",
            "description": "Current monthly spending",
            "example": 450.25
          },
          "monthly_limit": {
            "type": "number",
            "format": "double",
            "description": "Monthly spending limit. null means unlimited.",
            "nullable": true,
            "example": 1000
          },
          "created_by": {
            "type": "string",
            "description": "User ID who created the group",
            "example": "user-123"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the group was created",
            "example": "2025-01-15T10:30:00Z"
          }
        },
        "required": [
          "id",
          "organization_id",
          "name",
          "members_count",
          "monthly_spend",
          "created_by",
          "created_at"
        ]
      },
      "OrganizationGroupMember": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The member user ID",
            "example": "user-123"
          },
          "email": {
            "type": "string",
            "format": "email",
            "description": "The member email",
            "example": "user@example.com"
          },
          "role": {
            "type": "string",
            "enum": [
              "admin",
              "member"
            ],
            "description": "The member role",
            "example": "member"
          },
          "monthly_limit": {
            "type": "number",
            "format": "double",
            "description": "Monthly spending limit for the member",
            "nullable": true,
            "example": 500
          },
          "monthly_spend": {
            "type": "number",
            "format": "double",
            "description": "Current monthly spending",
            "example": 250.5
          },
          "rate_limit": {
            "type": "integer",
            "format": "int64",
            "description": "Rate limit for the member",
            "nullable": true,
            "example": 100
          },
          "active": {
            "type": "boolean",
            "description": "Whether the member is active",
            "example": true
          }
        },
        "required": [
          "id",
          "email",
          "role",
          "monthly_spend",
          "active"
        ]
      },
      "RemoveMemberRequest": {
        "type": "object",
        "required": [
          "user_id"
        ],
        "properties": {
          "user_id": {
            "type": "string",
            "description": "The ID of the user to remove from the group",
            "example": "user-123"
          }
        },
        "example": {
          "user_id": "user-123"
        }
      },
      "UpdateExpiryRequest": {
        "type": "object",
        "properties": {
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "Expiry date in RFC3339 format (e.g., 2025-12-31T23:59:59Z). If not set or null, the current expiry will be removed, making the API key non-expiring.",
            "example": "2025-12-31T23:59:59Z"
          }
        }
      },
      "UpdateLabelRequest": {
        "type": "object",
        "properties": {
          "labels": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Key-value pairs of labels. Empty object removes all labels."
          }
        },
        "required": [
          "labels"
        ]
      },
      "UpdateLimitRequest": {
        "type": "object",
        "properties": {
          "monthly_limit": {
            "type": "number",
            "format": "decimal"
          }
        },
        "required": [
          "monthly_limit"
        ]
      },
      "UpdateMemberRoleRequest": {
        "type": "object",
        "required": [
          "role"
        ],
        "properties": {
          "role": {
            "type": "string",
            "enum": [
              "admin",
              "member"
            ],
            "description": "The new role to assign to the member",
            "example": "admin"
          }
        },
        "example": {
          "role": "admin"
        }
      },
      "UpdateMemberBudgetOverrideRequest": {
        "type": "object",
        "properties": {
          "budget_override": {
            "type": "number",
            "format": "double",
            "nullable": true,
            "description": "Monthly budget override for the member in USD. Set to null to remove the override and fall back to the group budget.",
            "example": 100
          }
        },
        "example": {
          "budget_override": 100
        }
      },
      "AccessListObject": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The access list ID"
          },
          "name": {
            "type": "string",
            "description": "The access list name"
          },
          "organization_id": {
            "type": "string",
            "description": "The organization ID that owns this access list"
          },
          "auto_approve": {
            "type": "boolean",
            "description": "Whether new models matching the list patterns are automatically approved"
          },
          "chat": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Allowed chat/completion model identifiers"
          },
          "embedding": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Allowed embedding model identifiers"
          },
          "image": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Allowed image generation model identifiers"
          },
          "transcription": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Allowed transcription model identifiers"
          },
          "speech": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Allowed speech model identifiers"
          }
        },
        "required": [
          "id",
          "name",
          "organization_id",
          "auto_approve"
        ]
      },
      "CreateAccessListRequest": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Name for the access list",
            "example": "Production Models"
          },
          "auto_approve": {
            "type": "boolean",
            "description": "Whether new models matching the list patterns are automatically approved",
            "default": false
          },
          "chat": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Chat/completion model identifiers to allow",
            "example": [
              "openai/gpt-4o",
              "anthropic/claude-sonnet-4-20250514"
            ]
          },
          "embedding": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Embedding model identifiers to allow"
          },
          "image": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Image generation model identifiers to allow"
          },
          "transcription": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Transcription model identifiers to allow"
          },
          "speech": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Speech model identifiers to allow"
          }
        }
      },
      "CreateAccessListResponse": {
        "type": "object",
        "required": [
          "id"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The ID of the newly created access list"
          }
        }
      },
      "GetAccessListResponse": {
        "type": "object",
        "required": [
          "access_list"
        ],
        "properties": {
          "access_list": {
            "$ref": "#/components/schemas/AccessListObject"
          }
        }
      },
      "ListAccessListsResponse": {
        "type": "object",
        "required": [
          "access_lists"
        ],
        "properties": {
          "access_lists": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccessListObject"
            },
            "description": "List of access lists in the organization"
          }
        }
      },
      "UpdateAccessListRequest": {
        "type": "object",
        "description": "All fields are optional. Only the fields you include are updated.",
        "properties": {
          "name": {
            "type": "string",
            "description": "New name for the access list"
          },
          "auto_approve": {
            "type": "boolean",
            "description": "Whether new models matching the list patterns are automatically approved"
          },
          "chat": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Replace the allowed chat/completion model identifiers"
          },
          "embedding": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Replace the allowed embedding model identifiers"
          },
          "image": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Replace the allowed image generation model identifiers"
          },
          "transcription": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Replace the allowed transcription model identifiers"
          },
          "speech": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Replace the allowed speech model identifiers"
          }
        }
      },
      "SetGroupDefaultAccessListRequest": {
        "type": "object",
        "properties": {
          "access_list_id": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "description": "The access list ID to set as the default for groups. Pass null to clear the default.",
            "example": "123e4567-e89b-12d3-a456-426614174000"
          }
        }
      },
      "User": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "email": {
            "type": "string"
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "origin",
              "message"
            ],
            "properties": {
              "origin": {
                "type": "string",
                "enum": [
                  "router",
                  "provider"
                ],
                "description": "Whether the error originated from Requesty's router or an upstream provider."
              },
              "message": {
                "type": "string",
                "description": "Human-readable error description."
              }
            }
          }
        }
      }
    },
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "API key for authentication"
      }
    }
  }
}