import * as z from "zod/v4";
import * as discriminatedUnionTypes from "../types/discriminatedUnion.js";
import { ClosedEnum } from "../types/enums.js";
import { Result as SafeParseResult } from "../types/fp.js";
import { ApiErrorType } from "./apierrortype.js";
import { ApplyPatchServerTool } from "./applypatchservertool.js";
import { BaseInputsUnion } from "./baseinputsunion.js";
import { BaseReasoningConfig } from "./basereasoningconfig.js";
import { CodeInterpreterServerTool } from "./codeinterpreterservertool.js";
import { CodexLocalShellTool } from "./codexlocalshelltool.js";
import { ComputerUseServerTool } from "./computeruseservertool.js";
import { CustomTool } from "./customtool.js";
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
import { FileSearchServerTool } from "./filesearchservertool.js";
import { ImageGenerationServerTool } from "./imagegenerationservertool.js";
import { IncompleteDetails } from "./incompletedetails.js";
import { LegacyWebSearchServerTool } from "./legacywebsearchservertool.js";
import { McpServerTool } from "./mcpservertool.js";
import { NamespaceTool } from "./namespacetool.js";
import { OpenAIResponsesResponseStatus } from "./openairesponsesresponsestatus.js";
import { OpenAIResponsesToolChoiceUnion } from "./openairesponsestoolchoiceunion.js";
import { OpenRouterMetadata } from "./openroutermetadata.js";
import { OutputItems } from "./outputitems.js";
import { Preview20250311WebSearchServerTool } from "./preview20250311websearchservertool.js";
import { PreviewWebSearchServerTool } from "./previewwebsearchservertool.js";
import { PromptCacheOptions } from "./promptcacheoptions.js";
import { ResponsesErrorField } from "./responseserrorfield.js";
import { ServerToolUseDetails } from "./servertoolusedetails.js";
import { ShellServerTool } from "./shellservertool.js";
import { StoredPromptTemplate } from "./storedprompttemplate.js";
import { TextExtendedConfig } from "./textextendedconfig.js";
import { Truncation } from "./truncation.js";
import { WebSearchServerTool } from "./websearchservertool.js";
export declare const OpenResponsesResultObject: {
    readonly Response: "response";
};
export type OpenResponsesResultObject = ClosedEnum<typeof OpenResponsesResultObject>;
/**
 * Function tool definition
 */
export type OpenResponsesResultToolFunction = {
    description?: string | null | undefined;
    name: string;
    parameters: {
        [k: string]: any;
    } | null;
    strict?: boolean | null | undefined;
    type: "function";
};
export type OpenResponsesResultToolUnion = OpenResponsesResultToolFunction | (PreviewWebSearchServerTool & {
    type: "web_search_preview";
}) | (Preview20250311WebSearchServerTool & {
    type: "web_search_preview_2025_03_11";
}) | (LegacyWebSearchServerTool & {
    type: "web_search";
}) | (WebSearchServerTool & {
    type: "web_search_2025_08_26";
}) | (FileSearchServerTool & {
    type: "file_search";
}) | (ComputerUseServerTool & {
    type: "computer_use_preview";
}) | (CodeInterpreterServerTool & {
    type: "code_interpreter";
}) | (McpServerTool & {
    type: "mcp";
}) | (ImageGenerationServerTool & {
    type: "image_generation";
}) | (CodexLocalShellTool & {
    type: "local_shell";
}) | (ShellServerTool & {
    type: "shell";
}) | (ApplyPatchServerTool & {
    type: "apply_patch";
}) | (CustomTool & {
    type: "custom";
}) | (NamespaceTool & {
    type: "namespace";
}) | discriminatedUnionTypes.Unknown<"type">;
export type InputTokensDetails = {
    cacheWriteTokens?: number | null | undefined;
    cachedTokens: number;
};
export type OutputTokensDetails = {
    reasoningTokens: number;
};
export type UsageCostDetails = {
    upstreamInferenceCost?: number | null | undefined;
    upstreamInferenceInputCost: number;
    upstreamInferenceOutputCost: number;
};
export type Usage = {
    inputTokens: number;
    inputTokensDetails: InputTokensDetails;
    outputTokens: number;
    outputTokensDetails: OutputTokensDetails;
    totalTokens: number;
    /**
     * Cost of the completion
     */
    cost?: number | null | undefined;
    costDetails?: UsageCostDetails | undefined;
    /**
     * Whether a request was made using a Bring Your Own Key configuration
     */
    isByok?: boolean | undefined;
    /**
     * Usage for server-side tool execution (e.g., web search)
     */
    serverToolUseDetails?: ServerToolUseDetails | null | undefined;
};
/**
 * Complete non-streaming response from the Responses API
 */
