import type { VerlonConfig, RequestOptions } from './types/index.js'; import { SpanEmitter } from './tracing/emitter.js'; import { AgentHandle, type ToolOptions } from './tracing/handles.js'; import type { VerlonRequestInput, VerlonResponse, ChatRequest, ImageGenerationRequest, VideoGenerationRequest, EmbeddingsRequest, TextToSpeechRequest, OCRRequest } from './types/index.js'; import type { ModelRegistrySnapshot } from './types/index.js'; export declare class Verlon { private apiKey; private baseUrl; private emitter; private telemetryOptions; private strictTasks; constructor(config: VerlonConfig); request(options: RequestOptions): Promise; /** * Fetch the platform's CURRENT model registry. * * Prefer this over the exported `MODEL_REGISTRY` constant whenever the * answer matters. That constant is a snapshot frozen when this package * was published, so its pricing and capability data drift the moment * the platform adds a model or a provider changes a rate — it exists * to generate the `ModelId` union at compile time, not to be a source * of truth at runtime. This method asks the platform. * * Unauthenticated: the registry is public, and the request carries no * credentials, so it is safe to call before a key is configured. * * @example * const { models, version } = await verlon.models(); * const grok = models['grok-4.5']; * console.log(grok.pricing?.input, grok.pricing?.longContext?.threshold); */ models(): Promise; /** @internal */ getBaseUrl(): string; /** @internal */ getJson(path: string): Promise; /** @internal */ isStrictTasks(): boolean; /** @internal */ getEmitter(): SpanEmitter; /** * Handle for one agent gate: open trace scopes and declare tasks. * * const support = verlon.agent(process.env.SUPPORT_GATE); * const classify = support.task('classify'); * await support.trace({ conversationId: chatId }, () => runAgent()); */ agent(gateId: string, displayName?: string): AgentHandle; /** * Wrap a function so each execution becomes a tool span on the * active trace. Outside a trace scope the wrapper is a pure * pass-through. Errors are recorded and rethrown unchanged. */ tool unknown>(name: string, fn: F, options?: ToolOptions): F; /** * Fetch wrapper for native SDKs (OpenAI, Anthropic, …): injects the * ambient traceparent + conversation id at call time so every proxied * call inside a trace scope lands on the timeline with zero per-call * code. Usage: `new OpenAI({ baseURL, fetch: verlon.instrumentFetch() })`. */ instrumentFetch(base?: typeof fetch): typeof fetch; /** Drain buffered telemetry (e.g. before process exit). */ flushTelemetry(): Promise; /** @internal */ chatWithHeaders(request: Record, headers: Record): Promise; /** * @deprecated Verlon is retiring SDK inference in favor of the drop-in * gateway routes (removed in 3.0.0, scheduled December 1, 2026). Use the official `openai` package — * inside a trace scope: * * const openai = new OpenAI({ apiKey, ...agent.clientOptions('openai') }); * * or standalone with `baseURL: '/v1'`, addressing your gate (and * optionally a task) through the model string: `model: '/'`. * Unlike chat(), this method never attached trace context — migrating is * strictly an upgrade. See https://docs.verlon.ai/integrations/openai-sdk. */ complete(request: VerlonRequestInput): Promise; /** * v3 Chat completion endpoint - Type-safe chat requests * @param request - Chat request with gateId and ChatRequest data * @deprecated Verlon is retiring SDK inference in favor of the drop-in * gateway routes (removed in 3.0.0, scheduled December 1, 2026). Use the official `openai` package — * inside a trace scope, `clientOptions()` carries the same gate/task * attribution and trace correlation this method attached: * * const openai = new OpenAI({ apiKey, ...agent.clientOptions('openai') }); * await openai.chat.completions.create({ model, messages }); * * Standalone, set `baseURL: '/v1'` and address your gate (and * optionally a task) through the model string: `model: '/'`. * See https://docs.verlon.ai/integrations/openai-sdk. */ chat(request: { gateId: string; gateName?: string; data: ChatRequest; model?: string; metadata?: Record; endUserId?: string; }): Promise; /** * v3 Chat completion endpoint with streaming support - yields chunks as they arrive * @param request - Chat request with gateId and ChatRequest data (stream: true is set automatically) * @deprecated Verlon is retiring SDK inference in favor of the drop-in * gateway routes (removed in 3.0.0, scheduled December 1, 2026). Use the official `openai` package with * `stream: true` — see the chat() deprecation note for client setup, and * https://docs.verlon.ai/integrations/openai-sdk. */ chatStream(request: { gateId: string; gateName?: string; data: Omit; model?: string; metadata?: Record; endUserId?: string; }): AsyncGenerator; /** @internal */ chatStreamWithHeaders(request: Record, headers: Record): AsyncGenerator; /** * v3 Image generation endpoint - Type-safe image requests * @param request - Image request with gateId and ImageGenerationRequest data * @deprecated Verlon is retiring SDK inference in favor of the drop-in * gateway routes (removed in 3.0.0, scheduled December 1, 2026). Use the official `openai` package's * `images.generate()` against Verlon's `/v1/images/generations` — see the * chat() deprecation note for client setup, and * https://docs.verlon.ai/integrations/openai-sdk. */ image(request: { gateId: string; gateName?: string; data: ImageGenerationRequest; model?: string; metadata?: Record; endUserId?: string; }): Promise; /** * v3 Video generation endpoint - Type-safe video requests * @param request - Video request with gateId and VideoGenerationRequest data * @deprecated Verlon is retiring SDK inference in favor of the drop-in * gateway routes (removed in 3.0.0, scheduled December 1, 2026). Use the * official `openai` package's async Videos surface — `videos.create()` / * `videos.retrieve()` / `videos.downloadContent()` against Verlon's * `/v1/videos` — see the chat() deprecation note for client setup, and * https://docs.verlon.ai/integrations/openai-sdk. */ video(request: { gateId: string; gateName?: string; data: VideoGenerationRequest; model?: string; metadata?: Record; endUserId?: string; }): Promise; /** * v3 Embeddings endpoint - Type-safe embeddings requests * @param request - Embeddings request with gateId and EmbeddingsRequest data * @deprecated Verlon is retiring SDK inference in favor of the drop-in * gateway routes (removed in 3.0.0, scheduled December 1, 2026). Use the official `openai` package's * `embeddings.create()` against Verlon's `/v1/embeddings` — see the chat() * deprecation note for client setup, and * https://docs.verlon.ai/integrations/openai-sdk. */ embeddings(request: { gateId: string; gateName?: string; data: EmbeddingsRequest; model?: string; metadata?: Record; endUserId?: string; }): Promise; /** * v3 Text-to-Speech endpoint - Type-safe TTS requests * @param request - TTS request with gateId and TextToSpeechRequest data * @deprecated Verlon is retiring SDK inference in favor of the drop-in * gateway routes (removed in 3.0.0, scheduled December 1, 2026). Use the official `openai` package's * `audio.speech.create()` against Verlon's `/v1/audio/speech` — see the * chat() deprecation note for client setup, and * https://docs.verlon.ai/integrations/openai-sdk. */ tts(request: { gateId: string; gateName?: string; data: TextToSpeechRequest; model?: string; metadata?: Record; endUserId?: string; }): Promise; /** * v3 OCR endpoint - Type-safe OCR requests * @param request - OCR request with gateId and OCRRequest data * @deprecated Verlon is retiring SDK inference in favor of the drop-in * gateway routes (removed in 3.0.0, scheduled December 1, 2026). Use the * official `@mistralai/mistralai` package's `ocr.process()` against * Verlon's `/mistral/v1/ocr` (serverURL `https://api.verlon.ai/mistral`). * See https://docs.verlon.ai/getting-started/migrate. */ ocr(request: { gateId: string; gateName?: string; data: OCRRequest; model?: string; metadata?: Record; endUserId?: string; }): Promise; } //# sourceMappingURL=client.d.ts.map