Platform Architecture & Capabilities

Engineered for Production Scale

Eliminate LLM downtime, protect unit economics with guaranteed margin floors, and power your software teams with unified multi-model intelligence.

End-to-End Execution Flow

How Codque Orchestrates Every Request

Sub-20ms gateway routing overhead with transactional guarantees.

01. INGESTION

Client Ingestion

Requests originate from IDE sidecars, the `codq` CLI, or standard OpenAI-compatible SDKs.

02. QUOTA & CIR-BREAK

Auth & Quota Lock

Validates API key scopes and IP allowlist. Atomically reserves target credits and checks circuit health.

03. SMART ROUTING

Multi-Factor Scoring

Evaluates provider latency, token costs, reliability, and enforces customer margin floor (≥40%).

04. DISPATCH & SETTLE

Execution & Settle

Streams LLM response to client. On success, commits credit reservation; on provider failure, releases it.

Enterprise Capabilities in Detail

Everything required to run mission-critical AI pair programming and LLM pipelines at scale.

Routing Engine

Intelligent Dynamic Routing

Task classification shifts payloads dynamically to optimal or fallback models to guarantee cost compliance and a constant ≥40% gross margin floor.

  • Multi-dimensional weighted scoring: quality, cost, latency, reliability, and context match
  • Automatic fallback cascade with max 2 retries on upstream provider 5xx/429 errors
  • Real-time circuit health tracking with automatic traffic shifting
  • Configurable customer margin floor enforcement per tier and route
Billing Engine

Transactional Subscription Credits

Atomic billing-cycle credit reservations prevent race conditions and protect a shared organization subscription pool across all developer API keys.

  • Monthly billing periods synchronize precisely with actual renewal timestamps
  • Failed upstream attempts release reservations immediately with zero net deduction
  • Shared organization pools support granular per-key quotas and member attribution
  • Non-expiring prepaid credits provide seamless overflow capacity during traffic spikes
Reliability

Stateless Resilient Failover

Database-backed circuit breakers monitor upstream model reliability in real-time, dynamically isolating degraded providers without dropped requests.

  • Persistent circuit breaker state across container restarts and horizontal scaling
  • Configurable exponential cooldown with automatic half-open health probe checks
  • Sub-millisecond route switching when upstream latency or error thresholds breach
  • Graceful fallback degradation down to localized or secondary provider pools
Orchestration

Multi-Agent Coding Execution

Deploy concurrent agents to read, plan, synthesize, and verify complex multi-file codebases in parallel, dramatically shortening completion cycles.

  • Simultaneous multi-file generation with syntactic coherence and AST awareness
  • Automated test suite validation executes in isolated sandboxes before presentation
  • Native CLI (codq) and editor sidecar integration for VS Code and JetBrains IDEs
  • Shared session context allows teammates to inspect and review agent trajectories
Security & Governance

Enterprise Key Scoping & Compliance

Enterprise-grade credential controls with granular permissions, IP CIDR allowlists, domain referrer validation, and strict Zero Data Retention.

  • Strict Zero Data Retention (ZDR) policy: proprietary code is never used for LLM training
  • Per-key permission scoping, IP CIDR allowlisting, and referrer origin validation
  • Full compliance with India's DPDP Act, 2023 & Information Technology Act, 2000
  • Tamper-evident audit logging for all authentication, quota, and billing events
Observability

Real-Time Telemetry & Margin Tracking

Granular visibility into token accounting, latency distributions, model utilization trends, and customer-level financial metrics in real-time.

  • Accurate prompt and completion token accounting per invocation and per developer
  • P50, P90, and P99 latency percentiles tracked across all supported provider endpoints
  • Instant visibility into realized gross margin percentages and effective credit costs
  • Exportable JSON and CSV telemetry logs for external SIEM and data warehouse integration

Direct Provider APIs vs. Codque AI Gateway

Why forward-thinking engineering teams standardize on Codque rather than point integrations.

Evaluation MetricDirect LLM Provider APIsCodque Gateway Platform
Provider Outages & 5xx SpikesHard user-facing error; requires custom app retry logicAutomatic stateless failover to backup model chain
Cost Control & MarginsUnpredictable token bills; negative margins on complex promptsGuaranteed ≥40% margin floor enforcement at runtime
Team Credit PoolsSeparate credit card charges or unmanaged raw API keysUnified subscription credit pool with per-developer limits
Source Code PrivacyDependent on individual vendor consumer termsStrict Zero Data Retention (ZDR) and DPDP Act compliance

Ready to Upgrade Your AI Engineering Stack?

Get started with your team in minutes. Simple integration, transparent credit quotas, and production reliability.