Announcing the AfiniTwin API for integrators
Five REST endpoints authenticated with API key. Serve your AfiniTwin as system prompt from your CRM, custom assistant, or overnight pipeline. Included in your afini.ai subscription. Today.
I. The minimum gesture
The AfiniTwin Portable has been downloadable from the dashboard for a couple of months. It works: you copy the preset, paste it into Claude, ChatGPT, or Gemini, and the AI talks to you as if it had known you from turn one. But copy-and-paste doesn't scale. If your B2B integration is serious โ a CRM, a custom assistant, an overnight processing pipeline โ you need something else: the AfiniTwin entering programmatically, on its own, in every call your system makes to the LLM.
That's what we're releasing today. An authenticated REST API that serves your AfiniTwin as a system prompt, ready to inject from whatever code you're writing.
One key, one call:
curl -H "X-Twin-Key: atk_live_xxxxxxxx_yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy" \
"https://api.afini.ai/v1/public/twin/preset/estandar?format=json&lang=en"
Returns the full meta-prompt of the preset you asked for, in the format you asked for. You load it as system in your Anthropic, OpenAI, Mistral, or whatever client, and from then on every turn is calibrated to your cognitive profile. No retraining. No fine-tuning. No going through our infrastructure beyond the initial snapshot read.
System prompt, def.: the way an LLM remembers who it is before forgetting who you are. The B2B API takes care of preserving its memory of you.
II. Five endpoints, one idea
/v1/public/twin/health โ a ping to verify your key is alive without spending monthly quota. For your deployment health checks.
/v1/public/twin/me โ key identity, owner's plan, used and remaining quota, latest available Twin. What you'll call when your integration boots, to detect plan downgrade or revoked key.
/v1/public/twin/historic โ listing of your snapshots, one for each AfiniTwin your subscription generates month by month. Useful if your integration wants to let the user pick from several.
/v1/public/twin/snapshots/:id โ metadata for a specific snapshot.
/v1/public/twin/preset/:slug?format=...&lang=...&variant=...&includeNarratives=... โ the meaty endpoint. Returns the artifact in .txt, .md, .json, or .yaml, in six languages, with or without integrated Opus narratives.
All endpoints except /health count against the monthly quota. Default ten thousand requests per month, configurable up to one million per key. Every response includes X-Twin-Quota-{Limit,Used,Remaining} headers so your integration knows how much it has left without having to guess.
III. Why API key, not OAuth
OAuth would make sense if the integration were a third party accessing a different user's profile. That's not the case here. The B2B API serves your AfiniTwin to your integration โ your CRM, your assistant, your agent. A personal API key, generated in your dashboard, copied to your integration's vault, is the cleanest model: zero consent friction, instant revocation, one key per integration so a leak's blast radius is bounded.
API key, def.: a secret that retains its secrecy precisely between the line where it's generated and the first time someone, distractedly, pastes it into a public repository. That's why revocation is fast.
Keys are secrets in the strong sense: in the database we store only the SHA-256 hash, format atk_live_<8 hex>_<32 hex>. Plaintext is shown only once on creation. If you lose it, revoke and create another. If you accidentally publish the key in a public repo โ happens, you're not the first โ you revoke from the dashboard and it's offline in milliseconds.
IV. Part of your subscription
Key generation is included in your afini.ai subscription, either via an active Stripe subscription or a live voucher. The public endpoints serve indistinctly, as long as your key was issued to an account with an active subscription. If your subscription lapses, keys remain stored but endpoints return 403 until you reactivate. We don't delete them โ we leave them paused, waiting.
The API is one more feature of the subscription, not an add-on you buy separately. B2B integrations imply sustained load on our infrastructure โ the snapshot lives in our database, headers come from our proxy โ and that's already covered by the monthly quota. No fine print: if you're subscribed, you have it.
V. Quota and rate limit: two belts
Monthly quota measures aggregate volume. The IP and key rate limit measures bursts. Today we serve you sixty requests per minute on each heavy endpoint, one hundred and twenty per minute on /health. If your integration hits an accidental infinite loop, the rate limit catches it before draining your monthly quota. Not single-layer security.
Monthly quota, def.: temporary mercy the infrastructure grants the careless integrator, expressed in requests. It renews on day one; on day two the trial begins again.
VI. What we are NOT
This is not a fetch user X's profile endpoint where X is someone other than the key owner. The key authenticates the owner and always returns their AfiniTwin. No multi-tenant paths. No remote admin.
This is not an endpoint to train models at the user's expense. What we serve is what's already in their immutable snapshot. If our inference provider (Anthropic) changes its retention policy, it doesn't retroactively affect already-generated snapshots.
And this is not a substitute for journaling, coaching, or therapy. It's a technical component for integrators. Human matters remain human.
VII. How to start today
- Subscribe or redeem your voucher at
https://afini.ai/preciosif you haven't yet. - Generate your AfiniTwin from the dashboard if you don't have it yet. The API works without a Twin โ returns 403
NO_TWIN_PURCHASEDโ but without a Twin there's not much to serve. - Generate your first key at
https://afini.ai/en/dashboard/twin/api. Copy it to your integration's vault. Do not commit it to a repo. - Call
/v1/public/twin/healthto verify it's alive. Doesn't consume quota. - Read the full documentation at
https://afini.ai/en/afinitwin/api. cURL, Node.js, and Python examples, full error table, security recommendations.
If your integration case has special requirements โ quotas above one million per month, specific scopes, SLA support โ write to info@afini.ai. There's negotiation room.
VIII. Honest roadmap
Today (v1.0): the five endpoints above, single twin:read scope, included in the afini.ai subscription, quota configurable up to one million.
Next weeks: webhooks to notify you when a new snapshot is ready โ no polling needed โ, twin:write scope for integrations wanting to seed life facts with explicit consent, usage metrics from the dashboard.
When needed: official TypeScript and Python SDKs, canonical integration examples with Anthropic and OpenAI, Enterprise plan with SLA and quotas above the million.
We don't promise what isn't there. If you need it and it isn't yet, say so and it gets prioritized.
โ Ricardo
