OpenAI
Connect Scrub AI to OpenAI to use GPT-5 and other OpenAI models with PHI protection.
Setup
- Get an OpenAI API key from platform.openai.com
- Log in to your Scrub AI Dashboard
- Go to Providers and select OpenAI
- Paste your API key and save
Available Models
| Model | Description |
|---|---|
gpt-5.2 | The best model for coding and agentic tasks across industries |
gpt-5-mini | A faster, cost-efficient version of GPT-5 for well-defined tasks |
gpt-5-nano | Fastest, most cost-efficient version of GPT-5 |
gpt-5.2-pro | Premium GPT-5.2 with enhanced capabilities |
gpt-5.2.1-2025-04-14 | Smartest non-reasoning model |
Example Request
curl https://api.scrub.health/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $SCRUB_API_KEY" \
-d '{
"model": "gpt-5.2",
"messages": [
{"role": "system", "content": "You are a helpful healthcare assistant."},
{"role": "user", "content": "What are the symptoms of hypertension?"}
],
"temperature": 0.7
}'
Using the OpenAI SDK
Since Scrub AI is OpenAI-compatible, you can use the official OpenAI SDK by changing the base URL:
from openai import OpenAI
client = OpenAI(
api_key="your_scrub_api_key",
base_url="https://api.scrub.health/v1"
)
response = client.chat.completions.create(
model="gpt-5.2",
messages=[
{"role": "user", "content": "Hello!"}
]
)
print(response.choices[0].message.content)
import OpenAI from 'openai';
const client = new OpenAI({
apiKey: process.env.SCRUB_API_KEY,
baseURL: 'https://api.scrub.health/v1',
});
const response = await client.chat.completions.create({
model: 'gpt-5.2',
messages: [{ role: 'user', content: 'Hello!' }],
});
console.log(response.choices[0].message.content);
Supported Parameters
Scrub AI passes through all standard OpenAI parameters:
temperaturemax_tokenstop_pfrequency_penaltypresence_penaltystopstreamn
Streaming
Streaming is fully supported:
stream = client.chat.completions.create(
model="gpt-5.2",
messages=[{"role": "user", "content": "Tell me a story"}],
stream=True
)
for chunk in stream:
if chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="")