Skip to main content
Reference

SDK References

Qoder Agent SDK ships in two languages: TypeScript and Python. The two cover the same core surface — the agent loop, tools, permissions, hooks, sessions, MCP, skills, and plugins — while API signatures, type definitions, and naming follow each language's conventions (camelCase in TypeScript; snake_case for public options in Python). A small number of options exist in only one language; see Language differences below. The full API references are maintained per language:

By language

LanguageReferencePackage
TypeScriptSDK References - TypeScript@qodercn-ai/qodercn-agent-sdk
PythonSDK References - Pythonqodercn-agent-sdk

Language differences

Most options map one-to-one between the two SDKs. These do not. Each language reference page remains authoritative for its own surface.

TypeScript only

CapabilityOption or methodNotes
Memorymemory, flushMemory(), refreshMemory()Configure native or application-owned memory
Built-in tool behaviortoolConfigTune how built-in tools behave; see Tools
Session persistence controlpersistSession, resumeSessionAt, resumeDropsTurnFine-grained control over what a resumed session loads and keeps
Prompt suggestionspromptSuggestionsReceive suggested follow-up prompts
Model request patchesmodelRequestPatchesAdjust outgoing model requests
Hook event filteringincludeHookEventsChoose which hook events reach the message stream
Custom transport and process controltransport, spawnQoderCLIProcess, executable, executableArgsReplace how the runtime is launched or connected

Python only

CapabilityOptionNotes
System prompt from a filesystem_prompt={"type": "file", "path": ...}No TypeScript equivalent; in TypeScript, read the file and pass the contents as a string
MCP authentication callbackon_mcp_oauth_requiredInbound callback when a server requires OAuth; TypeScript drives this through runtime methods instead
MCP status callbackon_mcp_status_changeInbound callback for server status transitions
Read buffer limitmax_buffer_sizeCap the transport read buffer

Naming map

Core API mapping between the two SDKs, handy for cross-language migration:
CapabilityTypeScriptPython
One-shot queryquery()query()
Multi-turn sessionquery() + async message streamQoderSDKClient
Session optionsOptions (query({ options }))QoderAgentOptions
Auth: PAT from envaccessTokenFromEnv()access_token_from_env()
Auth: PAT directlyaccessToken()access_token()
Auth: Service AccountserviceAccount()service_account()
Auth: local login stateqodercliAuth()qodercli_auth()
Custom toolstool()@tool() decorator
In-process MCP servercreateSdkMcpServer()create_sdk_mcp_server()
Permission callbackcanUseToolcan_use_tool
Interrupt the current responseq.interrupt()client.interrupt()
File rewindq.rewindFiles()client.rewind_files()
MCP status queryq.mcpServerStatus()client.get_mcp_status()
Initialization resultq.initializationResult()client.get_server_info()
Context usageq.getContextUsage()client.get_context_usage()
Account and session usageq.getUsageInfo()client.get_usage_info()
Note: Python's protocol-level structures—AgentDefinition, hooks outputs, settings, etc.—keep the wire-protocol camelCase field names (such as maxTurns, hookSpecificOutput), unlike the snake_case public options. See each feature page for details.

Feature docs

Feature pages carry merged examples for both languages—switch TypeScript / Python inside any code block: