{"record":{"id":"dba48cba1057889b","repo":"vercel/ai","slug":"too-many-values-for-a-single-embedding-call-the","errorCode":null,"errorMessage":"Too many values for a single embedding call. The ${options.provider} model \"${options.modelId}\" can only embed up to ${options.maxEmbeddingsPerCall} values per call, but ${options.values.length} values were provided.","messagePattern":"Too many values for a single embedding call\\. The (.+?) model \"(.+?)\" can only embed up to (.+?) values per call, but (.+?) values were provided\\.","errorType":"exception","errorClass":"TooManyEmbeddingValuesForCallError","httpStatus":null,"severity":"error","filePath":"packages/cohere/src/cohere-embedding-model.ts","lineNumber":76,"sourceCode":"    return this.config.provider;\n  }\n\n  async doEmbed({\n    values,\n    headers,\n    abortSignal,\n    providerOptions,\n  }: Parameters<EmbeddingModelV4['doEmbed']>[0]): Promise<\n    Awaited<ReturnType<EmbeddingModelV4['doEmbed']>>\n  > {\n    const embeddingOptions = await parseProviderOptions({\n      provider: 'cohere',\n      providerOptions,\n      schema: cohereEmbeddingModelOptions,\n    });\n\n    if (values.length > this.maxEmbeddingsPerCall) {\n      throw new TooManyEmbeddingValuesForCallError({\n        provider: this.provider,\n        modelId: this.modelId,\n        maxEmbeddingsPerCall: this.maxEmbeddingsPerCall,\n        values,\n      });\n    }\n\n    const {\n      responseHeaders,\n      value: response,\n      rawValue,\n    } = await postJsonToApi({\n      url: `${this.config.baseURL}/embed`,\n      headers: combineHeaders(this.config.headers?.(), headers),\n      body: {\n        model: this.modelId,\n        // The AI SDK only supports 'float' embeddings. Note that the Cohere API\n        // supports other embedding types, but they are not currently supported by the AI SDK.","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/vercel/ai/blob/69428b1f8b037e4d118fb4853428d5c4e620493c/packages/cohere/src/cohere-embedding-model.ts#L58-L94","documentation":"Error \"Too many values for a single embedding call. The ${options.provider} model \"${options.modelId}\" can only embed up to ${options.maxEmbeddingsPerCall} values per call, but ${options.values.length} values were provided.\" thrown in vercel/ai.","triggerScenarios":"Thrown at packages/cohere/src/cohere-embedding-model.ts:76 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"69428b1f8b037e4d118fb4853428d5c4e620493c","analyzedAt":"2026-08-30T12:32:21.016Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}