OpenAI
OpenAI is one of the supported AI providers in Clanker. It uses the OpenAI Chat Completions API.
Provider Details
| Property | Value |
|---|---|
| Config key | openai |
| Default model | gpt-5 |
| API endpoint | https://api.openai.com/v1 |
| Auth method | API key |
Configuration
Add the following to ~/.clanker.yaml:
yaml
ai:
default_provider: openai
providers:
openai:
model: gpt-5
api_key: "sk-proj-..."Alternatively, use the api_key_env field to read the key from an environment variable:
yaml
ai:
default_provider: openai
providers:
openai:
model: gpt-5
api_key_env: OPENAI_API_KEYEnvironment Variable
| Variable | Description |
|---|---|
OPENAI_API_KEY | OpenAI API key |
CLI Flag Overrides
| Flag | Description |
|---|---|
--ai-profile openai | Select this provider |
--openai-key <key> | Override the API key for this query |
--openai-model <model> | Override the model for this query |
Usage Example
bash
# Set the key via environment variable
export OPENAI_API_KEY="sk-proj-..."
# Query using OpenAI
clanker ask --ai-profile openai "What Lambda functions have high error rates?"
# Override model and key inline
clanker ask --ai-profile openai --openai-key "$OPENAI_API_KEY" --openai-model gpt-4o "Show me EC2 instances"