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

    OptionTypeDescription
    apiKeystringAPI key for authentication (mutually exclusive with token/tokenProvider)
    tokenstringStatic bearer token
    tokenProvider() => Promise<string>Dynamic token function (for rotating tokens)
    orgIdnumberOrganization ID for multi-tenant isolation
    baseUrlstringAPI base URL (default: platform URL)

    Resources

    PropertyTypeDescription
    client.agentsAgentsAPIExecute agents, stream results, manage agents
    client.sessionsSessionsAPIMulti-turn conversations, session history
    client.skillsSkillsAPIList and manage agent skills
    client.toolsToolsAPIList, manage, and execute tools directly
    client.artifactsArtifactsAPIStore 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)