CadraClient
The main entry point for the Cadra SDK. Provides access to all resource APIs.
Constructor
typescript
import { CadraClient } from '@cadraos/sdk';
const client = new CadraClient({
apiKey: 'sk-cad-xxxxxxxxxxxx',
orgId: 123,
baseUrl: 'https://your-instance.cadraos.com', // optional
});Options
| Option | Type | Description |
|---|---|---|
| apiKey | string | API key for authentication (mutually exclusive with token/tokenProvider) |
| token | string | Static bearer token |
| tokenProvider | () => Promise<string> | Dynamic token function (for rotating tokens) |
| orgId | number | Organization ID for multi-tenant isolation |
| baseUrl | string | API base URL (default: platform URL) |
Resources
| Property | Type | Description |
|---|---|---|
| client.agents | AgentsAPI | Execute agents, stream results, manage agents |
| client.sessions | SessionsAPI | Multi-turn conversations, session history |
| client.skills | SkillsAPI | List and manage agent skills |
| client.tools | ToolsAPI | List, manage, and execute tools directly |
| client.artifacts | ArtifactsAPI | Store and retrieve agent-produced artifacts |
Request Headers
All requests include these headers automatically:
text
Authorization: Bearer <token> | ApiKey <apiKey>
X-Organization-Id: <orgId>
Content-Type: application/json
Idempotency-Key: <auto-generated> (for POST requests)