Skip to main content
Reference

SDK References

Qoder Agent SDK ships in three languages: TypeScript, Python, and Java. All three use the same CLI runtime protocol and share the core capabilities: the agent loop, tools, permissions, hooks, sessions, and MCP. API signatures, type definitions, and naming follow each language's conventions (camelCase in TypeScript and Java; snake_case for public options in Python). TypeScript and Python cover nearly the same surface; Java's surface is narrower, and some options exist in only one or two languages. See Language differences below. The full API references are maintained per language:

By language

LanguageReferencePackage
TypeScriptSDK References - TypeScript@qoder-ai/qoder-agent-sdk
PythonSDK References - Pythonqoder-agent-sdk
JavaSDK References - Javacom.qoder.sdk:qoder-agent-sdk

Language differences

Most TypeScript and Python options map one-to-one, and Java lacks some of them. The differences are listed below. Each language reference page remains authoritative for its own surface.

TypeScript only

CapabilityOption or methodNotes
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
Goal maximum turnsgoalMaxTurns, setGoalMaxTurns()Configure future Goals without changing the current Goal; see the TypeScript reference
Model request patchesmodelRequestPatchesAdjust outgoing model requests
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": ...}See Load the prompt from a file
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

TypeScript and Java

Python does not have the following capabilities.
CapabilityTypeScriptJavaNotes
Hook events in the message streamincludeHookEventsincludeHookEvents(boolean)Deliver hook lifecycle events in the message stream; does not affect hook callbacks themselves

Not yet available in Java

The following capabilities are available in TypeScript or Python, but Java has no corresponding option or method.
CapabilityTypeScript / Python entry pointJava
Subagent definitionsagentsNo corresponding option; see Subagents
PluginspluginsNo plugins option; reloadPlugins() does not return the plugin list; see Plugins
Skills and setting sourcesskills, settingSourcesSupports only selecting skills for a single message and reloadSkills()
Code security scanssecurityScan / security_scanNo corresponding option; see Scan code for security issues
Usage and context queriesgetContextUsage(), getUsageInfo(), and othersOnly ResultMessage.usage(), which gives the turn's input and output token counts; see Cost and usage
Settings and output stylessettings, output style settingsSee Use settings to provide permission rules and Adjust the output style separately
In-session permission updatesPermissionUpdateUse PermissionResult.allow().withScope(PermissionScope.SESSION); see Approval options and scope (Java)
External authorization tool, MCP Tool PolicypermissionPromptToolName, MCP Tool PolicySee Permissions
Additional directories at startupadditionalDirectories / add_dirsNo startup option; after the session opens, call QoderSession.addDirectories(List<Path>). See Additional directories
AskUserQuestionHandle AskUserQuestion in canUseToolSee Handle AskUserQuestion
Authentication failure callbackonAuthExpired / on_auth_expiredCatch AuthenticationException with error code CLI_AUTH_FATAL; see Authentication failure callback
Custom tool helperstool(), createSdkMcpServer()Implement InProcessMcpHandler; see MCP integration
Strict MCP configurationstrictMcpConfig / strict_mcp_configNo corresponding option
Switching models at runtimeSwitch the current model in fixed-model modeNo corresponding method; see Model selection
Specifying a new session IDsessionIdThe CLI assigns the session ID; read it from initialization(); see Session control
Read timeout and write policy for external session storageloadTimeoutMs, sessionStoreFlushSet mirroring batch and wait limits with sessionMirrorOptions(...); see External session storage
Renaming, tagging, and importing sessionsrenameSession() and related functionsNo corresponding functions
stderr callbackstderrWhen the CLI exits abnormally, read the stderr tail with CliProcessException.getStderrTail()

Java behavior differences

All three languages have the following capabilities, but Java behaves differently:
  • CLI runtime: The Java SDK does not bundle the CLI. On first start it downloads the CLI version pinned to this release and caches it for reuse; see Managed CLI (Java).
  • Authentication: Authentication is configured on QoderClient.Builder.auth(), and every session created by the same client shares it. Auth.accessTokenEnv() reads only the JVM process environment, not variables passed through putEnvironment().
  • Subprocess environment: The CLI subprocess inherits only PATH by default; pass other variables explicitly; see Subprocess environment (Java).
  • Tool list: tools(empty list) is the same as not setting it and leaves the choice to the CLI default; an empty list cannot disable all tools; see Tools.
  • Input priority: The default UserInput priority is NOW; see Input modes.
  • Runtime controls: Runtime methods such as switching permission modes, MCP management, and rewind exist only on QoderSession; the one-shot QoderQuery does not have them.
  • External session storage: If the external record is missing on resume, startup fails instead of falling back to the CLI's local storage; see External session storage.
  • Model selection callback timeout: Not delivered to the application as an exception; detect it with a diagnostics listener; see SDK exceptions.

Naming map

Core API mapping across the three SDKs, handy for cross-language migration:
CapabilityTypeScriptPythonJava
One-shot queryquery()query()QoderClient.query()
Streaming inputquery() + async message streamQoderSDKClientQoderClient.openSession() + QoderSession.send()
Session optionsOptions (query({ options }))QoderAgentOptionsSessionOptions (SessionOptions.builder())
Auth: PAT from envaccessTokenFromEnv()access_token_from_env()Auth.accessTokenEnv()
Auth: PAT directlyaccessToken()access_token()Auth.accessToken(SecretValue)
Auth: Service AccountserviceAccount()service_account()Auth.serviceAccountKey() / Auth.serviceAccountTokenProvider()
Auth: local login stateqodercliAuth()qodercli_auth()Auth.qoderCli()
Custom toolstool()@tool() decoratorImplement tools/list and tools/call in an InProcessMcpHandler
In-process MCP servercreateSdkMcpServer()create_sdk_mcp_server()McpServerConfig.inProcess()
Permission callbackcanUseToolcan_use_toolcanUseTool(ToolPermissionHandler)
Interrupt the current responseq.interrupt()client.interrupt()query.interrupt() / session.interrupt()
File rewindq.rewindFiles()client.rewind_files()session.rewindFiles()
MCP status queryq.mcpServerStatus()client.get_mcp_status()session.mcpServerStatus()
Initialization resultq.initializationResult()client.get_server_info()initialization()
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 each language; switch TypeScript / Python / Java inside any code block. Sections without a Java equivalent mark the applicable languages in the heading or at the top of the page: