Access OpenAI models including GPT-5.4, GPT-5.2, and GPT-5 mini through the OpenAI integration.
Setup
Add Provider
mixtrain provider add openaiOr via SDK:
from mixtrain import MixClient
client = MixClient()
client.create_model_provider(
provider_type="openai",
secrets={"api_key": "sk-..."}
)Once added, OpenAI models are available via mixtrain model catalog.
Usage
from mixtrain import Model
model = Model("gpt-5.4")
result = model.run({
"prompt": "Write a haiku about machine learning",
"max_tokens": 100
})Available Models
| Model ID | Description |
|---|---|
gpt-5.4 | Most capable frontier model with 1M context |
gpt-5.4-pro | Extended reasoning for difficult problems |
gpt-5.2 | Professional knowledge work |
gpt-5-mini | Fast and cost-effective |
gpt-image-1.5 | Image generation |
Configuration Options
| Parameter | Description |
|---|---|
max_tokens | Maximum tokens to generate |
temperature | Sampling temperature (0-2) |
top_p | Nucleus sampling parameter |
frequency_penalty | Reduce repetition |
presence_penalty | Encourage new topics |
Getting an API Key
- Sign up at platform.openai.com
- Navigate to API Keys
- Create a new secret key
- Add it to Mixtrain using the setup steps above