import type { AuthEnvelope } from "../../authProfileLayer/authEnvelope.js";
export declare const OPENAI_V1_CHAT_COMPLETIONS_ENDPOINT: "/v1/chat/completions";
export type OpenAiV1ChatCompletionsMethod = "POST";
export type OpenAiV1ChatCompletionsGate = {
    accepted: boolean;
    reason?: string;
};
export type OpenAiV1ChatCompletionsTrace = {
    correlationId?: string;
    callerId?: string;
};
export type OpenAiV1ChatCompletionsMockCallerRequest = {
    provider: "openai";
    endpoint: typeof OPENAI_V1_CHAT_COMPLETIONS_ENDPOINT;
    url: string;
    method: OpenAiV1ChatCompletionsMethod;
    requestBody: Record<string, unknown>;
    headers: {
        "content-type"?: string;
        authorization?: string;
        organization?: string;
        project?: string;
    };
    timeoutMs: number;
    trace: OpenAiV1ChatCompletionsTrace;
};
export type OpenAiV1ChatCompletionsMockCallerResponse = {
    status: number;
    body?: unknown;
    headers?: Record<string, string>;
};
export type OpenAiV1ChatCompletionsMockCaller = (request: OpenAiV1ChatCompletionsMockCallerRequest) => Promise<OpenAiV1ChatCompletionsMockCallerResponse> | OpenAiV1ChatCompletionsMockCallerResponse;
export type OpenAiV1ChatCompletionsProviderCaller = (request: OpenAiV1ChatCompletionsMockCallerRequest) => unknown | Promise<unknown>;
export type OpenAiV1ChatCompletionsInvocationRequest = {
    requestBody?: unknown;
    baseUrl?: string;
    apiKey?: string;
    organizationId?: string;
    projectId?: string;
    auth?: AuthEnvelope;
    timeoutMs?: number;
    trace?: OpenAiV1ChatCompletionsTrace;
    contract?: OpenAiV1ChatCompletionsGate;
    governance?: OpenAiV1ChatCompletionsGate;
    dryRun?: boolean;
    caller?: OpenAiV1ChatCompletionsProviderCaller;
    mockCaller?: OpenAiV1ChatCompletionsMockCaller;
};
export type OpenAiV1ChatCompletionsErrorCode = "MISSING_REQUEST" | "MISSING_REQUEST_BODY" | "INVALID_REQUEST_BODY" | "INVALID_TIMEOUT" | "CONTRACT_REJECTED" | "GOVERNANCE_REJECTED" | "AUTH_REJECTED" | "MISSING_CALLER" | "MISSING_MOCK_CALLER" | "UPSTREAM_AUTH_FAILED" | "UPSTREAM_RATE_LIMITED" | "UPSTREAM_TIMEOUT" | "UPSTREAM_UNAVAILABLE" | "UPSTREAM_RESPONSE_DRIFT" | "UPSTREAM_ERROR";
export type OpenAiV1ChatCompletionsErrorBoundary = "input" | "contract" | "governance" | "provider";
export type OpenAiV1ChatCompletionsInvocationError = {
    code: OpenAiV1ChatCompletionsErrorCode;
    message: string;
    boundary: OpenAiV1ChatCompletionsErrorBoundary;
    providerSafe: true;
};
export type OpenAiV1ChatCompletionsProviderEnvelope = {
    provider: "openai";
    endpoint: typeof OPENAI_V1_CHAT_COMPLETIONS_ENDPOINT;
    url: string;
    method: OpenAiV1ChatCompletionsMethod;
    requestBody: Record<string, unknown>;
    status?: number;
    rawResponse?: unknown;
    responseHeaders?: Record<string, string>;
    usage?: OpenAiV1ChatCompletionsUsage;
    authState: "missing" | "provided";
    capabilitySignals: {
        actualInvocationLayer: true;
        providerShapePreserved: true;
        endpoint: typeof OPENAI_V1_CHAT_COMPLETIONS_ENDPOINT;
        mockable: true;
    };
    trace: OpenAiV1ChatCompletionsTrace;
    dryRun: boolean;
    unsafeSideEffects: false;
};
export type OpenAiV1ChatCompletionsUsage = {
    source: "openai.chat_completions.usage";
    inputTokens?: number;
    outputTokens?: number;
    totalTokens?: number;
    cachedInputTokens?: number;
    reasoningTokens?: number;
    estimated: false;
};
export type OpenAiV1ChatCompletionsInvocationResult = {
    ok: true;
    envelope: OpenAiV1ChatCompletionsProviderEnvelope;
    events: readonly string[];
} | {
    ok: false;
    error: OpenAiV1ChatCompletionsInvocationError;
    events: readonly string[];
};
export declare function invokeOpenAiV1ChatCompletions(request?: OpenAiV1ChatCompletionsInvocationRequest): Promise<OpenAiV1ChatCompletionsInvocationResult>;
