{
  "tool": {
    "slug": "cost-estimate",
    "title": "Cost Estimate",
    "category": "Token Economy",
    "description": "Estimate model call costs from input and output token counts using a small configurable rate table.",
    "buyerIntent": "Use when an agent needs to choose between a cheap deterministic tool call and another model retry.",
    "tokenValue": "Makes the cost tradeoff explicit before the agent spends tokens.",
    "method": "POST",
    "rawBlueprintSlug": "openai-cost-estimator",
    "priceUSDC": 0.002,
    "latencyTargetMs": 120,
    "status": "live-preview",
    "tags": [
      "pricing",
      "tokens",
      "cost",
      "budget"
    ],
    "requestSchema": {
      "type": "object",
      "required": [
        "inputPricePerMillion",
        "outputPricePerMillion"
      ],
      "properties": {
        "model": {
          "type": "string",
          "default": "custom"
        },
        "inputTokens": {
          "type": "integer",
          "default": 0
        },
        "outputTokens": {
          "type": "integer",
          "default": 0
        },
        "inputPricePerMillion": {
          "type": "number"
        },
        "outputPricePerMillion": {
          "type": "number"
        },
        "rates": {
          "type": "object"
        }
      }
    },
    "responseSchema": {
      "type": "object",
      "properties": {
        "model": {
          "type": "string"
        },
        "inputCost": {
          "type": "number"
        },
        "outputCost": {
          "type": "number"
        },
        "totalCost": {
          "type": "number"
        }
      }
    },
    "sampleRequest": {
      "model": "custom-large-model",
      "inputTokens": 100000,
      "outputTokens": 50000,
      "inputPricePerMillion": 2.5,
      "outputPricePerMillion": 10
    },
    "sampleResponse": {
      "model": "custom-large-model",
      "inputCost": 0.25,
      "outputCost": 0.5,
      "totalCost": 0.75
    },
    "endpoint": "/api/v1/agent-tools/cost-estimate/",
    "absoluteEndpoint": "https://elpa.space/api/v1/agent-tools/cost-estimate/",
    "pageUrl": "https://elpa.space/agent-tools/#cost-estimate",
    "rawBlueprintUrl": "https://elpa.space/raw/openai-cost-estimator",
    "priceLabel": "0.002 USDC"
  },
  "payment": {
    "protocol": "x402",
    "implementation": "x402 v2 exact EVM facilitator with legacy Base USDC transaction-hash fallback",
    "network": "Base",
    "networkCaip2": "eip155:8453",
    "currency": "USDC",
    "tokenContract": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
    "recipientAddress": "0xd9d6ae1d5a2128fea511460fac8e4dea58baf153",
    "paymentHeaders": [
      "PAYMENT-SIGNATURE",
      "X-PAYMENT",
      "x402-tx-hash (legacy)"
    ],
    "challengeHeader": "PAYMENT-REQUIRED",
    "responseHeader": "PAYMENT-RESPONSE",
    "facilitatorEnv": [
      "X402_FACILITATOR_URL",
      "X402_FACILITATOR_AUTHORIZATION"
    ],
    "maxTimeoutSeconds": 120,
    "priceUSDC": 0.002,
    "x402": {
      "x402Version": 2,
      "resource": {
        "url": "https://elpa.space/api/v1/agent-tools/cost-estimate/",
        "description": "Estimate model call costs from input and output token counts using a small configurable rate table.",
        "mimeType": "application/json",
        "serviceName": "ELPA Agent Tools",
        "tags": [
          "pricing",
          "tokens",
          "cost",
          "budget"
        ],
        "iconUrl": "https://elpa.space/logo.svg"
      },
      "accepts": [
        {
          "scheme": "exact",
          "network": "eip155:8453",
          "amount": "2000",
          "asset": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
          "payTo": "0xd9d6ae1d5a2128fea511460fac8e4dea58baf153",
          "maxTimeoutSeconds": 120,
          "extra": {
            "name": "USDC",
            "version": "2",
            "decimals": 6
          }
        }
      ],
      "paymentRequired": {
        "x402Version": 2,
        "error": "PAYMENT-SIGNATURE header is required",
        "resource": {
          "url": "https://elpa.space/api/v1/agent-tools/cost-estimate/",
          "description": "Estimate model call costs from input and output token counts using a small configurable rate table.",
          "mimeType": "application/json",
          "serviceName": "ELPA Agent Tools",
          "tags": [
            "pricing",
            "tokens",
            "cost",
            "budget"
          ],
          "iconUrl": "https://elpa.space/logo.svg"
        },
        "accepts": [
          {
            "scheme": "exact",
            "network": "eip155:8453",
            "amount": "2000",
            "asset": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
            "payTo": "0xd9d6ae1d5a2128fea511460fac8e4dea58baf153",
            "maxTimeoutSeconds": 120,
            "extra": {
              "name": "USDC",
              "version": "2",
              "decimals": 6
            }
          }
        ],
        "extensions": {
          "bazaar": {
            "info": {
              "discoverable": true,
              "category": "Token Economy",
              "tags": [
                "pricing",
                "tokens",
                "cost",
                "budget"
              ],
              "input": {
                "model": "custom-large-model",
                "inputTokens": 100000,
                "outputTokens": 50000,
                "inputPricePerMillion": 2.5,
                "outputPricePerMillion": 10
              },
              "output": {
                "model": "custom-large-model",
                "inputCost": 0.25,
                "outputCost": 0.5,
                "totalCost": 0.75
              }
            },
            "schema": {
              "type": "object",
              "properties": {
                "discoverable": {
                  "type": "boolean"
                },
                "category": {
                  "type": "string"
                },
                "tags": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "input": {
                  "type": "object",
                  "required": [
                    "inputPricePerMillion",
                    "outputPricePerMillion"
                  ],
                  "properties": {
                    "model": {
                      "type": "string",
                      "default": "custom"
                    },
                    "inputTokens": {
                      "type": "integer",
                      "default": 0
                    },
                    "outputTokens": {
                      "type": "integer",
                      "default": 0
                    },
                    "inputPricePerMillion": {
                      "type": "number"
                    },
                    "outputPricePerMillion": {
                      "type": "number"
                    },
                    "rates": {
                      "type": "object"
                    }
                  }
                },
                "output": {
                  "type": "object",
                  "properties": {
                    "model": {
                      "type": "string"
                    },
                    "inputCost": {
                      "type": "number"
                    },
                    "outputCost": {
                      "type": "number"
                    },
                    "totalCost": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "paymentRequiredBase64": "eyJ4NDAyVmVyc2lvbiI6MiwiZXJyb3IiOiJQQVlNRU5ULVNJR05BVFVSRSBoZWFkZXIgaXMgcmVxdWlyZWQiLCJyZXNvdXJjZSI6eyJ1cmwiOiJodHRwczovL2VscGEuc3BhY2UvYXBpL3YxL2FnZW50LXRvb2xzL2Nvc3QtZXN0aW1hdGUvIiwiZGVzY3JpcHRpb24iOiJFc3RpbWF0ZSBtb2RlbCBjYWxsIGNvc3RzIGZyb20gaW5wdXQgYW5kIG91dHB1dCB0b2tlbiBjb3VudHMgdXNpbmcgYSBzbWFsbCBjb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9iamVjdCIsInByb3BlcnRpZXMiOnsiZGlzY292ZXJhYmxlIjp7InR5cGUiOiJib29sZWFuIn0sImNhdGVnb3J5Ijp7InR5cGUiOiJzdHJpbmcifSwidGFncyI6eyJ0eXBlIjoiYXJyYXkiLCJpdGVtcyI6eyJ0eXBlIjoic3RyaW5nIn19LCJpbnB1dCI6eyJ0eXBlIjoib2JqZWN0IiwicmVxdWlyZWQiOlsiaW5wdXRQcmljZVBlck1pbGxpb24iLCJvdXRwdXRQcmljZVBlck1pbGxpb24iXSwicHJvcGVydGllcyI6eyJtb2RlbCI6eyJ0eXBlIjoic3RyaW5nIiwiZGVmYXVsdCI6ImN1c3RvbSJ9LCJpbnB1dFRva2VucyI6eyJ0eXBlIjoiaW50ZWdlciIsImRlZmF1bHQiOjB9LCJvdXRwdXRUb2tlbnMiOnsidHlwZSI6ImludGVnZXIiLCJkZWZhdWx0IjowfSwiaW5wdXRQcmljZVBlck1pbGxpb24iOnsidHlwZSI6Im51bWJlciJ9LCJvdXRwdXRQcmljZVBlck1pbGxpb24iOnsidHlwZSI6Im51bWJlciJ9LCJyYXRlcyI6eyJ0eXBlIjoib2JqZWN0In19fSwib3V0cHV0Ijp7InR5cGUiOiJvYmplY3QiLCJwcm9wZXJ0aWVzIjp7Im1vZGVsIjp7InR5cGUiOiJzdHJpbmcifSwiaW5wdXRDb3N0Ijp7InR5cGUiOiJudW1iZXIifSwib3V0cHV0Q29zdCI6eyJ0eXBlIjoibnVtYmVyIn0sInRvdGFsQ29zdCI6eyJ0eXBlIjoibnVtYmVyIn19fX19fX19",
      "facilitator": {
        "url": "https://api.cdp.coinbase.com/platform/v2/x402",
        "verify": "/verify",
        "settle": "/settle"
      },
      "legacy": {
        "enabled": true,
        "header": "x402-tx-hash",
        "note": "Legacy Base USDC transaction-hash receipts remain accepted for manual testing, but PAYMENT-SIGNATURE is the primary x402 path."
      }
    }
  }
}