{"record":{"id":"4fc51391752fd437","repo":"mastra-ai/mastra","slug":"provider-normalizedconfig-providerid-does-not-h","errorCode":null,"errorMessage":"Provider ${normalizedConfig.providerId} does not have a URL configured","messagePattern":"Provider (.+?) does not have a URL configured","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/core/src/llm/model/embedding-router.ts","lineNumber":254,"sourceCode":"        }\n      }\n\n      if (!apiKey) {\n        const envVarDisplay = Array.isArray(providerConfig.apiKeyEnvVar)\n          ? providerConfig.apiKeyEnvVar.join(' or ')\n          : providerConfig.apiKeyEnvVar;\n        throw new Error(`API key not found for provider ${normalizedConfig.providerId}. Set ${envVarDisplay}`);\n      }\n\n      // Initialize the provider model directly in constructor\n      if (normalizedConfig.providerId === 'openai') {\n        this.providerModel = createOpenAI({ apiKey }).embeddingModel(normalizedConfig.modelId);\n      } else if (normalizedConfig.providerId === 'google') {\n        this.providerModel = createGoogleGenerativeAI({ apiKey }).embeddingModel(normalizedConfig.modelId);\n      } else {\n        // Use OpenAI-compatible provider for other providers\n        if (!providerConfig.url) {\n          throw new Error(`Provider ${normalizedConfig.providerId} does not have a URL configured`);\n        }\n        this.providerModel = createOpenAICompatible({\n          name: normalizedConfig.providerId,\n          apiKey,\n          baseURL: providerConfig.url,\n        }).embeddingModel(normalizedConfig.modelId);\n      }\n    }\n\n    // Copy properties from the provider model if available\n    if (this.providerModel.maxEmbeddingsPerCall !== undefined) {\n      this.maxEmbeddingsPerCall = this.providerModel.maxEmbeddingsPerCall;\n    }\n    if (this.providerModel.supportsParallelCalls !== undefined) {\n      this.supportsParallelCalls = this.providerModel.supportsParallelCalls;\n    }\n  }\n","sourceCodeStart":236,"sourceCodeEnd":272,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/core/src/llm/model/embedding-router.ts#L236-L272","documentation":"For registry providers that are neither openai nor google, the router falls back to an OpenAI-compatible client, which requires a base URL. If the GatewayRegistry entry for that provider has no url configured, the constructor throws because it has no endpoint to send requests to.","triggerScenarios":"new EmbeddingRouter(\"some-compatible-provider/model-id\") where the provider exists in the registry (so it passed the unknown-provider check) but its registry entry lacks a `url`, and no explicit url was supplied in config.","commonSituations":"Partially registered/custom providers; registry misconfiguration after editing gateway defaults; using a provider that requires an explicit url (self-hosted vLLM, Azure resource endpoint) without supplying it.","solutions":["Pass an explicit url in the object config: { providerId, modelId, url: \"https://your-endpoint/v1\", apiKey }.","Fix the provider's registry entry to include the correct base url.","Switch to a fully registered provider (openai, google) if you didn't intend to use a custom endpoint.","Check for typos in the providerId that may match a stub/placeholder registry entry."],"exampleFix":"// before\nnew EmbeddingRouter(\"custom-provider/embed-model\");\n// after\nnew EmbeddingRouter({\n  providerId: \"custom-provider\",\n  modelId: \"embed-model\",\n  url: \"https://api.custom-provider.com/v1\",\n  apiKey: process.env.CUSTOM_API_KEY,\n});","handlingStrategy":"validation","validationCode":"const pc = GatewayRegistry.getInstance().getProviderConfig(providerId);\nif (pc && !pc.url && providerId !== 'openai' && providerId !== 'google' && !config.url) {\n  throw new Error(`Provider \"${providerId}\" has no registry URL; pass url in config`);\n}","typeGuard":"const hasEndpoint = (providerId, config) => Boolean(config?.url || GatewayRegistry.getInstance().getProviderConfig(providerId)?.url);","tryCatchPattern":"try {\n  router = new EmbeddingRouter(config);\n} catch (e) {\n  if (e instanceof Error && e.message.includes('does not have a URL configured')) {\n    console.error(`Add { url: \"https://your-endpoint/v1\" } to the config for ${config.providerId}`);\n  } else throw e;\n}","preventionTips":["Always supply an explicit url for self-hosted or OpenAI-compatible endpoints.","Keep registry entries complete (url + apiKeyEnvVar) when customizing gateways.","Verify provider endpoints with a smoke request at startup."],"tags":["configuration","url","provider-registry"],"backgroundTag":"missing-provider-url","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}