Skip to content

ema / config / OpenAIApiConfig

Class: OpenAIApiConfig

Defined in: packages/ema/src/config.ts:117

API Configuration for the OpenAI provider.

Examples

yaml
# Configure in config.yaml
llm:
  openai:
    key: "sk-1234567890"
    base_url: "https://api.openai.com/v1"
env
# Configure in .env (suggested)
OPENAI_API_KEY=sk-1234567890
OPENAI_API_BASE=https://api.openai.com/v1

Implements

Constructors

Constructor

ts
new OpenAIApiConfig(key, base_url): OpenAIApiConfig;

Defined in: packages/ema/src/config.ts:118

Parameters

key

string = ""

API key for the OpenAI provider.

If environment variable OPENAI_API_KEY is set, it will be used first.

base_url

string = "https://api.openai.com/v1"

Base URL for the OpenAI provider.

If environment variable OPENAI_API_BASE is set, it will be used first.

Returns

OpenAIApiConfig

Properties

base_url

ts
base_url: string = "https://api.openai.com/v1";

Defined in: packages/ema/src/config.ts:130

Base URL for the OpenAI provider.

If environment variable OPENAI_API_BASE is set, it will be used first.

Implementation of

LLMApiConfig.base_url


key

ts
key: string = "";

Defined in: packages/ema/src/config.ts:124

API key for the OpenAI provider.

If environment variable OPENAI_API_KEY is set, it will be used first.

Implementation of

LLMApiConfig.key