export type OpenResponsesResult = {
    background?: boolean | null | undefined;
    completedAt: number | null;
    createdAt: number;
    /**
     * Error information returned from the API
     */
    error: ResponsesErrorField | null;
    frequencyPenalty: number | null;
    id: string;
    incompleteDetails: IncompleteDetails | null;
    instructions: BaseInputsUnion | null;
    maxOutputTokens?: number | null | undefined;
    maxToolCalls?: number | null | undefined;
    /**
     * Metadata key-value pairs for the request. Keys must be ≤64 characters and cannot contain brackets. Values must be ≤512 characters. Maximum 16 pairs allowed.
     */
    metadata: {
        [k: string]: string;
    } | null;
    model: string;
    object: OpenResponsesResultObject;
    output: Array<OutputItems>;
    outputText?: string | undefined;
    parallelToolCalls: boolean;
    presencePenalty: number | null;
    previousResponseId?: string | null | undefined;
    prompt?: StoredPromptTemplate | null | undefined;
    promptCacheKey?: string | null | undefined;
    /**
     * Request-level prompt-cache controls. `mode: "explicit"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer.
     */
    promptCacheOptions?: PromptCacheOptions | null | undefined;
    reasoning?: BaseReasoningConfig | null | undefined;
    safetyIdentifier?: string | null | undefined;
    serviceTier?: string | null | undefined;
    status: OpenAIResponsesResponseStatus;
    store?: boolean | undefined;
    temperature: number | null;
    /**
     * Text output configuration including format and verbosity
     */
    text?: TextExtendedConfig | undefined;
    toolChoice: OpenAIResponsesToolChoiceUnion;
    tools: Array<OpenResponsesResultToolFunction | (PreviewWebSearchServerTool & {
        type: "web_search_preview";
    }) | (Preview20250311WebSearchServerTool & {
        type: "web_search_preview_2025_03_11";
    }) | (LegacyWebSearchServerTool & {
        type: "web_search";
    }) | (WebSearchServerTool & {
        type: "web_search_2025_08_26";
    }) | (FileSearchServerTool & {
        type: "file_search";
    }) | (ComputerUseServerTool & {
        type: "computer_use_preview";
    }) | (CodeInterpreterServerTool & {
        type: "code_interpreter";
    }) | (McpServerTool & {
        type: "mcp";
    }) | (ImageGenerationServerTool & {
        type: "image_generation";
    }) | (CodexLocalShellTool & {
        type: "local_shell";
    }) | (ShellServerTool & {
        type: "shell";
    }) | (ApplyPatchServerTool & {
        type: "apply_patch";
    }) | (CustomTool & {
        type: "custom";
    }) | (NamespaceTool & {
        type: "namespace";
    }) | discriminatedUnionTypes.Unknown<"type">>;
    topLogprobs?: number | null | undefined;
    topP: number | null;
    truncation?: Truncation | null | undefined;
    /**
     * Token usage information for the response
     */
    usage?: Usage | null | undefined;
    user?: string | null | undefined;
    /**
     * Canonical OpenRouter error type, stable across all API formats
     */
    errorType?: ApiErrorType | undefined;
    openrouterMetadata?: OpenRouterMetadata | undefined;
};
/** @internal */
export declare const OpenResponsesResultObject$inboundSchema: z.ZodEnum<typeof OpenResponsesResultObject>;
/** @internal */
export declare const OpenResponsesResultToolFunction$inboundSchema: z.ZodType<OpenResponsesResultToolFunction, unknown>;
export declare function openResponsesResultToolFunctionFromJSON(jsonString: string): SafeParseResult<OpenResponsesResultToolFunction, SDKValidationError>;
/** @internal */
export declare const OpenResponsesResultToolUnion$inboundSchema: z.ZodType<OpenResponsesResultToolUnion, unknown>;
export declare function openResponsesResultToolUnionFromJSON(jsonString: string): SafeParseResult<OpenResponsesResultToolUnion, SDKValidationError>;
/** @internal */
export declare const InputTokensDetails$inboundSchema: z.ZodType<InputTokensDetails, unknown>;
export declare function inputTokensDetailsFromJSON(jsonString: string): SafeParseResult<InputTokensDetails, SDKValidationError>;
/** @internal */
export declare const OutputTokensDetails$inboundSchema: z.ZodType<OutputTokensDetails, unknown>;
export declare function outputTokensDetailsFromJSON(jsonString: string): SafeParseResult<OutputTokensDetails, SDKValidationError>;
/** @internal */
export declare const UsageCostDetails$inboundSchema: z.ZodType<UsageCostDetails, unknown>;
export declare function usageCostDetailsFromJSON(jsonString: string): SafeParseResult<UsageCostDetails, SDKValidationError>;
/** @internal */
export declare const Usage$inboundSchema: z.ZodType<Usage, unknown>;
export declare function usageFromJSON(jsonString: string): SafeParseResult<Usage, SDKValidationError>;
/** @internal */
export declare const OpenResponsesResult$inboundSchema: z.ZodType<OpenResponsesResult, unknown>;
export declare function openResponsesResultFromJSON(jsonString: string): SafeParseResult<OpenResponsesResult, SDKValidationError>;
//# sourceMappingURL=openresponsesresult.d.ts.map