Skip to content

[Bug Report]: The OPENAI_API_KEY environment variable is missing or empty #945

@hidaviddong

Description

@hidaviddong

Version

0.2.10

Issue Type

  • Select a issue type 👇
  • Agent TARS Web UI (@agent-tars/web-ui)
  • Agent TARS CLI (@agent-tars/server)
  • Agent TARS Server (@agent-tars/server)
  • Agent TARS (@agent-tars/core)
  • MCP Agent (@mcp-agent/core)
  • Agent Kernel (@multimodal/agent)
  • Other (please specify in description)

Model Provider

  • Select a model provider 👇
  • Volcengine
  • Anthropic
  • OpenAI
  • Azure OpenAI
  • Other (please specify in description)

Problem Description

I use agent-tars workspace --init to create a workspace
and then i create a .env file

OPENAI_API_KEY=abcdefg

Myagent-tars.config.ts file is as follows

import { defineConfig } from "@agent-tars/interface";
const config = defineConfig({
  model: {
    provider: "volcengine",
    id: "doubao-1-5-thinking-vision-pro-250428",
    apiKey: process.env.OPENAI_API_KEY
  },
});

export default config;

But when i run agent-tars, it can correctly load the workspace and model in the config file

Image

But theapiKey in the configuration file cannot be read

Error Logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions