Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.asteroid.ai/llms.txt

Use this file to discover all available pages before exploring further.

Use the asteroid-odyssey TypeScript SDK to execute agents, monitor executions, work with files, and manage profiles from your application.
The SDK exports a client singleton and individual endpoint functions. Configure the client once with your API key, then call the functions directly.

Install

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

Quickstart

import { client, agentExecutePost, executionGet } from 'asteroid-odyssey';

client.setConfig({
  headers: { 'X-Asteroid-Agents-Api-Key': process.env.ASTEROID_API_KEY! },
});

const { data, error } = await agentExecutePost({
  path: { agentId: 'your-agent-id' },
  body: {
    inputs: {
      customerName: 'Jane Doe',
    },
    metadata: {
      source: 'docs',
    },
  },
});

if (error) throw new Error(JSON.stringify(error));
const executionId = data.executionId;

// Poll until complete
let exec;
do {
  await new Promise((r) => setTimeout(r, 3000));
  const res = await executionGet({ path: { executionId } });
  exec = res.data;
} while (exec?.status === 'running' || exec?.status === 'starting');

console.log(exec?.status, exec?.inputs);
Run it with:
npx tsx run_agent.ts

Client Configuration

All SDK functions share the singleton client. Configure it once at startup:
import { client } from 'asteroid-odyssey';

client.setConfig({
  headers: { 'X-Asteroid-Agents-Api-Key': process.env.ASTEROID_API_KEY! },
  // Optional: override the base URL
  baseUrl: 'https://odyssey.asteroid.ai/agents/v2',
});
Every function accepts an optional client override if you need per-request auth:
const { data } = await executionGet({
  client: myOtherClient,
  path: { executionId },
});

Exported Functions

FunctionPurpose
agentListList agents with pagination
agentExecutePostExecute an agent
executionGetFetch execution details
executionsListList executions with filters
executionActivitiesGetFetch execution activities (returns Array)
executionStatusUpdateUpdate execution status (e.g. cancel)
executionUserMessagesAddSend a user message to a running execution
executionContextFilesGetList files on an execution
executionContextFilesUploadUpload files to a running execution
tempFilesStageStage temporary files before execution
agentProfilesListList agent profiles (requires organizationId)
agentProfilesCreateCreate an agent profile
agentProfileGetFetch a single profile
agentProfileUpdateUpdate a profile
agentProfileDeleteDelete a profile
agentWorkflowsExecuteExecute a specific workflow version

Common Patterns

import {
  client,
  agentExecutePost,
  executionsList,
  executionActivitiesGet,
  executionUserMessagesAdd,
} from 'asteroid-odyssey';

client.setConfig({
  headers: { 'X-Asteroid-Agents-Api-Key': process.env.ASTEROID_API_KEY! },
});

const { data } = await agentExecutePost({
  path: { agentId: 'your-agent-id' },
  body: {
    inputs: {
      task: 'Summarize the attached invoice',
    },
  },
});
const executionId = data!.executionId;

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

const { data: activities } = await executionActivitiesGet({
  path: { executionId },
  query: { limit: 20, order: 'desc' },
});

await executionUserMessagesAdd({
  path: { executionId },
  body: { message: 'Please use the latest file only.' },
});

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

Notes

  • Use inputs for execution variables — dynamicData is deprecated.
  • executionActivitiesGet returns Array<AgentsExecutionActivity> directly, not a wrapped object.
  • agentProfilesList requires organizationId in the query.
  • All functions return { data, error }. Check error before using data.
  • File list responses include a downloadUrl per file. Fetch it with your API key in the X-Asteroid-Agents-Api-Key header.

Python SDK

See the Python SDK guide

API

Browse the API landing page and common workflows