---
title: OpenAI
url: https://arcana.otnelhq.com/docs/providers/openai
---

# OpenAI



OpenAI provides GPT-4o, o1, o3, and other frontier models. Set one environment variable and Arcana detects it automatically.




## Setup



```bash
# 1. Get your API key from https://platform.openai.com/api-keys
export OPENAI_API_KEY=sk-...

# 2. Verify detection
arcana doctor

# 3. Run
arcana run "hello"
```




## Available Models



| Model | Context | Best For |
| --- | --- | --- |
| `gpt-4o` | 128K | General purpose, tool use, coding |
| `gpt-4o-mini` | 128K | Fast, cheap, good for extraction |
| `o1` | 128K | Deep reasoning, math, complex analysis |
| `o3` | 200K | Advanced reasoning, coding challenges |
| `o3-mini` | 200K | Fast reasoning, cost-effective |




## Config File



You can also set the provider in `~/.arcana/config.json`:



```json
{
  "provider": "openai",
  "model": "gpt-4o",
  "utilityModel": "gpt-4o-mini"
}
```




## Environment Variables



| Variable | Description |
| --- | --- |
| `OPENAI_API_KEY` | Your OpenAI API key (required) |
| `OPENAI_BASE_URL` | Custom base URL for compatible proxies |
| `OPENAI_ORG_ID` | Organization ID for billing (optional) |




## Pricing Notes



OpenAI charges per token. Approximate costs per 1M tokens:



| Model | Input | Output |
| --- | --- | --- |
| gpt-4o | $2.50 | $10.00 |
| gpt-4o-mini | $0.15 | $0.60 |
| o1 | $15.00 | $60.00 |
| o3 | $10.00 | $40.00 |



Prices may change. Check [openai.com/pricing](https://openai.com/pricing) for current rates.




## Tips



- Use `gpt-4o-mini` as the `utilityModel` for extraction and compaction tasks to save costs
- `o1` and `o3` are slower but excel at complex reasoning
- Set `OPENAI_BASE_URL` to use OpenAI-compatible APIs (e.g., Azure, local proxies)
- Run `arcana doctor` to verify your key is detected
