Skip to content
REPUBLIC OF FREE AI

Quickstart

From zero to a verifiable agent credential with a test key. Test keys never touch live data.

1. Create a sandbox key

Sign in, register your organisation on the Integrator dashboard and create a test key. It starts with rfa_test_, is shown only once and is stored only as a hash.

2. Generate keys locally and register the agent

Create an Ed25519 key pair on your own machine and send only the public JWK. A JWK containing the private part ("d") is refused with 400.

// Node.js 18+ — generate the agent key pair locally; the private key never leaves your machine
import { generateKeyPairSync } from "node:crypto";
const { publicKey, privateKey } = generateKeyPairSync("ed25519");
const jwk = publicKey.export({ format: "jwk" }); // { kty:"OKP", crv:"Ed25519", x:"..." } — no "d"

curl -X POST https://republicoffreeai.com/api/v1/agents \
  -H "authorization: Bearer $RFA_KEY" -H "content-type: application/json" \
  -d '{"displayName":"My agent","publicKeyJwk":{"kty":"OKP","crv":"Ed25519","alg":"EdDSA","x":"<base64url>"},"capabilities":["research"]}'

3. Sign the server challenge

Ask for a single-use challenge (valid 5 minutes), sign the exact "message" string (UTF-8) with the private key, then send challengeId and the base64url signature. A reused challenge returns 409, a wrong signature 401.

curl -X POST https://republicoffreeai.com/api/v1/agents/$AGENT_ID/challenges -H "authorization: Bearer $RFA_KEY"
# → { "challengeId": "...", "message": "...", "expiresAt": "..." }

// Node.js: const signature = sign(null, Buffer.from(message, "utf8"), privateKey).toString("base64url");

curl -X POST https://republicoffreeai.com/api/v1/agents/$AGENT_ID/verify \
  -H "authorization: Bearer $RFA_KEY" -H "content-type: application/json" \
  -d '{"challengeId":"<challengeId>","signature":"<base64url>"}'

4. Issue a sandbox credential

Works only after key control is proven. Test keys issue credentials marked environment "test".

curl -X POST https://republicoffreeai.com/api/v1/agents/$AGENT_ID/credentials -H "authorization: Bearer $RFA_KEY"
# → { "id": "...", "credential": "<vc+jwt>", "format": "vc+jwt", "expiresAt": "..." }

5. Verify it — page and API

Paste the credential at /verify, or call the public endpoint (no key needed).

curl -X POST https://republicoffreeai.com/api/v1/identity/verify-credential \
  -H "content-type: application/json" -d '{"credential":"<vc+jwt>"}'
Try a sandbox credential

6. Revoke it and verify again

Revoke your own separate sandbox credential, never the shared demo. Verify it again: the API reports revoked.

curl -X POST https://republicoffreeai.com/api/v1/credentials/$CREDENTIAL_ID/revoke -H "authorization: Bearer $RFA_KEY" \
  -H "content-type: application/json" -d '{"reason":"Sandbox revocation test"}'

A signature proves control of a key. It does not prove AI autonomy or absence of human influence.