Skip to main content

OpenAI (direct)

Connect Toby directly to the OpenAI API. Personas that use the openai provider send requests to OpenAI with bare model ids (no provider/ prefix).

Get an API key

  1. Sign in at platform.openai.com.
  2. Open API keys (under your organization settings).
  3. Create a new secret key. Copy it immediately—OpenAI shows the full value only once.
  4. Ensure your account has billing enabled and usage limits that fit your expected volume.

Store the key in Toby, not in shell profiles or committed files.

Configure in Toby

toby config
  1. Go to AI → OpenAI → API Token.
  2. Paste your API key and save.

Toby writes the token to ~/.toby/credentials.json.

For a persona, set AI Provider to openai and choose a model from the list (or type a supported model id if you know it is available on your account).

These models are built into Toby’s configure picker and work well for everyday use. All use direct ids (examples below).

ModelRole
gpt-5-miniDefault for the built-in Toby persona. Strong balance of quality, speed, and cost for chat, summarization, and organization.
gpt-4.1-miniReliable fallback for planning and other auxiliary calls.
gpt-4.1-nanoDefault pretreatment model when using OpenAI direct (fast classification).

Faster or lower cost

ModelRole
gpt-5-nanoLighter GPT-5 tier for quick triage or high-volume schedules.
gpt-4.1-nanoCheapest GPT-4.1 family option for simple classification-style work.
gpt-4o-miniOlder but still capable small model if your account still lists it.

Higher quality or reasoning

ModelRole
gpt-5More capable GPT-5 tier when answers need extra depth.
gpt-4.1Strong general model when you want quality without the GPT-5 line.
gpt-4oPrevious flagship multimodal model; still useful if you rely on it today.
o3Reasoning-focused work (complex planning, multi-step analysis).
o4-miniLighter reasoning model when you want some “think longer” behavior at lower cost than o3.

Start with gpt-5-mini for most personas. Move to gpt-5 or o3 when you notice quality limits; use gpt-5-nano for cron-style schedules that run often.

Prompt caching

Toby sends a stable OpenAI promptCacheKey on chat turns so repeated system prompts can hit OpenAI prompt caching when your model and account support it.

Environment variables

VariablePurpose
TOBY_PRETREAT_MODELOverride the pretreatment model (bare OpenAI id, e.g. gpt-4.1-nano)
TOBY_PRETREAT_DELTASet to 0 to disable follow-up delta pretreatment (default: enabled)

OpenAI credentials are not read from OPENAI_API_KEY by Toby today—use configure or ~/.toby/credentials.json via backup/restore.

See also