import * as z from "zod/v4"; import { ClosedEnum, OpenEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import * as models from "../index.js"; export type CreateEmbeddingsGlobals = { /** * The app identifier should be your app's URL and is used as the primary identifier for rankings. * * @remarks * This is used to track API usage per application. */ httpReferer?: string | undefined; /** * The app display name allows you to customize how your app appears in OpenRouter's dashboard. * * @remarks */ appTitle?: string | undefined; /** * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. * * @remarks */ appCategories?: string | undefined; }; /** * The format of the output embeddings */ export declare const EncodingFormat: { readonly Float: "float"; readonly Base64: "base64"; }; /** * The format of the output embeddings */ export type EncodingFormat = OpenEnum; export type ImageUrl = { url: string; }; export type ContentImageURL = { imageUrl: ImageUrl; type: "image_url"; }; export type ContentText = { text: string; type: "text"; }; export type Content = ContentText | ContentImageURL | models.ContentPartInputAudio | models.ContentPartInputVideo | models.ContentPartInputFile; export type Input = { content: Array; }; /** * Text, token, or multimodal input(s) to embed */ export type InputUnion = string | Array | Array | Array> | Array; /** * Embeddings request input */ export type CreateEmbeddingsRequestBody = { /** * The number of dimensions for the output embeddings */ dimensions?: number | undefined; /** * The format of the output embeddings */ encodingFormat?: EncodingFormat | undefined; /** * Text, token, or multimodal input(s) to embed */ input: string | Array | Array | Array> | Array; /** * The type of input (e.g. search_query, search_document) */ inputType?: string | undefined; /** * The model to use for embeddings */ model: string; provider?: models.ProviderPreferences | null | undefined; /** * A unique identifier for the end-user */ user?: string | undefined; }; export type CreateEmbeddingsRequest = { /** * The app identifier should be your app's URL and is used as the primary identifier for rankings. * * @remarks * This is used to track API usage per application. */ httpReferer?: string | undefined; /** * The app display name allows you to customize how your app appears in OpenRouter's dashboard. * * @remarks */ appTitle?: string | undefined; /** * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. * * @remarks */ appCategories?: string | undefined; requestBody: CreateEmbeddingsRequestBody; }; /** * Embedding vector as an array of floats or a base64 string */ export type Embedding = Array | string; export declare const ObjectEmbedding: { readonly Embedding: "embedding"; }; export type ObjectEmbedding = ClosedEnum; /** * A single embedding object */ export type CreateEmbeddingsData = { /** * Embedding vector as an array of floats or a base64 string */ embedding: Array | string; /** * Index of the embedding in the input list */ index?: number | undefined; object: ObjectEmbedding; }; export declare const ObjectT: { readonly List: "list"; }; export type ObjectT = ClosedEnum; /** * Per-modality token breakdown. Only present when the input contains 2+ modalities (e.g. text + image) and the upstream provider returns modality-level usage data. Only non-zero modality counts are included. */ export type PromptTokensDetails = { /** * Number of audio tokens in the input */ audioTokens?: number | undefined; /** * Number of file/document tokens in the input */ fileTokens?: number | undefined; /** * Number of image tokens in the input */ imageTokens?: number | undefined; /** * Number of text tokens in the input */ textTokens?: number | undefined; /** * Number of video tokens in the input */ videoTokens?: number | undefined; }; /** * Token usage statistics */ export type CreateEmbeddingsUsage = { /** * Cost of the request in credits */ cost?: number | undefined; /** * Number of tokens in the input */ promptTokens: number; /** * Per-modality token breakdown. Only present when the input contains 2+ modalities (e.g. text + image) and the upstream provider returns modality-level usage data. Only non-zero modality counts are included. */ promptTokensDetails?: PromptTokensDetails | undefined; /** * Total number of tokens used */ totalTokens: number; }; /** * Embeddings response containing embedding vectors */ export type CreateEmbeddingsResponseBody = { /** * List of embedding objects */ data: Array; /** * Unique identifier for the embeddings response */ id?: string | undefined; /** * The model used for embeddings */ model: string; object: ObjectT; /** * Token usage statistics */ usage?: CreateEmbeddingsUsage | undefined; }; export type CreateEmbeddingsResponse = CreateEmbeddingsResponseBody | string; /** @internal */ export declare const EncodingFormat$outboundSchema: z.ZodType; /** @internal */ export type ImageUrl$Outbound = { url: string; }; /** @internal */ export declare const ImageUrl$outboundSchema: z.ZodType; export declare function imageUrlToJSON(imageUrl: ImageUrl): string; /** @internal */ export type ContentImageURL$Outbound = { image_url: ImageUrl$Outbound; type: "image_url"; }; /** @internal */ export declare const ContentImageURL$outboundSchema: z.ZodType; export declare function contentImageURLToJSON(contentImageURL: ContentImageURL): string; /** @internal */ export type ContentText$Outbound = { text: string; type: "text"; }; /** @internal */ export declare const ContentText$outboundSchema: z.ZodType; export declare function contentTextToJSON(contentText: ContentText): string; /** @internal */ export type Content$Outbound = ContentText$Outbound | ContentImageURL$Outbound | models.ContentPartInputAudio$Outbound | models.ContentPartInputVideo$Outbound | models.ContentPartInputFile$Outbound; /** @internal */ export declare const Content$outboundSchema: z.ZodType; export declare function contentToJSON(content: Content): string; /** @internal */ export type Input$Outbound = { content: Array; }; /** @internal */ export declare const Input$outboundSchema: z.ZodType; export declare function inputToJSON(input: Input): string; /** @internal */ export type InputUnion$Outbound = string | Array | Array | Array> | Array; /** @internal */ export declare const InputUnion$outboundSchema: z.ZodType; export declare function inputUnionToJSON(inputUnion: InputUnion): string; /** @internal */ export type CreateEmbeddingsRequestBody$Outbound = { dimensions?: number | undefined; encoding_format?: string | undefined; input: string | Array | Array | Array> | Array; input_type?: string | undefined; model: string; provider?: models.ProviderPreferences$Outbound | null | undefined; user?: string | undefined; }; /** @internal */ export declare const CreateEmbeddingsRequestBody$outboundSchema: z.ZodType; export declare function createEmbeddingsRequestBodyToJSON(createEmbeddingsRequestBody: CreateEmbeddingsRequestBody): string; /** @internal */ export type CreateEmbeddingsRequest$Outbound = { "HTTP-Referer"?: string | undefined; appTitle?: string | undefined; appCategories?: string | undefined; RequestBody: CreateEmbeddingsRequestBody$Outbound; }; /** @internal */ export declare const CreateEmbeddingsRequest$outboundSchema: z.ZodType; export declare function createEmbeddingsRequestToJSON(createEmbeddingsRequest: CreateEmbeddingsRequest): string; /** @internal */ export declare const Embedding$inboundSchema: z.ZodType; export declare function embeddingFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const ObjectEmbedding$inboundSchema: z.ZodEnum; /** @internal */ export declare const CreateEmbeddingsData$inboundSchema: z.ZodType; export declare function createEmbeddingsDataFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const ObjectT$inboundSchema: z.ZodEnum; /** @internal */ export declare const PromptTokensDetails$inboundSchema: z.ZodType; export declare function promptTokensDetailsFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const CreateEmbeddingsUsage$inboundSchema: z.ZodType; export declare function createEmbeddingsUsageFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const CreateEmbeddingsResponseBody$inboundSchema: z.ZodType; export declare function createEmbeddingsResponseBodyFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const CreateEmbeddingsResponse$inboundSchema: z.ZodType; export declare function createEmbeddingsResponseFromJSON(jsonString: string): SafeParseResult; //# sourceMappingURL=createembeddings.d.ts.map