import * as plugins from './plugins.js'; import type { TOpenAiReasoningEffort } from './index.js'; import type { IOpenAiChatGptModelReasoningEffort, IOpenAiChatGptModelServiceTier, TOpenAiChatGptInputModality } from './smartai.chatgpt.catalog.js'; /** * A model of OpenAI's public API, as OpenAI's model page states it, in the vocabulary of `IOpenAiChatGptModel` * so a consumer reads both catalogs alike. Only what the page states is here: a field the page leaves out is absent, * never filled in. */ export interface IOpenAiApiModel { readonly providerId: 'openai'; readonly modelId: string; /** Other ids the model page lists for the model, such as dated snapshots. */ readonly snapshots: readonly string[]; readonly displayName: string; readonly description: string; /** The `reasoning.effort` values the model accepts, lowest first. The pages give no per-effort description. */ readonly reasoningEfforts: readonly IOpenAiChatGptModelReasoningEffort[]; /** The effort the model uses when a request names none; absent when OpenAI's pages do not state it. */ readonly defaultReasoningEffort?: TOpenAiReasoningEffort; readonly inputModalities: readonly TOpenAiChatGptInputModality[]; /** * The `service_tier` values besides Standard (`default`) the model is served in: `flex`, `priority` (Fast mode; * `fast` names it in a request too) and `ultrafast`. The pages give no per-tier description. */ readonly serviceTiers: readonly IOpenAiChatGptModelServiceTier[]; /** The context window in tokens. */ readonly contextWindow: number; /** The input limit in tokens, when the page states one. */ readonly maxInputTokens?: number; readonly maxOutputTokens: number; readonly source: plugins.IModelSource; } /** * The models of OpenAI's public API this package describes, newest first, each read from its model page * (`source`) on 2026-10-21. GPT-6 Astra's page states no default effort, and the GPT-5.5 and GPT-5.4 pages state * no input limit. The `reasoningEfforts`, defaults and tiers of GPT-6 Astra and GPT-6.1 Sol are also stated in * https://developers.openai.com/api/docs/guides/latest-model and the tiers in * https://developers.openai.com/api/docs/pricing. */ export declare const OPENAI_API_MODELS: readonly IOpenAiApiModel[]; /** The `OPENAI_API_MODELS` entry for exactly this model id or one of its listed snapshots; nothing else matches. */ export declare function getOpenAiApiModel(modelIdArg: string): IOpenAiApiModel | undefined; /** * The prices of `OPENAI_API_MODELS` from https://developers.openai.com/api/docs/pricing, checked 2026-10-21, keyed * by the response's `service_tier`. A tier the page prices no long context for (Fast on GPT-5.5 and GPT-5.4) has * only the short band, so a longer prompt is refused. GPT-5.6 Sol's prices are promotional, at least through * 2026-11-21. */ export declare const OPENAI_MODEL_PRICES: readonly plugins.IModelPrice[]; /** The price of exactly this model id or one of its listed snapshots; `undefined` for any other id. */ export declare function getOpenAiModelPrice(modelIdArg: string): plugins.IModelPrice | undefined; /** * Reads a Responses API `usage` object, raw as the API sends it, with the response's `service_tier` (the tier that * served the call). `input_tokens` counts every input token, cache reads and writes included; the writes are split * by lifetime from `input_tokens_details.cache_write_tokens_details` (`ttl_30m_tokens`, `ttl_12h_tokens`), and * writes the response does not split go to `unknownLifetimeCacheWriteTokens`. Output includes reasoning. The usage * names no server-tool calls: count `web_search_call` and `file_search_call` output items into `toolCalls`. * A usage that is not complete throws a `ModelUsageReadError`. */ export declare function readOpenAiResponsesUsage(rawUsageArg: unknown, serviceTierArg: unknown): plugins.IModelPricedUsage;