{
  "openapi": "3.1.0",
  "info": {
    "title": "Watt",
    "version": "1",
    "summary": "OpenAI-compatible embeddings, chat and decisions on Area21's own fleet.",
    "description": "Pay with an API key (Bearer), or per call with x402 (USDC on Base): a request without a key is answered 402 with the price; repeat it with the signed payment in X-PAYMENT (v1) or PAYMENT-SIGNATURE (v2).",
    "x-guidance": "Send OpenAI-shaped JSON. Without an API key a paid POST answers 402 with x402 payment requirements (USDC on Base, scheme exact); repeat the identical request with the signed payment in X-PAYMENT (v1) or PAYMENT-SIGNATURE (v2). The price is the per-call amount in /v1/pricing, at least $0.001. An x402 call is $0.002 when the request includes images, $0.001 for text-only. Chat is not production-grade yet and is not listed in /.well-known/x402. Embeddings take text and images in one 2048-dimension space."
  },
  "servers": [
    {
      "url": "https://watt.area21.io"
    }
  ],
  "security": [
    {
      "bearer": []
    },
    {}
  ],
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "A Watt API key, watt_\u2026"
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string"
              },
              "type": {
                "type": "string"
              },
              "param": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "code": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          }
        }
      },
      "EmbeddingInput": {
        "description": "A string, a list of items; an item is a string, {text, image}, or {content: [OpenAI content parts]} with image_url as a data URL, base64 or public https URL.",
        "oneOf": [
          {
            "type": "string"
          },
          {
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "type": "string"
                },
                {
                  "type": "object",
                  "properties": {
                    "text": {
                      "type": "string"
                    },
                    "image": {
                      "type": "string"
                    }
                  }
                },
                {
                  "type": "object",
                  "properties": {
                    "content": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              ]
            }
          }
        ]
      },
      "EmbeddingsRequest": {
        "type": "object",
        "required": [
          "input"
        ],
        "properties": {
          "model": {
            "type": "string",
            "default": "qwen3-vl-embedding-2b"
          },
          "input": {
            "$ref": "#/components/schemas/EmbeddingInput"
          },
          "dimensions": {
            "type": "integer",
            "minimum": 64,
            "maximum": 2048
          },
          "encoding_format": {
            "type": "string",
            "enum": [
              "float",
              "base64"
            ]
          },
          "instruction": {
            "type": "string",
            "description": "What the vectors are for (the model is instruction-aware)."
          },
          "max_pixels": {
            "type": "integer",
            "minimum": 4096,
            "maximum": 1843200
          },
          "user": {
            "type": "string"
          }
        }
      },
      "EmbeddingsResponse": {
        "type": "object",
        "properties": {
          "object": {
            "const": "list"
          },
          "model": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "object": {
                  "const": "embedding"
                },
                "index": {
                  "type": "integer"
                },
                "embedding": {
                  "oneOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "number"
                      }
                    },
                    {
                      "type": "string"
                    }
                  ]
                }
              }
            }
          },
          "usage": {
            "type": "object",
            "properties": {
              "prompt_tokens": {
                "type": "integer"
              },
              "total_tokens": {
                "type": "integer"
              }
            }
          }
        }
      },
      "ChatRequest": {
        "type": "object",
        "required": [
          "messages"
        ],
        "properties": {
          "model": {
            "type": "string",
            "enum": [
              "qwen3.5-4b",
              "qwen3-1.7b",
              "qwen3-0.6b"
            ]
          },
          "messages": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "role",
                "content"
              ],
              "properties": {
                "role": {
                  "type": "string",
                  "enum": [
                    "system",
                    "developer",
                    "user",
                    "assistant"
                  ]
                },
                "content": {
                  "oneOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  ]
                }
              }
            }
          },
          "max_tokens": {
            "type": "integer"
          },
          "max_completion_tokens": {
            "type": "integer"
          },
          "temperature": {
            "type": "number"
          },
          "top_p": {
            "type": "number"
          },
          "stop": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ]
          },
          "stream": {
            "type": "boolean"
          }
        }
      },
      "ChatResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "object": {
            "const": "chat.completion"
          },
          "model": {
            "type": "string"
          },
          "choices": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "index": {
                  "type": "integer"
                },
                "message": {
                  "type": "object",
                  "properties": {
                    "role": {
                      "type": "string"
                    },
                    "content": {
                      "type": "string"
                    }
                  }
                },
                "finish_reason": {
                  "type": "string"
                }
              }
            }
          },
          "usage": {
            "type": "object",
            "properties": {
              "prompt_tokens": {
                "type": "integer"
              },
              "completion_tokens": {
                "type": "integer"
              },
              "total_tokens": {
                "type": "integer"
              }
            }
          }
        }
      },
      "DecisionsRequest": {
        "type": "object",
        "required": [
          "input",
          "questions"
        ],
        "properties": {
          "model": {
            "type": "string",
            "description": "qwen3.5-4b, qwen3-1.7b or qwen3-0.6b (the chat models' ids); left out, the best one ready."
          },
          "input": {
            "description": "The text the questions are about: a string or OpenAI input items (text only).",
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array"
              }
            ]
          },
          "questions": {
            "type": "array",
            "maxItems": 200,
            "items": {
              "type": "object",
              "required": [
                "type",
                "name",
                "instructions"
              ],
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "predicate",
                    "choice",
                    "score"
                  ]
                },
                "name": {
                  "type": "string"
                },
                "instructions": {
                  "type": "string"
                },
                "choices": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "value": {
                        "type": [
                          "string",
                          "boolean"
                        ]
                      },
                      "description": {
                        "type": "string"
                      }
                    }
                  }
                },
                "levels": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "label": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "DecisionsResponse": {
        "type": "object",
        "properties": {
          "model": {
            "type": "string"
          },
          "answers": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "probability": {
                  "type": "number",
                  "description": "predicate: P(yes)"
                },
                "choice": {
                  "type": [
                    "string",
                    "boolean"
                  ]
                },
                "confidence": {
                  "type": "number"
                }
              }
            }
          }
        }
      }
    },
    "responses": {
      "PaymentRequired": {
        "description": "No key: pay per call with x402. The body is x402 v1 PaymentRequirementsResponse; the PAYMENT-REQUIRED header carries the v2 PaymentRequired, base64.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "x402Version": {
                  "type": "integer"
                },
                "error": {
                  "type": "string"
                },
                "accepts": {
                  "type": "array",
                  "items": {
                    "type": "object"
                  }
                }
              }
            }
          }
        }
      },
      "Busy": {
        "description": "Over the key's limits or the fleet is full: retry after Retry-After seconds.",
        "headers": {
          "Retry-After": {
            "schema": {
              "type": "integer"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Error": {
        "description": "OpenAI's error shape.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    }
  },
  "paths": {
    "/v1/embeddings": {
      "post": {
        "operationId": "createEmbeddings",
        "summary": "Embed text, images, or text with an image, in one 2048-dimension space.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmbeddingsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The vectors.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmbeddingsResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "price": {
            "mode": "dynamic",
            "currency": "USD",
            "min": "0.001",
            "max": "0.05"
          }
        }
      }
    },
    "/v1/chat/completions": {
      "post": {
        "operationId": "createChatCompletion",
        "summary": "Chat with a small Qwen model (OpenAI's request; stream supported). Not production-grade yet.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChatRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The completion, or an SSE stream when stream is true.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatResponse"
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "price": {
            "mode": "dynamic",
            "currency": "USD",
            "min": "0.001",
            "max": "0.5"
          }
        }
      }
    },
    "/v1/decisions": {
      "post": {
        "operationId": "createDecisions",
        "summary": "Answer typed questions (yes/no, choice, score) about a text with calibrated probabilities.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DecisionsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "One answer a question, in order.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DecisionsResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "price": {
            "mode": "dynamic",
            "currency": "USD",
            "min": "0.001",
            "max": "0.05"
          }
        }
      }
    },
    "/v1/systemone": {
      "post": {
        "operationId": "createSystemone",
        "summary": "Decisions in OpenJev's shape. Same price as /v1/decisions.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The answers."
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          }
        },
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "price": {
            "mode": "dynamic",
            "currency": "USD",
            "min": "0.001",
            "max": "0.05"
          }
        }
      }
    },
    "/v1/moderations": {
      "post": {
        "operationId": "createModeration",
        "summary": "Screen text against OpenAI's 13 moderation categories. Up to 32 texts per call. Text only.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["input"],
                "properties": {
                  "model": {
                    "type": "string",
                    "description": "qwen3.5-4b, qwen3-1.7b, or qwen3-0.6b. Omitted, the best one ready."
                  },
                  "input": {
                    "description": "A string, or a list of up to 32 strings. An image is refused.",
                    "oneOf": [
                      { "type": "string" },
                      {
                        "type": "array",
                        "maxItems": 32,
                        "items": { "type": "string" }
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "One result per input, in order. flagged when any category's probability is at least 0.5.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": { "type": "string" },
                    "model": { "type": "string" },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "flagged": { "type": "boolean" },
                          "categories": { "type": "object" },
                          "category_scores": { "type": "object" }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": { "$ref": "#/components/responses/Error" },
          "401": { "$ref": "#/components/responses/Error" },
          "402": { "$ref": "#/components/responses/PaymentRequired" },
          "413": {
            "description": "Body over 8 MiB.",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Error" }
              }
            }
          },
          "429": { "$ref": "#/components/responses/Busy" },
          "503": { "$ref": "#/components/responses/Error" }
        },
        "x-payment-info": {
          "protocols": ["x402"],
          "price": {
            "mode": "dynamic",
            "currency": "USD",
            "min": "0.001",
            "max": "0.05"
          }
        }
      }
    },
    "/v1/models": {
      "get": {
        "operationId": "listModels",
        "summary": "The models served now, with pricing and context_length.",
        "responses": {
          "200": {
            "description": "OpenAI's model list.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/v1/provider/models": {
      "get": {
        "operationId": "providerModels",
        "summary": "The offer in OpenRouter's provider schema 2.4, with live capacity. Open.",
        "security": [
          {}
        ],
        "responses": {
          "200": {
            "description": "The provider model list.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  }
}
