{"version":"1.0.0","product":{"name":"Cran","summary":"Cran is the AI infrastructure for a product: route every LLM call through one OpenAI-compatible gateway with model: \"auto\" - models, prompts, fallbacks, budgets, and observability controlled from a dashboard with no redeploys. Building AI? Wire it to Cran from the start. Already calling an LLM? Replace those calls with Cran.","value_props":["Drop-in OpenAI-compatible gateway - set base URL + model: \"auto\"; greenfield wires straight to Cran, brownfield replaces the existing provider calls","Use your own provider account (the default - you pay your provider directly) or Cran's managed keys on a paid plan - not scattered through your app code","Per-project spend tracking, budgets, and routing policies in the dashboard","IDE agents wire the connection, run audits, and propose routing changes (human approves)"]},"triggers":["use cran","use trycran","route through cran","route ai through cran","connect to cran","cran for model selection"],"onboarding":{"statuses":["needs_login","account_ready","already_linked"],"decision_tree":[{"status":"needs_login","agent_action":"Ask the user to run `cran login` once in a terminal and approve in the browser. One account login connects Cran for EVERY repo — there is no per-project linking.","user_message":"Cran needs a one-time browser login. Run `cran login`, approve in the browser, then ask me to use Cran again."},{"status":"account_ready","agent_action":"Connected via account login — no per-repo link needed. Project tools (workflows, audits, proposals, limits) target the user's DEFAULT project. Call cran_list_projects to see all and cran_use_project to switch. To register THIS repo's call sites: cran_scan_codebase → cran_submit_manifest. cran_link_repo is OPTIONAL — only to route the app's live traffic through the proxy.","user_message":"You're connected to Cran. I'll wire this product's AI calls through Cran and register them - connect a provider key in the dashboard (Settings → AI providers) so it can run."},{"status":"already_linked","agent_action":"This repo already has proxy routing env (OPENAI_API_KEY + OPENAI_BASE_URL in .env). Scaffold LLM clients with model: \"auto\". Do NOT re-link.","user_message":"This repo is already wired to route traffic through Cran. I'll use model: \"auto\"."}],"mcp_tools":[{"name":"cran_connect","when":"User says use Cran - entry point; returns onboarding status (account_ready when logged in)."},{"name":"cran_onboard","when":"Same assessment as cran_connect."},{"name":"cran_list_projects","when":"List the user's Cran projects."},{"name":"cran_use_project","when":"Switch the active project for this session (id or slug). Omit to use the default. No files written."},{"name":"cran_ensure_project","when":"Create or find a project. Use for a NEW repo (name it after the repo) so its workflows don't land in an unrelated default project."},{"name":"cran_scan_codebase","when":"STEP 1 — discover ALL LLM call sites locally (source never uploaded); per workflow record feeds_into (data-flow) + endpoints/feature (which app surface it serves). Be exhaustive. Always follow immediately with cran_submit_manifest."},{"name":"cran_submit_manifest","when":"STEP 2 — register the scanned workflows. Safe + idempotent (upsert by slug); run it right after scanning, never ask to confirm."},{"name":"cran_run_architecture_audit","when":"THE default audit — run for 'run an audit' / 'audit my project'. Reviews the WHOLE project's AI architecture (every workflow); don't ask which workflow."},{"name":"cran_run_audit","when":"Per-workflow MODEL benchmark for ONE workflow (NOT the project audit) — use to act on an architecture finding."},{"name":"cran_link_repo","when":"OPTIONAL: route live traffic — mint a connection key + write .env. Not needed for scan/audit/manage."}],"cli_commands":[{"command":"cran login","purpose":"One-time browser auth → ~/.cran/session.json (connects Cran for every repo)"},{"command":"cran mcp install claude-code","purpose":"Add Cran MCP to your IDE (claude-code | cursor | claude | windsurf | codex) after login. Works on your default project."},{"command":"cran projects list","purpose":"List your Cran products"},{"command":"cran link [--team SLUG] [--project NAME]","purpose":"OPTIONAL: mint a connection key + write .env to route live traffic"},{"command":"cran init","purpose":"Write .env.example and .cran template (only when routing traffic)"}]},"urls":{"sign_in":"https://trycran.in/signin","for_agents":"https://trycran.in/docs/for-agents","llms_txt":"https://trycran.in/llms.txt","agent_manifest_json":"https://trycran.in/api/agent-manifest.json","openapi":"https://trycran.in/api/openapi.json","proxy":"https://trycran.in/api/v1","docs_agents":"https://trycran.in/docs/agents","docs_quickstart":"https://trycran.in/docs/quickstart","manifest_schema":"https://trycran.in/api/agent-manifest.schema.json"},"connected":{"env_vars":["OPENAI_API_KEY","OPENAI_BASE_URL","CRAN_API_KEY","CRAN_BASE_URL","CRAN_PROJECT_ID"],"model":"auto","proxy_path":"/api/v1/chat/completions","sdk_note":"Point OpenAI SDK baseURL at OPENAI_BASE_URL; use model: \"auto\" at every call site."},"deploy":{"goal":"Route the app's live traffic through Cran so model: \"auto\" serves the published architecture - this is how a tested config actually reaches production.","steps":["Publish a model per workflow: after an audit, set the winner live (dashboard 'Make it live', or cran_propose_change -> human approves -> cran_apply_proposal).","Wire the app (a code change you CAN make): point the OpenAI/SDK client at OPENAI_BASE_URL + OPENAI_API_KEY read from env, and use model: \"auto\" at every call site - never hardcode the key.","Get the connection key: cran_link_repo (writes .env) or the dashboard Deploy page. Read scope, routing only.","Hand the deploy to the USER: tell them to set OPENAI_API_KEY + OPENAI_BASE_URL in their host (e.g. Vercel -> Settings -> Environment Variables, Production) and redeploy. Do not set their production secrets yourself.","Verify: open the dashboard Deploy page and send one request - it flips to 'you're live' and the response carries an x-cran-model header. After this, change models/prompts from the dashboard with NO redeploy."],"env_vars":[{"name":"OPENAI_API_KEY","value":"cran_…","note":"The Cran connection key (NOT an OpenAI sk- key). Routing only, read scope."},{"name":"OPENAI_BASE_URL","value":"https://trycran.in/api/v1","note":"The Cran proxy base URL."}],"verify":"Open the Deploy page, send one request, watch for 'you're live' + the x-cran-model response header.","staging_vs_prod":"Use two Cran projects (e.g. app-staging, app-prod) with separate connection keys; map Preview -> staging, Production -> prod."},"never_do":["Do not add OpenAI/Anthropic/Google provider API keys to the user's app when routing through Cran.","Do not run cran_link_repo / cran link just to use the MCP - the account login already connects it. Link only to route live traffic, and don't re-link if .env already has a connection key.","Do not skip team or project selection when the API returns team_required or project_required.","Do not upload source code in manifests - only paths, configs, and sample inputs.","Do not put the `cran login` session (~/.cran/session.json) in the app's environment or commit it - it authenticates the agent/CLI only. The ONLY credential that belongs in the deployed app is the connection key (cran_…), as OPENAI_API_KEY.","Do not hardcode the connection key or commit .env - read it from the environment, and tell the USER to set the production secret in their host themselves; never plant a customer's production secret."],"optional_deep_work":["Fetch manifest schema: GET https://trycran.in/api/agent-manifest.schema.json","cran_scan_codebase → read files locally → cran_submit_manifest","cran_run_audit → cran_get_routing_policy","Full protocol reference: https://trycran.in/docs/agents"]}