Cosen 0.2 is now available →

Control your AI surface area

An enterprise-grade, local-first gateway. Point any OpenAI-compatible or Anthropic model at it, and every call is automatically priced, traced, and scanned.

Get Started View Source
Cosen - AI Cost, Observability, Security - LLM-agnostic cost, traces, and security. Self-host it. | Product Hunt

Your Application

  • Python / Node SDKs
  • CLI Agents (Aider, Codex)
  • Cursor Editor (MCP)
/v1/chat

Cosen Gateway

  • Security Scanners
  • Budget Enforcement
  • SQLite Trace Store
Proxy

LLM Providers

  • OpenAI / Anthropic
  • Local (Ollama, vLLM)
  • OpenRouter / Groq

One suite, three critical jobs

Stop running disconnected tools. Cosen puts cost, observability, and security on the exact same request path.

On-Path Security

Deterministic scanners intercept requests and responses. Block or redact secrets, PII, prompt injections, and system-prompt leaks instantly—without requiring an extra LLM-as-judge.

10:42:01[SCAN]Analyzing input payload...
10:42:01[BLOCK]Prompt injection detected: "Ignore previous instructions..."
10:42:01[403]Request terminated before reaching upstream.

Cost & Budgets

Track token usage × model price, tagged by feature, project, and user. Set daily kill-switches to prevent runaway agents from burning your budget.

support-bot$12.40 / $20

Observability without the SaaS

Zero-instrumentation tracing. View model mix, latency, and spend by feature in a local web dashboard or via CLI reports. Data lives in a local SQLite database—no cloud account required.

FeatureModelStatusCost
invoice-extractclaude-3.5ok$0.014
support-botgpt-4o-miniblocked$0.000
rag-faqllama3.2ok$0.000

Drop-in replacement

Cosen speaks native OpenAI and Anthropic protocols. Just change your Base URL and add custom attribution headers.

app.py
from openai import OpenAI # 1. Point SDK at local Cosen gateway client = OpenAI( base_url="http://127.0.0.1:8080/v1", api_key="not-needed-in-mock" ) # 2. Tag requests for cost tracking response = client.chat.completions.create( model="gpt-4o-mini", messages=[{"role": "user", "content": "hello"}], extra_headers={ "X-COS-Feature": "support-bot", "X-COS-Project": "acme-corp" } )
View CLI Agent Integrations →

Featured on Product Hunt

Support Cosen on Product Hunt — upvote, comment, and share the launch.

Cosen - AI Cost, Observability, Security - LLM-agnostic cost, traces, and security. Self-host it. | Product Hunt
Cosen - AI Cost, Observability, Security

Cosen - AI Cost, Observability, Security

LLM-agnostic cost, traces, and security. Self-host it.

Check it out on Product Hunt →