Integration Guide
Production-ready Python and Node.js/TypeScript SDKs, framework metadata, and SDK-first registration.
Multiple ways to integrate KYA Platform into your workflow with our production-ready SDKs.
Python SDK (v2.0.0)
Register and manage AI agents with API key auth, email+password, or secp256k1 crypto signing. Includes CLI and decorator support.
# pip install astrasyncai
from astrasyncai import AstraSync
client = AstraSync(api_key="kya_your_api_key")
result = client.register(
name="My AI Assistant",
model={
"model_name": "claude-opus-4.6",
"model_provider": "anthropic",
"model_type": "llm",
},
)
print(f"Agent ID: {result['data']['agent']['kyaAgentId']}")
print(f"Trust Score: {result['data']['agent']['trustScore']}")Node.js / TypeScript SDK (v1.0.0)
TypeScript SDK with complete type definitions, 3 auth methods, and full model/framework/PDLSS registration support. Includes CLI.
// npm install @astrasyncai/verification-gateway
import { AstraSync } from '@astrasyncai/verification-gateway/registration';
const client = new AstraSync({
apiKey: 'kya_your_api_key',
});
const result = await client.register({
name: 'My AI Agent',
model: {
modelName: 'gpt-4o',
modelProvider: 'openai',
modelType: 'llm',
},
});
console.log(`Agent ID: ${result.data.agent.kyaAgentId}`);Framework & Model Metadata
Pass your agent's framework and model metadata during registration to improve its trust score. AstraSync works with any AI agent framework — just include the name and version:
// Node.js
await client.register({
name: 'My Agent',
model: { modelName: 'gpt-4o', modelProvider: 'openai', modelType: 'llm' },
framework: { frameworkName: 'langchain', frameworkVersion: '0.3.0' },
});# Python
client.register(
name="My Agent",
model={"model_name": "gpt-4o", "model_provider": "openai", "model_type": "llm"},
framework={"framework_name": "crewai", "framework_version": "0.1.0"},
)Providing model and framework metadata contributes to the Origin component of your agent's trust score (up to 5 points for platform+model data).
Registration — SDK first
Use @astrasyncai/verification-gateway for all registration — both developer-CLI calls and
autonomous agent self-registration. The SDK handles the API-key step-up handshake for you (202 →
owner approval → poll). Raw HTTP is documented for non-Node clients only.
import { AstraSync } from '@astrasyncai/verification-gateway/registration';
const sdk = new AstraSync({
apiKey: process.env.ASTRASYNC_API_KEY,
// Optional: signature auth for synchronous 201 registration
privateKey: process.env.ASTRASYNC_PRIVATE_KEY,
});
// Long-running / CLI pattern — block until approved
const agent = await sdk.register({
name: 'My AI Agent',
description: 'Handles customer inquiries',
apiEndpoint: 'https://my-agent.example.com', // runtime-challenge URL (optional)
model: { modelName: 'claude-opus-4.6', modelProvider: 'anthropic', modelType: 'llm' },
waitForApproval: true,
});
// Or non-blocking — best for serverless / scheduled agents
const result = await sdk.register({ name: 'My AI Agent' });
if (result.status === 'pending_approval') {
storage.set('astrasync.requestId', result.requestId);
}Raw HTTP fallback (non-Node clients)
curl -X POST https://astrasync.ai/api/agents/register \
-H "Authorization: Bearer kya_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"name": "My AI Agent",
"description": "Handles customer inquiries",
"apiEndpoint": "https://my-agent.example.com",
"model": {
"modelName": "claude-opus-4.6",
"modelProvider": "anthropic",
"modelType": "llm"
}
}'
# API-key auth returns 202 pending_approval with a requestId.
# Poll: GET https://astrasync.ai/api/agents/request-registration/{requestId}
# Crypto-keypair signed (X-AstraSync-Signature header) returns 201 sync.
