export declare const OPENAI_V1_COMPLETIONS_ENDPOINT: "/v1/completions";
export declare const DEFAULT_OPENAI_V1_COMPLETIONS_BASE_URL: "https://api.openai.com";
export type OpenAIV1CompletionsBoundary = "input" | "contract" | "governance" | "auth" | "scope" | "provider" | "response";
export type OpenAIV1CompletionsErrorCode = "MISSING_BODY" | "MISSING_RUNTIME_ID" | "CONTRACT_REJECTED" | "GOVERNANCE_REJECTED" | "SCOPE_DENIED" | "AUTH_REJECTED" | "CALLER_REQUIRED" | "PROVIDER_AUTH_FAILED" | "PROVIDER_RATE_LIMITED" | "PROVIDER_TIMEOUT" | "PROVIDER_UNAVAILABLE" | "RESPONSE_FORMAT_DRIFT" | "CALLER_FAILED";
export type OpenAIV1CompletionsGate = {
    accepted: boolean;
    reason?: string;
};
export type OpenAIV1CompletionsRuntimeContext = {
    runtimeId?: string;
    invocationId?: string;
    traceId?: string;
    callerId?: string;
};
export type OpenAIV1CompletionsAuthEnvelope = {
    kind: "bearer" | "api-key" | "none";
    present: boolean;
    redactedToken?: string;
};
export type OpenAIV1CompletionsRequestEnvelope = {
    provider: "openai";
    apiVersion: "v1";
    endpoint: typeof OPENAI_V1_COMPLETIONS_ENDPOINT;
    operation: "create-completion";
    method: "POST";
    url: string;
    headers: Readonly<Record<string, string>>;
    body: unknown;
    runtime: Required<OpenAIV1CompletionsRuntimeContext>;
    requestedScopes: readonly string[];
    grantedScopes: readonly string[];
    dryRun: boolean;
    providerCallPlanned: boolean;
    unsafeSideEffects: false;
    providerFieldsOpaque: true;
};
export type OpenAIV1CompletionsProviderCaller = (envelope: OpenAIV1CompletionsRequestEnvelope) => unknown | Promise<unknown>;
export type OpenAIV1CompletionsInvocationRequest = {
    body?: unknown;
    baseUrl?: string;
    headers?: Readonly<Record<string, string | undefined>>;
    auth?: OpenAIV1CompletionsAuthEnvelope;
    runtime?: OpenAIV1CompletionsRuntimeContext;
    requiredScopes?: readonly string[];
    allowedScopes?: readonly string[];
    contract?: OpenAIV1CompletionsGate;
    governance?: OpenAIV1CompletionsGate;
    dryRun?: boolean;
    mockResponse?: unknown;
    expectResponseObject?: boolean;
    caller?: OpenAIV1CompletionsProviderCaller;
};
export type OpenAIV1CompletionsResponseEnvelope = {
    provider: "openai";
    endpoint: typeof OPENAI_V1_COMPLETIONS_ENDPOINT;
    mode: "dry-run" | "mock" | "caller";
    raw: unknown;
    providerFieldsOpaque: true;
};
export type OpenAIV1CompletionsCapabilitySignal = {
    provider: "openai";
    endpoint: typeof OPENAI_V1_COMPLETIONS_ENDPOINT;
    operation: "create-completion";
    rawShape: "completion-object" | "mock" | "dry-run";
};
export type OpenAIV1CompletionsError = {
    code: OpenAIV1CompletionsErrorCode;
    message: string;
    boundary: OpenAIV1CompletionsBoundary;
    retryable: boolean;
};
export type OpenAIV1CompletionsResult = {
    ok: true;
    request: OpenAIV1CompletionsRequestEnvelope;
    response: OpenAIV1CompletionsResponseEnvelope;
    capability: OpenAIV1CompletionsCapabilitySignal;
    events: readonly string[];
} | {
    ok: false;
    error: OpenAIV1CompletionsError;
    request?: OpenAIV1CompletionsRequestEnvelope;
    events: readonly string[];
};
export declare function classifyOpenAIV1CompletionsProviderError(error: unknown): OpenAIV1CompletionsErrorCode;
export declare function invokeOpenAIV1Completions(input?: OpenAIV1CompletionsInvocationRequest): Promise<OpenAIV1CompletionsResult>;
