Skip to content

OpenAI

GPT models through the OpenAI API. Simple setup, strong tool calling and structured output, embeddings included. Official docs: models · pricing · API keys.

Setup

  1. Create an account at platform.openai.com, add billing (prepaid credits) and set a monthly limit under Settings → Limits.
  2. Create a key at API keys; it is shown once.
  3. From the ai-learning folder: uv pip install -e '.[hosted]', then cp .env.example .env (if you haven't) and set:
    LLM_MODEL=openai/gpt-5.4-mini
    OPENAI_API_KEY=sk-...
    # optional, see "Embeddings" below
    # EMBED_MODEL=openai/text-embedding-3-small
    
  4. Check: python -c "import door; print(door.describe())", then cd llm-api && python tools.py.

Models for the labs

Use LLM_MODEL Note
Start here openai/gpt-5.4-mini Small, cheap, good at tools and JSON
Cheapest openai/gpt-5.4-nano Fine for moderation and routing; weaker on long agent runs
Embeddings openai/text-embedding-3-small Set as EMBED_MODEL; a new index is built

Names checked November 2026; if one is refused, take a current name from the model list.

What's different

  • Reasoning models fix their own temperature; the door drops a setting a model doesn't accept instead of failing.
  • think=True becomes reasoning_effort="medium". Some models reason by default even with think=False, which shows up as more output tokens than on Ollama.
  • Structured output is sent as a non-strict JSON schema: the shape is followed, but Pydantic still validates it.

Troubleshooting

Symptom Fix
401 AuthenticationError Wrong or missing OPENAI_API_KEY
429 insufficient_quota No credits or the monthly limit was reached: check Billing
429 rate limit New accounts start on a low usage tier: slow down (--n 20) or wait

Shared rules for data, keys, cost and evals: README.md.