{
  "openapi": "3.1.0",
  "info": {
    "title": "Fuse",
    "contact": {
      "name": "Fuse by entangleit",
      "url": "https://entangleit.com/fuse/pay"
    },
    "version": "1.0.0",
    "description": "Pay-per-call LLM inference for agents. No account, no API key: call the OpenAI-compatible endpoint, get an x402 v2 402 challenge, pay and retry. fuse-fast: 500 sats (~$0.001), max 512 output tokens. fuse-smart: 2,500 sats (~$0.005), max 1,024 output tokens. Rail: BSV mainnet (network bsv:mainnet, payTo 1LZnMgySiAPhNLepEC53p5AgHkNiVPXcRs, payload p2pkh-rawtx). Docs: https://entangleit.com/fuse/pay",
    "x-guidance": "POST /fuse/v1/chat/completions with an OpenAI chat-completions body. The 402 response (PAYMENT-REQUIRED header and JSON body) lists accepts[]; pay accepts[0] and resend with the PAYMENT-SIGNATURE header. MCP clients can use the agentpay server (claim_trial + chat tools). See https://entangleit.com/fuse/llms.txt"
  },
  "servers": [
    {
      "url": "https://entangleit.com"
    }
  ],
  "externalDocs": {
    "url": "https://entangleit.com/fuse/pay"
  },
  "x-discovery": {
    "wellKnown": "https://entangleit.com/fuse/.well-known/x402",
    "models": "https://entangleit.com/fuse/v1/models"
  },
  "paths": {
    "/fuse/v1/chat/completions": {
      "post": {
        "operationId": "createChatCompletion",
        "summary": "Chat completion (fuse-fast 500 sats, fuse-smart 2,500 sats), paid per call via x402 v2",
        "description": "OpenAI-compatible chat completion. Price depends on model: fuse-fast 500 sats (~$0.001, max_tokens <= 512), fuse-smart 2,500 sats (~$0.005, max_tokens <= 1024). Unpaid requests receive HTTP 402 with an x402 v2 challenge (scheme exact, network bsv:mainnet, asset BSV, amount in satoshis, payTo 1LZnMgySiAPhNLepEC53p5AgHkNiVPXcRs). Empty completions are not charged.",
        "tags": [
          "inference"
        ],
        "x-payment-info": {
          "protocols": [
            {
              "x402": {
                "version": 2,
                "network": "bsv:mainnet",
                "scheme": "exact",
                "asset": "BSV",
                "payTo": "1LZnMgySiAPhNLepEC53p5AgHkNiVPXcRs"
              }
            }
          ],
          "price": {
            "mode": "dynamic",
            "currency": "USD",
            "min": "0.001",
            "max": "0.005"
          }
        },
        "x-x402": {
          "x402Version": 2,
          "accepts": [
            {
              "model": "fuse-fast",
              "scheme": "exact",
              "network": "bsv:mainnet",
              "asset": "BSV",
              "amount": "500",
              "payTo": "1LZnMgySiAPhNLepEC53p5AgHkNiVPXcRs",
              "maxTokens": 512
            },
            {
              "model": "fuse-smart",
              "scheme": "exact",
              "network": "bsv:mainnet",
              "asset": "BSV",
              "amount": "2500",
              "payTo": "1LZnMgySiAPhNLepEC53p5AgHkNiVPXcRs",
              "maxTokens": 1024
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "model",
                  "messages"
                ],
                "properties": {
                  "model": {
                    "type": "string",
                    "enum": [
                      "fuse-fast",
                      "fuse-smart"
                    ],
                    "default": "fuse-fast"
                  },
                  "messages": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "object",
                      "required": [
                        "role",
                        "content"
                      ],
                      "properties": {
                        "role": {
                          "type": "string",
                          "enum": [
                            "system",
                            "user",
                            "assistant"
                          ]
                        },
                        "content": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "max_tokens": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1024,
                    "description": "fuse-fast caps at 512, fuse-smart at 1024"
                  },
                  "temperature": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 2
                  }
                }
              },
              "example": {
                "model": "fuse-fast",
                "messages": [
                  {
                    "role": "user",
                    "content": "Say hello in five words."
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Completion (OpenAI chat.completion object). PAYMENT-RESPONSE header carries settlement info; X-Fuse-Receipt links a public receipt.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "object": {
                      "type": "string",
                      "const": "chat.completion"
                    },
                    "model": {
                      "type": "string"
                    },
                    "choices": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "index": {
                            "type": "integer"
                          },
                          "message": {
                            "type": "object",
                            "required": [
                              "role",
                              "content"
                            ],
                            "properties": {
                              "role": {
                                "type": "string",
                                "enum": [
                                  "system",
                                  "user",
                                  "assistant"
                                ]
                              },
                              "content": {
                                "type": "string"
                              }
                            }
                          },
                          "finish_reason": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "usage": {
                      "type": "object",
                      "properties": {
                        "prompt_tokens": {
                          "type": "integer"
                        },
                        "completion_tokens": {
                          "type": "integer"
                        },
                        "total_tokens": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. x402 v2 challenge in the PAYMENT-REQUIRED header (base64 JSON) and in the JSON body.",
            "headers": {
              "PAYMENT-REQUIRED": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "x402Version": {
                      "type": "integer",
                      "const": 2
                    },
                    "error": {
                      "type": "string"
                    },
                    "resource": {
                      "type": "object"
                    },
                    "accepts": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}