{
	"info": {
		"description": "Semantic search API for Telegram. Search across 1M channels, 150K chats, and 100K bots using hybrid search (embedding similarity + BM25 keyword matches).",
		"title": "Semagram",
		"version": "0.1.0",
		"x-guidance": "Use POST /api/agent/search for semantic search across Telegram channels, groups, and bots. Pass query param 'q' with your search text and optional 'limit' for max results (default 100, max 1000). Requires x402 payment. Price scales with limit: 0.01 USDC per 100 results."
	},
	"openapi": "3.1.0",
	"paths": {
		"/api/agent/search": {
			"post": {
				"operationId": "search",
				"parameters": [
					{
						"description": "Semantic search query",
						"in": "query",
						"name": "q",
						"required": true,
						"schema": {
							"type": "string"
						}
					},
					{
						"description": "Maximum number of results. Price scales with limit (ceil(limit/100) * base price).",
						"in": "query",
						"name": "limit",
						"required": false,
						"schema": {
							"default": 100,
							"maximum": 1000,
							"minimum": 1,
							"type": "integer"
						}
					},
					{
						"description": "Language filter (ISO 639-1 code, e.g. \"en\", \"ru\")",
						"in": "query",
						"name": "lang",
						"required": false,
						"schema": {
							"type": "string"
						}
					},
					{
						"description": "Entity type filter (\"channel\", \"group\", or \"bot\")",
						"in": "query",
						"name": "kind",
						"required": false,
						"schema": {
							"enum": [
								"channel",
								"group",
								"bot"
							],
							"type": "string"
						}
					},
					{
						"description": "Minimum subscriber/member count",
						"in": "query",
						"name": "min_users",
						"required": false,
						"schema": {
							"type": "integer"
						}
					},
					{
						"description": "Maximum subscriber/member count",
						"in": "query",
						"name": "max_users",
						"required": false,
						"schema": {
							"type": "integer"
						}
					}
				],
				"responses": {
					"200": {
						"content": {
							"application/json": {
								"schema": {
									"items": {
										"properties": {
											"avatar_url": {
												"type": "string"
											},
											"bio": {
												"type": "string"
											},
											"description": {
												"type": "string"
											},
											"kind": {
												"type": "string"
											},
											"name": {
												"type": "string"
											},
											"user_count": {
												"type": "integer"
											},
											"username": {
												"type": "string"
											},
											"uuid": {
												"type": "string"
											}
										},
										"required": [
											"uuid",
											"username"
										],
										"type": "object"
									},
									"type": "array"
								}
							}
						},
						"description": "Successful response"
					},
					"402": {
						"description": "Payment Required"
					},
					"502": {
						"description": "Upstream search service unavailable"
					}
				},
				"summary": "Semantic search across Telegram channels, groups, and bots",
				"tags": [
					"Search"
				],
				"x-payment-info": {
					"basePrice": "0.01",
					"pricingMode": "dynamic",
					"pricingRule": "ceil(limit / 100) * basePrice",
					"protocols": [
						"x402",
						"mpp"
					]
				}
			}
		}
	},
	"x-discovery": {
		"ownershipProofs": []
	}
}
