import { OpenAICompatibleModelProvider } from './model.js'; /** * Default base URL for Vercel AI Gateway's OpenAI-compatible Chat Completions * endpoint. The gateway accepts the standard OpenAI request body and routes * through to the configured provider; switching from OpenAI to the gateway * is just a base-URL change. * * See https://vercel.com/docs/ai-gateway/sdks-and-apis/openai-compat */ export declare const VERCEL_AI_GATEWAY_BASE_URL = "https://ai-gateway.vercel.sh/v1"; export interface VercelAIGatewayProviderOptions { /** * AI Gateway API key. From the Vercel dashboard, or pass an OIDC token if * you've configured workload identity. Forwarded as `Authorization: Bearer`. */ apiKey: string; /** * Default model id (e.g. `anthropic/claude-3-5-sonnet-20241022`, * `openai/gpt-4o`). Used when `init({ model: ... })` isn't set per-call. */ defaultModel?: string; /** * Override the gateway base URL. Default is the production gateway * (`https://ai-gateway.vercel.sh/v1`). Override for staging or self-hosted. */ baseUrl?: string; /** Optional name override for telemetry. Defaults to `vercel-ai-gateway`. */ name?: string; /** Extra headers (e.g. team scoping, observability tags). */ headers?: Record; } /** * Vercel AI Gateway model provider. * * The gateway is an OpenAI-compatible HTTP endpoint that brokers between * your agent and any of the major model providers (OpenAI, Anthropic, * Google, xAI, Groq, etc.) with a single key, observability, caching, and * spend controls. Use this provider on any deploy target — Node, Cloudflare * Workers, Vercel — to route inference through the gateway. * * ```ts * import { vercelAIGateway, init } from '@fabric-harness/sdk'; * * const fabric = await init({ * modelProvider: vercelAIGateway({ * apiKey: process.env.AI_GATEWAY_API_KEY!, * defaultModel: 'anthropic/claude-3-5-sonnet-20241022', * }), * }); * ``` * * Returns an {@link OpenAICompatibleModelProvider} configured for the gateway * — use it anywhere a `ModelProvider` is accepted. Compatible with * fabric-harness's tool-calling, retries, and timeout semantics. */ export declare function vercelAIGateway(options: VercelAIGatewayProviderOptions): OpenAICompatibleModelProvider; //# sourceMappingURL=vercel-ai-gateway.d.ts.map