Developer quickstart
Connect your app to Halvr.
Start with one small request. You need a Halvr account and an API key from your model provider. Halvr tracks the request; your provider still charges for inference.
Summary
Add your provider credential in Services, create a Halvr API key in API Keys, and send a chat request to https://api.halvr.io/v1/chat/completions. Use the Halvr key as the bearer token, not your provider key.
Endpoint
OpenAI-compatible chat API
Authentication
Halvr API key
Prerequisite
Provider API access
1. Connect a provider and create a Halvr key.
Create an account, verify your email, and finish project setup. In Services, add an OpenAI API key with access to the model you intend to use. Run the connection test. A saved credential is not proof that the provider will accept a request: model permissions, billing, quota, and network access still matter.
Open API Keys and create a key for this project. Save it when it is shown, then put it in a server-side environment variable named HALVR_API_KEY. Never expose a Halvr key in browser JavaScript, a public repository, or a screenshot.
2. Send a small, bounded request.
The example below uses an OpenAI model. Confirm that your provider account supports it. Supply your Halvr key through the environment; the request should go to Halvr, not directly to the provider. This is a real inference request and may incur a small provider charge.
max_tokens sets the output ceiling for this request. customerId and feature are attribution labels: use stable internal identifiers, not names, email addresses, or other sensitive information.
curl https://api.halvr.io/v1/chat/completions \
--header "Authorization: Bearer $HALVR_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"model": "gpt-4o-mini",
"messages": [{"role": "user", "content": "Reply with pong."}],
"max_tokens": 16,
"metadata": {
"customerId": "customer_123",
"feature": "connection_test"
}
}'3. Check the request and its cost.
Open Requests in the dashboard and find the request by time, model, and attribution labels. Check the provider, token counts, cost, and outcome. Usage is processed asynchronously, so a successful API response can appear before the dashboard has caught up.
If no record appears, confirm that the app used the Halvr endpoint and a key belonging to the project you are viewing. Calls made directly to a provider are outside Halvr's request path and cannot be blocked by its budgets.
4. Add a spend limit before sending more traffic.
Set a project spend budget in Settings, then add a narrower limit to the API key if needed. Spend enforcement uses dollar costs across models, not just a token count. The rolling window covers the trailing 30 UTC day buckets; it is not a calendar-month reset.
Halvr reserves estimated spend before a provider call and reconciles when usage arrives. A completed request can cost more than its estimate; that overage is recorded and can block subsequent requests. Do not treat a budget as a promise that no in-flight request can ever take the total above the limit.
Configure and test a budget-alert destination. A 402 response means the request was denied for a spending or billing restriction; inspect its error body before retrying. Do not blindly retry a denied request.
Common setup errors.
401: check the Halvr bearer token and whether the key has been revoked. A provider authentication error is different: check the credential saved in Services and the upstream error details.
429: check whether the response came from Halvr's rate limit or the provider's quota. Retry transient throttling with backoff, not a tight loop. Unsupported models and malformed payloads require a configuration or request fix, not repeated retries.
Before using production traffic, test your application's handling of denied requests and provider outages. Keep provider credentials server-side, review request retention, and rotate the test key if it was exposed.
Try Halvr
Route a real request through Halvr.
Keep your current SDK. Change the base URL, attach customer and feature metadata, and set a spend limit.