Overview

One API for routing, security, and tracing.

Keep the OpenAI-compatible chat completions request format. LineMod applies routing and security policies and records a trace for each request.

Pay with platform credits or use your own provider keys (BYOK).
POST /v1/chat/completionsExample
{
  "model": "auto:balanced",
  "messages": [
    { "role": "user", "content": "Summarize this incident log." }
  ]
}
Selected modelclaude-sonnet
Credentialplatform
Estimated cost$0.0042
Model selection and cost change with policy and usage.
Flow

How it works

One request, one trace. Input checks run before the model call. Output checks run after the model responds.
01RequestOpenAI-compatible call
02SecurityPrompt, sensitive data, tool calls
03RoutingPolicy selects model
04TraceAudit and metrics

Routing, security, and tracing in one gateway

RoutingPick the right model per request

Choose an auto:* preset, apply organization routing rules, and configure fallback models and the cost–quality setting. Inspect X-LineMod-Model-Used and X-LineMod-Route-Reason on every response.

SecurityCheck content before the provider call

Scan prompts and model outputs, redact sensitive data, control agent tool access, and set a security template for each API key. Blocked requests never reach your provider.

ObservabilityTrace every decision

Review request IDs, costs, and multi-step agent runs in Console. Agent Insights shows run diagnostics, and audit logs can be exported.

Guides

Find the next step

Start with Quickstart, then use the API reference, Smart routing guide, and Security guide as needed.
QuickstartCreate a key and send your first request.
Console signup, base URL, and auto:balanced.
API referenceEndpoints, headers, streaming, and errors.
Chat completions, model list, request and response headers, and agent run headers.
Smart routingSelect a model with an auto alias.
Organization routing policy, budget, and fallback models.
Security guideCheck prompts, outputs, and tool calls.
Templates, redaction, and tool access.
Billing

Billing options

Use platform credits or your own provider keys with the same API endpoint. The gateway tags every response with X-LineMod-Credential-Source.
ModeWho pays upstreamWhat you pay LineMod
platformLineMod wallet (platform credits)Per-token usage bundled with routing, security, and observability
org_byokYour provider contractMonthly BYOK subscription for gateway features
platform_fallbackLineMod when BYOK path is unavailable (if enabled)Fallback token usage per org policy
Hybrid orgs

Connect provider keys for OpenAI and Anthropic, use platform credits for other providers. One LineMod API key supports both billing paths. See pricing for plan details.