export declare const OPENAI_V1_MODELS_ENDPOINT: "/v1/models";
export declare const DEFAULT_OPENAI_V1_MODELS_BASE_URL: "https://api.openai.com";
export type OpenAIV1ModelsOperation = "list" | "retrieve" | "delete";
export type OpenAIV1ModelsMethod = "GET" | "DELETE";
export type OpenAIV1ModelsBoundary = "input" | "contract" | "governance" | "auth" | "scope" | "provider" | "response";
export type OpenAIV1ModelsErrorCode = "MISSING_OPERATION" | "MISSING_MODEL_ID" | "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 OpenAIV1ModelsGate = {
    accepted: boolean;
    reason?: string;
};
export type OpenAIV1ModelsRuntimeContext = {
    runtimeId?: string;
    invocationId?: string;
    traceId?: string;
    callerId?: string;
};
export type OpenAIV1ModelsAuthEnvelope = {
    kind: "bearer" | "api-key" | "none";
    present: boolean;
    redactedToken?: string;
};
export type OpenAIV1ModelsRequestEnvelope = {
    provider: "openai";
    apiVersion: "v1";
    endpoint: typeof OPENAI_V1_MODELS_ENDPOINT;
    operation: OpenAIV1ModelsOperation;
    method: OpenAIV1ModelsMethod;
    url: string;
    pathSuffix: string;
    query: Readonly<Record<string, string>>;
    headers: Readonly<Record<string, string>>;
    runtime: Required<OpenAIV1ModelsRuntimeContext>;
    requestedScopes: readonly string[];
    grantedScopes: readonly string[];
    dryRun: boolean;
    providerCallPlanned: boolean;
    unsafeSideEffects: false;
    providerFieldsOpaque: true;
};
export type OpenAIV1ModelsProviderCaller = (envelope: OpenAIV1ModelsRequestEnvelope) => unknown | Promise<unknown>;
export type OpenAIV1ModelsInvocationRequest = {
    operation?: OpenAIV1ModelsOperation;
    modelId?: string;
    query?: Readonly<Record<string, string | number | boolean | undefined>>;
    headers?: Readonly<Record<string, string | undefined>>;
    baseUrl?: string;
    auth?: OpenAIV1ModelsAuthEnvelope;
    runtime?: OpenAIV1ModelsRuntimeContext;
    requiredScopes?: readonly string[];
    allowedScopes?: readonly string[];
    contract?: OpenAIV1ModelsGate;
    governance?: OpenAIV1ModelsGate;
    dryRun?: boolean;
    mockResponse?: unknown;
    expectResponseObject?: boolean;
    caller?: OpenAIV1ModelsProviderCaller;
};
export type OpenAIV1ModelsResponseEnvelope = {
    provider: "openai";
    endpoint: typeof OPENAI_V1_MODELS_ENDPOINT;
    mode: "dry-run" | "mock" | "caller";
    raw: unknown;
    providerFieldsOpaque: true;
};
export type OpenAIV1ModelsCapabilitySignal = {
    provider: "openai";
    endpoint: typeof OPENAI_V1_MODELS_ENDPOINT;
    operation: OpenAIV1ModelsOperation;
    rawShape: "model-list" | "model-object" | "model-deletion" | "mock" | "dry-run";
};
export type OpenAIV1ModelsError = {
    code: OpenAIV1ModelsErrorCode;
    message: string;
    boundary: OpenAIV1ModelsBoundary;
    retryable: boolean;
};
export type OpenAIV1ModelsResult = {
    ok: true;
    request: OpenAIV1ModelsRequestEnvelope;
    response: OpenAIV1ModelsResponseEnvelope;
    capability: OpenAIV1ModelsCapabilitySignal;
    events: readonly string[];
} | {
    ok: false;
    error: OpenAIV1ModelsError;
    request?: OpenAIV1ModelsRequestEnvelope;
    events: readonly string[];
};
export declare function classifyOpenAIV1ModelsProviderError(error: unknown): OpenAIV1ModelsErrorCode;
export declare function invokeOpenAIV1Models(input?: OpenAIV1ModelsInvocationRequest): Promise<OpenAIV1ModelsResult>;
