> For the complete documentation index, see [llms.txt](https://docs.halfred.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.halfred.ai/02-sdk-integration.md).

# SDK Integration

Multiple integration options for Halfred including native SDKs for Node.js and Python, plus OpenAI SDK compatibility.

## 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.md) - Official SDK for JavaScript and TypeScript projects
* [**Python SDK**](https://docs.halfred.ai/02-sdk-integration/02-python.md) - 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.md) - 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.md) - 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)
