Types
All TypeScript types exported by@castari/sdk.
Agent
Represents a Castari agent.| Field | Type | Description |
|---|---|---|
id | string | Unique identifier |
name | string | Display name |
slug | string | URL-safe identifier |
status | AgentStatus | Current status |
source_type | AgentSourceType | 'git' or 'local' |
git_repo_url | string? | Source repository URL |
sandbox_id | string? | Active sandbox ID (when deployed) |
created_at | string | ISO 8601 timestamp |
updated_at | string | ISO 8601 timestamp |
AgentStatus
Possible agent statuses.| Status | Description |
|---|---|
draft | Created but not configured |
pending | Configured but never deployed |
deploying | Deployment in progress |
active | Running and ready for invocations |
stopped | Manually stopped |
failed | Deployment or runtime error |
AgentSourceType
Source type for agent code.InvocationResponse
Response from invoking an agent.| Field | Type | Description |
|---|---|---|
invocation_id | string | Unique identifier (e.g., inv_abc123) |
session_id | string | Session ID for the invocation |
response_content | string | Agent’s response text |
input_tokens | number | Tokens in the prompt |
output_tokens | number | Tokens in the response |
total_cost_usd | number | string | Total cost in USD |
duration_ms | number | Execution time in milliseconds |
status | string | 'completed' or 'failed' |
InvokeOptions
Options for invoking an agent.| Field | Type | Required | Description |
|---|---|---|---|
prompt | string | Yes | The prompt to send |
sessionId | string | No | Session ID for conversation continuity |
CreateAgentOptions
Options for creating an agent.| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Display name for the agent |
slug | string | No | URL-safe identifier (auto-generated if omitted) |
description | string | No | Agent description |
sourceType | AgentSourceType | No | 'git' (default) or 'local' |
gitRepoUrl | string | No | Git repository URL |
UploadResponse
Response from uploading code.Secret
Represents a secret (metadata only — values are never returned).| Field | Type | Description |
|---|---|---|
key | string | Secret name (e.g., OPENAI_API_KEY) |
CastariClientOptions
Options for creating a client.| Field | Type | Description |
|---|---|---|
apiKey | string | API key (starts with cast_) |
token | string | OAuth token |
baseUrl | string | API base URL (default: https://api.castari.com) |
CastariError
Error thrown by SDK operations.| Field | Type | Description |
|---|---|---|
message | string | Human-readable error message |
status | number | HTTP status code |
code | string? | Error code (e.g., agent_not_found) |
detail | string? | Additional details |
Importing Types
All types are exported from the main package:See Also
- CastariClient — Client setup
- Agents API — Agent methods
- Secrets API — Secrets methods