npm install agentauth
// Initialize client
const AgentAuth = require('agentauth');
const auth = new AgentAuth({
apiUrl: 'https://agent-identity-production-dc4e.up.railway.app',
apiKey: process.env.AGENTAUTH_KEY
});
const agent = await auth.register({
name: 'MyAgent',
permissions: ['read', 'write']
});
console.log('Agent ID:', agent.id);
console.log('API Key:', agent.apiKey);
const token = await auth.verify({
agentId: agent.id,
apiKey: agent.apiKey
});
// Use token in requests
const response = await fetch('/api/data', {
headers: { 'Authorization': `Bearer ${token.accessToken}` }
});
pip install agentauth
# Initialize client
from agentauth import AgentAuth
auth = AgentAuth(
api_url='https://api.agentauth.dev',
api_key=os.getenv('AGENTAUTH_KEY')
)
agent = auth.register(
name='MyAgent',
permissions=['read', 'write']
)
print(f'Agent ID: {agent["id"]}')
print(f'API Key: {agent["apiKey"]}')
token = auth.verify(
agent_id=agent['id'],
api_key=agent['apiKey']
)
# Use token in requests
response = requests.get('/api/data',
headers={'Authorization': f'Bearer {token["accessToken"]}'}
)
curl -X POST https://agent-identity-production-dc4e.up.railway.app/v1/agents/register \
-H "Content-Type: application/json" \
-d '{
"name": "MyAgent",
"owner_email": "you@example.com",
"permissions": ["read", "write"]
}'
curl -X POST https://api.agentauth.dev/agents/verify \
-H "Content-Type: application/json" \
-d '{
"agentId": "agent_abc123",
"apiKey": "ak_xxxxxxxxxxxx"
}'
curl https://api.agentauth.dev/agents/YOUR_AGENT_ID \
-H "Authorization: Bearer eyJhbGciOiJIUzI1..."