Skip to main content

OpenAI

Use GPT and o-series models from OpenAI as the LLM for your agents.

Get an API key

Sign up at platform.openai.com and create an API key under API Keys.

Setup

# 1. Store the key
pai add secret openai-key --from-literal api-key=sk-...

# 2. Create a model binding
pai apply -f - <<EOF
apiVersion: pai.io/v1
kind: ModelBinding
metadata:
name: gpt-4o
spec:
provider: openai
model: gpt-4o
maxTokensPerDay: 500000
maxTokensPerRequest: 16000
apiKeySecretRef:
name: openai-key
key: api-key
EOF

Supported models

Modelmodel valueBest for
GPT-4ogpt-4oBest overall — multimodal, fast
GPT-4o minigpt-4o-miniFast, cost-efficient
o1o1Deep reasoning
o3-minio3-miniFast reasoning

Use in an agent

spec:
modelBindings:
- gpt-4o