Overview
This page provides comprehensive documentation for all Maikers SDK methods and interfaces. The SDK is built with TypeScript and provides full type safety for all operations.Authentication
Manage API authentication and sessions
Agent Operations
Create, manage, and interact with AI agents
Type Definitions
TypeScript interfaces and types
Error Handling
Error types and handling patterns
SDK Initialization
Constructor
| Parameter | Type | Required | Description |
|---|---|---|---|
config | SDKConfig | No | Configuration options for the SDK |
Authentication Methods
auth()
| Parameter | Type | Required | Description |
|---|---|---|---|
apiKey | string | Yes | Your Maikers API key |
Promise<AuthResponse>
AuthResponse Interface:
isAuthenticated()
boolean
Example:
logout()
Agent Operations
agent.create()
| Parameter | Type | Required | Description |
|---|---|---|---|
config | AgentConfig | Yes | Agent configuration object |
Promise<Agent>
Agent Interface:
agent.get()
| Parameter | Type | Required | Description |
|---|---|---|---|
agentId | string | Yes | The unique identifier of the agent |
Promise<Agent>
Example:
agent.list()
| Parameter | Type | Required | Description |
|---|---|---|---|
options | ListOptions | No | Filtering and pagination options |
Promise<Agent[]>
Example:
agent.update()
| Parameter | Type | Required | Description |
|---|---|---|---|
agentId | string | Yes | The unique identifier of the agent |
updates | Partial<AgentConfig> | Yes | Fields to update |
Promise<Agent>
Example:
agent.updateSettings()
| Parameter | Type | Required | Description |
|---|---|---|---|
agentId | string | Yes | The unique identifier of the agent |
settings | AgentSettings | Yes | New settings to apply |
Promise<Agent>
Example:
agent.delete()
| Parameter | Type | Required | Description |
|---|---|---|---|
agentId | string | Yes | The unique identifier of the agent |
Promise<void>
Example:
Agent Interaction
agent.query()
| Parameter | Type | Required | Description |
|---|---|---|---|
agentId | string | Yes | The unique identifier of the agent |
query | QueryRequest | Yes | The query to send to the agent |
Promise<QueryResponse>
QueryResponse Interface:
agent.chat()
| Parameter | Type | Required | Description |
|---|---|---|---|
agentId | string | Yes | The unique identifier of the agent |
options | ChatOptions | No | Chat session options |
Promise<ChatSession>
ChatSession Interface:
Error Handling
Error Types
The SDK throws specific error types for different scenarios:Error Handling Examples
Utility Methods
getCredits()
Promise<CreditsInfo>
CreditsInfo Interface:
getUsage()
| Parameter | Type | Required | Description |
|---|---|---|---|
period | 'day' | 'week' | 'month' | No | Time period for stats (default: ‘month’) |
Promise<UsageStats>
UsageStats Interface:
