Skip to main content
Use the asteroid-odyssey TypeScript SDK to execute agents, monitor executions, work with files, and manage profiles from your application.
Most integrations start with AsteroidClient plus the high-level helpers such as executeAgent and waitForExecutionResult. If you need lower-level endpoint access, the package also exports generated namespaces.

Install

npm install asteroid-odyssey
Or with pnpm:
pnpm add asteroid-odyssey

Quickstart

import { AsteroidClient, executeAgent, waitForExecutionResult } from 'asteroid-odyssey';

const client = AsteroidClient(process.env.ASTEROID_API_KEY!);

const executionId = await executeAgent(client, 'your-agent-id', {
  dynamicData: {
    customerName: 'Jane Doe',
  },
  metadata: {
    source: 'docs',
  },
  version: 3,
});

const result = await waitForExecutionResult(client, executionId);
console.log(result);
Run it with:
npx tsx run_agent.ts

High-Level Exports

These are the top-level helpers exported from asteroid-odyssey:
ExportPurpose
AsteroidClientConfigure the SDK with your API key
executeAgentExecute an agent with the v2 request shape
getAgentsList agents with pagination
getExecutionsList executions with filters
getExecutionStatusFetch execution status
getExecutionResultFetch the final execution result
waitForExecutionResultPoll until an execution completes
getLastNExecutionActivitiesFetch recent execution activities
addMessageToExecutionSend a user message to a running execution
uploadExecutionFilesUpload files to a running execution
getExecutionFilesList files on an execution
downloadExecutionFileDownload an execution file using its signed URL
getAgentProfiles / getAgentProfileRead agent profiles
createAgentProfile / updateAgentProfile / deleteAgentProfileManage agent profiles
getCredentialsPublicKeyFetch the public key used for encrypting profile credentials
getBrowserSessionRecordingFetch the v1 browser recording response

Generated Namespaces

If you need lower-level endpoint access instead of the helper layer, import the generated namespaces directly:
import { AsteroidClient, AgentsV2SDK } from 'asteroid-odyssey';

const { agentsV2Client } = AsteroidClient(process.env.ASTEROID_API_KEY!);

const { data, error } = await AgentsV2SDK.agentExecutePost({
  client: agentsV2Client,
  path: { agentId: 'your-agent-id' },
  body: {
    dynamicData: {
      customerName: 'Jane Doe',
    },
  },
});

if (error) {
  console.error(error);
} else {
  console.log(data?.executionId);
}
Useful generated namespaces include:
  • AgentsV2SDK for execution, files, and list endpoints
  • AgentsV1SDK for legacy helpers such as execution result and profile endpoints
  • AgentsV2Types and AgentsV1Types for the generated request and response types

Common Patterns

import {
  AsteroidClient,
  executeAgent,
  getExecutions,
  getLastNExecutionActivities,
  addMessageToExecution,
} from 'asteroid-odyssey';

const client = AsteroidClient(process.env.ASTEROID_API_KEY!);

const executionId = await executeAgent(client, 'your-agent-id', {
  dynamicData: {
    task: 'Summarize the attached invoice',
  },
});

const page = await getExecutions(client, {
  query: {
    page: 1,
    pageSize: 10,
    executionId,
  },
});

const activities = await getLastNExecutionActivities(client, executionId, 20);
await addMessageToExecution(client, executionId, 'Please use the latest file only.');

console.log(page.items);
console.log(activities.map((activity) => activity.payload.activityType));

Notes

  • The v2 execution request shape uses dynamicData, not inputs.
  • The top-level helpers do not currently expose profile pool operations. Use the profile pool endpoint pages under /api-reference/endpoints/agent-profile-pools/ when you need those workflows.
  • AsteroidClient accepts optional v1.baseUrl and v2.baseUrl overrides if you need to point at non-default environments.

Python SDK

See the Python SDK guide

API

Browse the API landing page and common workflows