SDK Reference

SDK Reference

The Syntic SDK gives you programmatic access to the same agent runtime that powers the CLI. Build custom coding agents, embed Syntic into your platform, or run scripted coding workflows.

Available SDKs

LanguagePackageStatus
TypeScript@syntic-ai/sdkStable
Pythonsyntic-sdkStable
Rustsyntic-sdk (crates.io)Beta
Gogithub.com/syntic-ai/sdk-goBeta

TypeScript Quick Example

npm install @syntic-ai/sdk
import { SynticAgent } from '@syntic-ai/sdk'
 
const agent = new SynticAgent({
  apiKey: process.env.SYNTIC_API_KEY,
  model: 'kimi-k2-6',
  cwd: process.cwd(),
})
 
const result = await agent.run({
  prompt: 'add a /healthz endpoint to the express app',
  permissionMode: 'approve',
})
 
console.log(result.summary)

Python Quick Example

pip install syntic-sdk
from syntic_sdk import SynticAgent
 
agent = SynticAgent(
    api_key=os.environ["SYNTIC_API_KEY"],
    model="kimi-k2-6",
    cwd=".",
)
 
result = agent.run(
    prompt="refactor user.py to use dependency injection",
    permission_mode="approve",
)
 
print(result.summary)

Rust Quick Example

# Cargo.toml
[dependencies]
syntic-sdk = "0.1"
tokio = { version = "1", features = ["full"] }
use syntic_sdk::Agent;
 
#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let agent = Agent::builder()
        .api_key(std::env::var("SYNTIC_API_KEY")?)
        .model("kimi-k2-6")
        .build()?;
 
    let result = agent.run("write a benchmark for the sorting module").await?;
    println!("{}", result.summary);
    Ok(())
}

Core Concepts

ConceptDescription
AgentA running instance with a model, working directory, and tool set
ToolsBuilt-in (Read, Edit, Bash, Grep) plus MCP server tools
SkillsComposable behaviors loaded into the agent’s system prompt
HooksPre/post tool callbacks for policy and automation
SessionA conversation transcript; resumable via session ID

Streaming Responses

All SDKs expose a streaming API for live token output and tool-use events:

const stream = agent.runStream({ prompt: '...' })
for await (const event of stream) {
  if (event.type === 'text') process.stdout.write(event.text)
  if (event.type === 'tool_use') console.log('→', event.tool)
}

Reference