{"openapi":"3.1.0","info":{"title":"Cran - Audit API","version":"1.0.0","description":"Multi-prompt × multi-model LLM audits with LLM-as-judge grading. Designed for AI agents (Claude Code, Codex, Cursor, ChatGPT custom GPTs) to drive a defensible model-selection decision.","x-llms-txt":"https://trycran.in/llms.txt","x-agent-manifest":"https://trycran.in/api/agent-manifest.json","x-docs":"https://trycran.in/docs/for-agents"},"servers":[{"url":"https://trycran.in"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"cran_<24-byte-base64url>","description":"Cran bearer token (cran_…). User CLI token from cran login, connection token from cran link, or agent token from dashboard."}},"schemas":{"ModelId":{"type":"string","enum":["openai/gpt-5.5","openai/gpt-5.5-pro","openai/gpt-5.4","openai/gpt-5.4-pro","openai/gpt-5.4-mini","openai/gpt-5.4-nano","openai/gpt-5.2","openai/gpt-5.2-pro","openai/gpt-5.1","openai/gpt-5","openai/gpt-5-mini","openai/gpt-5-nano","openai/gpt-5-pro","openai/gpt-4.1","openai/gpt-4.1-mini","openai/gpt-4.1-nano","openai/gpt-4o","openai/gpt-4o-mini","openai/o3","openai/o3-pro","openai/o3-mini","openai/o4-mini","openai/o1","anthropic/claude-fable-5","anthropic/claude-opus-4-8","anthropic/claude-sonnet-5","anthropic/claude-opus-4-7","anthropic/claude-opus-4-6","anthropic/claude-opus-4-5","anthropic/claude-opus-4-1","anthropic/claude-sonnet-4-6","anthropic/claude-sonnet-4-5","anthropic/claude-sonnet-4","anthropic/claude-3-7-sonnet","anthropic/claude-haiku-4-5","anthropic/claude-3-haiku","google/gemini-3.1-pro","google/gemini-3-pro","google/gemini-3.5-flash","google/gemini-3-flash","google/gemini-3.1-flash-lite","google/gemini-2.5-pro","google/gemini-2.5-flash","google/gemini-2.5-flash-lite","google/gemini-2.0-flash","google/gemini-2.0-flash-lite","xai/grok-4","xai/grok-3-mini","groq/llama-3.3-70b-versatile","groq/llama-3.1-8b-instant","mistral/mistral-large-latest","mistral/mistral-small-latest","deepseek/deepseek-chat","deepseek/deepseek-reasoner","together/llama-3.3-70b-instruct-turbo","together/qwen2.5-72b-instruct-turbo","fireworks/llama-v3p3-70b-instruct","fireworks/kimi-k2-instruct","cohere/command-a","azure/gpt-4o","azure/gpt-4o-mini","azure/gpt-4.1","openrouter/auto","openrouter/llama-3.3-70b-instruct","perplexity/sonar-pro","perplexity/sonar","cerebras/llama-3.3-70b","cerebras/gpt-oss-120b","sambanova/llama-3.3-70b","nvidia/llama-3.3-70b-instruct","huggingface/llama-3.3-70b-instruct","hyperbolic/llama-3.3-70b-instruct","novita/llama-3.3-70b-instruct","moonshot/kimi-k2-turbo","moonshot/kimi-k2-thinking","qwen/qwen-max","qwen/qwen-plus","zhipu/glm-4.6","openai/text-embedding-3-small","openai/text-embedding-3-large","google/gemini-embedding","cohere/embed-v4","openai/gpt-image-1","openai/dall-e-3","google/imagen-4"]},"Prompt":{"type":"object","required":["text"],"properties":{"id":{"type":"string","maxLength":120},"text":{"type":"string","minLength":1,"maxLength":20000},"expected":{"type":"string","maxLength":8000}}},"Judgment":{"type":"object","properties":{"score":{"type":"integer","minimum":1,"maximum":5},"rationale":{"type":"string"},"dimensions":{"type":"object","properties":{"correctness":{"type":"integer","minimum":1,"maximum":5},"completeness":{"type":"integer","minimum":1,"maximum":5},"formatting":{"type":"integer","minimum":1,"maximum":5}}}}},"AuditCell":{"type":"object","properties":{"promptId":{"type":"string"},"promptText":{"type":"string"},"expected":{"type":"string"},"modelId":{"$ref":"#/components/schemas/ModelId"},"output":{"type":"string"},"inputTokens":{"type":"integer"},"outputTokens":{"type":"integer"},"latencyMs":{"type":"integer"},"costUsd":{"type":"number"},"error":{"type":"string"},"judgment":{"$ref":"#/components/schemas/Judgment"}}},"AuditSummary":{"type":"object","properties":{"modelId":{"type":"string"},"runs":{"type":"integer"},"failures":{"type":"integer"},"avgScore":{"type":"number"},"avgLatencyMs":{"type":"number"},"p50LatencyMs":{"type":"number"},"p95LatencyMs":{"type":"number"},"totalCostUsd":{"type":"number"},"avgCorrectness":{"type":"number"},"avgCompleteness":{"type":"number"},"avgFormatting":{"type":"number"}}},"Recommendation":{"type":"object","properties":{"primary":{"type":["string","null"]},"fallbacks":{"type":"array","items":{"type":"string"}},"costRoute":{"type":["string","null"]},"reason":{"type":"string"}}},"AuditResult":{"type":"object","properties":{"audit_id":{"type":["string","null"]},"cells":{"type":"array","items":{"$ref":"#/components/schemas/AuditCell"}},"perModel":{"type":"array","items":{"$ref":"#/components/schemas/AuditSummary"}},"recommendation":{"$ref":"#/components/schemas/Recommendation"}}}}},"security":[{"bearerAuth":[]}],"paths":{"/api/audits":{"post":{"summary":"Run a multi-prompt × multi-model audit.","operationId":"runAudit","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["prompts","models"],"properties":{"prompts":{"type":"array","minItems":1,"maxItems":100,"items":{"$ref":"#/components/schemas/Prompt"}},"models":{"type":"array","minItems":1,"maxItems":6,"items":{"$ref":"#/components/schemas/ModelId"}},"system":{"type":"string","maxLength":8000},"judgeModel":{"type":"string"}}}}}},"responses":{"200":{"description":"Audit completed (partial errors are in cells[i].error)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditResult"}}}},"400":{"description":"Validation failed"},"401":{"description":"Missing or invalid bearer token"},"403":{"description":"Token missing required scope"}}},"get":{"summary":"List audits for this token's project (newest first).","operationId":"listAudits","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":50}}],"responses":{"200":{"description":"List of audits","content":{"application/json":{"schema":{"type":"object","properties":{"project_id":{"type":"string"},"audits":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"prompt_count":{"type":"integer"},"model_count":{"type":"integer"},"recommendation":{"$ref":"#/components/schemas/Recommendation"},"started_at":{"type":"string","format":"date-time"},"finished_at":{"type":["string","null"],"format":"date-time"}}}}}}}}}}}},"/api/audits/{id}":{"get":{"summary":"Fetch a saved audit with all cells.","operationId":"getAudit","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Audit + cells"},"403":{"description":"Audit not in this token's project"},"404":{"description":"Audit not found"}}}}}}