Setyenv · Docs
  • English
  • Spanish
  • Chinese
  • Japanese
  • Arabic
  • German
  • French
  • Hindi
  • Indonesian
  • Italian
  • Dutch
  • Portuguese
  • Russian
  • Turkish

OpenAI

Setting up OpenAI as a provider.

Get a key

https://platform.openai.com/api-keys → Create new secret key. Restrict it to API access only. Save the key string (starts with sk-).

Add the provider

Setyenv → Agent → Providers → Add Provider → OpenAI.

Required fields:

  • API key: the sk- string.
  • Default model: gpt-4o recommended for general use, gpt-4o-mini for cost-optimised runs.

Optional:

  • Organisation ID (only if your account has multiple orgs).
  • Project ID (if you use OpenAI Projects).

Pricing

As of writing: GPT-4o is $5/M input + $15/M output. GPT-4o-mini is $0.15/M + $0.60/M. For a typical agent turn (15K input including tool catalog + 1K output), GPT-4o costs about $0.09 per turn, GPT-4o-mini costs about $0.003 per turn.

Always check https://openai.com/pricing for current numbers.

Tool use

Fully supported via OpenAI's tools parameter. The agent uses tool_choice: "auto" so the LLM decides when to call a tool vs answer directly.

Structured output

For tools that need strict JSON output, the agent uses OpenAI's response_format: json_schema mode when the model supports it (GPT-4o and newer). Reduces malformed-JSON retries to nearly zero.

Known issues

  • o1 and o3-mini reasoning models don't support tool use in the same way; the agent falls back to a "describe what you would do, then a separate model executes" pattern, which is slower. For agent use cases pick a GPT-4o variant.