An AI key connects AI nodes and the agent to a model provider.
Add a key
- Dataset › AI › Add key.
- Pick the Provider: OpenAI or DeepSeek.
- Paste the API key (OpenAI also takes an optional Organization ID and Project ID).
- Load models and pick the Model; optionally an Effort (
noneturns reasoning off; empty = the model's default). - Optionally fill Price (USD per 1M tokens): Input, Cached input, Output, from the provider's pricing page.
- Verify & add: the key is checked with the provider before it's saved.
The list shows the model, a hint of the key, Last used, and the Balance (DeepSeek; OpenAI doesn't expose it to API keys). Test sends a tiny prompt: Replied "OK" in 0.8s.
Prices and cost
With prices set, every AI step logs its cost and runs add it up:
cost = (input − cached) × price.input / 1e6 + cached × price.cached / 1e6 + output × price.output / 1e6
Example: 3,357 input (1,000 cached), 2,074 output at $0.27 / $0.07 / $1.10 → 0.000636 + 0.00007 + 0.002281 ≈ $0.0030.
Leave all prices empty to show tokens only. The price belongs to the key's own model: when the agent overrides the model for a conversation, those calls count tokens without cost. Cost shows on the run's summary card, the Runs page and Insights.
Used by
All ai/* nodes (Prompt, JSON, Choose, Classify, Summarize, Write, Guard) and the Studio agent. Agent turns can override the model and effort per conversation.
How flows use it
AI nodes never pick a key directly. A flow declares an AI key option (Flow settings › Options), ai in every template, and its AI nodes' AI key (and Fallback AI key) fields use it: {{ option.ai }}. Then:
- A campaign picks one of your AI keys for it; Studio runs use the option's default (a template starts it on your first key).
- The key goes into what the run gets as the node's secret.
A field holding a key id instead of an option is refused when the run starts: "ai" must use an AI key option. Campaign exports carry the key's name, matched back to your key with the same name on import.
FAQ
"Not enough balance for API calls"
The provider account behind the key has no credit. Top it up and Refresh balance.
Can images be sent to the model?
In the agent, yes (pasted or attached images, OpenAI image parts). AI nodes send text.