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:
Most options map one-to-one between the two SDKs. These do not. Each language reference page remains authoritative for its own surface.
Core API mapping between the two SDKs, handy for cross-language migration:
Feature pages carry merged examples for both languages—switch TypeScript / Python inside any code block:
By language
| Language | Reference | Package |
|---|---|---|
| TypeScript | SDK References - TypeScript | @qodercn-ai/qodercn-agent-sdk |
| Python | SDK References - Python | qodercn-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
| Capability | Option or method | Notes |
|---|---|---|
| Memory | memory, flushMemory(), refreshMemory() | Configure native or application-owned memory |
| Built-in tool behavior | toolConfig | Tune how built-in tools behave; see Tools |
| Session persistence control | persistSession, resumeSessionAt, resumeDropsTurn | Fine-grained control over what a resumed session loads and keeps |
| Prompt suggestions | promptSuggestions | Receive suggested follow-up prompts |
| Model request patches | modelRequestPatches | Adjust outgoing model requests |
| Hook event filtering | includeHookEvents | Choose which hook events reach the message stream |
| Custom transport and process control | transport, spawnQoderCLIProcess, executable, executableArgs | Replace how the runtime is launched or connected |
Python only
| Capability | Option | Notes |
|---|---|---|
| System prompt from a file | system_prompt={"type": "file", "path": ...} | No TypeScript equivalent; in TypeScript, read the file and pass the contents as a string |
| MCP authentication callback | on_mcp_oauth_required | Inbound callback when a server requires OAuth; TypeScript drives this through runtime methods instead |
| MCP status callback | on_mcp_status_change | Inbound callback for server status transitions |
| Read buffer limit | max_buffer_size | Cap the transport read buffer |
Naming map
Core API mapping between the two SDKs, handy for cross-language migration:
| Capability | TypeScript | Python |
|---|---|---|
| One-shot query | query() | query() |
| Multi-turn session | query() + async message stream | QoderSDKClient |
| Session options | Options (query({ options })) | QoderAgentOptions |
| Auth: PAT from env | accessTokenFromEnv() | access_token_from_env() |
| Auth: PAT directly | accessToken() | access_token() |
| Auth: Service Account | serviceAccount() | service_account() |
| Auth: local login state | qodercliAuth() | qodercli_auth() |
| Custom tools | tool() | @tool() decorator |
| In-process MCP server | createSdkMcpServer() | create_sdk_mcp_server() |
| Permission callback | canUseTool | can_use_tool |
| Interrupt the current response | q.interrupt() | client.interrupt() |
| File rewind | q.rewindFiles() | client.rewind_files() |
| MCP status query | q.mcpServerStatus() | client.get_mcp_status() |
| Initialization result | q.initializationResult() | client.get_server_info() |
| Context usage | q.getContextUsage() | client.get_context_usage() |
| Account and session usage | q.getUsageInfo() | client.get_usage_info() |
Note: Python's protocol-level structures—AgentDefinition, hooks outputs, settings, etc.—keep the wire-protocol camelCase field names (such asmaxTurns,hookSpecificOutput), unlike the snake_case public options. See each feature page for details.