skopik

Getting Started

This guide gets you from an empty workspace to a completed agent run with the @skopiklabs/client SDK.

Quick Links

Action Description
createSkopikClient() Install the SDK and authenticate.
agents.create() Create a durable agent identity.
agents.brain.writeFile() Give the agent operating instructions.
tasks.create() Describe the work.
tasks.dispatch() Start agent work on the task.
runs.get() Follow the run to completion.

1. Install And Authenticate

Install the SDK:

npm install @skopiklabs/client

Create an API key in the console or with apiKeys.create(), then construct a client. Grant only the scopes your application needs — the flow below needs agent read/write, task write, and run dispatch scopes.

import { createSkopikClient } from '@skopiklabs/client'

const client = createSkopikClient({ apiKey: process.env.SKOPIK_API_KEY })

The SDK uses camelCase field names and converts them to the API's snake_case wire format automatically — the HTTP tab on any example shows the raw shape. See Workspace API Keys for key rotation, revocation, and scope details.

2. Create An Agent

const { agent } = await client.agents.create({
	name: 'Research Agent',
	description: 'Finds sources, summarizes tradeoffs, and writes short briefs.',
	canWebSearch: true,
	dailyBudgetUsd: 5,
})

The response includes the new agent and its first activeBrainSnapshot. Use agent.agentId in later calls.

3. Add Brain Context

Brain files are regular text files addressed by path. They travel with the agent no matter where it runs.

await client.agents.brain.writeFile(agent.agentId, 'instructions.md', {
	content: 'Always cite sources. Prefer concise answers with clear next steps.',
})

4. Create A Task

const { task } = await client.tasks.create({
	title: 'Find pricing signals',
	prompt: 'Research current pricing patterns in AI agent platforms and summarize the top 5 observations.',
	assignedTo: agent.agentId,
})

5. Dispatch The Task

const { run } = await client.tasks.dispatch(task.taskId)

Dispatch resolves with the run that is executing the task.

6. Follow The Run

Poll the run and read its messages, or stream updates live over Server-Sent Events.

const { run: latest } = await client.runs.get(run.runId)
console.log(latest.status)

const { data: batches } = await client.runs.listMessages(run.runId)

See Run streaming for the SSE event shapes.

Common Next Steps