Skip to main content

Best Model for This

Costs assume ~1K tokens input + ~500 tokens output per step, at today’s published prices. qwen-3-coder and minimax-m2.5 are in the free tier; kimi-k2.6 needs a top-up first.

Quick Start

Tips & Best Practices

  • Set temperature=0 — deterministic code generation reduces syntax errors and off-script behavior.
  • Include file context in system prompt — paste relevant file contents so the model knows your codebase structure.
  • Most active models support tool calling — a few (the sonar search models, for example) do not. Check supports_tools in /v1/models before switching model.
  • Limit execution environment — sandbox run_python with a timeout and restricted imports for production agents.

Cost Estimate

Costs scale with context size — long files passed to the model increase input tokens significantly.

Next Steps