Model Registry
Model Registry
The library includes registry schema v2 metadata for the current text/realtime catalog, plus separate TTS, STT, image, video, and embedding registries.
Using the Model Registry
import {
getModelInfo,
calculateCost,
getModelsByVendor,
getActiveModels,
getDeprecatedModels,
LLM_MODELS,
MODEL_REGISTRY_SCHEMA_VERSION,
Vendor,
} from 'oneringai';
// Get model information
const model = getModelInfo('gpt-6-astra');
if (!model) throw new Error('Model is not registered');
console.log(model.provider); // 'openai'
console.log(MODEL_REGISTRY_SCHEMA_VERSION); // 2
console.log(model.features.input.tokens); // 1050000 total context-window guardrail
console.log(model.features.output.tokens); // 128000
console.log(model.features.reasoning); // true
console.log(model.features.vision); // true
console.log(model.lifecycle); // 'active'
console.log(model.endpoints); // ['responses', 'chat_completions', 'batch']
// Calculate API costs
const cost = calculateCost('gpt-5.6-luna', 50000, 2000);
console.log(`Cost: $${cost}`); // $0.0124
// With mixed cached and uncached input, using batch pricing
const cachedCost = calculateCost('gpt-5.6-luna', 50000, 2000, {
cachedInputTokens: 30000,
processingMode: 'batch',
});
console.log(`Optimized: $${cachedCost}`); // $0.0035
// Get all models for a vendor
const openaiModels = getModelsByVendor(Vendor.OpenAI);
console.log(openaiModels.map(m => m.name));
// ['gpt-6-astra', 'gpt-5.6-sol', 'gpt-5.6-terra', 'gpt-5.6-luna', ...]
// Get all active models
const activeModels = getActiveModels();
console.log(activeModels.length); // lifecycle-aware active records only
// Use model constants
const flagship = LLM_MODELS[Vendor.OpenAI].GPT_6_ASTRA;
const efficient = LLM_MODELS[Vendor.OpenAI].GPT_5_6_LUNA;
Registry schema v2 and API compatibility
Schema v2 is additive for existing consumers. name, provider, isActive,
features, and the original cost fields retain their meaning. New metadata is:
lifecycle:preview,active,legacy,deprecated, orretired;availability,preferred,aliases, andsnapshots;endpoints,deprecationDate,retirementDate, andreplacementModel;- official
sourceson media records and newly audited text entries; and - long-context, processing-mode, duration, message, resolution, and modality pricing where the vendor publishes it.
Unknown token limits are represented as null, not 0. This currently matters
for duration-priced voice-agent models. Existing code that assumes a number
should use resolveMaxContextTokens() or check for null.
Lookup helpers resolve aliases. Direct indexing remains canonical-only:
getModelInfo('gpt-5.6')?.name; // 'gpt-5.6-sol'
getModelInfo('grok-voice-latest')?.name; // 'grok-voice-think-fast-2.0'
MODEL_REGISTRY['gpt-5.6']; // undefined by design
Use getDeprecatedModels() and the equivalent media helpers instead of treating
every callable-but-deprecated model as inactive. isActive means the API can
still be called; lifecycle carries the vendor's migration state.
Current provider API selection
- OpenAI text models use Responses by default, including current reasoning, service-tier, explicit/implicit prompt-cache, hosted-tool, and long-context cost metadata. Connector-first wrappers also expose Decisions, GPT-Live, and custom voices.
- Anthropic supports Claude 5.5 adaptive/between-tools thinking, effort through
output_config, Opus fast mode, tool search/deferred tools, server-side compaction, and current server tools. Generic request metadata is narrowed to Anthropic's supported{ user_id }shape; unrelated host keys remain local rather than producing invalid Messages requests. - Gemini 3.5+ uses the GA Interactions API (
steps,step.delta) by default; Gemini 3.8 also supports continuation tokens, file search, and computer use. SetvendorOptions.api = 'generateContent'to retain the legacy path, orvendorOptions.api = 'interactions'to force Interactions on another model. Named function selection is strict on both paths (allowed_toolsfor Interactions andallowedFunctionNamesforgenerateContent). Live sessions and custom voices have connector-first wrappers. - xAI text uses a dedicated OpenAI-compatible adapter for Grok reasoning, registry-gated X/web search, hosted code execution, ordered replay, and cost telemetry; dedicated image, video, TTS, STT, and realtime voice endpoints use native contracts.
Resolve Model Capabilities
Providers use the registry to resolve model capabilities automatically, but you can also use the helper directly:
import { resolveModelCapabilities, resolveMaxContextTokens } from 'oneringai';
// Get full capabilities for a registered model
const caps = resolveModelCapabilities('gpt-5.6-terra', {
supportsTools: true, supportsVision: false, supportsJSON: true,
supportsJSONSchema: false, maxTokens: 128000, maxOutputTokens: 4096,
});
console.log(caps.maxTokens); // 1050000 (from registry)
console.log(caps.maxOutputTokens); // 128000 (from registry)
// For unregistered models, vendor defaults are returned
const unknown = resolveModelCapabilities('my-custom-model', { ...vendorDefaults });
console.log(unknown.maxTokens); // falls back to vendorDefaults
// Quick context limit lookup (useful for error messages)
const limit = resolveMaxContextTokens('gpt-5.6-terra', 128000);
console.log(limit); // 1050000
Model Information
interface ILLMDescription {
name: string;
provider: string;
description?: string;
isActive: boolean; // callable, not necessarily recommended
lifecycle?: 'preview' | 'active' | 'legacy' | 'deprecated' | 'retired';
availability?: 'public' | 'limited' | 'invite_only' | 'enterprise' | 'region_limited';
preferred?: boolean;
aliases?: readonly string[];
snapshots?: readonly string[];
endpoints?: readonly ModelEndpoint[];
releaseDate?: string;
deprecationDate?: string;
retirementDate?: string;
replacementModel?: string;
knowledgeCutoff?: string;
sources?: {
documentation: string;
pricing?: string;
apiReference?: string;
lastVerified: string;
};
features: {
input: {
tokens: number | null;
cpm: number;
cpmCached?: number;
};
output: {
tokens: number | null;
cpm: number;
};
// Feature flags
reasoning: boolean;
streaming: boolean;
structuredOutput: boolean;
functionCalling: boolean;
vision: boolean;
audio: boolean;
video: boolean;
extendedThinking: boolean;
batchAPI: boolean;
promptCaching: boolean;
pricing?: {
text?: TokenPricing;
audio?: TokenPricing;
image?: TokenPricing;
audioDurationPerMinute?: number;
textInputPerMessage?: number;
processingMultipliers?: Partial<Record<ProcessingMode, number>>;
};
};
}
Available Models
OpenAI:
- GPT-6: Astra, GPT-6.1 Sol, GPT-6 Sol, and GPT-6 Luna
- Specialized: GPT-5.6 Cyber and GPT-Rosalind Research (access-controlled)
- GPT-5.6: Sol, Terra, Luna
- GPT-5.5 Pro
- GPT-5.3: codex, chat-latest
- GPT-5.2: standard, pro, codex, chat-latest
- GPT-5.1: standard, codex, codex-max, codex-mini, chat-latest
- GPT-5: standard, mini, nano, codex, chat-latest
- GPT-4.1: standard, mini, nano
- GPT-4o: standard, mini
- Audio: gpt-audio-1.5, gpt-audio, gpt-audio-mini
- Realtime: gpt-realtime-2.1 (recommended), gpt-realtime-2.1-mini, gpt-realtime-2, gpt-realtime-translate, gpt-realtime-1.5; gpt-realtime and gpt-realtime-mini are deprecated
- Realtime transcription: gpt-live-transcribe (recommended) and gpt-realtime-whisper ($0.017/audio minute)
- o-series: o3, o4-mini, o3-mini, o1
- Deep Research: o3-deep-research, o4-mini-deep-research
- Open-weight: gpt-oss-120b, gpt-oss-20b
Anthropic:
- Claude 5.5: Opus 5.5 and Sonnet 5.5
- Claude 5: Opus 5, Mythos 5, Fable 5, and Sonnet 5
- Opus 4.8
- Claude 4.7: Opus 4.7 (legacy flagship)
- Claude 4.6: Opus 4.6, Sonnet 4.6
- Claude 4.5: Opus, Sonnet, Haiku
- Claude 4.x legacy: Opus 4.1, Opus 4, Sonnet 4
- Claude 3.7: Sonnet
Google:
- Gemini 3.8 Flash, Live, and Live Extended Thinking
- Gemini 3.7 and 3.6 Flash; Gemini 3.5 and 3.5 Flash-Lite
- Gemini 3.1: Pro, Flash-Lite, Flash Image, Flash Live
- Gemini 3 (preview): Flash, Pro Image
- Gemini 2.5: Pro, Flash, Flash-Lite, Flash Image
Grok / xAI:
- Grok 4.7, Grok 4.6, Grok 4.5, Grok 4.3, and Grok Build 0.1
- Grok 4.20 (2M context, flagship): reasoning, non-reasoning, multi-agent
- Grok 4.1 fast (2M context): reasoning, non-reasoning
- Grok Voice Think Fast 2.0 and maintained 1.0 migration entries
DeepSeek (5 models):
- V4 Flash, V4 Pro, and V4 Flash Vision Experimental
- Retired
deepseek-chatanddeepseek-reasonercompatibility records
Dedicated media registries add GPT Image 2.5 Sunburst/Flare, Gemini Nano Banana
2.1 and 3.1 Flash-Lite Image, Grok Imagine Image 2.0, Sora 2, Veo/Omni, Grok
Imagine Video 1.5, current OpenAI speech, Gemini 3.8 TTS, Grok Voice Transcribe
2.0, Google/xAI voice models, and Gemini Embedding 2. Use
getImageModelInfo, getVideoModelInfo, getTTSModelInfo, getSTTModelInfo,
and getEmbeddingModelInfo for their modality-specific capability schemas.
The complete official-source audit and migration table is in
docs/MODEL_REGISTRY_AUDIT.md.