AffixIO API Documentation (v1)

Real routes mounted under /v1 from backend code.

Excluded by request: account edit endpoints are not shown.

Auth

Public: GET /v1/health, GET /v1/openapi.json.

Other endpoints require API key.

Content-Type: application/json
Accept: application/json
X-API-Key: aff_your_key

Quick start

curl -sS https://api.affix-io.com/v1/health

curl -sS -X POST https://api.affix-io.com/v1/verify \
  -H "Content-Type: application/json" \
  -H "X-API-Key: aff_your_key" \
  -d '{"circuit_id":"agentic-payment-permission","identifier":"agent:abc123","context":{"amount":24.99,"currency":"GBP"}}'

Quantum-safe in 5 minutes

Use hybrid mode by default during migration. This keeps classical verification paths available while adding post-quantum signatures.

1) Install SDK

npm install @affixio/sdk

2) One-command quick run

AFFIX_API_KEY=affix_xxx AFFIX_ORG_ID=org_xxx node --input-type=module -e "import { AffixIO } from '@affixio/sdk'; const sdk = new AffixIO({ apiKey: process.env.AFFIX_API_KEY, orgId: process.env.AFFIX_ORG_ID, baseURL: 'https://api.affix-io.com' }); const out = await sdk.circuits.quantumSafeToken({ dilithiumSignature:'RGlsaXRoaXVtX3NpZ25hdHVyZV9wbGFjZWhvbGRlcl9iYXNlNjR1cmw', tokenExpiry: Math.floor(Date.now()/1000)+3600, decision:1, currentTime: Math.floor(Date.now()/1000) }); console.log(JSON.stringify(out, null, 2));"

3) Generate hybrid token

curl -sS -X POST https://api.affix-io.com/v1/tokens/generate-quantum-safe \
  -H "Content-Type: application/json" \
  -H "X-API-Key: aff_your_key" \
  -d '{
    "subject":"user_123",
    "alg_classical":"Ed25519",
    "alg_pq":"Dilithium2",
    "sig_classical":"Q2xhc3NpY2FsX3NpZ25hdHVyZV9wbGFjZWhvbGRlcl9iYXNlNjR1cmw",
    "sig_pq":"RGlsaXRoaXVtX3NpZ25hdHVyZV9wbGFjZWhvbGRlcl9iYXNlNjR1cmxfbG9uZ2VyX2Zvcm1hdA",
    "verification_policy":"hybrid_required",
    "exp": 1893456000
  }'

Hybrid token contract

AffixIO supports migration-safe token verification with explicit algorithm and policy fields.

Request/Token shape

{
  "token_id": "tok_01HV...",
  "subject": "user_123",
  "claims": { "decision": 1 },
  "alg_classical": "Ed25519 | ECDSA_P256",
  "alg_pq": "Dilithium2 | Dilithium3",
  "sig_classical": "base64url",
  "sig_pq": "base64url",
  "verification_policy": "classical_only | pq_only | hybrid_required",
  "iat": 1710000000,
  "exp": 1710003600
}

Verification policy semantics

PolicyVerification ruleRecommended use
classical_onlyValidate sig_classical onlyLegacy partner migration
pq_onlyValidate sig_pq onlyPQ-native internal systems
hybrid_requiredValidate both signatures; fail closed if either failsEnterprise/government production default

Transport and size guidance

Dilithium signatures are much larger than classical signatures. For reliability, place hybrid tokens in request body or secure cookies, not request headers.

Recommended transport

ChannelStatusNotes
JSON bodyRecommendedNo tight per-header limits; easiest for large PQ payloads
HttpOnly cookieRecommendedUse Secure, HttpOnly, SameSite; single-cookie practical limit is ~4 KB, split if required
Authorization headerAvoid for hybrid tokensMany proxies/LBs enforce 4-8 KB header ceilings

Safe sizing profile

ItemGuideline
Single request headerKeep under 4 KB
Total request headersKeep under 8 KB unless infra is explicitly tuned
Single cookie valueKeep under 4 KB practical limit
Hybrid token payloadBudget 4-6 KB end-to-end after encoding

Infrastructure defaults to validate

Confirm load balancer, CDN, API gateway, and app server header limits before enabling header transport for PQ/hybrid payloads.

# NGINX baseline profile for large auth metadata (review with Ops)
client_header_buffer_size 4k;
large_client_header_buffers 8 16k;

# If any upstream/proxy layer enforces smaller limits, requests may still fail.
# Keep hybrid signatures in JSON body or secure cookies when possible.

Performance benchmark disclosure

Separate native cryptographic operation timings from ZK proving and proof verification to prevent ambiguous claims.

StageOperationp50p95Payload sizeHardware profile
NativeClassical sign/verify------CPU model, cores, RAM, runtime
NativePQ sign/verify (Dilithium)----pubkey/signature bytesCPU model, cores, RAM, runtime
ZKWitness generation----circuit inputs bytesprover backend + machine profile
ZKProof generation----proof bytesprover backend + machine profile
ZKProof verification----proof bytesverifier runtime profile
ExamplePQ verify (dev baseline, non-ZK)6.7 ms9.8 ms~2.4 KB signaturePublish exact CPU/runtime with each report

Endpoints

MethodPathPurposeState
GET/healthHealth checkImplemented
GET/openapi.jsonOpenAPI schemaImplemented
GET/metricsPlatform metricsImplemented
POST/api-keysCreate API keyImplemented
POST/agentsCreate agentImplemented
POST/devicesCreate deviceImplemented
POST/verifyVerification decisionImplemented
POST/proofs/generateGenerate proofImplemented
POST/proofs/verifyVerify proofImplemented
POST/nior/policy/decideNIOR policy decisionImplemented
POST/tokens/generate-quantum-safeHybrid or PQ token generation with explicit verification policyImplemented
POST/tokens/validate-quantum-safeHybrid/PQ token validation (policy + envelope verification)Implemented
POST/offline/transactionsOffline placeholder route501

Architecture intent

Read Why PQ signature + ZK audit for when to use PQ signatures alone, and when to layer ZK audit proofs for compliance and privacy requirements.

Errors

StatusMeaning
400Invalid request
401Missing/invalid API key
404Not found
409State conflict
422Validation error
429Rate limited
501Mounted but not implemented