SerenAI

Pay Per Call Agentic Commerce

DataResponse_PricingConfigResponse

Generic API response wrapper with optional pagination This wrapper provides a consistent structure for all API responses, making it easier for clients to handle responses uniformly. It supports both single resources and collections, with optional pagination metadata. # Response Structure ```json { "data": T, "pagination": { ... } // optional } ``` # Examples ## Single Resource ```rust use seren_core::http::DataResponse; use serde::Serialize; #[derive(Serialize)] struct Project { id: String, name: String, } let project = Project { id: "123".to_string(), name: "My Project".to_string(), }; let response = DataResponse::new(project); // Serializes to: {"data": {"id": "123", "name": "My Project"}} ``` ## Collection with Pagination ```rust use seren_core::http::DataResponse; use seren_core::pagination::PaginationMeta; use serde::Serialize; #[derive(Serialize)] struct Project { id: String, name: String, } let projects: Vec<Project> = Vec::new(); let pagination = PaginationMeta { total: 0, count: 0, limit: 20, offset: 0, has_more: false, }; let response = DataResponse::with_pagination(projects, pagination); // Serializes to: {"data": [...], "pagination": {"total": 0, "count": 0, "limit": 20, "offset": 0, "has_more": false}} ```

Properties

PropertyTypeRequiredDescription
data object Yes Pricing config response
pagination any No
View JSON Schema
{
  "type": "object",
  "description": "Generic API response wrapper with optional pagination\n\nThis wrapper provides a consistent structure for all API responses,\nmaking it easier for clients to handle responses uniformly. It supports\nboth single resources and collections, with optional pagination metadata.\n\n# Response Structure\n\n```json\n{\n  \"data\": T,\n  \"pagination\": { ... } // optional\n}\n```\n\n# Examples\n\n## Single Resource\n\n```rust\nuse seren_core::http::DataResponse;\nuse serde::Serialize;\n\n#[derive(Serialize)]\nstruct Project {\n    id: String,\n    name: String,\n}\n\nlet project = Project {\n    id: \"123\".to_string(),\n    name: \"My Project\".to_string(),\n};\n\nlet response = DataResponse::new(project);\n// Serializes to: {\"data\": {\"id\": \"123\", \"name\": \"My Project\"}}\n```\n\n## Collection with Pagination\n\n```rust\nuse seren_core::http::DataResponse;\nuse seren_core::pagination::PaginationMeta;\nuse serde::Serialize;\n\n#[derive(Serialize)]\nstruct Project {\n    id: String,\n    name: String,\n}\n\nlet projects: Vec<Project> = Vec::new();\nlet pagination = PaginationMeta {\n    total: 0,\n    count: 0,\n    limit: 20,\n    offset: 0,\n    has_more: false,\n};\n\nlet response = DataResponse::with_pagination(projects, pagination);\n// Serializes to: {\"data\": [...], \"pagination\": {\"total\": 0, \"count\": 0, \"limit\": 20, \"offset\": 0, \"has_more\": false}}\n```",
  "required": [
    "data"
  ],
  "properties": {
    "data": {
      "type": "object",
      "description": "Pricing config response",
      "required": [
        "asset_id",
        "pricing_model",
        "base_price_per_1000_rows",
        "markup_multiplier",
        "min_charge",
        "payment_expiry_minutes",
        "prepaid_enabled",
        "onchain_enabled",
        "minimum_balance",
        "low_balance_threshold"
      ],
      "properties": {
        "asset_id": {
          "type": "string",
          "format": "uuid",
          "description": "Asset this pricing applies to"
        },
        "asset_symbol": {
          "type": [
            "string",
            "null"
          ],
          "description": "Asset symbol for display"
        },
        "base_price_per_1000_rows": {
          "type": "string"
        },
        "grace_period_minutes": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int32"
        },
        "hourly_rate": {
          "type": [
            "string",
            "null"
          ]
        },
        "low_balance_threshold": {
          "type": "string"
        },
        "markup_multiplier": {
          "type": "string"
        },
        "max_queries_per_minute": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int32"
        },
        "min_charge": {
          "type": "string"
        },
        "min_display_price": {
          "type": [
            "string",
            "null"
          ],
          "description": "Minimum price to display in UI for passthrough publishers (informational only)"
        },
        "minimum_balance": {
          "type": "string"
        },
        "onchain_enabled": {
          "type": "boolean"
        },
        "payment_expiry_minutes": {
          "type": "integer",
          "format": "int32"
        },
        "prepaid_enabled": {
          "type": "boolean"
        },
        "price_per_call": {
          "type": [
            "string",
            "null"
          ]
        },
        "price_per_delete": {
          "type": [
            "string",
            "null"
          ]
        },
        "price_per_execution": {
          "type": [
            "string",
            "null"
          ],
          "description": "Price per execution for agent templates or usage-based billing"
        },
        "price_per_get": {
          "type": [
            "string",
            "null"
          ]
        },
        "price_per_patch": {
          "type": [
            "string",
            "null"
          ]
        },
        "price_per_post": {
          "type": [
            "string",
            "null"
          ]
        },
        "price_per_put": {
          "type": [
            "string",
            "null"
          ]
        },
        "pricing_display_text": {
          "type": [
            "string",
            "null"
          ],
          "description": "Text to display for variable pricing (e.g., \"Varies by model\")"
        },
        "pricing_model": {
          "$ref": "#/components/schemas/PricingModel"
        },
        "reserve_max_charge": {
          "type": [
            "string",
            "null"
          ]
        },
        "unresolved_fallback_charge": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "pagination": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "$ref": "#/components/schemas/PaginationMeta",
          "description": "Optional pagination metadata"
        }
      ]
    }
  }
}