import * as z from "zod/v4"; import { OpenEnum } from "../types/enums.js"; import { Result as SafeParseResult } from "../types/fp.js"; import { SDKValidationError } from "./errors/sdkvalidationerror.js"; import { ProviderResponse } from "./providerresponse.js"; /** * Type of API used for the generation */ export declare const ApiType: { readonly Completions: "completions"; readonly Embeddings: "embeddings"; readonly Rerank: "rerank"; readonly Tts: "tts"; readonly Stt: "stt"; readonly Video: "video"; }; /** * Type of API used for the generation */ export type ApiType = OpenEnum; /** * Generation data */ export type GenerationResponseData = { /** * Type of API used for the generation */ apiType: ApiType | null; /** * ID of the app that made the request */ appId: number | null; /** * Discount applied due to caching */ cacheDiscount: number | null; /** * Whether the generation was cancelled */ cancelled: boolean | null; /** * ISO 8601 timestamp of when the generation was created */ createdAt: string; /** * External user identifier */ externalUser: string | null; /** * Reason the generation finished */ finishReason: string | null; /** * Time taken for generation in milliseconds */ generationTime: number | null; /** * Referer header from the request */ httpReferer: string | null; /** * Unique identifier for the generation */ id: string; /** * Whether this used bring-your-own-key */ isByok: boolean; /** * Total latency in milliseconds */ latency: number | null; /** * Model used for the generation */ model: string; /** * Moderation latency in milliseconds */ moderationLatency: number | null; /** * Native finish reason as reported by provider */ nativeFinishReason: string | null; /** * Native cached tokens as reported by provider */ nativeTokensCached: number | null; /** * Native completion tokens as reported by provider */ nativeTokensCompletion: number | null; /** * Native completion image tokens as reported by provider */ nativeTokensCompletionImages: number | null; /** * Native prompt tokens as reported by provider */ nativeTokensPrompt: number | null; /** * Native reasoning tokens as reported by provider */ nativeTokensReasoning: number | null; /** * Number of web fetches performed */ numFetches: number | null; /** * Number of audio inputs in the prompt */ numInputAudioPrompt: number | null; /** * Number of media items in the completion */ numMediaCompletion: number | null; /** * Number of media items in the prompt */ numMediaPrompt: number | null; /** * Number of search results included */ numSearchResults: number | null; /** * Origin URL of the request */ origin: string; /** * Name of the provider that served the request */ providerName: string | null; /** * List of provider responses for this generation, including fallback attempts */ providerResponses: Array | null; /** * Unique identifier grouping all generations from a single API request */ requestId?: string | null | undefined; /** * If this generation was served from response cache, contains the original generation ID. Null otherwise. */ responseCacheSourceId?: string | null | undefined; /** * Router used for the request (e.g., openrouter/auto) */ router: string | null; /** * Service tier the upstream provider reported running this request on, or null if it did not report one. */ serviceTier: string | null; /** * Session identifier grouping multiple generations in the same session */ sessionId?: string | null | undefined; /** * Whether the response was streamed */ streamed: boolean | null; /** * Number of tokens in the completion */ tokensCompletion: number | null; /** * Number of tokens in the prompt */ tokensPrompt: number | null; /** * Total cost of the generation in USD */ totalCost: number; /** * Upstream provider's identifier for this generation */ upstreamId: string | null; /** * Cost charged by the upstream provider */ upstreamInferenceCost: number | null; /** * Usage amount in USD */ usage: number; /** * User-Agent header from the request */ userAgent: string | null; /** * The resolved web search engine used for this generation (e.g. exa, firecrawl, parallel) */ webSearchEngine: string | null; }; /** * Generation response */ export type GenerationResponse = { /** * Generation data */ data: GenerationResponseData; }; /** @internal */ export declare const ApiType$inboundSchema: z.ZodType; /** @internal */ export declare const GenerationResponseData$inboundSchema: z.ZodType; export declare function generationResponseDataFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const GenerationResponse$inboundSchema: z.ZodType; export declare function generationResponseFromJSON(jsonString: string): SafeParseResult; //# sourceMappingURL=generationresponse.d.ts.map