OpenAI SDK Compatibility
Use Halfred as a drop-in replacement for OpenAI with existing OpenAI SDK libraries. Simply point your client to Halfred's endpoint.
Why Use OpenAI SDK with Halfred?
Quick Setup
Base URL Configuration
Base URL: https://api.halfred.ai/v1/
API Key: Your Halfred API key (starts with "halfred_")Language-Specific Examples
JavaScript/TypeScript (Node.js)
Installation
Configuration
Environment Variables
Python
Installation
Configuration
Environment Variables
Go
Installation
Configuration
PHP
Installation
Configuration
Ruby
Installation
Configuration
Model Selection
Available Models
Model Name
Halfred Profile
Description
Alternative Model Names
Supported Features
✅ Fully Supported
Response Format
Additional Fields
Migration from OpenAI
Step 1: Update Configuration
Step 2: Update Model Names
Step 3: Test Your Integration
Best Practices
Model Selection Strategy
Error Handling
Troubleshooting
Common Issues
Authentication Error
Invalid Model Error
Base URL Not Set
Timeout Configuration
Retry Logic
Support
Last updated