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 })
import os
from skopik import Skopik
client = Skopik(api_key=os.environ["SKOPIK_API_KEY"])
export SKOPIK_API_BASE="https://api.skopik.com/api/v1"
curl "$SKOPIK_API_BASE/agents" \
-H "Authorization: Bearer $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,
})
agent = client.agents.create(
name="Research Agent",
description="Finds sources, summarizes tradeoffs, and writes short briefs.",
can_web_search=True,
daily_budget_usd=5,
).agent
curl "$SKOPIK_API_BASE/agents" \
-H "Authorization: Bearer $SKOPIK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Research Agent",
"description": "Finds sources, summarizes tradeoffs, and writes short briefs.",
"can_web_search": true,
"daily_budget_usd": 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.',
})
client.agents.brain.write_file(
agent.agent_id,
"instructions.md",
content="Always cite sources. Prefer concise answers with clear next steps.",
)
curl "$SKOPIK_API_BASE/agents/$AGENT_ID/brain/instructions.md" \
-X PUT \
-H "Authorization: Bearer $SKOPIK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"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,
})
task = client.tasks.create(
title="Find pricing signals",
prompt="Research current pricing patterns in AI agent platforms and summarize the top 5 observations.",
assigned_to=agent.agent_id,
).task
curl "$SKOPIK_API_BASE/tasks" \
-H "Authorization: Bearer $SKOPIK_API_KEY" \
-H "Content-Type: application/json" \
-d "{
\"title\": \"Find pricing signals\",
\"prompt\": \"Research current pricing patterns in AI agent platforms and summarize the top 5 observations.\",
\"assigned_to\": \"$AGENT_ID\"
}"
5. Dispatch The Task
const { run } = await client.tasks.dispatch(task.taskId)
run = client.tasks.dispatch(task.task_id).run
curl "$SKOPIK_API_BASE/tasks/$TASK_ID/dispatch" \
-X POST \
-H "Authorization: Bearer $SKOPIK_API_KEY"
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)
latest = client.runs.get(run.run_id).run
print(latest.status)
batches = client.runs.list_messages(run.run_id).data
curl "$SKOPIK_API_BASE/runs/$RUN_ID" \
-H "Authorization: Bearer $SKOPIK_API_KEY"
curl -N "$SKOPIK_API_BASE/runs/$RUN_ID/stream" \
-H "Authorization: Bearer $SKOPIK_API_KEY"
See Run streaming for the SSE event shapes.
Common Next Steps
- Upload files to give the agent private knowledge.
- Create a project and attach related tasks.
- Register a remote when you want work to run on your own machine.