# Promptly ## List Runs `client.promptly.listRuns(PromptlyListRunsParamsquery, RequestOptionsoptions?): PromptlyListRunsResponse` **get** `/api/promptly/runs` Retrieve all task runs across all tasks for the organization ### Parameters - `query: PromptlyListRunsParams` - `organizationId: string` - `limit?: number` ### Returns - `PromptlyListRunsResponse = Array` - `id?: string` - `completedAt?: string` - `costCents?: number` Cost in cents - `createdAt?: string` - `deliveryStatus?: "pending" | "delivered" | "failed"` - `"pending"` - `"delivered"` - `"failed"` - `durationMs?: number` Execution time in milliseconds - `error?: string` Error message if failed - `output?: string` AI-generated output - `startedAt?: string` - `status?: "pending" | "running" | "completed" | "failed"` - `"pending"` - `"running"` - `"completed"` - `"failed"` - `taskId?: string` - `tokensUsed?: number` Total tokens consumed ### Example ```typescript import _0ct from '0ct'; const client = new _0ct({ apiKey: process.env['0CT_API_KEY'], // This is the default and can be omitted }); const taskRuns = await client.promptly.listRuns({ organizationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', }); console.log(taskRuns); ``` ## Get Stats `client.promptly.getStats(PromptlyGetStatsParamsquery, RequestOptionsoptions?): PromptlyGetStatsResponse` **get** `/api/promptly/stats` Retrieve task execution statistics for the organization ### Parameters - `query: PromptlyGetStatsParams` - `organizationId: string` ### Returns - `PromptlyGetStatsResponse` - `activeTasks?: number` - `failedRuns?: number` - `successfulRuns?: number` - `totalCostCents?: number` - `totalRuns?: number` - `totalTasks?: number` - `totalTokensUsed?: number` ### Example ```typescript import _0ct from '0ct'; const client = new _0ct({ apiKey: process.env['0CT_API_KEY'], // This is the default and can be omitted }); const response = await client.promptly.getStats({ organizationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', }); console.log(response.activeTasks); ``` # Tasks ## List `client.promptly.tasks.list(TaskListParamsquery, RequestOptionsoptions?): TaskListResponse` **get** `/api/promptly/tasks` Retrieve all tasks for the authenticated user's organization ### Parameters - `query: TaskListParams` - `organizationId: string` Organization ID to filter tasks ### Returns - `TaskListResponse = Array` - `id: string` - `createdAt: string` - `model: string` AI model identifier (e.g., 'gpt-4o-mini') - `name: string` Human-readable task name - `prompt: string` The AI prompt to execute - `schedule: "once" | "hourly" | "daily" | "weekly"` Task execution frequency - `"once"` - `"hourly"` - `"daily"` - `"weekly"` - `status: "active" | "paused" | "completed"` - `"active"` - `"paused"` - `"completed"` - `cronExpression?: string` Custom cron expression (overrides schedule settings) - `deliveryEmail?: boolean` Email delivery enabled - `deliveryEmailAddress?: string` Email address for delivery - `deliveryPhoneNumber?: string` Phone number for SMS delivery - `deliverySms?: boolean` SMS delivery enabled - `destinations?: Array` Where to deliver task results - `type: "email" | "sms" | "webhook"` - `"email"` - `"sms"` - `"webhook"` - `value: string` Email address, phone number, or webhook URL - `label?: string` Optional human-readable label - `lastRunAt?: string | null` - `nextRunAt?: string | null` - `organizationId?: string` - `scheduleDays?: Array<"monday" | "tuesday" | "wednesday" | 4 more>` Days of week to run (for weekly schedule) - `"monday"` - `"tuesday"` - `"wednesday"` - `"thursday"` - `"friday"` - `"saturday"` - `"sunday"` - `scheduleTime?: string` Time of day to run (HH:MM format) - `skillIds?: Array` IDs of attached skills - `skills?: Array` Attached skills (when expanded) - `id: string` - `content: string` Markdown instructions that guide task execution - `name: string` - `category?: string` - `createdAt?: string` - `description?: string` - `frontmatter?: Frontmatter` Skill metadata - `author?: string` - `requiredSources?: Array` Source slugs this skill depends on - `tags?: Array` - `iconUrl?: string` - `isPublic?: boolean` Whether the skill is shared publicly - `isUserInvocable?: boolean` Whether users can manually attach this skill - `organizationId?: string` - `slug?: string` URL-friendly identifier - `updatedAt?: string` - `version?: number` - `sourceIds?: Array` IDs of attached sources - `sources?: Array` Attached data sources (when expanded) - `id: string` - `config: Config` Source-specific configuration - `args?: Array` Command arguments - `baseUrl?: string` Base URL for API sources - `command?: string` Command to run for stdio transport - `env?: Record` Environment variables - `transport?: "stdio" | "http" | "websocket"` MCP transport type - `"stdio"` - `"http"` - `"websocket"` - `url?: string` URL for http/websocket transport - `name: string` - `type: "mcp" | "api" | "local"` Source connection type - `"mcp"` - `"api"` - `"local"` - `authConfig?: AuthConfig` Authentication configuration - `headerName?: string` - `prefix?: string` - `provider?: string` - `authType?: "none" | "oauth" | "bearer" | 5 more` - `"none"` - `"oauth"` - `"bearer"` - `"basic"` - `"header"` - `"query"` - `"api_key"` - `"composio"` - `composioConnected?: boolean` Whether Composio OAuth is completed - `composioToolkit?: string` Composio toolkit name (e.g., 'todoist', 'github') - `createdAt?: string` - `description?: string` - `iconUrl?: string` - `isActive?: boolean` Whether the source is connected and ready - `lastConnectedAt?: string` - `organizationId?: string` - `slug?: string` URL-friendly identifier - `tools?: Array` Available tools from this source - `description?: string` - `inputSchema?: unknown` JSON Schema for tool parameters - `name?: string` - `updatedAt?: string` - `timezone?: string` IANA timezone (e.g., 'America/New_York') - `updatedAt?: string` - `userId?: string` Owner user ID ### Example ```typescript import _0ct from '0ct'; const client = new _0ct({ apiKey: process.env['0CT_API_KEY'], // This is the default and can be omitted }); const tasks = await client.promptly.tasks.list({ organizationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', }); console.log(tasks); ``` ## Create `client.promptly.tasks.create(TaskCreateParamsbody, RequestOptionsoptions?): Task` **post** `/api/promptly/tasks` Create a new scheduled AI task ### Parameters - `body: TaskCreateParams` - `name: string` Human-readable task name - `organizationId: string` Organization to create the task in - `prompt: string` The AI prompt to execute - `deliveryEmail?: boolean` Enable email delivery - `deliveryEmailAddress?: string` Email address for delivery - `deliveryPhoneNumber?: string` Phone number for SMS delivery - `deliverySms?: boolean` Enable SMS delivery - `destinations?: Array` Where to deliver task results - `type: "email" | "sms" | "webhook"` - `"email"` - `"sms"` - `"webhook"` - `value: string` Email address, phone number, or webhook URL - `label?: string` Optional human-readable label - `model?: string` AI model identifier from /api/promptly/models - `schedule?: "once" | "hourly" | "daily" | "weekly"` Execution frequency - `"once"` - `"hourly"` - `"daily"` - `"weekly"` - `scheduleDays?: Array<"monday" | "tuesday" | "wednesday" | 4 more>` Days to run (for weekly schedule) - `"monday"` - `"tuesday"` - `"wednesday"` - `"thursday"` - `"friday"` - `"saturday"` - `"sunday"` - `scheduleTime?: string` Time of day to run (HH:MM in 24h format) - `skillIds?: Array` Skill IDs to attach to this task - `sourceIds?: Array` Source IDs to attach to this task - `timezone?: string` IANA timezone identifier ### Returns - `Task` - `id: string` - `createdAt: string` - `model: string` AI model identifier (e.g., 'gpt-4o-mini') - `name: string` Human-readable task name - `prompt: string` The AI prompt to execute - `schedule: "once" | "hourly" | "daily" | "weekly"` Task execution frequency - `"once"` - `"hourly"` - `"daily"` - `"weekly"` - `status: "active" | "paused" | "completed"` - `"active"` - `"paused"` - `"completed"` - `cronExpression?: string` Custom cron expression (overrides schedule settings) - `deliveryEmail?: boolean` Email delivery enabled - `deliveryEmailAddress?: string` Email address for delivery - `deliveryPhoneNumber?: string` Phone number for SMS delivery - `deliverySms?: boolean` SMS delivery enabled - `destinations?: Array` Where to deliver task results - `type: "email" | "sms" | "webhook"` - `"email"` - `"sms"` - `"webhook"` - `value: string` Email address, phone number, or webhook URL - `label?: string` Optional human-readable label - `lastRunAt?: string | null` - `nextRunAt?: string | null` - `organizationId?: string` - `scheduleDays?: Array<"monday" | "tuesday" | "wednesday" | 4 more>` Days of week to run (for weekly schedule) - `"monday"` - `"tuesday"` - `"wednesday"` - `"thursday"` - `"friday"` - `"saturday"` - `"sunday"` - `scheduleTime?: string` Time of day to run (HH:MM format) - `skillIds?: Array` IDs of attached skills - `skills?: Array` Attached skills (when expanded) - `id: string` - `content: string` Markdown instructions that guide task execution - `name: string` - `category?: string` - `createdAt?: string` - `description?: string` - `frontmatter?: Frontmatter` Skill metadata - `author?: string` - `requiredSources?: Array` Source slugs this skill depends on - `tags?: Array` - `iconUrl?: string` - `isPublic?: boolean` Whether the skill is shared publicly - `isUserInvocable?: boolean` Whether users can manually attach this skill - `organizationId?: string` - `slug?: string` URL-friendly identifier - `updatedAt?: string` - `version?: number` - `sourceIds?: Array` IDs of attached sources - `sources?: Array` Attached data sources (when expanded) - `id: string` - `config: Config` Source-specific configuration - `args?: Array` Command arguments - `baseUrl?: string` Base URL for API sources - `command?: string` Command to run for stdio transport - `env?: Record` Environment variables - `transport?: "stdio" | "http" | "websocket"` MCP transport type - `"stdio"` - `"http"` - `"websocket"` - `url?: string` URL for http/websocket transport - `name: string` - `type: "mcp" | "api" | "local"` Source connection type - `"mcp"` - `"api"` - `"local"` - `authConfig?: AuthConfig` Authentication configuration - `headerName?: string` - `prefix?: string` - `provider?: string` - `authType?: "none" | "oauth" | "bearer" | 5 more` - `"none"` - `"oauth"` - `"bearer"` - `"basic"` - `"header"` - `"query"` - `"api_key"` - `"composio"` - `composioConnected?: boolean` Whether Composio OAuth is completed - `composioToolkit?: string` Composio toolkit name (e.g., 'todoist', 'github') - `createdAt?: string` - `description?: string` - `iconUrl?: string` - `isActive?: boolean` Whether the source is connected and ready - `lastConnectedAt?: string` - `organizationId?: string` - `slug?: string` URL-friendly identifier - `tools?: Array` Available tools from this source - `description?: string` - `inputSchema?: unknown` JSON Schema for tool parameters - `name?: string` - `updatedAt?: string` - `timezone?: string` IANA timezone (e.g., 'America/New_York') - `updatedAt?: string` - `userId?: string` Owner user ID ### Example ```typescript import _0ct from '0ct'; const client = new _0ct({ apiKey: process.env['0CT_API_KEY'], // This is the default and can be omitted }); const task = await client.promptly.tasks.create({ name: 'x', organizationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', prompt: 'x', }); console.log(task.id); ``` ## Retrieve `client.promptly.tasks.retrieve(stringtaskID, RequestOptionsoptions?): Task` **get** `/api/promptly/tasks/{taskId}` Retrieve a specific task by ID ### Parameters - `taskID: string` ### Returns - `Task` - `id: string` - `createdAt: string` - `model: string` AI model identifier (e.g., 'gpt-4o-mini') - `name: string` Human-readable task name - `prompt: string` The AI prompt to execute - `schedule: "once" | "hourly" | "daily" | "weekly"` Task execution frequency - `"once"` - `"hourly"` - `"daily"` - `"weekly"` - `status: "active" | "paused" | "completed"` - `"active"` - `"paused"` - `"completed"` - `cronExpression?: string` Custom cron expression (overrides schedule settings) - `deliveryEmail?: boolean` Email delivery enabled - `deliveryEmailAddress?: string` Email address for delivery - `deliveryPhoneNumber?: string` Phone number for SMS delivery - `deliverySms?: boolean` SMS delivery enabled - `destinations?: Array` Where to deliver task results - `type: "email" | "sms" | "webhook"` - `"email"` - `"sms"` - `"webhook"` - `value: string` Email address, phone number, or webhook URL - `label?: string` Optional human-readable label - `lastRunAt?: string | null` - `nextRunAt?: string | null` - `organizationId?: string` - `scheduleDays?: Array<"monday" | "tuesday" | "wednesday" | 4 more>` Days of week to run (for weekly schedule) - `"monday"` - `"tuesday"` - `"wednesday"` - `"thursday"` - `"friday"` - `"saturday"` - `"sunday"` - `scheduleTime?: string` Time of day to run (HH:MM format) - `skillIds?: Array` IDs of attached skills - `skills?: Array` Attached skills (when expanded) - `id: string` - `content: string` Markdown instructions that guide task execution - `name: string` - `category?: string` - `createdAt?: string` - `description?: string` - `frontmatter?: Frontmatter` Skill metadata - `author?: string` - `requiredSources?: Array` Source slugs this skill depends on - `tags?: Array` - `iconUrl?: string` - `isPublic?: boolean` Whether the skill is shared publicly - `isUserInvocable?: boolean` Whether users can manually attach this skill - `organizationId?: string` - `slug?: string` URL-friendly identifier - `updatedAt?: string` - `version?: number` - `sourceIds?: Array` IDs of attached sources - `sources?: Array` Attached data sources (when expanded) - `id: string` - `config: Config` Source-specific configuration - `args?: Array` Command arguments - `baseUrl?: string` Base URL for API sources - `command?: string` Command to run for stdio transport - `env?: Record` Environment variables - `transport?: "stdio" | "http" | "websocket"` MCP transport type - `"stdio"` - `"http"` - `"websocket"` - `url?: string` URL for http/websocket transport - `name: string` - `type: "mcp" | "api" | "local"` Source connection type - `"mcp"` - `"api"` - `"local"` - `authConfig?: AuthConfig` Authentication configuration - `headerName?: string` - `prefix?: string` - `provider?: string` - `authType?: "none" | "oauth" | "bearer" | 5 more` - `"none"` - `"oauth"` - `"bearer"` - `"basic"` - `"header"` - `"query"` - `"api_key"` - `"composio"` - `composioConnected?: boolean` Whether Composio OAuth is completed - `composioToolkit?: string` Composio toolkit name (e.g., 'todoist', 'github') - `createdAt?: string` - `description?: string` - `iconUrl?: string` - `isActive?: boolean` Whether the source is connected and ready - `lastConnectedAt?: string` - `organizationId?: string` - `slug?: string` URL-friendly identifier - `tools?: Array` Available tools from this source - `description?: string` - `inputSchema?: unknown` JSON Schema for tool parameters - `name?: string` - `updatedAt?: string` - `timezone?: string` IANA timezone (e.g., 'America/New_York') - `updatedAt?: string` - `userId?: string` Owner user ID ### Example ```typescript import _0ct from '0ct'; const client = new _0ct({ apiKey: process.env['0CT_API_KEY'], // This is the default and can be omitted }); const task = await client.promptly.tasks.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'); console.log(task.id); ``` ## Update `client.promptly.tasks.update(stringtaskID, TaskUpdateParamsbody, RequestOptionsoptions?): Task` **patch** `/api/promptly/tasks/{taskId}` Update an existing task ### Parameters - `taskID: string` - `body: TaskUpdateParams` - `deliveryEmail?: boolean` - `deliveryEmailAddress?: string` - `deliveryPhoneNumber?: string` - `deliverySms?: boolean` - `destinations?: Array` - `type: "email" | "sms" | "webhook"` - `"email"` - `"sms"` - `"webhook"` - `value: string` Email address, phone number, or webhook URL - `label?: string` Optional human-readable label - `model?: string` - `name?: string` - `prompt?: string` - `schedule?: "once" | "hourly" | "daily" | "weekly"` - `"once"` - `"hourly"` - `"daily"` - `"weekly"` - `scheduleDays?: Array<"monday" | "tuesday" | "wednesday" | 4 more>` - `"monday"` - `"tuesday"` - `"wednesday"` - `"thursday"` - `"friday"` - `"saturday"` - `"sunday"` - `scheduleTime?: string` - `skillIds?: Array` Replace all attached skills with these IDs - `sourceIds?: Array` Replace all attached sources with these IDs - `status?: "active" | "paused" | "completed"` - `"active"` - `"paused"` - `"completed"` - `timezone?: string` ### Returns - `Task` - `id: string` - `createdAt: string` - `model: string` AI model identifier (e.g., 'gpt-4o-mini') - `name: string` Human-readable task name - `prompt: string` The AI prompt to execute - `schedule: "once" | "hourly" | "daily" | "weekly"` Task execution frequency - `"once"` - `"hourly"` - `"daily"` - `"weekly"` - `status: "active" | "paused" | "completed"` - `"active"` - `"paused"` - `"completed"` - `cronExpression?: string` Custom cron expression (overrides schedule settings) - `deliveryEmail?: boolean` Email delivery enabled - `deliveryEmailAddress?: string` Email address for delivery - `deliveryPhoneNumber?: string` Phone number for SMS delivery - `deliverySms?: boolean` SMS delivery enabled - `destinations?: Array` Where to deliver task results - `type: "email" | "sms" | "webhook"` - `"email"` - `"sms"` - `"webhook"` - `value: string` Email address, phone number, or webhook URL - `label?: string` Optional human-readable label - `lastRunAt?: string | null` - `nextRunAt?: string | null` - `organizationId?: string` - `scheduleDays?: Array<"monday" | "tuesday" | "wednesday" | 4 more>` Days of week to run (for weekly schedule) - `"monday"` - `"tuesday"` - `"wednesday"` - `"thursday"` - `"friday"` - `"saturday"` - `"sunday"` - `scheduleTime?: string` Time of day to run (HH:MM format) - `skillIds?: Array` IDs of attached skills - `skills?: Array` Attached skills (when expanded) - `id: string` - `content: string` Markdown instructions that guide task execution - `name: string` - `category?: string` - `createdAt?: string` - `description?: string` - `frontmatter?: Frontmatter` Skill metadata - `author?: string` - `requiredSources?: Array` Source slugs this skill depends on - `tags?: Array` - `iconUrl?: string` - `isPublic?: boolean` Whether the skill is shared publicly - `isUserInvocable?: boolean` Whether users can manually attach this skill - `organizationId?: string` - `slug?: string` URL-friendly identifier - `updatedAt?: string` - `version?: number` - `sourceIds?: Array` IDs of attached sources - `sources?: Array` Attached data sources (when expanded) - `id: string` - `config: Config` Source-specific configuration - `args?: Array` Command arguments - `baseUrl?: string` Base URL for API sources - `command?: string` Command to run for stdio transport - `env?: Record` Environment variables - `transport?: "stdio" | "http" | "websocket"` MCP transport type - `"stdio"` - `"http"` - `"websocket"` - `url?: string` URL for http/websocket transport - `name: string` - `type: "mcp" | "api" | "local"` Source connection type - `"mcp"` - `"api"` - `"local"` - `authConfig?: AuthConfig` Authentication configuration - `headerName?: string` - `prefix?: string` - `provider?: string` - `authType?: "none" | "oauth" | "bearer" | 5 more` - `"none"` - `"oauth"` - `"bearer"` - `"basic"` - `"header"` - `"query"` - `"api_key"` - `"composio"` - `composioConnected?: boolean` Whether Composio OAuth is completed - `composioToolkit?: string` Composio toolkit name (e.g., 'todoist', 'github') - `createdAt?: string` - `description?: string` - `iconUrl?: string` - `isActive?: boolean` Whether the source is connected and ready - `lastConnectedAt?: string` - `organizationId?: string` - `slug?: string` URL-friendly identifier - `tools?: Array` Available tools from this source - `description?: string` - `inputSchema?: unknown` JSON Schema for tool parameters - `name?: string` - `updatedAt?: string` - `timezone?: string` IANA timezone (e.g., 'America/New_York') - `updatedAt?: string` - `userId?: string` Owner user ID ### Example ```typescript import _0ct from '0ct'; const client = new _0ct({ apiKey: process.env['0CT_API_KEY'], // This is the default and can be omitted }); const task = await client.promptly.tasks.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'); console.log(task.id); ``` ## Delete `client.promptly.tasks.delete(stringtaskID, RequestOptionsoptions?): TaskDeleteResponse` **delete** `/api/promptly/tasks/{taskId}` Delete a task and all its run history ### Parameters - `taskID: string` ### Returns - `TaskDeleteResponse` - `success?: boolean` ### Example ```typescript import _0ct from '0ct'; const client = new _0ct({ apiKey: process.env['0CT_API_KEY'], // This is the default and can be omitted }); const task = await client.promptly.tasks.delete('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'); console.log(task.success); ``` ## Run `client.promptly.tasks.run(stringtaskID, RequestOptionsoptions?): TaskRun` **post** `/api/promptly/tasks/{taskId}/run` Execute a task immediately, regardless of its schedule ### Parameters - `taskID: string` ### Returns - `TaskRun` - `id?: string` - `completedAt?: string` - `costCents?: number` Cost in cents - `createdAt?: string` - `deliveryStatus?: "pending" | "delivered" | "failed"` - `"pending"` - `"delivered"` - `"failed"` - `durationMs?: number` Execution time in milliseconds - `error?: string` Error message if failed - `output?: string` AI-generated output - `startedAt?: string` - `status?: "pending" | "running" | "completed" | "failed"` - `"pending"` - `"running"` - `"completed"` - `"failed"` - `taskId?: string` - `tokensUsed?: number` Total tokens consumed ### Example ```typescript import _0ct from '0ct'; const client = new _0ct({ apiKey: process.env['0CT_API_KEY'], // This is the default and can be omitted }); const taskRun = await client.promptly.tasks.run('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'); console.log(taskRun.id); ``` ## List Runs `client.promptly.tasks.listRuns(stringtaskID, TaskListRunsParamsquery?, RequestOptionsoptions?): TaskListRunsResponse` **get** `/api/promptly/tasks/{taskId}/runs` Retrieve run history for a specific task ### Parameters - `taskID: string` - `query: TaskListRunsParams` - `limit?: number` Maximum number of runs to return ### Returns - `TaskListRunsResponse = Array` - `id?: string` - `completedAt?: string` - `costCents?: number` Cost in cents - `createdAt?: string` - `deliveryStatus?: "pending" | "delivered" | "failed"` - `"pending"` - `"delivered"` - `"failed"` - `durationMs?: number` Execution time in milliseconds - `error?: string` Error message if failed - `output?: string` AI-generated output - `startedAt?: string` - `status?: "pending" | "running" | "completed" | "failed"` - `"pending"` - `"running"` - `"completed"` - `"failed"` - `taskId?: string` - `tokensUsed?: number` Total tokens consumed ### Example ```typescript import _0ct from '0ct'; const client = new _0ct({ apiKey: process.env['0CT_API_KEY'], // This is the default and can be omitted }); const taskRuns = await client.promptly.tasks.listRuns('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'); console.log(taskRuns); ``` ## Domain Types ### Destination - `Destination` - `type: "email" | "sms" | "webhook"` - `"email"` - `"sms"` - `"webhook"` - `value: string` Email address, phone number, or webhook URL - `label?: string` Optional human-readable label ### Task - `Task` - `id: string` - `createdAt: string` - `model: string` AI model identifier (e.g., 'gpt-4o-mini') - `name: string` Human-readable task name - `prompt: string` The AI prompt to execute - `schedule: "once" | "hourly" | "daily" | "weekly"` Task execution frequency - `"once"` - `"hourly"` - `"daily"` - `"weekly"` - `status: "active" | "paused" | "completed"` - `"active"` - `"paused"` - `"completed"` - `cronExpression?: string` Custom cron expression (overrides schedule settings) - `deliveryEmail?: boolean` Email delivery enabled - `deliveryEmailAddress?: string` Email address for delivery - `deliveryPhoneNumber?: string` Phone number for SMS delivery - `deliverySms?: boolean` SMS delivery enabled - `destinations?: Array` Where to deliver task results - `type: "email" | "sms" | "webhook"` - `"email"` - `"sms"` - `"webhook"` - `value: string` Email address, phone number, or webhook URL - `label?: string` Optional human-readable label - `lastRunAt?: string | null` - `nextRunAt?: string | null` - `organizationId?: string` - `scheduleDays?: Array<"monday" | "tuesday" | "wednesday" | 4 more>` Days of week to run (for weekly schedule) - `"monday"` - `"tuesday"` - `"wednesday"` - `"thursday"` - `"friday"` - `"saturday"` - `"sunday"` - `scheduleTime?: string` Time of day to run (HH:MM format) - `skillIds?: Array` IDs of attached skills - `skills?: Array` Attached skills (when expanded) - `id: string` - `content: string` Markdown instructions that guide task execution - `name: string` - `category?: string` - `createdAt?: string` - `description?: string` - `frontmatter?: Frontmatter` Skill metadata - `author?: string` - `requiredSources?: Array` Source slugs this skill depends on - `tags?: Array` - `iconUrl?: string` - `isPublic?: boolean` Whether the skill is shared publicly - `isUserInvocable?: boolean` Whether users can manually attach this skill - `organizationId?: string` - `slug?: string` URL-friendly identifier - `updatedAt?: string` - `version?: number` - `sourceIds?: Array` IDs of attached sources - `sources?: Array` Attached data sources (when expanded) - `id: string` - `config: Config` Source-specific configuration - `args?: Array` Command arguments - `baseUrl?: string` Base URL for API sources - `command?: string` Command to run for stdio transport - `env?: Record` Environment variables - `transport?: "stdio" | "http" | "websocket"` MCP transport type - `"stdio"` - `"http"` - `"websocket"` - `url?: string` URL for http/websocket transport - `name: string` - `type: "mcp" | "api" | "local"` Source connection type - `"mcp"` - `"api"` - `"local"` - `authConfig?: AuthConfig` Authentication configuration - `headerName?: string` - `prefix?: string` - `provider?: string` - `authType?: "none" | "oauth" | "bearer" | 5 more` - `"none"` - `"oauth"` - `"bearer"` - `"basic"` - `"header"` - `"query"` - `"api_key"` - `"composio"` - `composioConnected?: boolean` Whether Composio OAuth is completed - `composioToolkit?: string` Composio toolkit name (e.g., 'todoist', 'github') - `createdAt?: string` - `description?: string` - `iconUrl?: string` - `isActive?: boolean` Whether the source is connected and ready - `lastConnectedAt?: string` - `organizationId?: string` - `slug?: string` URL-friendly identifier - `tools?: Array` Available tools from this source - `description?: string` - `inputSchema?: unknown` JSON Schema for tool parameters - `name?: string` - `updatedAt?: string` - `timezone?: string` IANA timezone (e.g., 'America/New_York') - `updatedAt?: string` - `userId?: string` Owner user ID ### Task Run - `TaskRun` - `id?: string` - `completedAt?: string` - `costCents?: number` Cost in cents - `createdAt?: string` - `deliveryStatus?: "pending" | "delivered" | "failed"` - `"pending"` - `"delivered"` - `"failed"` - `durationMs?: number` Execution time in milliseconds - `error?: string` Error message if failed - `output?: string` AI-generated output - `startedAt?: string` - `status?: "pending" | "running" | "completed" | "failed"` - `"pending"` - `"running"` - `"completed"` - `"failed"` - `taskId?: string` - `tokensUsed?: number` Total tokens consumed # Sources ## Attach `client.promptly.tasks.sources.attach(stringtaskID, SourceAttachParamsbody, RequestOptionsoptions?): void` **post** `/api/promptly/tasks/{taskId}/sources` Connect a data source to provide context for task execution ### Parameters - `taskID: string` - `body: SourceAttachParams` - `sourceId: string` ### Example ```typescript import _0ct from '0ct'; const client = new _0ct({ apiKey: process.env['0CT_API_KEY'], // This is the default and can be omitted }); await client.promptly.tasks.sources.attach('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { sourceId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', }); ``` ## Detach `client.promptly.tasks.sources.detach(stringsourceID, SourceDetachParamsparams, RequestOptionsoptions?): void` **delete** `/api/promptly/tasks/{taskId}/sources/{sourceId}` Detach a source from a task ### Parameters - `sourceID: string` - `params: SourceDetachParams` - `taskId: string` Unique task identifier ### Example ```typescript import _0ct from '0ct'; const client = new _0ct({ apiKey: process.env['0CT_API_KEY'], // This is the default and can be omitted }); await client.promptly.tasks.sources.detach('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { taskId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', }); ``` # Skills ## Attach `client.promptly.tasks.skills.attach(stringtaskID, SkillAttachParamsbody, RequestOptionsoptions?): void` **post** `/api/promptly/tasks/{taskId}/skills` Add reusable instructions to guide task execution ### Parameters - `taskID: string` - `body: SkillAttachParams` - `skillId: string` ### Example ```typescript import _0ct from '0ct'; const client = new _0ct({ apiKey: process.env['0CT_API_KEY'], // This is the default and can be omitted }); await client.promptly.tasks.skills.attach('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { skillId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', }); ``` ## Detach `client.promptly.tasks.skills.detach(stringskillID, SkillDetachParamsparams, RequestOptionsoptions?): void` **delete** `/api/promptly/tasks/{taskId}/skills/{skillId}` Detach a skill from a task ### Parameters - `skillID: string` - `params: SkillDetachParams` - `taskId: string` Unique task identifier ### Example ```typescript import _0ct from '0ct'; const client = new _0ct({ apiKey: process.env['0CT_API_KEY'], // This is the default and can be omitted }); await client.promptly.tasks.skills.detach('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { taskId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', }); ``` # Sources ## List `client.promptly.sources.list(SourceListParamsquery, RequestOptionsoptions?): SourceListResponse` **get** `/api/promptly/sources` Retrieve all data sources for the organization ### Parameters - `query: SourceListParams` - `organizationId: string` ### Returns - `SourceListResponse = Array` - `id: string` - `config: Config` Source-specific configuration - `args?: Array` Command arguments - `baseUrl?: string` Base URL for API sources - `command?: string` Command to run for stdio transport - `env?: Record` Environment variables - `transport?: "stdio" | "http" | "websocket"` MCP transport type - `"stdio"` - `"http"` - `"websocket"` - `url?: string` URL for http/websocket transport - `name: string` - `type: "mcp" | "api" | "local"` Source connection type - `"mcp"` - `"api"` - `"local"` - `authConfig?: AuthConfig` Authentication configuration - `headerName?: string` - `prefix?: string` - `provider?: string` - `authType?: "none" | "oauth" | "bearer" | 5 more` - `"none"` - `"oauth"` - `"bearer"` - `"basic"` - `"header"` - `"query"` - `"api_key"` - `"composio"` - `composioConnected?: boolean` Whether Composio OAuth is completed - `composioToolkit?: string` Composio toolkit name (e.g., 'todoist', 'github') - `createdAt?: string` - `description?: string` - `iconUrl?: string` - `isActive?: boolean` Whether the source is connected and ready - `lastConnectedAt?: string` - `organizationId?: string` - `slug?: string` URL-friendly identifier - `tools?: Array` Available tools from this source - `description?: string` - `inputSchema?: unknown` JSON Schema for tool parameters - `name?: string` - `updatedAt?: string` ### Example ```typescript import _0ct from '0ct'; const client = new _0ct({ apiKey: process.env['0CT_API_KEY'], // This is the default and can be omitted }); const sources = await client.promptly.sources.list({ organizationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', }); console.log(sources); ``` ## Create `client.promptly.sources.create(SourceCreateParamsbody, RequestOptionsoptions?): Source` **post** `/api/promptly/sources` Create a new data source connection ### Parameters - `body: SourceCreateParams` - `config: unknown` - `name: string` - `organizationId: string` - `type: "mcp" | "api" | "local"` - `"mcp"` - `"api"` - `"local"` - `authConfig?: unknown` - `authType?: string` - `description?: string` - `iconUrl?: string` - `slug?: string` ### Returns - `Source` - `id: string` - `config: Config` Source-specific configuration - `args?: Array` Command arguments - `baseUrl?: string` Base URL for API sources - `command?: string` Command to run for stdio transport - `env?: Record` Environment variables - `transport?: "stdio" | "http" | "websocket"` MCP transport type - `"stdio"` - `"http"` - `"websocket"` - `url?: string` URL for http/websocket transport - `name: string` - `type: "mcp" | "api" | "local"` Source connection type - `"mcp"` - `"api"` - `"local"` - `authConfig?: AuthConfig` Authentication configuration - `headerName?: string` - `prefix?: string` - `provider?: string` - `authType?: "none" | "oauth" | "bearer" | 5 more` - `"none"` - `"oauth"` - `"bearer"` - `"basic"` - `"header"` - `"query"` - `"api_key"` - `"composio"` - `composioConnected?: boolean` Whether Composio OAuth is completed - `composioToolkit?: string` Composio toolkit name (e.g., 'todoist', 'github') - `createdAt?: string` - `description?: string` - `iconUrl?: string` - `isActive?: boolean` Whether the source is connected and ready - `lastConnectedAt?: string` - `organizationId?: string` - `slug?: string` URL-friendly identifier - `tools?: Array` Available tools from this source - `description?: string` - `inputSchema?: unknown` JSON Schema for tool parameters - `name?: string` - `updatedAt?: string` ### Example ```typescript import _0ct from '0ct'; const client = new _0ct({ apiKey: process.env['0CT_API_KEY'], // This is the default and can be omitted }); const source = await client.promptly.sources.create({ config: {}, name: 'name', organizationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', type: 'mcp', }); console.log(source.id); ``` ## Retrieve `client.promptly.sources.retrieve(stringsourceID, RequestOptionsoptions?): Source` **get** `/api/promptly/sources/{sourceId}` Retrieve a specific source by ID ### Parameters - `sourceID: string` ### Returns - `Source` - `id: string` - `config: Config` Source-specific configuration - `args?: Array` Command arguments - `baseUrl?: string` Base URL for API sources - `command?: string` Command to run for stdio transport - `env?: Record` Environment variables - `transport?: "stdio" | "http" | "websocket"` MCP transport type - `"stdio"` - `"http"` - `"websocket"` - `url?: string` URL for http/websocket transport - `name: string` - `type: "mcp" | "api" | "local"` Source connection type - `"mcp"` - `"api"` - `"local"` - `authConfig?: AuthConfig` Authentication configuration - `headerName?: string` - `prefix?: string` - `provider?: string` - `authType?: "none" | "oauth" | "bearer" | 5 more` - `"none"` - `"oauth"` - `"bearer"` - `"basic"` - `"header"` - `"query"` - `"api_key"` - `"composio"` - `composioConnected?: boolean` Whether Composio OAuth is completed - `composioToolkit?: string` Composio toolkit name (e.g., 'todoist', 'github') - `createdAt?: string` - `description?: string` - `iconUrl?: string` - `isActive?: boolean` Whether the source is connected and ready - `lastConnectedAt?: string` - `organizationId?: string` - `slug?: string` URL-friendly identifier - `tools?: Array` Available tools from this source - `description?: string` - `inputSchema?: unknown` JSON Schema for tool parameters - `name?: string` - `updatedAt?: string` ### Example ```typescript import _0ct from '0ct'; const client = new _0ct({ apiKey: process.env['0CT_API_KEY'], // This is the default and can be omitted }); const source = await client.promptly.sources.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'); console.log(source.id); ``` ## Update `client.promptly.sources.update(stringsourceID, SourceUpdateParamsbody, RequestOptionsoptions?): Source` **patch** `/api/promptly/sources/{sourceId}` Update a source ### Parameters - `sourceID: string` - `body: SourceUpdateParams` - `authConfig?: unknown` - `authType?: string` - `config?: unknown` - `description?: string` - `isActive?: boolean` - `name?: string` ### Returns - `Source` - `id: string` - `config: Config` Source-specific configuration - `args?: Array` Command arguments - `baseUrl?: string` Base URL for API sources - `command?: string` Command to run for stdio transport - `env?: Record` Environment variables - `transport?: "stdio" | "http" | "websocket"` MCP transport type - `"stdio"` - `"http"` - `"websocket"` - `url?: string` URL for http/websocket transport - `name: string` - `type: "mcp" | "api" | "local"` Source connection type - `"mcp"` - `"api"` - `"local"` - `authConfig?: AuthConfig` Authentication configuration - `headerName?: string` - `prefix?: string` - `provider?: string` - `authType?: "none" | "oauth" | "bearer" | 5 more` - `"none"` - `"oauth"` - `"bearer"` - `"basic"` - `"header"` - `"query"` - `"api_key"` - `"composio"` - `composioConnected?: boolean` Whether Composio OAuth is completed - `composioToolkit?: string` Composio toolkit name (e.g., 'todoist', 'github') - `createdAt?: string` - `description?: string` - `iconUrl?: string` - `isActive?: boolean` Whether the source is connected and ready - `lastConnectedAt?: string` - `organizationId?: string` - `slug?: string` URL-friendly identifier - `tools?: Array` Available tools from this source - `description?: string` - `inputSchema?: unknown` JSON Schema for tool parameters - `name?: string` - `updatedAt?: string` ### Example ```typescript import _0ct from '0ct'; const client = new _0ct({ apiKey: process.env['0CT_API_KEY'], // This is the default and can be omitted }); const source = await client.promptly.sources.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'); console.log(source.id); ``` ## Delete `client.promptly.sources.delete(stringsourceID, RequestOptionsoptions?): void` **delete** `/api/promptly/sources/{sourceId}` Delete a source ### Parameters - `sourceID: string` ### Example ```typescript import _0ct from '0ct'; const client = new _0ct({ apiKey: process.env['0CT_API_KEY'], // This is the default and can be omitted }); await client.promptly.sources.delete('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'); ``` ## Test `client.promptly.sources.test(stringsourceID, RequestOptionsoptions?): SourceTestResponse` **post** `/api/promptly/sources/{sourceId}/test` Verify the source connection is working properly ### Parameters - `sourceID: string` ### Returns - `SourceTestResponse` - `message?: string` - `success?: boolean` - `tools?: Array` - `description?: string` - `inputSchema?: unknown` JSON Schema for tool parameters - `name?: string` ### Example ```typescript import _0ct from '0ct'; const client = new _0ct({ apiKey: process.env['0CT_API_KEY'], // This is the default and can be omitted }); const response = await client.promptly.sources.test('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'); console.log(response.message); ``` ## Domain Types ### Source - `Source` - `id: string` - `config: Config` Source-specific configuration - `args?: Array` Command arguments - `baseUrl?: string` Base URL for API sources - `command?: string` Command to run for stdio transport - `env?: Record` Environment variables - `transport?: "stdio" | "http" | "websocket"` MCP transport type - `"stdio"` - `"http"` - `"websocket"` - `url?: string` URL for http/websocket transport - `name: string` - `type: "mcp" | "api" | "local"` Source connection type - `"mcp"` - `"api"` - `"local"` - `authConfig?: AuthConfig` Authentication configuration - `headerName?: string` - `prefix?: string` - `provider?: string` - `authType?: "none" | "oauth" | "bearer" | 5 more` - `"none"` - `"oauth"` - `"bearer"` - `"basic"` - `"header"` - `"query"` - `"api_key"` - `"composio"` - `composioConnected?: boolean` Whether Composio OAuth is completed - `composioToolkit?: string` Composio toolkit name (e.g., 'todoist', 'github') - `createdAt?: string` - `description?: string` - `iconUrl?: string` - `isActive?: boolean` Whether the source is connected and ready - `lastConnectedAt?: string` - `organizationId?: string` - `slug?: string` URL-friendly identifier - `tools?: Array` Available tools from this source - `description?: string` - `inputSchema?: unknown` JSON Schema for tool parameters - `name?: string` - `updatedAt?: string` ### Tool - `Tool` - `description?: string` - `inputSchema?: unknown` JSON Schema for tool parameters - `name?: string` # Skills ## List `client.promptly.skills.list(SkillListParamsquery, RequestOptionsoptions?): SkillListResponse` **get** `/api/promptly/skills` Retrieve all skills for the organization ### Parameters - `query: SkillListParams` - `organizationId: string` ### Returns - `SkillListResponse = Array` - `id: string` - `content: string` Markdown instructions that guide task execution - `name: string` - `category?: string` - `createdAt?: string` - `description?: string` - `frontmatter?: Frontmatter` Skill metadata - `author?: string` - `requiredSources?: Array` Source slugs this skill depends on - `tags?: Array` - `iconUrl?: string` - `isPublic?: boolean` Whether the skill is shared publicly - `isUserInvocable?: boolean` Whether users can manually attach this skill - `organizationId?: string` - `slug?: string` URL-friendly identifier - `updatedAt?: string` - `version?: number` ### Example ```typescript import _0ct from '0ct'; const client = new _0ct({ apiKey: process.env['0CT_API_KEY'], // This is the default and can be omitted }); const skills = await client.promptly.skills.list({ organizationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', }); console.log(skills); ``` ## Create `client.promptly.skills.create(SkillCreateParamsbody, RequestOptionsoptions?): Skill` **post** `/api/promptly/skills` Create a new reusable instruction set ### Parameters - `body: SkillCreateParams` - `content: string` - `name: string` - `organizationId: string` - `category?: string` - `description?: string` - `frontmatter?: unknown` - `iconUrl?: string` - `isPublic?: boolean` - `slug?: string` ### Returns - `Skill` - `id: string` - `content: string` Markdown instructions that guide task execution - `name: string` - `category?: string` - `createdAt?: string` - `description?: string` - `frontmatter?: Frontmatter` Skill metadata - `author?: string` - `requiredSources?: Array` Source slugs this skill depends on - `tags?: Array` - `iconUrl?: string` - `isPublic?: boolean` Whether the skill is shared publicly - `isUserInvocable?: boolean` Whether users can manually attach this skill - `organizationId?: string` - `slug?: string` URL-friendly identifier - `updatedAt?: string` - `version?: number` ### Example ```typescript import _0ct from '0ct'; const client = new _0ct({ apiKey: process.env['0CT_API_KEY'], // This is the default and can be omitted }); const skill = await client.promptly.skills.create({ content: 'content', name: 'name', organizationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', }); console.log(skill.id); ``` ## Retrieve `client.promptly.skills.retrieve(stringskillID, RequestOptionsoptions?): Skill` **get** `/api/promptly/skills/{skillId}` Get a skill ### Parameters - `skillID: string` ### Returns - `Skill` - `id: string` - `content: string` Markdown instructions that guide task execution - `name: string` - `category?: string` - `createdAt?: string` - `description?: string` - `frontmatter?: Frontmatter` Skill metadata - `author?: string` - `requiredSources?: Array` Source slugs this skill depends on - `tags?: Array` - `iconUrl?: string` - `isPublic?: boolean` Whether the skill is shared publicly - `isUserInvocable?: boolean` Whether users can manually attach this skill - `organizationId?: string` - `slug?: string` URL-friendly identifier - `updatedAt?: string` - `version?: number` ### Example ```typescript import _0ct from '0ct'; const client = new _0ct({ apiKey: process.env['0CT_API_KEY'], // This is the default and can be omitted }); const skill = await client.promptly.skills.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'); console.log(skill.id); ``` ## Update `client.promptly.skills.update(stringskillID, SkillUpdateParamsbody, RequestOptionsoptions?): Skill` **patch** `/api/promptly/skills/{skillId}` Update a skill ### Parameters - `skillID: string` - `body: SkillUpdateParams` - `category?: string` - `content?: string` - `description?: string` - `frontmatter?: unknown` - `isPublic?: boolean` - `name?: string` ### Returns - `Skill` - `id: string` - `content: string` Markdown instructions that guide task execution - `name: string` - `category?: string` - `createdAt?: string` - `description?: string` - `frontmatter?: Frontmatter` Skill metadata - `author?: string` - `requiredSources?: Array` Source slugs this skill depends on - `tags?: Array` - `iconUrl?: string` - `isPublic?: boolean` Whether the skill is shared publicly - `isUserInvocable?: boolean` Whether users can manually attach this skill - `organizationId?: string` - `slug?: string` URL-friendly identifier - `updatedAt?: string` - `version?: number` ### Example ```typescript import _0ct from '0ct'; const client = new _0ct({ apiKey: process.env['0CT_API_KEY'], // This is the default and can be omitted }); const skill = await client.promptly.skills.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'); console.log(skill.id); ``` ## Delete `client.promptly.skills.delete(stringskillID, RequestOptionsoptions?): void` **delete** `/api/promptly/skills/{skillId}` Delete a skill ### Parameters - `skillID: string` ### Example ```typescript import _0ct from '0ct'; const client = new _0ct({ apiKey: process.env['0CT_API_KEY'], // This is the default and can be omitted }); await client.promptly.skills.delete('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'); ``` ## Domain Types ### Skill - `Skill` - `id: string` - `content: string` Markdown instructions that guide task execution - `name: string` - `category?: string` - `createdAt?: string` - `description?: string` - `frontmatter?: Frontmatter` Skill metadata - `author?: string` - `requiredSources?: Array` Source slugs this skill depends on - `tags?: Array` - `iconUrl?: string` - `isPublic?: boolean` Whether the skill is shared publicly - `isUserInvocable?: boolean` Whether users can manually attach this skill - `organizationId?: string` - `slug?: string` URL-friendly identifier - `updatedAt?: string` - `version?: number` # Models ## List `client.promptly.models.list(RequestOptionsoptions?): ModelListResponse` **get** `/api/promptly/models` Retrieve all available AI models for task execution ### Returns - `ModelListResponse = Array` - `id?: string` - `codingIndex?: number` Coding benchmark score - `contextLength?: number` Maximum context window size - `intelligenceIndex?: number` Intelligence benchmark score - `name?: string` - `openRouterId?: string` Model identifier for OpenRouter - `outputSpeed?: number` Tokens per second - `powerTier?: number` Power tier (1 = most powerful) - `provider?: string` Model provider (anthropic, openai, google, etc.) - `supportsInternetSearch?: boolean` - `supportsToolCalling?: boolean` ### Example ```typescript import _0ct from '0ct'; const client = new _0ct({ apiKey: process.env['0CT_API_KEY'], // This is the default and can be omitted }); const models = await client.promptly.models.list(); console.log(models); ``` ## Retrieve `client.promptly.models.retrieve(stringmodelID, RequestOptionsoptions?): Model` **get** `/api/promptly/models/{modelId}` Get a model ### Parameters - `modelID: string` ### Returns - `Model` - `id?: string` - `codingIndex?: number` Coding benchmark score - `contextLength?: number` Maximum context window size - `intelligenceIndex?: number` Intelligence benchmark score - `name?: string` - `openRouterId?: string` Model identifier for OpenRouter - `outputSpeed?: number` Tokens per second - `powerTier?: number` Power tier (1 = most powerful) - `provider?: string` Model provider (anthropic, openai, google, etc.) - `supportsInternetSearch?: boolean` - `supportsToolCalling?: boolean` ### Example ```typescript import _0ct from '0ct'; const client = new _0ct({ apiKey: process.env['0CT_API_KEY'], // This is the default and can be omitted }); const model = await client.promptly.models.retrieve('modelId'); console.log(model.id); ``` ## Domain Types ### Model - `Model` - `id?: string` - `codingIndex?: number` Coding benchmark score - `contextLength?: number` Maximum context window size - `intelligenceIndex?: number` Intelligence benchmark score - `name?: string` - `openRouterId?: string` Model identifier for OpenRouter - `outputSpeed?: number` Tokens per second - `powerTier?: number` Power tier (1 = most powerful) - `provider?: string` Model provider (anthropic, openai, google, etc.) - `supportsInternetSearch?: boolean` - `supportsToolCalling?: boolean` # Billing ## Get Status `client.promptly.billing.getStatus(BillingGetStatusParamsquery, RequestOptionsoptions?): BillingGetStatusResponse` **get** `/api/promptly/billing/status` Retrieve current subscription and usage information ### Parameters - `query: BillingGetStatusParams` - `organizationId: string` ### Returns - `BillingGetStatusResponse` - `billingPeriodStart?: string` - `plan?: "free" | "paid"` - `"free"` - `"paid"` - `runsLimit?: number` Maximum runs allowed (null for unlimited) - `runsUsed?: number` Task runs used this billing period - `stripeCustomerId?: string` - `stripeSubscriptionId?: string` - `tasksCount?: number` Current number of active tasks - `tasksLimit?: number` Maximum tasks allowed - `usageCostCents?: number` Usage-based charges this period - `usageCreditsCents?: number` Usage credits included in plan - `usersCount?: number` - `usersLimit?: number` ### Example ```typescript import _0ct from '0ct'; const client = new _0ct({ apiKey: process.env['0CT_API_KEY'], // This is the default and can be omitted }); const response = await client.promptly.billing.getStatus({ organizationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', }); console.log(response.billingPeriodStart); ``` ## Create Checkout `client.promptly.billing.createCheckout(BillingCreateCheckoutParamsbody, RequestOptionsoptions?): BillingCreateCheckoutResponse` **post** `/api/promptly/billing/checkout` Create a Stripe checkout session for upgrading to paid plan ### Parameters - `body: BillingCreateCheckoutParams` - `organizationId: string` ### Returns - `BillingCreateCheckoutResponse` - `url?: string` Stripe checkout URL ### Example ```typescript import _0ct from '0ct'; const client = new _0ct({ apiKey: process.env['0CT_API_KEY'], // This is the default and can be omitted }); const response = await client.promptly.billing.createCheckout({ organizationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', }); console.log(response.url); ``` ## Create Portal `client.promptly.billing.createPortal(BillingCreatePortalParamsbody, RequestOptionsoptions?): BillingCreatePortalResponse` **post** `/api/promptly/billing/portal` Create a Stripe billing portal session for managing subscription ### Parameters - `body: BillingCreatePortalParams` - `organizationId: string` ### Returns - `BillingCreatePortalResponse` - `url?: string` Stripe billing portal URL ### Example ```typescript import _0ct from '0ct'; const client = new _0ct({ apiKey: process.env['0CT_API_KEY'], // This is the default and can be omitted }); const response = await client.promptly.billing.createPortal({ organizationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', }); console.log(response.url); ```