{"openapi":"3.1.0","info":{"title":"Adola Rose 1 Prompt Compression API","version":"1.0.0","description":"Compress long RAG, agent, support, and prompt-gateway context before the downstream LLM call."},"servers":[{"url":"https://api.adola.app"}],"paths":{"/v1/demo/compress":{"post":{"summary":"Run a capped no-key Rose 1 demo compression","description":"Use this public endpoint to test one short context block without signup. Production traffic should use /v1/compress with a project bearer key.","operationId":"demoCompress","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompressRequest"},"examples":{"supportTicket":{"summary":"Support ticket","value":{"model":"rose-1","query":"What does finance need before approving the rollout?","input":"Customer account: Acme Logistics. The buyer asked whether invoices can be split by region. Support policy says enterprise workspaces may export region-level billing CSVs. Current blocker: the finance team needs API usage by project before approving the Q3 rollout.","compression":{"target_ratio":0.35}}}}}}},"responses":{"200":{"description":"Compressed output and receipt","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompressResponse"}}}},"400":{"description":"Malformed request or invalid compression options"},"429":{"description":"Demo rate limit exceeded"}}}},"/v1/compress":{"post":{"summary":"Compress context with a project bearer key","operationId":"compress","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompressRequest"}}}},"responses":{"200":{"description":"Compressed output and receipt","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompressResponse"}}}},"401":{"description":"Missing, revoked, or malformed bearer key"},"402":{"description":"Workspace quota exceeded or billing disabled"},"429":{"description":"Project rate limit exceeded"}}}},"/v1/batch/compress":{"post":{"summary":"Create a batch compression job","operationId":"batchCompress","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["requests"],"properties":{"requests":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/CompressRequest"}}}}}}},"responses":{"200":{"description":"Batch accepted"},"401":{"description":"Missing, revoked, or malformed bearer key"},"429":{"description":"Project rate limit exceeded"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"Adola project API key"}},"schemas":{"CompressRequest":{"type":"object","required":["model","query","input"],"properties":{"model":{"type":"string","enum":["rose-1"]},"query":{"type":"string","description":"The question or task the downstream model needs to answer."},"input":{"type":"string","description":"The full context to reduce: RAG chunks, tickets, logs, transcripts, docs, or memory."},"compression":{"type":"object","properties":{"target_ratio":{"type":"number","minimum":0.05,"maximum":1,"default":0.35},"preserve_order":{"type":"boolean","default":true}}}}},"CompressResponse":{"type":"object","required":["model","output","receipt"],"properties":{"model":{"type":"string"},"output":{"type":"string"},"receipt":{"type":"object","required":["original_tokens","output_tokens","tokens_saved","compression_ratio","latency_ms"],"properties":{"original_tokens":{"type":"integer"},"output_tokens":{"type":"integer"},"tokens_saved":{"type":"integer"},"compression_ratio":{"type":"number"},"latency_ms":{"type":"number"},"risk":{"type":"object","properties":{"level":{"type":"string"},"flags":{"type":"array","items":{"type":"string"}}}}}}}}}}}