Node SDK: TypeScript Types

Use the types shipped with your installed @keito-ai/sdk version instead of copying an abbreviated interface from a guide. The SDK combines generated OpenAPI models with resource-specific helper types.

import type {
  TimeEntry,
  TimeEntryCreate,
  TimeEntryUpdate,
  TimeEntryStart,
  TimeEntrySource,
  Expense,
  ExpenseCreate,
  Project,
  User,
  PaginatedResponse,
  ListTimeEntriesParams,
  ListExpensesParams,
} from '@keito-ai/sdk';

const create: ExpenseCreate = {
  project_id: projectId,
  expense_category_id: categoryId,
  spent_date: '2026-10-30',
  total_cost: 24.50,
  source: 'api',
};

Important response fields

Resource Contract
Time entry billable, decimal hours, spent_date, and optional/null timer timestamps. is_billable is not the entry field.
Expense total_cost, currency, units, and nested expense_category. Its configured rate is expense_category.unit_price, not a writable top-level price.
Project Commercial fields may be omitted when the identity cannot see them. A missing rate or budget does not mean zero.
User Directory, /users/me, and personal-sync projections differ. Do not assume every user response includes email, company, capacity or financial fields.

For details and permission-dependent omissions, see Concepts, Users, and OpenAPI. SDK models describe the package’s contract; REST may expose additional endpoints before a dedicated SDK helper exists.

Pagination

PaginatedResponse<T> contains data, page, per_page, total_pages, and total_entries. It implements async iteration, and exposes hasNextPage() and nextPage().

const page = await keito.expenses.list({ per_page: 100 });
for await (const expense of page) {
  console.log(expense.id, expense.total_cost);
}

This wrapper differs from a raw REST response, whose array key is expenses, time_entries, or the corresponding resource name.