{"record":{"id":"b92be5062a5289fc","repo":"vercel/ai","slug":"together-ai-api-key-is-deprecated-and-will-be-remo","errorCode":null,"errorMessage":"TOGETHER_AI_API_KEY is deprecated and will be removed in a future release. Please use TOGETHER_API_KEY instead.","messagePattern":"TOGETHER_AI_API_KEY is deprecated and will be removed in a future release\\. Please use TOGETHER_API_KEY instead\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/togetherai/src/togetherai-provider.ts","lineNumber":110,"sourceCode":"  reranking(modelId: TogetherAIRerankingModelId): RerankingModelV4;\n\n  /**\n   * Creates a model for reranking.\n   */\n  rerankingModel(modelId: TogetherAIRerankingModelId): RerankingModelV4;\n}\n\nfunction loadDeprecatedApiKey(): string | undefined {\n  if (typeof process === 'undefined') {\n    return undefined;\n  }\n  // If the new env var is set, let loadApiKey handle it\n  if (typeof process.env.TOGETHER_API_KEY === 'string') {\n    return undefined;\n  }\n  const key = process.env.TOGETHER_AI_API_KEY;\n  if (typeof key === 'string') {\n    console.warn(\n      'TOGETHER_AI_API_KEY is deprecated and will be removed in a future release. Please use TOGETHER_API_KEY instead.',\n    );\n  }\n  return key;\n}\n\nexport function getModelStructuredOutputSupport(\n  modelId: TogetherAIChatModelId,\n): boolean {\n  return modelId === 'deepseek-ai/DeepSeek-V4-Flash-0731';\n}\n\nexport function createTogetherAI(\n  options: TogetherAIProviderSettings = {},\n): TogetherAIProvider {\n  const baseURL = withoutTrailingSlash(\n    options.baseURL ?? 'https://api.together.xyz/v1/',\n  );","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/vercel/ai/blob/69428b1f8b037e4d118fb4853428d5c4e620493c/packages/togetherai/src/togetherai-provider.ts#L92-L128","documentation":"The TogetherAI provider loads its API key from an environment variable; TOGETHER_AI_API_KEY is the deprecated name. When only the deprecated variable is set (and TOGETHER_API_KEY is not), the key still works but this deprecation warning is printed, because the variable will be removed in a future release.","triggerScenarios":"Creating the TogetherAI provider (createTogetherAI or the default export) with only process.env.TOGETHER_AI_API_KEY set and no explicit apiKey argument and no TOGETHER_API_KEY.","commonSituations":"Older .env files or CI secrets configured before the env var rename; deployment platforms where legacy secret names persist after upgrading @ai-sdk/togetherai.","solutions":["Rename the environment variable from TOGETHER_AI_API_KEY to TOGETHER_API_KEY in your .env / hosting secret settings.","Alternatively pass the key explicitly via createTogetherAI({ apiKey: '...' }).","Update CI/CD secret names and any IaC templates referencing the old variable.","If you set both, keep only TOGETHER_API_KEY to keep behavior predictable."],"exampleFix":"// before (.env)\nTOGETHER_AI_API_KEY=sk-...\n// after (.env)\nTOGETHER_API_KEY=sk-...","handlingStrategy":"validation","validationCode":"if (process.env.TOGETHER_AI_API_KEY && !process.env.TOGETHER_API_KEY) {\n  console.warn('Rename TOGETHER_AI_API_KEY to TOGETHER_API_KEY before the next release.');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Audit .env files and CI secrets for deprecated TOGETHER_AI_API_KEY","Set TOGETHER_API_KEY as the single source of truth","Grep deploy configs/IaC for legacy env var names during upgrades"],"tags":["deprecation","env-var","togetherai","configuration"],"backgroundTag":"deprecated-env-var","analyzedSha":"69428b1f8b037e4d118fb4853428d5c4e620493c","analyzedAt":"2026-08-30T12:32:21.016Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}