SerenAI

Pay Per Call Agentic Commerce

EndpointDefinition

A structured endpoint definition for LLM discoverability and access control

Properties

PropertyTypeRequiredDescription
body_template any No Template for request body with {{query}} placeholder for user input Used by browser extensions and LLMs to construct valid requests
description string,null No Human-readable description of what this endpoint does
example_request any No Example request body
example_response any No Example response body
is_default boolean No Whether this is the default endpoint for simple queries When multiple endpoints exist, the default is used for basic operations
is_protected boolean No Whether this endpoint is blocked from agent access Protected endpoints are documented but return 403 if called
method HttpMethod Yes HTTP method (GET, POST, PUT, DELETE, PATCH)
path string Yes Path relative to api_url (e.g., "/chat/completions")
price string,null No Endpoint-specific price override (in asset decimals, e.g., "0.49" for $0.49) If set, takes precedence over method-level pricing (price_per_post, etc.)
protection_reason string,null No Reason for protection (shown in 403 response, e.g., "Data redistribution policy")
query_params array,null No Query parameter definitions
request_body any No Request body schema (JSON Schema or simplified description)
required_headers array,null No Headers required for this endpoint (beyond publisher defaults)
response any No Response schema (JSON Schema or simplified description)
View JSON Schema
{
  "type": "object",
  "description": "A structured endpoint definition for LLM discoverability and access control",
  "required": [
    "method",
    "path"
  ],
  "properties": {
    "body_template": {
      "description": "Template for request body with {{query}} placeholder for user input\nUsed by browser extensions and LLMs to construct valid requests"
    },
    "description": {
      "type": [
        "string",
        "null"
      ],
      "description": "Human-readable description of what this endpoint does"
    },
    "example_request": {
      "description": "Example request body"
    },
    "example_response": {
      "description": "Example response body"
    },
    "is_default": {
      "type": "boolean",
      "description": "Whether this is the default endpoint for simple queries\nWhen multiple endpoints exist, the default is used for basic operations"
    },
    "is_protected": {
      "type": "boolean",
      "description": "Whether this endpoint is blocked from agent access\nProtected endpoints are documented but return 403 if called"
    },
    "method": {
      "$ref": "#/components/schemas/HttpMethod",
      "description": "HTTP method (GET, POST, PUT, DELETE, PATCH)"
    },
    "path": {
      "type": "string",
      "description": "Path relative to api_url (e.g., \"/chat/completions\")"
    },
    "price": {
      "type": [
        "string",
        "null"
      ],
      "description": "Endpoint-specific price override (in asset decimals, e.g., \"0.49\" for $0.49)\nIf set, takes precedence over method-level pricing (price_per_post, etc.)"
    },
    "protection_reason": {
      "type": [
        "string",
        "null"
      ],
      "description": "Reason for protection (shown in 403 response, e.g., \"Data redistribution policy\")"
    },
    "query_params": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/components/schemas/QueryParamDefinition"
      },
      "description": "Query parameter definitions"
    },
    "request_body": {
      "description": "Request body schema (JSON Schema or simplified description)"
    },
    "required_headers": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string"
      },
      "description": "Headers required for this endpoint (beyond publisher defaults)"
    },
    "response": {
      "description": "Response schema (JSON Schema or simplified description)"
    }
  }
}