{"openapi":"3.1.0","info":{"title":"Claude Watermark Agent API","version":"1.0.0","description":"OAuth-authenticated, prepaid credit API. Authentication instructions at /auth.md."},"servers":[{"url":"https://claudewatermark.xyz"}],"security":[{"oauth":["mcp:rewrite"]}],"components":{"securitySchemes":{"oauth":{"type":"oauth2","flows":{"authorizationCode":{"authorizationUrl":"https://claudewatermark.xyz/api/auth/oauth2/authorize","tokenUrl":"https://claudewatermark.xyz/api/auth/oauth2/token","scopes":{"mcp:rewrite":"Read credit balance and rewrite text using account credits"}}}}}},"paths":{"/api/cli/account":{"get":{"operationId":"getAccount","summary":"Get account credit balance","responses":{"200":{"description":"Account balance","content":{"application/json":{"schema":{"type":"object","required":["status","credits"],"properties":{"status":{"const":"authenticated"},"credits":{"type":"number"}}}}}},"401":{"description":"Missing or invalid access token"},"403":{"description":"Insufficient scope"}}}},"/api/cli/rewrite":{"post":{"operationId":"rewriteText","summary":"Rewrite text using account credits","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":1000000},"options":{"default":{},"type":"object","properties":{"replaceEmDashes":{"type":"boolean"},"normalizeQuotes":{"type":"boolean"},"strength":{"type":"string","enum":["light","standard","heavy"]},"tone":{"type":"string","enum":["neutral","academic","casual","professional"]},"preserveCitations":{"type":"boolean"}}}},"required":["text"]}}}},"responses":{"200":{"description":"Rewritten text and credits spent/remaining","content":{"application/json":{"schema":{"type":"object","required":["status","text","creditsSpent","creditsRemaining"],"properties":{"status":{"const":"success"},"text":{"type":"string"},"creditsSpent":{"type":"number"},"creditsRemaining":{"type":"number"}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing or invalid access token"},"402":{"description":"Insufficient credits; response contains required, available, shortfall and topUpUrl"},"403":{"description":"Insufficient scope"},"413":{"description":"Word limit exceeded"},"429":{"description":"Hourly limit exceeded"},"default":{"description":"Rewrite provider failure; no credits charged"}}}}}}