export interface PublicApiMeta { requestId: string; idempotencyKey?: string; idempotentReplay?: boolean; nextCursor?: string; } export interface PublicApiSuccess { data: T; meta: PublicApiMeta; } export interface PublicApiErrorBody { error: { code: "invalid_request" | "invalid_json" | "payload_too_large" | "not_found" | "idempotency_conflict" | "policy_blocked" | "rate_limited" | "unauthorized" | "internal_error"; message: string; requestId: string; retryable: boolean; }; } export interface PublicApiThread { id: string; object: "thread"; title: string; createdAt: string; updatedAt: string; } export interface PublicApiMessage { id: string; object: "message"; threadId: string; role: "user" | "agent" | "system"; text: string; format: "plain_text" | "markdown"; createdAt: string; } export interface PublicApiModel { id: string; object: "model"; title: string; default: boolean; capabilities: { conversation: boolean; streaming: boolean; }; } export interface PublicApiListModels { models: PublicApiModel[]; } export interface PublicApiListThreads { threads: PublicApiThread[]; } export interface PublicApiThreadDetail { thread: PublicApiThread; } export interface PublicApiListMessages { messages: PublicApiMessage[]; } export interface PublicApiCreateThreadInput { requestId?: string; idempotencyKey?: string; title: string; } export interface PublicApiListInput { requestId?: string; limit?: number; cursor?: string; } export interface PublicApiThreadInput { requestId?: string; threadId: string; } export interface PublicApiCreateMessageInput extends PublicApiThreadInput { idempotencyKey: string; text: string; format?: "plain_text" | "markdown"; }