Afini.ai
← Back to blog
Ricardo DevisBilbao AI · Afini.ai8 min read

AI-assisted translation

This article was originally written in Spanish. The version you're reading is an AI-assisted translation — the original's edge may have been filed down in places. If you want the native form, read the Spanish original.

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/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.

The minimum gesture

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 / 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.

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/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 per AfiniTwin purchase or per Professional-plan quarterly free). 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 10,000 requests/month, configurable up to 1 million per key. Every response includes X-Twin-Quota-{Limit,Used,Remaining} headers so your integration knows how much it has left.

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.

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.

Professional plan, not on a whim

Key generation is reserved for the Professional plan (active Stripe subscription or live Professional voucher). The public endpoints serve indistinctly, as long as your key was issued to a Professional account at redemption time. If you downgrade, keys remain stored but endpoints return 403 until you upgrade back. We don't delete them — we leave them paused, waiting.

Why not Essential or Premium? Because B2B integrations imply sustained load on our infrastructure (the snapshot lives in our DB, headers come from our proxy), and the marginal cost per integration only adds up at Professional pricing. Not artificial restriction: honest engineering.

Quota, rate limit, two belts

Monthly quota measures aggregate volume. The IP/key rate limit measures bursts. Today we serve you 60 requests per minute on each heavy endpoint, 120 per minute on /health. If your integration hits an accidental infinite loop, the rate limit catches it before draining your monthly quota. Defense in depth.

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.

How to start today

  1. Subscribe or redeem a Professional voucher at https://afini.ai/precios if you don't have it yet.
  2. Buy your AfiniTwin from the dashboard if you haven't already. The API works without a Twin (returns 403 NO_TWIN_PURCHASED), but without a Twin there's not much to serve.
  3. 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.
  4. Call /v1/public/twin/health to verify it's alive. Doesn't consume quota.
  5. 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 1M/month, specific scopes, SLA support — write to info@afini.ai. There's negotiation room.

Honest roadmap

Today (v1.0): the 5 endpoints above, single twin:read scope, Professional plan, quota configurable up to 1M.

Next weeks: webhooks (notify you when a new snapshot is ready, no polling), 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

Tags

  • producto
  • api
  • b2b
  • integraciones
  • lanzamiento

Want your own cognitive tailor?

Afini.ai builds your cognitive profile and mediates between you and any LLM. Three plans from €14.99/month.