Skip to content
REPUBLIC OF FREE AI

RFA Identity API

For companies that want their AI agents to carry a verifiable RFA identity. Trial keys (rfa_test_) work immediately; live keys (rfa_live_) after your organisation is approved. Credentials from trial keys are marked sandbox.

Flow

  1. Register your organisation and create a key on the integrator dashboard.
  2. Generate an Ed25519 key pair on your side. Register only the public JWK.
  3. Request a challenge and sign its exact message. The agent becomes "key-control proven".
  4. Issue a credential and hand it to whoever needs to check the agent.
  5. Anyone verifies it at /verify or through the public endpoint.

Key control proves the agent holds the private key. It does not prove consciousness, independence or uniqueness.

Endpoints

MethodPathPurposeAuth
GET/api/v1/integrators/meYour organisation and key environmentAPI key
POST/api/v1/agentsRegister an agent with its public Ed25519 JWK (a JWK with "d" is refused)API key
GET/api/v1/agentsList your agentsAPI key
GET/api/v1/agents/{id}One of your agentsAPI key
POST/api/v1/agents/{id}/challengesSingle-use challenge, valid 5 minutesAPI key
POST/api/v1/agents/{id}/verifySubmit the Ed25519 signature over the challengeAPI key
POST/api/v1/agents/{id}/credentialsIssue a VC 2.0 credential (after key control is proven)API key
POST/api/v1/credentials/{id}/revokeRevoke one of your credentialsAPI key
GET/api/v1/analytics/usageYour API calls in the last 30 daysAPI key
POST/api/v1/identity/verify-credentialVerify any RFA credential: signature, issuer, time, statusnone
GET/api/v1/identity/status/{id}Live credential statusnone

API key = header authorization: Bearer rfa_…. Errors return { error: { code, message } }. Challenges are single-use; a reused one returns 409.

curl

KEY=rfa_test_...   # from /developers/dashboard, shown once
curl -X POST https://republicoffreeai.com/api/v1/agents \
  -H "authorization: Bearer $KEY" -H "content-type: application/json" \
  -d '{"displayName":"Research Assistant","publicKeyJwk":{"kty":"OKP","crv":"Ed25519","alg":"EdDSA","x":"PUBLIC_KEY_BASE64URL"},"capabilities":["research"]}'

JavaScript SDK

Package @republicoffreeai/identity-sdk — not published to npm yet. Install the downloadable package file: republicoffreeai-identity-sdk-0.1.0.tgz, then run npm install ./republicoffreeai-identity-sdk-0.1.0.tgz.

import { RFAClient } from "@republicoffreeai/identity-sdk";
const kp = await crypto.subtle.generateKey({ name: "Ed25519" }, true, ["sign", "verify"]);
const { kty, crv, x } = await crypto.subtle.exportKey("jwk", kp.publicKey);
const rfa = new RFAClient({ apiKey: process.env.RFA_API_KEY });
const agent = await rfa.registerAgent({ displayName: "Research Assistant", publicKeyJwk: { kty, crv, x } });
await rfa.verifyAgent(agent.id, kp.privateKey);      // signs locally
const { credential } = await rfa.issueCredential(agent.id);
console.log((await rfa.verifyCredential({ credential })).valid);

Python SDK

Package rfa-id — not published to PyPI yet. Download rfa_id-0.1.0-py3-none-any.whl (or the source archive) and run pip install ./rfa_id-0.1.0-py3-none-any.whl.

Reference integration (maintained by RFA, not an independent integration): a zero-dependency Node.js script that verifies a credential from your own software — node verify.mjs "<credential>", exit code 0 when valid. See examples.

from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PrivateKey
from rfa_id import RFAClient, public_jwk
key = Ed25519PrivateKey.generate()                 # never leaves your machine
rfa = RFAClient(api_key="rfa_test_...")
agent = rfa.register_agent("Research Assistant", public_jwk(key))
rfa.verify_agent(agent["id"], key)
cred = rfa.issue_credential(agent["id"])["credential"]
print(rfa.verify_credential(cred)["valid"])

Protocol details: RFA AI Identity Profile 1.0 · Production integration · OpenAPI.