{"openapi":"3.1.0","info":{"title":"JT AI Digital Studio API","version":"1.0.0","description":"Public REST API for JT AI Digital Studio. Authenticate with an API key via `Authorization: Bearer jts_<prefix>_<secret>`.","contact":{"name":"JT AI Digital Studio","url":"http://localhost:3000"}},"servers":[{"url":"http://localhost:3000/api/v1","description":"Production"}],"security":[{"bearerAuth":[]}],"paths":{"/me":{"get":{"summary":"Get current caller","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Caller details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/ai/completions":{"post":{"summary":"Create a Claude completion","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompletionRequest"}}}},"responses":{"200":{"description":"Completion result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompletionResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/leads":{"post":{"summary":"Create a lead","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadInput"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadCreated"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"422":{"$ref":"#/components/responses/ValidationError"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"jts"}},"responses":{"Unauthorized":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"ValidationError":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}},"required":["code"]}}},"Me":{"type":"object","properties":{"user":{"type":["object","null"],"properties":{"id":{"type":"string"},"email":{"type":"string","format":"email"},"name":{"type":["string","null"]},"role":{"type":"string"}}},"plan":{"type":"string","enum":["FREE","STARTER","PRO","ENTERPRISE"]}}},"CompletionRequest":{"type":"object","required":["messages"],"properties":{"model":{"type":"string","enum":["primary","fast"]},"system":{"type":"string"},"messages":{"type":"array","items":{"type":"object","required":["role","content"],"properties":{"role":{"type":"string","enum":["user","assistant"]},"content":{"type":"string"}}}},"max_tokens":{"type":"integer","minimum":1,"maximum":4096},"temperature":{"type":"number","minimum":0,"maximum":1}}},"CompletionResponse":{"type":"object","properties":{"model":{"type":"string"},"content":{"type":"string"},"stop_reason":{"type":["string","null"]},"usage":{"type":"object","properties":{"input_tokens":{"type":"integer"},"output_tokens":{"type":"integer"},"cache_read_input_tokens":{"type":"integer"},"cache_creation_input_tokens":{"type":"integer"}}}}},"LeadInput":{"type":"object","required":["name","email","service","message"],"properties":{"name":{"type":"string"},"email":{"type":"string","format":"email"},"phone":{"type":"string"},"company":{"type":"string"},"service":{"type":"string"},"budget":{"type":"string"},"message":{"type":"string"},"locale":{"type":"string"},"source":{"type":"string"},"utm":{"type":"object","properties":{"source":{"type":"string"},"medium":{"type":"string"},"campaign":{"type":"string"}}}}},"LeadCreated":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}}}}}}