Skip to content

Interface: OpenAiNamespace ​

Defined in: openai/src/builders/openai-namespace-contract.ts:11

Builder namespace contract exported as openai by @paraharness/openai.

Provides entrypoints for declaring passive OpenAiAccountSeatNode and OpenAiModelNode AST descriptors without import-time or declaration-time side effects.

Methods ​

account() ​

ts
account(id): OpenAiAccountSeatBuilder;

Defined in: openai/src/builders/openai-namespace-contract.ts:23

Declares an OpenAI API key or Codex CLI account seat (type: 'openai:account-seat').

Supports .apiKey(envRef) for API key seats and .configDir(path) for Codex CLI subscription seats.

Parameters ​

ParameterTypeDescription
idstringUnique identifier for the OpenAI account seat.

Returns ​

OpenAiAccountSeatBuilder

Fluent builder for the OpenAI account seat.

Throws ​

If id is an empty or whitespace-only string.


cliAccount() ​

ts
cliAccount(id): OpenAiAccountSeatBuilder;

Defined in: openai/src/builders/openai-namespace-contract.ts:36

Declares an OpenAI Codex CLI subscription seat (type: 'openai:account-seat').

Alias for account(id) supporting .configDir(path) and .apiKey(envRef).

Parameters ​

ParameterTypeDescription
idstringUnique identifier for the OpenAI Codex CLI seat.

Returns ​

OpenAiAccountSeatBuilder

Fluent builder for the OpenAI account seat.

Throws ​

If id is an empty or whitespace-only string.


model() ​

ts
model(alias, options?): OpenAiModelBuilder;

Defined in: openai/src/builders/openai-namespace-contract.ts:50

Declares an OpenAI Responses API model configuration (type: 'openai:model', vendor: 'openai').

Supports .accountPool(pool) / .pool(pool) and .effort(level) before compiling to OpenAiModelNode.

Parameters ​

ParameterTypeDescription
aliasstringLogical model alias (such as 'gpt5' or 'gpt-5').
options?OpenAiModelOptionsOptional OpenAI model identifier (defaults to alias) and reasoning effort.

Returns ​

OpenAiModelBuilder

Fluent builder for the OpenAI model node.

Throws ​

If alias or options.id is an empty or whitespace-only string.

Released under the MIT License.