# SDK Integration

## Official Halfred SDKs

Native SDKs built specifically for Halfred with full feature support:

* [**Node.js / TypeScript SDK**](https://docs.halfred.ai/02-sdk-integration/01-nodejs) - Official SDK for JavaScript and TypeScript projects
* [**Python SDK**](https://docs.halfred.ai/02-sdk-integration/02-python) - Official SDK for Python applications

## OpenAI SDK Compatibility

Already using OpenAI? Switch to Halfred with minimal code changes. Also the recommended way to integrate Halfred in languages other than Python and Node.js:

* [**OpenAI SDK Compatibility Guide**](https://docs.halfred.ai/02-sdk-integration/03-openai-compatibility) - Use existing OpenAI client libraries with Halfred

**Supported Languages**: Go, PHP, Ruby, Java, .NET, Rust, and more - any language with an OpenAI SDK can work with Halfred.

## Comparison

| Feature           | Halfred Node.js SDK | Halfred Python SDK | OpenAI SDK            |
| ----------------- | ------------------- | ------------------ | --------------------- |
| Halfred-optimized | ✅                   | ✅                  | ⚠️ Compatibility mode |
| Type safety       | ✅ TypeScript        | ✅ Type hints       | ✅                     |
| Async/await       | ✅                   | ✅                  | ✅                     |
| Profile selection | ✅                   | ✅                  | ✅                     |
| Migration effort  | New install         | New install        | Change endpoint only  |

## Choosing the Right SDK

### Use Halfred Native SDKs When:

* Starting a new project
* You want Halfred-specific features and optimizations
* You need the latest features first
* You want official support and documentation

### Use OpenAI SDK Compatibility When:

* You have existing OpenAI integration
* You want a drop-in replacement with minimal changes
* Your team is already familiar with OpenAI SDK
* You need to support both OpenAI and Halfred endpoints
* **You're working in a language other than Python or Node.js** (Go, PHP, Ruby, Java, .NET, etc.)

## REST API Alternative

If you prefer direct HTTP calls or your language isn't supported yet, use our REST API:

* [**REST API Reference**](https://docs.halfred.ai/04-api-reference/01-endpoints) - Complete HTTP API documentation

## Coming Soon

We're working on SDKs for:

* Flutter
* Kotlin
* Swift

Want to see support for a specific language? [Let us know](mailto:support@halfred.ai)!

## Support

Need help with integration?

* **Email**: <support@halfred.ai>
* **Discord**: [Join our community](https://discord.gg/wS2awX4EV7)
* **Examples**: Check out our [GitHub examples repository](https://github.com/halfred-ai/examples)
