# Agent authentication — haimaker.ai

How an autonomous agent gets credentials for the haimaker API and uses them.
Machine-readable companions: [`/.well-known/api-catalog`](https://haimaker.ai/.well-known/api-catalog),
[`/.well-known/ai-catalog.json`](https://haimaker.ai/.well-known/ai-catalog.json),
[OpenAPI 3.1 spec](https://api.haimaker.ai/openapi.json).

## Scheme

haimaker uses **long-lived API keys**, not OAuth. There is no authorization
server, no `/.well-known/openid-configuration`, and no
`/.well-known/oauth-authorization-server` — an agent that expects an OAuth
flow here will not find one. Present the key as a bearer credential:

```
Authorization: Bearer sk-...
```

The OpenAPI description also names an `x-litellm-api-key` header; the
`Authorization` header is the supported form and the one every OpenAI-compatible
client already sends.

## Registration

Keys are issued to a human account. An agent cannot self-register.

1. Create an account at <https://app.haimaker.ai/sign-up>.
2. In the dashboard, create an API key. Scope it to the models and spend limit
   the agent should have.
3. Hand the key to the agent through your normal secret store — environment
   variable, keychain, or secret manager. Never commit it.

Key creation, rotation, budgets and per-key model allow-lists are documented at
<https://docs.haimaker.ai/docs/key_management>.

## Making a request

Base URL: `https://api.haimaker.ai/v1`. The surface is OpenAI-compatible, so
point any OpenAI SDK at it:

```bash
curl https://api.haimaker.ai/v1/chat/completions \
  -H "Authorization: Bearer $HAIMAKER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "anthropic/claude-sonnet-5",
    "messages": [{"role": "user", "content": "Hello"}]
  }'
```

```python
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["HAIMAKER_API_KEY"],
    base_url="https://api.haimaker.ai/v1",
)
```

To wire a coding agent (Claude Code, Codex, opencode, OpenClaw, Hermes, Cline,
Kilo Code) without editing config by hand:

```bash
npx @haimaker/connect
```

## Discovering what you can call

- `GET https://api.haimaker.ai/v1/models` — models your key can reach (authenticated).
- `GET https://api.haimaker.ai/public/model_hub` — the full public catalog with
  per-token pricing, context windows and capability flags (no auth).
- `GET https://api.haimaker.ai/openapi.json` — the complete OpenAPI 3.1 description.

## Errors

| Status | Meaning |
| --- | --- |
| `401` `missing_api_key` | No `Authorization` header. |
| `401` `invalid_api_key` | Key is wrong, revoked, or from another environment. |
| `429` | Rate or budget limit hit. Back off and retry. |

The website's own `/api/contact` endpoint returns IETF `RateLimit-*` headers and
`Retry-After` on `429`; honour them rather than retrying immediately.

## Contact

Security or access questions: <https://haimaker.ai/contact-us>.
Terms: <https://haimaker.ai/terms-and-conditions>.
Privacy: <https://haimaker.ai/privacy-policy>.
