Opik Agent Optimizer Quickstart gives you the fastest path from “hello world” to a successful optimization run. If you already walked through the main Opik Quickstart (tracing + evaluation), this is the next stop—it layers on the opik-optimizer SDK so you can automatically improve prompts and agents. Prefer a UI workflow? Use Optimization Studio instead.
Estimated time: ≤10 minutes if you already have Python and an Opik API key configured.
OPENAI_API_KEY, ANTHROPIC_API_KEY, etc.)Setting OPIK_PROJECT_NAME ensures all traces, experiments, and optimization runs are logged to the same project without having to pass project_name to every SDK call.
Using a different LLM provider? The optimizer supports OpenAI, Anthropic, Gemini, Azure, Ollama, and 100+ other providers via LiteLLM. See the Configure LLM Providers guide for setup instructions.
opik dashboard or open https://www.comet.com/opik.Import ChatPrompt from opik_optimizer and wrap your messages list before passing it to any optimizer.
Re-run opik configure and confirm the account has Agent Optimizer access. If you changed machines, copy the ~/.opik/config file or re-enter the key.
Ensure provider keys (e.g., OPENAI_API_KEY) are exported in the same shell running the script, and verify the model you selected is enabled for that key.