Developer DocsstableUpdated 2026-07-06

Overview

Understand the developer integration model for Gateway, direct ingest, metadata, tracing, webhooks and production readiness.

Kadryn connects AI usage to costs, owners, policies and operational evidence.

A good developer integration does four things:

  1. authenticates server-side systems securely;
  2. sends complete usage or runtime traffic;
  3. attaches metadata that makes spend attributable;
  4. preserves traceability for debugging and audit.

Integration modes

Kadryn supports two primary integration modes.

ModeWhat it doesBest for
GatewayYour application sends provider-compatible AI requests through Kadryn.Runtime control, budget caps, policy checks, route visibility and request tracing.
Direct ingestYour application or pipeline sends usage events after provider execution.Offline usage import, backfills, external proxies and observability without proxying.

Use Gateway when Kadryn must evaluate a request before provider execution.

Use Direct ingest when Kadryn only needs to receive usage data after the request happened.

Minimum production contract

Every production integration should provide:

  • a workspace API key;
  • a project identifier;
  • an environment identifier;
  • a feature, workflow or agent identifier;
  • a trace ID or request group ID;
  • idempotency keys for retryable writes;
  • safe error handling;
  • server-side secret storage.

Data flow

A typical integration produces these signals:

  1. authentication identifies the workspace;
  2. metadata identifies the business context;
  3. usage or gateway events record provider, model, tokens, cost, latency and status;
  4. Logs & Traces expose request-level debugging;
  5. Costs and Guardrails use the normalized records;
  6. Alerts, reports and webhooks notify downstream systems.

What to verify first

Before rolling out production traffic, verify that:

  • a test request appears in Developers → Logs & Traces;
  • the request has the expected project and environment;
  • cost appears in the right period;
  • failures include enough IDs for debugging;
  • no secret is visible in frontend code or logs;
  • retries do not create duplicate usage.

Start with a single low-risk service.

Send traffic from one environment, such as staging, then verify:

  • authentication;
  • route readiness;
  • metadata quality;
  • trace search;
  • cost normalization;
  • error handling;
  • idempotency behavior.

Only then expand to production and additional services.