Skip to content
Version: Current

Migrating a client to acumen

import StatusPill from ‘../../../components/StatusPill.astro’;

This guide covers everything you need to migrate your client to acumen. It consolidates guidance from multiple sources into a single reference.

Before migrating, ensure you have:

  1. An acumen instance running (see first request)
  2. A virtual key with appropriate scopes (see authentication)
  3. The base URL: http://127.0.0.1:4020 (loopback) or https://ai.tcp.systems (public, verified 2026-10-21)

acumen serves on a different base URL than most providers:

Old: https://api.openai.com/v1
New: http://127.0.0.1:4020/v1 # loopback
or
https://ai.tcp.systems/v1 # public, TLS terminated at edge

acumen uses virtual keys instead of provider keys:

Old: sk-... (OpenAI) or xai-... (Anthropic)
New: vk_... (acumen virtual key)

Key management:

Terminal window
# Create a key (admin scope required)
curl -X POST http://127.0.0.1:4020/v1/router/keys \
-H "Authorization: Bearer $ADMIN_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"my-client","scopes":["chat"],"daily_usd":10}'
# Use the key in requests
curl -X POST http://127.0.0.1:4020/v1/chat/completions \
-H "Authorization: Bearer vk_..." \
-H "Content-Type: application/json" \
-d '{"model":"cheap","messages":[{"role":"user","content":"hello"}]}'

acumen provides public model aliases instead of vendor model IDs.

  • auto: Default routing picks based on cost and availability.
  • cheap: Lowest cost option, typically GPT-3.5 tier.
  • coding: Optimized for code generation.
  • reason: Strong reasoning capabilities, typically GPT-4 tier.
  • vision: Image-capable models.
  • search: Search-enhanced models.

acumen speaks OpenAI API natively:

{
"model": "cheap",
"messages": [
{"role": "user", "content": "Hello world"}
],
"stream": false
}

For Anthropic-shaped requests, use /v1/messages:

{
"model": "cheap",
"messages": [
{"role": "user", "content": "Hello world"}
],
"max_tokens": 1000
}

acumen tells you which model actually answered your request via the X-Acumen-Served-Model header (added 2026-11-04):

HTTP/1.1 200 OK
X-Acumen-Served-Model: gpt-5.3-codex
Content-Type: application/json

This helps you understand routing decisions and debug cost variations.

Streaming works similarly to OpenAI:

Terminal window
curl -X POST http://127.0.0.1:4020/v1/chat/completions \
-H "Authorization: Bearer vk_..." \
-H "Content-Type: application/json" \
-d '{"model":"cheap","messages":[{"role":"user","content":"hello"}],"stream":true}'

The response is text/event-stream with OpenAI-formatted chunks.

acumen has specific retry behavior.

  • If a provider returns 429 or times out, acumen opens the circuit for that provider.
  • Subsequent requests retry the next available provider.
  • The same deployment is not retried immediately.
  • free or subscription seats: 30s circuit hold.
  • prepaid seats: 60s circuit hold.
  • Vendor Retry-After headers are not honored.
Status X-Acumen-Denied-By Meaning
401 key Invalid or unknown virtual key
403 scope Missing required scope
403 model Model not on allowlist
429 rate Rate limit exceeded
502 - All providers failed or exhausted
503 - No eligible provider available

acumen enforces limits at multiple levels.

  • RPM (requests per minute) and TPM (tokens per minute) per key.
  • Windows reset on process restart.
  • Daily and monthly USD limits per key.
  • Hard stops (402) when exceeded.
  • Context window and max output vary by model.
  • See /v1/models for exact values per provider.

acumen automatically fails over between providers:

  1. Bandit routing: Routes to cheapest available provider by default.
  2. Circuit breaking: Opens circuits for failing providers.
  3. Seat ranking: Eligible seats ranked by catalog order and price.
  4. No retries: Same request never retried on same deployment.
  • X-Acumen-Served-Model shows which model actually answered.
  • Check /v1/router/stats for circuit states and recent decisions.
  • Monitor /v1/router/analytics for failover counts.
  1. Change base URL to acumen endpoint.
  2. Replace provider keys with virtual keys.
  3. Update model names to public aliases.
  4. Handle X-Acumen-Served-Model header for logging.
  5. Implement retry logic for 502 errors.
  6. Monitor rate limits and spend caps.
  7. Test both OpenAI and Anthropic dialects if needed.