# Welcome to Halfred Documentation

![Halfred, at your service](https://1478748869-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAFMBI63BCqm80BSF757A%2Fuploads%2Fgit-blob-854c0e21debfd356c458616075965926857026e2%2Fhalfred-large.png?alt=media)

## What is Halfred?

Think the precision of HAL 9000 combined with the loyalty and quiet brilliance of Alfred, Bruce Wayne's best wingman. Behind the character is a real service: an AI infrastructure layer that serves the best model for the job, with zero friction.

Halfred is not a chatbot. It's the infrastructure that handles:

* **Intelligent model routing**: Automatically selects the best model for your use case
* **Multi-provider access**: Connect to OpenAI, Anthropic, Google, Mistral, and more through a single API
* **Profile-based abstraction**: Choose a profile (Lite, Standard, DeepThink) instead of managing individual models
* **Usage tracking**: Monitor consumption and credits in real-time
* **Unified billing**: One account, one invoice, even if requests hit multiple providers

## Why Choose Halfred?

### For Developers Who Want to Ship Fast

* **5-minute integration**: Simple SDK with minimal setup
* **No AI expertise required**: Choose a profile, we handle the rest
* **Drop-in OpenAI replacement**: Use existing OpenAI SDK code with Halfred
* **Zero vendor lock-in**: Switch providers seamlessly behind the scenes

### Intelligent and Cost-Effective

* **Smart routing**: Optimized for speed, quality, and cost
* **Resilient & reliable**: No interruption—requests auto-failover to maintain service and uptime
* **Transparent pricing**: Prepaid credit system with no hidden costs
* **Free development tier**: Test and prototype without consuming credits

## Quick Links

### Getting Started

* [Quick Start Guide](https://docs.halfred.ai/01-getting-started/01-quickstart) - Get up and running in 5 minutes
* [Authentication](https://docs.halfred.ai/01-getting-started/02-authentication) - How to create and manage API keys

### SDK Integration

* [Halfred Node.js SDK](https://docs.halfred.ai/02-sdk-integration/01-nodejs) - Official Node.js/TypeScript SDK
* [Halfred Python SDK](https://docs.halfred.ai/02-sdk-integration/02-python) - Official Python SDK
* [OpenAI SDK Compatibility](https://docs.halfred.ai/02-sdk-integration/03-openai-compatibility) - Use Halfred with OpenAI clients

### Core Concepts

* [Model Profiles](https://docs.halfred.ai/03-concepts/01-profiles) - Understanding Lite, Standard, DeepThink, and Dev profiles
* [Pricing & Credits](https://docs.halfred.ai/03-concepts/02-pricing) - How credits and billing work
* [Tokens Explained](https://docs.halfred.ai/03-concepts/03-tokens) - What tokens are and why they matter

### API Reference

* [REST API Documentation](https://docs.halfred.ai/04-api-reference/01-endpoints) - Complete REST API reference
* [Error Handling](https://docs.halfred.ai/04-api-reference/02-errors) - Error codes and troubleshooting

## Need Help?

* **Email**: <support@halfred.ai>
* **Discord**: [Join our community](https://discord.gg/wS2awX4EV7)
* **Dashboard**: [halfred.ai](https://halfred.ai)

***

Ready to get started? Follow our [Quick Start Guide](https://docs.halfred.ai/01-getting-started/01-quickstart) to integrate Halfred in less than 5 minutes.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.halfred.ai/readme.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
