This document explains how to configure HEDit to use the Claude Platform on Amazon Web Services (AWS) for cloud-based large language model (LLM) inference.
The Claude Platform on AWS is an Anthropic-operated Messages API billed through the AWS Marketplace. It is explicitly NOT Amazon Bedrock: requests go to an Anthropic-managed endpoint and are authenticated with an Anthropic API key plus a workspace identifier.
- Single provider: All agents run on Anthropic Claude models
- Simple billing: Usage is billed through your AWS account
- Consistent quality: The same models power annotation, evaluation, and vision
| Model | Role |
|---|---|
claude-haiku-4-5 |
Default for annotation, evaluation (judge), and vision |
claude-sonnet-5 |
Optional, larger, 2.3x the cost (no measured quality gain, see docs/reasoning.md) |
No other models are offered (Opus is not available).
Legacy OpenRouter-style identifiers such as anthropic/claude-haiku-4.5 are accepted as aliases,
but qwen, mistral, and gpt-oss model identifiers are rejected with HTTP 400.
- Sign in to the AWS Console
- Navigate to Claude Platform on AWS -> API keys
- Create an API key and note your workspace ID (
wrkspc_...)
All three credentials are required; the endpoint rejects requests that do not carry the workspace header.
Option A: Using .env file (Recommended)
cp .env.example .envThen edit .env and set:
LLM_PROVIDER=anthropic
ANTHROPIC_API_KEY=your-api-key-here
ANTHROPIC_BASE_URL=https://aws-external-anthropic.us-east-2.api.aws
ANTHROPIC_WORKSPACE_ID=wrkspc_your_workspace_id
# Model configuration (defaults shown)
ANNOTATION_MODEL=claude-haiku-4-5
EVALUATION_MODEL=claude-haiku-4-5
VISION_MODEL=claude-haiku-4-5Option B: Environment variables (edit ~/.bashrc or ~/.zshrc):
export LLM_PROVIDER=anthropic
export ANTHROPIC_API_KEY=your-api-key-here
export ANTHROPIC_BASE_URL=https://aws-external-anthropic.us-east-2.api.aws
export ANTHROPIC_WORKSPACE_ID=wrkspc_your_workspace_idNotes:
LLM_PROVIDER=anthropicis the only supported value; legacy valuesopenrouterandollamaare coerced toanthropicwith a warning.- The per-agent provider variables
(
ANNOTATION_PROVIDER,EVALUATION_PROVIDER,VISION_PROVIDER,LLM_PROVIDER_PREFERENCE) were removed; models are selected by bare model identifier only. - Set
ANNOTATION_MODEL=claude-sonnet-5for the highest annotation quality. HEDIT_PROMPT_CACHE_TTLsets the prompt-cache lifetime,5m(default) or1h. Keep5mfor a server; see prompt-caching.md for when1his cheaper.
Once configured, the API works as follows:
curl -X POST http://localhost:38427/annotate \
-H "Content-Type: application/json" \
-d '{
"description": "A red circle appears on the left side of the screen",
"schema_version": "8.3.0",
"max_validation_attempts": 3
}'Users can supply their own first-party Anthropic API key (sk-ant-...)
via the X-Anthropic-Key request header.
BYOK requests go to api.anthropic.com, not the AWS workspace endpoint.
Model, evaluation-model, vision-model, and temperature overrides travel as
X-Anthropic-Model, X-Anthropic-Eval-Model, X-Anthropic-Vision-Model, and
X-Anthropic-Temperature.
The legacy X-OpenRouter-* spellings of those names remain accepted indefinitely,
so existing clients keep working.
Error: "ANTHROPIC_API_KEY environment variable is required"
- Set the variable and reload your shell:
source ~/.bashrc
Requests rejected by the endpoint
- Verify
ANTHROPIC_WORKSPACE_IDis set; the endpoint rejects requests without the workspace header - Verify
ANTHROPIC_BASE_URLishttps://aws-external-anthropic.us-east-2.api.aws
HTTP 400 on model selection
- Only
claude-haiku-4-5andclaude-sonnet-5are offered; other model identifiers are rejected
Every annotation reports its token use, cost, and prompt-cache savings:
in the CLI output, in the usage field of API responses, and server-wide via
GET /metrics (server API key required).
The annotation prefix is ~21.8k tokens, so a cache hit removes roughly 80% of a
request's cost. See prompt-caching.md for measured figures
and the break-even math.
- Claude API documentation: https://docs.anthropic.com/
- HEDit issues: https://github.com/Annotation-Garden/HEDit/issues