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
| Language | Package | Status |
|---|---|---|
| TypeScript | @syntic-ai/sdk | Stable |
| Python | syntic-sdk | Stable |
| Rust | syntic-sdk (crates.io) | Beta |
| Go | github.com/syntic-ai/sdk-go | Beta |
TypeScript Quick Example
npm install @syntic-ai/sdkimport { 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-sdkfrom 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
| Concept | Description |
|---|---|
| Agent | A running instance with a model, working directory, and tool set |
| Tools | Built-in (Read, Edit, Bash, Grep) plus MCP server tools |
| Skills | Composable behaviors loaded into the agent’s system prompt |
| Hooks | Pre/post tool callbacks for policy and automation |
| Session | A 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
- Agent Configuration — All builder options
- Tools API — Built-in tools and custom tool registration
- Hooks API — Lifecycle callbacks
- Sessions — Resume, branch, export
- Error Handling — Typed error classes