UNPKG

eve

Version:

Filesystem-first framework for durable backend AI agents that run anywhere.

31 lines (30 loc) 1.25 kB
import type { LanguageModel } from "ai"; /** * Creates a language model billed to the local ChatGPT subscription instead * of an API key, served through the Codex backend the `codex login` flow * authorizes. * * Defaults to `gpt-5.6-sol`. Pass a bare OpenAI model slug or an * `openai/`-prefixed id to override it; the Codex backend serves OpenAI models * only, so any other provider-qualified id is rejected. Model availability is * enforced by the Codex backend per account at call time, not at compile time. * * Credentials are read from the Codex CLI login on the machine the agent * runs on, so this model works in local dev and fails in a deployment. * Branch on environment for production, and set `modelContextWindowTokens` * because Codex models carry no AI Gateway metadata: * * ```ts * export default defineAgent({ * model: * process.env.NODE_ENV === "production" * ? "anthropic/claude-sonnet-4.6" * : experimental_chatgpt(), * modelContextWindowTokens: 200_000, * }); * ``` * * Experimental: the Codex backend is not a public API contract and may * change or reject subscription-backed access without notice. */ export declare function experimental_chatgpt(model?: string): LanguageModel;